Skip to content

Commit

Permalink
Merge pull request cms-sw#7287 from CmsHI/mix_74X_11
Browse files Browse the repository at this point in the history
Bugfixes and clean-up after HI mixing updates
  • Loading branch information
davidlange6 committed Jan 27, 2015
2 parents 76d3f90 + 27f43ae commit 29d3123
Show file tree
Hide file tree
Showing 17 changed files with 48 additions and 97 deletions.
36 changes: 7 additions & 29 deletions Configuration/Applications/python/ConfigBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ class Options:
defaultOptions.scenarioOptions=['pp','cosmics','nocoll','HeavyIons']
defaultOptions.harvesting= 'AtRunEnd'
defaultOptions.gflash = False
defaultOptions.himix = False
defaultOptions.number = -1
defaultOptions.number_out = None
defaultOptions.arguments = ""
Expand Down Expand Up @@ -429,10 +428,6 @@ def filesFromOption(self):
if 'GEN' in self.stepMap.keys() or 'LHE' in self.stepMap or (not self._options.filein and hasattr(self._options, "evt_type")):
if self.process.source is None:
self.process.source=cms.Source("EmptySource")
# if option himix is active, drop possibly duplicate DIGI-RAW info:
if self._options.himix==True:
self.process.source.inputCommands = cms.untracked.vstring('drop *','keep *_generator_*_*','keep *_g4SimHits_*_*')
self.process.source.dropDescendantsOfDroppedBranches=cms.untracked.bool(False)

# modify source in case of run-dependent MC
self.runsAndWeights=None
Expand Down Expand Up @@ -1001,18 +996,10 @@ def define_Configs(self):
self.RECODefaultSeq='reconstructionCosmics'
self.DQMDefaultSeq='DQMOfflineCosmics'

if self._options.himix:
print "From the presence of the himix option, we have determined that this is heavy ions and will use '--scenario HeavyIons'."
self._options.scenario='HeavyIons'

if self._options.scenario=='HeavyIons':
if not self._options.beamspot:
self._options.beamspot=VtxSmearedHIDefaultKey
self.HLTDefaultSeq = 'HIon'
if not self._options.himix:
self.GENDefaultSeq='pgen_hi'
else:
self.GENDefaultSeq='pgen_himix'
self.VALIDATIONDefaultCFF="Configuration/StandardSequences/ValidationHeavyIons_cff"
self.VALIDATIONDefaultSeq=''
self.EVTCONTDefaultCFF="Configuration/EventContent/EventContentHeavyIons_cff"
Expand Down Expand Up @@ -1111,9 +1098,6 @@ def inGeometryKeys(opt):
#not driven by a default cff anymore
if self._options.isData:
self._options.pileup=None
elif self._options.isMC==True and self._options.himix==True:
self._options.pileup='HiMix'


if self._options.slhc:
self.GeometryCFF='SLHCUpgradeSimulations.Geometry.%s_cmsSimIdealGeometryXML_cff'%(self._options.slhc,)
Expand Down Expand Up @@ -1353,8 +1337,8 @@ def prepare_GEN(self, sequence = None):
elif isinstance(theObject, cms.Sequence) or isinstance(theObject, cmstypes.ESProducer):
self._options.inlineObjets+=','+name

if sequence == self.GENDefaultSeq or sequence == 'pgen_genonly' or ( sequence == 'pgen_himix' or sequence == 'pgen_hi'):
if 'ProductionFilterSequence' in genModules and ('generator' in genModules or 'hiSignal' in genModules):
if sequence == self.GENDefaultSeq or sequence == 'pgen_genonly':
if 'ProductionFilterSequence' in genModules and ('generator' in genModules):
self.productionFilterSequence = 'ProductionFilterSequence'
elif 'generator' in genModules:
self.productionFilterSequence = 'generator'
Expand All @@ -1371,8 +1355,11 @@ def prepare_GEN(self, sequence = None):
except ImportError:
raise Exception("VertexSmearing type or beamspot "+self._options.beamspot+" unknown.")

if self._options.scenario == 'HeavyIons' and self._options.himix:
self.loadAndRemember("SimGeneral/MixingModule/himixGEN_cff")
if self._options.scenario == 'HeavyIons':
if self._options.pileup=='HiMixGEN':
self.loadAndRemember("Configuration/StandardSequences/GeneratorMix_cff")
else:
self.loadAndRemember("Configuration/StandardSequences/GeneratorHI_cff")

self.process.generation_step = cms.Path( getattr(self.process,genSeqName) )
self.schedule.append(self.process.generation_step)
Expand All @@ -1399,12 +1386,6 @@ def prepare_SIM(self, sequence = None):

if self._options.magField=='0T':
self.executeAndRemember("process.g4SimHits.UseMagneticField = cms.bool(False)")

if self._options.himix==True:
if self._options.geometry in defaultOptions.geometryExtendedOptions:
self.loadAndRemember("SimGeneral/MixingModule/himixSIMExtended_cff")
else:
self.loadAndRemember("SimGeneral/MixingModule/himixSIMIdeal_cff")
else:
if self._options.magField=='0T':
self.executeAndRemember("process.famosSimHits.UseMagneticField = cms.bool(False)")
Expand All @@ -1419,9 +1400,6 @@ def prepare_DIGI(self, sequence = None):
if self._options.gflash==True:
self.loadAndRemember("Configuration/StandardSequences/GFlashDIGI_cff")

