Skip to content

Commit

Permalink
Store the dqm file (#53)
Browse files Browse the repository at this point in the history
* keep the dqm file
* Update README.md about the dqm option
  • Loading branch information
apsallid authored and clelange committed Jan 14, 2019
1 parent d62d01a commit d1854d3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,13 @@ python SubmitHGCalPGun.py \
--queue QUEUENAME \
--inDir partGun_[MYTAG]_[DATE] \
[--local] \
--tag MYTAG
--tag MYTAG \
--keepDQMfile
```

The script will get the list of GEN-SIM-DIGI files from the directory `partGun_[MYTAG]_[DATE]`/`GSD` (locally or on the CMG EOS area), and submit jobs to queue `QUEUENAME` (if possbile with `NPERJOB` events per job).
The batch `stdout`/`stderr` files and `.cfg` files are stored locally `in partGun_[MYTAG]_[DATE]`, while the resulting files `partGun_*_RECO_{i}.root` are stored in `partGun_[MYTAG]_[DATE]`/`RECO` either locally or in `/eos/cms/store/cmst3/group/hgcal/CMG_studies/Production/`.
In case the `--keepDQMfile` option is used, the resulting `partGun_*_DQM_{i}.root` files will also be stored in `partGun_[MYTAG]_[DATE]`/`DQM` locally or in `/eos/cms/store/cmst3/group/hgcal/CMG_studies/Production/`.

Rule of thumb for RECO: 10 events per `1nh`:
* 50 events should be possible to finish in queue `8nh`.
Expand Down
9 changes: 9 additions & 0 deletions SubmitFileGSD.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ CMSSWDIR=${8} # ${curDir}/../${CMSSWVER}
CMSSWARCH=${9} # slc6_amd64_gcc530
eosArea=${10}
dataTier=${11}
keepDQMfile=${12}

##Create Work Area
export SCRAM_ARCH=${CMSSWARCH}
Expand All @@ -34,6 +35,14 @@ cmsRun ${curDir}/${outDir}/cfg/${cfgFile}
if [ ${localFlag} == "True" ]
then
cp *${dataTier}*.root ${curDir}/${outDir}/${dataTier}/
if [ ${keepDQMfile} == "True" ]
then
cp *DQM*.root ${curDir}/${outDir}/DQM/
fi
else
xrdcp -N -v *${dataTier}*.root root://eoscms.cern.ch/${eosArea}/${outDir}/${dataTier}/
if [ ${keepDQMfile} == "True" ]
then
xrdcp -N -v *DQM*.root root://eoscms.cern.ch/${eosArea}/${outDir}/DQM/
fi
fi
8 changes: 7 additions & 1 deletion SubmitHGCalPGun.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def parseOptions():
parser.add_option('', '--addGenExtrapol', action='store_true', dest='ADDGENEXTR', default=False, help='add coordinates for the position of each gen particle extrapolated to the first HGCal layer (takes into account magnetic field)')
parser.add_option('', '--storePFCandidates', action='store_true', dest='storePFCandidates', default=False, help='store PFCandidates collection')
parser.add_option('', '--multiClusterTag', action='store', dest='MULTICLUSTAG', default="hgcalMultiClusters", help='name of HGCalMultiCluster InputTag - use hgcalLayerClusters before CMSSW_10_3_X')
parser.add_option('', '--keepDQMfile', action='store_true', dest='DQM', default=False, help='store the DQM file in relevant folder locally or in EOS, default is False.')


# store options and arguments as global variables
global opt, args
Expand Down Expand Up @@ -247,9 +249,11 @@ def submitHGCalProduction():
if (opt.LOCAL):
processCmd('mkdir -p '+outDir+'/'+opt.DTIER+'/')
recoInputPrefix = 'file:'+currentDir+'/'+outDir+'/'+previousDataTier+'/'
if (opt.DQM): processCmd('mkdir -p '+outDir+'/DQM/')
else:
processCmd(eosExec + ' mkdir -p '+opt.eosArea+'/'+outDir+'/'+opt.DTIER+'/');
recoInputPrefix = 'root://eoscms.cern.ch/'+opt.eosArea+'/'+outDir+'/'+previousDataTier+'/'
if (opt.DQM): processCmd(eosExec + ' mkdir -p '+opt.eosArea+'/'+outDir+'/DQM/');
# in case of relval always take reconInput from /store...
if DASquery: recoInputPrefix=''

Expand Down Expand Up @@ -309,11 +313,13 @@ def submitHGCalProduction():

cfgfile = basename +'.py'
outfile = basename +'.root'
outdqmfile = basename.replace(opt.DTIER, 'DQM') +'.root'
jobfile = basename +'.sub'

s_template=template

s_template=s_template.replace('DUMMYFILENAME',outfile)
s_template=s_template.replace('DUMMYDQMFILENAME',outdqmfile)
s_template=s_template.replace('DUMMYSEED',str(job))

if (opt.DTIER == 'GSD'):
Expand Down Expand Up @@ -363,7 +369,7 @@ def submitHGCalProduction():
write_condorjob= open(outDir+'/jobs/'+jobfile, 'w')
write_condorjob.write('+JobFlavour = "'+opt.QUEUE+'" \n\n')
write_condorjob.write('executable = '+currentDir+'/SubmitFileGSD.sh \n')
write_condorjob.write('arguments = $(ClusterID) $(ProcId) '+currentDir+' '+outDir+' '+cfgfile+' '+str(opt.LOCAL)+' '+CMSSW_VERSION+' '+CMSSW_BASE+' '+SCRAM_ARCH+' '+opt.eosArea+' '+opt.DTIER+'\n')
write_condorjob.write('arguments = $(ClusterID) $(ProcId) '+currentDir+' '+outDir+' '+cfgfile+' '+str(opt.LOCAL)+' '+CMSSW_VERSION+' '+CMSSW_BASE+' '+SCRAM_ARCH+' '+opt.eosArea+' '+opt.DTIER+' '+str(opt.DQM)+'\n')
write_condorjob.write('output = '+outDir+'/std/'+basename+'.out \n')
write_condorjob.write('error = '+outDir+'/std/'+basename+'.err \n')
write_condorjob.write('log = '+outDir+'/std/'+basename+'_htc.log \n\n')
Expand Down
1 change: 1 addition & 0 deletions templates/partGun_RECO_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

# Output definition
process.FEVTDEBUGHLToutput.fileName = cms.untracked.string('file:DUMMYFILENAME')
process.DQMoutput.fileName = cms.untracked.string('file:DUMMYDQMFILENAME')

# Customisation from command line
# process.hgcalLayerClusters.minClusters = cms.uint32(3)
Expand Down

0 comments on commit d1854d3

Please sign in to comment.