diff --git a/README.md b/README.md index 8720452..8229bd9 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/SubmitFileGSD.sh b/SubmitFileGSD.sh index 42dc6f3..4fc8329 100755 --- a/SubmitFileGSD.sh +++ b/SubmitFileGSD.sh @@ -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} @@ -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 \ No newline at end of file diff --git a/SubmitHGCalPGun.py b/SubmitHGCalPGun.py index ffd5916..8b2a0f8 100644 --- a/SubmitHGCalPGun.py +++ b/SubmitHGCalPGun.py @@ -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 @@ -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='' @@ -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'): @@ -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') diff --git a/templates/partGun_RECO_template.py b/templates/partGun_RECO_template.py index 8c3e95d..08e74f3 100644 --- a/templates/partGun_RECO_template.py +++ b/templates/partGun_RECO_template.py @@ -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)