Skip to content

Instantly share code, notes, and snippets.

View kpedro88's full-sized avatar

Kevin Pedro kpedro88

  • Fermi National Accelerator Laboratory
View GitHub Profile
#!/bin/bash -e
# check for CMSSW environment
if [ -z "$CMSSW_BASE" ]; then
echo '$CMSSW_BASE not set'
exit 1
fi
# check for python3 in actual CMSSW area
if ! (cd $CMSSW_BASE && scram tool info python3 >& /dev/null); then
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
TOOLS=(
pythia8 \
evtgen \
tauolapp \
# madgraph5amcatnlo \
)
TOOLFILE_LIST=""
for TOOL in ${TOOLS[@]}; do
@kpedro88
kpedro88 / README.md
Last active July 15, 2022 14:48
testT1eos

Instructions

  1. Set up CMS Connect account: https://connect.uscms.org/
  2. Log in to CMS connect and download files:
    wget https://gist.githubusercontent.com/kpedro88/effc271a43d0dfbd7b6e960b35d663d1/raw/testT1eos.sh
    wget https://gist.githubusercontent.com/kpedro88/effc271a43d0dfbd7b6e960b35d663d1/raw/testT1eos.jdl
    chmod +x testT1eos.sh
    
  3. Edit JDL file to change input file to an EOS file whose accessibility you want to test
#!/bin/bash
TOOLS=$CMSSW_BASE/config/toolbox/slc7_amd64_gcc700/tools/selected
GIST=fee1e6d1ff5b9e4ee96c4ac1203c23d4
mkdir $CMSSW_BASE/rootfix
cd $CMSSW_BASE/rootfix
lndir $ROOTSYS
cp ${TOOLS}/root_interface.xml root_interface.xml.orig
git clone https://gist.github.com/fee1e6d1ff5b9e4ee96c4ac1203c23d4.git
cp -f ${GIST}/libTMVA.so lib/
@kpedro88
kpedro88 / getTimes.py
Created June 30, 2021 22:59
SonicTriton metrics analysis
import sys,json,uuid
from collections import defaultdict
# keep lists on single line when json dumps w/ pretty settings
# from https://stackoverflow.com/questions/58736826/format-some-json-object-with-certain-fields-on-one-line
def replace(o):
if isinstance(o, dict):
replacements = []
result = {}
for key,val in o.iteritems():
@kpedro88
kpedro88 / testSingularity.jdl
Last active June 14, 2021 14:49
testSingularity
universe = vanilla
Executable = testSingularity.sh
+REQUIRED_OS = "rhel7"
+DesiredOS = REQUIRED_OS
request_cpus = 1
Should_Transfer_Files = YES
WhenToTransferOutput = ON_EXIT_OR_EVICT
Transfer_Input_Files = testSingularity.sh
Output = testSingularity_$(Process)_$(Cluster).stdout
Error = testSingularity_$(Process)_$(Cluster).stderr
@kpedro88
kpedro88 / README.md
Last active June 14, 2021 15:06
testT1

Instructions

  1. Set up CMS Connect account: https://connect.uscms.org/
  2. Log in to CMS connect and download files:
    wget https://gist.githubusercontent.com/kpedro88/dd5c8a43b1aafbfc7e5953d327be40e0/raw/testT1.sh
    wget https://gist.githubusercontent.com/kpedro88/dd5c8a43b1aafbfc7e5953d327be40e0/raw/testT1.jdl
    chmod +x testT1.sh
    
  3. Edit JDL file to change output directory in arguments to an EOS area where you have write permission
@kpedro88
kpedro88 / cmsdist.md
Last active December 25, 2023 22:39
cmsdist instructions and notes
  1. First notes:

    • do not have a CMSSW environment activated
    • use a regular user (non-root/superuser) account
    • typically requires at least a few GB of disk space
    • depending on what's in your login file etc., may need to do:
      unset PYTHONPATH
  2. Get environment variables for CMSSW master branch with production architecture:

@kpedro88
kpedro88 / old_htcondor_bindings.md
Last active January 14, 2021 03:20
Using htcondor python bindings in CMSSW_8_0_X

CMSSW_8_0_X cannot use the htcondor python bindings as installed using the system python in RHEL7 operating systems.

There is a method to install and use (automatically) the correct versions of the bindings. This can enable e.g. the use of manageJobs.py from CondorProduction. This method depends on scram-pip from lpc-scripts, which is available on cvmfs at /cvmfs/cms-lpc.opensciencegrid.org/FNALLPC/lpc-scripts/scram-pip.

Assuming you are in a CMSSW_8_0_X release area and have already done cmsenv, execute these bash commands:

HOME=$CMSSW_BASE python -m ensurepip --user
scram-pip -d $CMSSW_BASE/.local