13 vertexParameters = cms.PSet()
16 if not hasattr(process,
"VtxSmeared"):
17 "WARNING: no vtx smearing applied (ok for steps other than SIM)"
18 return vertexParameters
19 vertexGenerator = process.VtxSmeared
22 vertexGeneratorType = vertexGenerator.type_().
replace(
"EvtVtxGenerator",
"")
23 vtxGenMap = {
"Betafunc":
"BetaFunc",
"Flat":
"Flat",
"Gauss":
"Gaussian"}
24 if not vertexGeneratorType
in vtxGenMap.keys():
25 raise Error(
"WARNING: given vertex generator type for vertex smearing is not supported")
26 vertexParameters.type = cms.string(vtxGenMap[vertexGeneratorType])
29 vertexGeneratorParameterNames = vertexGenerator.parameterNames_()
30 for name
in vertexGeneratorParameterNames:
31 exec(
"vertexParameters.{0} = {1}".
format(name,getattr(vertexGenerator,name).
dumpPython()))
33 return vertexParameters
38 PileUpSimulator = cms.PSet()
42 if hasattr(_input,
"type"):
45 if _type ==
"poisson":
46 if not hasattr(_input.nbPileupEvents,
"averageNumber"):
47 print " ERROR while reading PU distribution for FastSim PileUpProducer:"
48 print " when process.mix.input.type is set to 'poisson', process.mix.input.nbPileupEvents.averageNumber must be specified."
50 PileUpSimulator.averageNumber = _input.nbPileupEvents.averageNumber
51 PileUpSimulator.usePoisson = cms.bool(
True)
53 elif _type ==
"probFunction":
54 if not hasattr(_input.nbPileupEvents,
"probFunctionVariable")
or not hasattr(_input.nbPileupEvents,
"probValue"):
55 print " ERROR while reading PU distribution for FastSim PileUpProducer:"
56 print " when process.mix.input.type is set to 'probFunction', process.mix.nbPileupEvents.probFunctionVariable and process.mix.nbPileupEvents.probValue must be specified"
58 PileUpSimulator.usePoisson = cms.bool(
False)
59 PileUpSimulator.probFunctionVariable = _input.nbPileupEvents.probFunctionVariable
60 PileUpSimulator.probValue = _input.nbPileupEvents.probValue
63 print " ERROR while reading PU distribution for FastSim PileUpProducer:"
64 print " value {0} for process.mix.input.type not supported by FastSim GEN-level PU mixing".
format(_type)
68 from FastSimulation.PileUpProducer.PileUpFiles_cff
import puFileNames
69 PileUpSimulator.fileNames = puFileNames.fileNames
72 PileUpSimulator.inputFile = cms.untracked.string(
'PileUpInputFile.txt')
74 return PileUpSimulator
80 if hasattr(digitizers,
"castor"):
81 delattr(digitizers,
"castor")
83 print "WARNING: digitizers has no attribute 'castor'"
86 if hasattr(digitizers,
"pixel")
and hasattr(digitizers,
"strip"):
87 delattr(digitizers,
"pixel")
88 delattr(digitizers,
"strip")
89 import FastSimulation.Tracking.recoTrackAccumulator_cfi
90 digitizers.tracker = cms.PSet(FastSimulation.Tracking.recoTrackAccumulator_cfi.recoTrackAccumulator)
92 print "WARNING: digitizers has no attribute 'pixel' and/or 'strip'"
93 print " : => not mixing tracks"
96 for element
in [
"ecal",
"hcal"]:
97 if hasattr(digitizers,element):
98 getattr(digitizers,element).hitsProducer =
"famosSimHits"
100 print "WARNING: digitizers has no attribute '{0}'".
format(element)
103 if hasattr(digitizers,
"mergedtruth"):
104 digitizers.mergedtruth.allowDifferentSimHitProcesses =
True
105 digitizers.mergedtruth.simHitCollections = cms.PSet(
106 muon = cms.VInputTag( cms.InputTag(
'MuonSimHits',
'MuonDTHits'),
107 cms.InputTag(
'MuonSimHits',
'MuonCSCHits'),
108 cms.InputTag(
'MuonSimHits',
'MuonRPCHits') ),
109 trackerAndPixel = cms.VInputTag( cms.InputTag(
'famosSimHits',
'TrackerHits') )
111 digitizers.mergedtruth.simTrackCollection = cms.InputTag(
'famosSimHits')
112 digitizers.mergedtruth.simVertexCollection = cms.InputTag(
'famosSimHits')
123 process.mix.maxBunch = cms.int32(0)
124 process.mix.minBunch = cms.int32(0)
132 process.mix.bunchspace = 450
135 process.famosPileUp = cms.EDProducer(
137 PileUpSimulator = cms.PSet(),
138 VertexGenerator = cms.PSet()
149 del process.mix.input
152 pos = process.psim.index(process.famosSimHits)
153 process.psim.insert(pos,process.famosPileUp)
156 del process.mix.digitizers.tracker
157 del process.mix.mixObjects.mixRecoTracks
158 del process.generalTracks
159 process.generalTracks = process.generalTracksBeforeMixing.clone()
160 process.iterTracking.replace(process.generalTracksBeforeMixing,process.generalTracks)
161 del process.generalTracksBeforeMixing
164 process.generalConversionTrackProducer.TrackProducer = cms.string(
'generalTracks')
165 process.generalConversionTrackProducerTmp.TrackProducer = cms.string(
'generalTracks')
166 process.trackerDrivenElectronSeedsTmp.TkColList = cms.VInputTag(cms.InputTag(
"generalTracks"))
167 process.trackerDrivenElectronSeeds.oldTrackCollection =
"generalTracks"
172 "generalTracks":cms.VPSet( cms.PSet(type=cms.string(
'recoTracks')),
173 cms.PSet(type=cms.string(
'recoTrackExtras')),
174 cms.PSet(type=cms.string(
'TrackingRecHitsOwned')),
175 cms.PSet(type=cms.string(
'floatedmValueMap')))
177 process.hltIter4HighPtMerged = cms.EDAlias(**_parameters)
178 process.hltIter2HighPtMerged = cms.EDAlias(**_parameters)
179 process.hltIter4Merged = cms.EDAlias(**_parameters)
180 process.hltIter2Merged = cms.EDAlias(**_parameters)
181 process.hltIter4Tau3MuMerged = cms.EDAlias(**_parameters)
182 process.hltIter4MergedReg = cms.EDAlias(**_parameters)
183 process.hltIter2MergedForElectrons = cms.EDAlias(**_parameters)
184 process.hltIter2MergedForPhotons = cms.EDAlias(**_parameters)
185 process.hltIter2L3MuonMerged = cms.EDAlias(**_parameters)
186 process.hltIter2L3MuonMergedReg = cms.EDAlias(**_parameters)
187 process.hltIter2MergedForBTag = cms.EDAlias(**_parameters)
188 process.hltIter2MergedForTau = cms.EDAlias(**_parameters)
189 process.hltIter4MergedForTau = cms.EDAlias(**_parameters)
190 process.hltIter2GlbTrkMuonMerged = cms.EDAlias(**_parameters)
191 process.hltIter2HighPtTkMuMerged = cms.EDAlias(**_parameters)
192 process.hltIter2HighPtTkMuIsoMerged = cms.EDAlias(**_parameters)
193 process.hltIter2DisplacedJpsiMerged = cms.EDAlias(**_parameters)
194 process.hltIter2DisplacedPsiPrimeMerged = cms.EDAlias(**_parameters)
195 process.hltIter2DisplacedNRMuMuMerged = cms.EDAlias(**_parameters)
196 process.hltIter0PFlowTrackSelectionHighPurityForBTag = cms.EDAlias(**_parameters)
197 process.hltIter4MergedWithIter012DisplacedJets = cms.EDAlias(**_parameters)
200 process.addPileupInfo.PileupMixingLabel = cms.InputTag(
"famosPileUp")
210 import FastSimulation.Configuration.mixObjects_cfi
211 process.mix.mixObjects = FastSimulation.Configuration.mixObjects_cfi.theMixObjects
215 for element
in [
"simCastorDigis",
"simSiPixelDigis",
"simSiStripDigis"]:
216 if hasattr(process,element):
217 delattr(process,element)
221 del process.theDigitizers
222 del process.theDigitizersValid
223 del process.trackingParticles
224 del process.stripDigitizer
225 del process.SiStripSimBlock
226 del process.castorDigitizer
227 del process.pixelDigitizer
228 del process.ecalDigitizer
232 del process.siStripGainSimESProducer
def get_PileUpSimulatorPSet_PileUpProducer
def get_VertexGeneratorPSet_PileUpProducer
def prepareDigiRecoMixing