Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store the dqm file #53

Merged
merged 3 commits into from
Jan 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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'
rovere marked this conversation as resolved.
Show resolved Hide resolved
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