if self._options.himix==True:
self.loadAndRemember("SimGeneral/MixingModule/himixDIGI_cff")

if sequence == 'pdigi_valid':
self.executeAndRemember("process.mix.digitizers = cms.PSet(process.theDigitizersValid)")

Expand Down
6 changes: 0 additions & 6 deletions Configuration/Applications/python/Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,6 @@
default=defaultOptions.gflash,
dest="gflash")

expertSettings.add_option("--himix",
help="Run the Heavy Ions signal mixing.",
action="store_true",
default=defaultOptions.himix,
dest="himix")

expertSettings.add_option("--python_filename",
help="Change the name of the created config file ",
default='',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,7 @@
workflows[140.2] = ['',['PhotonJets_Pt_10_13_HI','DIGIHI','RECOHI','HARVESTHI']]
workflows[140.3] = ['',['ZMM_13_HI','DIGIHI','RECOHI','HARVESTHI']]
workflows[140.4] = ['',['ZEEMM_13_HI','DIGIHI','RECOHI','HARVESTHI']]

# legacy: 141 => B0; 143 => B3 ; 144 => B5
#workflows[142] = ['',['HydjetQ_B8_2760GeV','DIGIHI','RECOHI','HARVESTHI','MINIAODMCUP15HI']]

Expand Down
10 changes: 10 additions & 0 deletions Configuration/StandardSequences/python/GeneratorHI_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import FWCore.ParameterSet.Config as cms

# Produce GenParticles of the two HepMCProducts
from Configuration.StandardSequences.Generator_cff import *

genParticles.doSubEvent = cms.untracked.bool(True)

hiGenJets = cms.Sequence(genParticlesForJets*hiRecoGenJets)
pgen = cms.Sequence(cms.SequencePlaceholder("randomEngineStateProducer")+VertexSmearing+genParticles+hiGenJets)

13 changes: 13 additions & 0 deletions Configuration/StandardSequences/python/GeneratorMix_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import FWCore.ParameterSet.Config as cms

# Produce GenParticles of the two HepMCProducts
from Configuration.StandardSequences.Generator_cff import *
genParticles.mix = cms.string("mix")
genParticles.doSubEvent = cms.untracked.bool(True)
genParticles.useCrossingFrame = cms.untracked.bool(True)
genParticles.saveBarCodes = cms.untracked.bool(True)
genParticles.abortOnUnknownPDGCode = cms.untracked.bool(False)

hiGenJets = cms.Sequence(genParticlesForJets*hiRecoGenJets)
pgen = cms.Sequence(cms.SequencePlaceholder("randomEngineStateProducer")+cms.SequencePlaceholder("mix")+VertexSmearing+genParticles+hiGenJets)

13 changes: 3 additions & 10 deletions Configuration/StandardSequences/python/Generator_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,18 @@
# untracked uint32 VtxSmeared = 98765432
# }
# }


VertexSmearing = cms.Sequence(cms.SequencePlaceholder("VtxSmeared"))
GeneInfo = cms.Sequence(genParticles)
genJetMET = cms.Sequence(genJetParticles*recoGenJets+genMETParticles*recoGenMET)

pgen = cms.Sequence(cms.SequencePlaceholder("randomEngineStateProducer")+VertexSmearing+GeneInfo+genJetMET)

# sequence for bare generator result only, without vertex smearing and analysis objects added

pgen_genonly = cms.Sequence(cms.SequencePlaceholder("randomEngineStateProducer"))

#
# this sequence is intended for HI runs/studies;
#

hiGenJets = cms.Sequence(hiGenParticlesForJets*hiRecoGenJets)
from PhysicsTools.HepMCCandAlgos.HiGenParticles_cfi import *

pgen_hi = cms.Sequence(cms.SequencePlaceholder("randomEngineStateProducer")+VertexSmearing+hiGenParticles+hiGenJets)
pgen_himix = cms.Sequence(cms.SequencePlaceholder("randomEngineStateProducer")+cms.SequencePlaceholder("mix")+VertexSmearing+hiGenParticles+hiGenJets)

fixGenInfo = cms.Sequence(GeneInfo * genJetMET)


Expand Down
1 change: 1 addition & 0 deletions Configuration/StandardSequences/python/VtxSmeared.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
'Realistic2p76TeV2011Collision': 'IOMC.EventVertexGenerators.VtxSmearedRealistic2p76TeV2011Collision_cfi',
'Realistic2p76TeV2013Collision': 'IOMC.EventVertexGenerators.VtxSmearedRealistic2p76TeV2013Collision_cfi',
'Centered7TeV2011Collision': 'IOMC.EventVertexGenerators.VtxSmearedCentered7TeV2011Collision_cfi',
'RealisticHI2011Collision': 'IOMC.EventVertexGenerators.VtxSmearedRealisticHI2011Collision_cfi',
'Realistic5TeVPPbBoost': 'GeneratorInterface.HiGenCommon.VtxSmearedRealistic5TeVPPbBoost_cff',
'Realistic5TeVPPbBoostReversed': 'GeneratorInterface.HiGenCommon.VtxSmearedRealistic5TeVPPbBoostReversed_cff',
'MatchHI': 'GeneratorInterface.HiGenCommon.VtxSmearedMatchHI_cff',
Expand Down
9 changes: 0 additions & 9 deletions PhysicsTools/HepMCCandAlgos/python/HiGenParticles_cfi.py

This file was deleted.

6 changes: 3 additions & 3 deletions RecoHI/HiJetAlgos/python/HiGenJets_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

iterativeCone5HiGenJets.doAreaFastjet = cms.bool(True)
iterativeCone5HiGenJets.doRhoFastjet = cms.bool(False)
iterativeCone5HiGenJets.src = cms.InputTag("hiGenParticlesForJets")

iterativeCone7HiGenJets = iterativeCone5HiGenJets.clone(rParam=0.7)

Expand All @@ -26,7 +25,6 @@

ak5HiGenJets.doAreaFastjet = cms.bool(True)
ak5HiGenJets.doRhoFastjet = cms.bool(False)
ak5HiGenJets.src = cms.InputTag("hiGenParticlesForJets")

ak1HiGenJets = ak5HiGenJets.clone(rParam = 0.1)
ak2HiGenJets = ak5HiGenJets.clone(rParam = 0.2)
Expand All @@ -44,7 +42,6 @@

kt4HiGenJets.doAreaFastjet = cms.bool(True)
kt4HiGenJets.doRhoFastjet = cms.bool(False)
kt4HiGenJets.src = cms.InputTag("hiGenParticlesForJets")

kt6HiGenJets = kt4HiGenJets.clone(rParam=0.6)

Expand All @@ -62,3 +59,6 @@
ak6HiGenJets +
ak7HiGenJets
)



