Skip to content

Commit

Permalink
added command-line switches for genparticle origin and extrapolation …
Browse files Browse the repository at this point in the history
…info
  • Loading branch information
jkiesele committed Sep 18, 2017
1 parent 68002a5 commit 8a582f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 5 additions & 6 deletions SubmitHGCalPGun.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def parseOptions():
parser.add_option('-i', '--inDir', dest='inDir', type='string', default='', help='name of the previous stage dir (relative to the local submission or "eosArea"), to be used as the input for next stage, not applicable for GEN stage')
parser.add_option('-r', '--RelVal', dest='RELVAL', type='string', default='', help='name of relval reco dataset to be ntuplized (currently implemented only for NTUP data Tier')
parser.add_option('', '--noReClust', action='store_false', dest='RECLUST', default=True, help='do not re-run RECO-level clustering at NTUP step, default is True (do re-run the clustering).')
parser.add_option('', '--addGenOrigin', action='store_true', dest='ADDGENORIG', default=False, help='add coordinates of the origin vertex for gen particles as well as the mother particle index')
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)')

# store options and arguments as global variables
global opt, args
Expand Down Expand Up @@ -382,16 +384,13 @@ def submitHGCalProduction():
inputFiles = '"' + '", "'.join([recoInputPrefix+str(f) for f in inputFilesListPerJob]) + '"'
s_template=s_template.replace('DUMMYINPUTFILELIST',inputFiles)
s_template=s_template.replace('DUMMYEVTSPERJOB',str(-1))


if DASquery:
# in case of relval centrally produced use readOfficialReco flag
s_template=s_template.replace('DUMMYROR','True')
else:
# otherwise put False
s_template=s_template.replace('DUMMYROR','False')

if (opt.DTIER == 'NTUP'):
s_template=s_template.replace('DUMMYRECLUST',str(opt.RECLUST))
s_template=s_template.replace('DUMMYSGO',str(opt.ADDGENORIG))
s_template=s_template.replace('DUMMYSGE',str(opt.ADDGENEXTR))

# submit job
# now write the file from the s_template
Expand Down
4 changes: 2 additions & 2 deletions templates/partGun_NTUP_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
detector = cms.string("all"),
rawRecHits = cms.bool(True),
readCaloParticles = cms.bool(False),
storeGenParticleOrigin = cms.bool(False),
storeGenParticleExtrapolation = cms.bool(False),
storeGenParticleOrigin = cms.bool(DUMMYSGO),
storeGenParticleExtrapolation = cms.bool(DUMMYSGE),
storePCAvariables = cms.bool(False),
recomputePCA = cms.bool(False),
dEdXWeights = dEdX,
Expand Down

0 comments on commit 8a582f8

Please sign in to comment.