Skip to content

Commit

Permalink
Merge pull request #7 from clelange/clange_addNTUP
Browse files Browse the repository at this point in the history
add script to automatically submit next step (RECO or NTUP) for all s…
  • Loading branch information
clelange authored Jul 15, 2016
2 parents b87435c + 373c809 commit 9f78198
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SubmitHGCalPGun.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def parseOptions():
parser.add_option('-n', '--nevts', dest='NEVTS', type=int, default=100, help='total number of events, applicable to runs with GEN stage, default is 100')
parser.add_option('-e', '--evtsperjob',dest='EVTSPERJOB', type=int,default=-1, help='number of events per job, if set to -1 it will set to a recommended value (GSD: 4events/1nh, RECO:8events/1nh), default is -1')
parser.add_option('-c', '--cfg', dest='CONFIGFILE', type='string', default='',help='CMSSW config template name, if empty string the deafult one will be used')
parser.add_option('-p', '--partID', dest='PARTID', type='string', default='', help='particle PDG ID, if empty string - run on all supported (11,13,22,111,211), default is empty string (all)')
parser.add_option('-p', '--partID', dest='PARTID', type='string', default='', help='particle PDG ID, if empty string - run on all supported (11,12,13,14,15,16,22,111,211), default is empty string (all)')
parser.add_option( '', '--nPart', dest='NPART', type=int, default=10, help='number of particles of type PARTID to be generated per event, default is 10')
parser.add_option( '', '--pTmin', dest='pTmin', type=float, default=1.0, help='min. pT value')
parser.add_option( '', '--pTmax', dest='pTmax', type=float, default=35.0, help='max. pT value')
Expand Down Expand Up @@ -61,7 +61,7 @@ def parseOptions():

# list of supported particles, check if requested partID is supported
global particles
particles = ['22', '111', '211', '11', '13']
particles = ['22', '111', '211', '11', '13', '15', '12', '14', '16']
if not (opt.PARTID in particles or opt.PARTID==''):
parser.error('Particle with ID ' + opt.PARTID + ' is not supported. Exiting...')
sys.exit()
Expand Down
32 changes: 32 additions & 0 deletions submitNextStep.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/bin/zsh

#
# Script to automatically submit jobs for next step (RECO or NTUP) for all
# samples in SAMPLEDIR. Can adjust events per job with variables listed
# below (EVTSRECO and EVTSNTUP).
#

eosExec='/afs/cern.ch/project/eos/installation/0.3.84-aquamarine/bin/eos.select'
SAMPLEDIR='/eos/cms/store/cmst3/group/hgcal/CMG_studies/Production'
EVTSRECO=10
EVTSNTUP=100

for i in `$eosExec ls $SAMPLEDIR`; do
CONTENT=("${(@f)$($eosExec ls $SAMPLEDIR/$i)}")
echo "$i has $CONTENT"
if [[ ${CONTENT[(r)GSD]} == GSD ]]; then
if [[ ${CONTENT[(r)RECO]} == RECO ]]; then
if [[ ${CONTENT[(r)NTUP]} == NTUP ]]; then
echo "Nothing to be done"
else
echo "submit NTUP for $i"
python SubmitHGCalPGun.py --datTier NTUP --evtsperjob $EVTSNTUP --queue 8nh --inDir $i
fi
else
echo "submit RECO for $i"
python SubmitHGCalPGun.py --datTier RECO --evtsperjob $EVTSRECO --queue 8nh --inDir $i
fi
else
echo "$i does not seem to be a directory containing event samples! Skipping."
fi
done

0 comments on commit 9f78198

Please sign in to comment.