3 changes: 0 additions & 3 deletions RecoJets/Configuration/python/GenJetParticles_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
tausAsJets = cms.bool(False)
)

hiGenParticlesForJets = genParticlesForJets.clone()
hiGenParticlesForJets.src = cms.InputTag("hiGenParticles")

genParticlesForJetsNoNu = genParticlesForJets.clone()
genParticlesForJetsNoNu.ignoreParticleIDs += cms.vuint32( 12,14,16)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,22 @@

HiMixRAW = cms.PSet(
outputCommands = cms.untracked.vstring(
'keep *_mix_MergedTrackTruth_*',
'drop CrossingFramePlaybackInfoExtended_mix_*_*',
'keep *_mix_*_SIM',
'keep *_hiGenParticles_*_*'
# 'keep *_mix_MergedTrackTruth_*',
# 'drop CrossingFramePlaybackInfoExtended_mix_*_*',
# 'keep *_mix_*_SIM',
)
)

HiMixRECO = cms.PSet(
outputCommands = cms.untracked.vstring(
'keep *_mix_MergedTrackTruth_*',
'drop CrossingFramePlaybackInfoExtended_mix_*_*',
'keep *_mix_*_SIM',
'keep *_hiGenParticles_*_*'
# 'keep *_mix_MergedTrackTruth_*',
# 'drop CrossingFramePlaybackInfoExtended_mix_*_*',
# 'keep *_mix_*_SIM',
)
)

HiMixAOD = cms.PSet(
outputCommands = cms.untracked.vstring(
'keep *_hiGenParticles_*_*'
)
)

5 changes: 3 additions & 2 deletions SimGeneral/MixingModule/plugins/MixingModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,9 @@ namespace edm {
playEventID,
std::bind(&MixingModule::pileAllWorkers, std::ref(*this), _1, mcc, bunchIdx,
_2, vertexOffset, std::ref(setup), e.streamID())
);
}
);
(*playbackInfo_)=(*playbackInfo_H);
}
}
for(Accumulators::const_iterator accItr = digiAccumulators_.begin(), accEnd = digiAccumulators_.end(); accItr != accEnd; ++accItr) {
(*accItr)->finalizeBunchCrossing(e, setup, bunchIdx);
Expand Down
3 changes: 0 additions & 3 deletions SimGeneral/MixingModule/python/himixDIGI_cff.py

This file was deleted.

6 changes: 0 additions & 6 deletions SimGeneral/MixingModule/python/himixGEN_cff.py

This file was deleted.

9 changes: 0 additions & 9 deletions SimGeneral/MixingModule/python/himixSIMExtended_cff.py

This file was deleted.

7 changes: 0 additions & 7 deletions SimGeneral/MixingModule/python/himixSIMIdeal_cff.py

This file was deleted.

2 changes: 1 addition & 1 deletion Validation/RecoHI/python/EgammaValidationHI_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

higenp = cms.EDFilter("PdgIdAndStatusCandViewSelector",
status = cms.vint32(3),
src = cms.InputTag("hiGenParticles"),
src = cms.InputTag("genParticles"),
pdgId = cms.vint32(22)
)

Expand Down

0 comments on commit 29d3123

Please sign in to comment.