5 from FWCore.ParameterSet.Modules
import _Module
10 self.nextInChain=
"NONE"
11 self.prevInChain=
"NONE"
12 self.prevInChainCandidate=
"NONE"
20 self.lookFor = lookFor
23 return self.nextInChain
25 return self.prevInChain
28 if isinstance(visitee, _Module):
31 self.nextInChain=visitee
33 if visitee == self.lookFor:
35 self.prevInChain=self.prevInChainCandidate
37 self.prevInChainCandidate=visitee
50 process._Process__name=
"EmbeddedRECO"
51 process.TFileService = cms.Service(
"TFileService", fileName = cms.string(
"histo_embedded.root") )
54 outputModule = process.output
58 outputModule = getattr(process,str(getattr(process,
list(process.endpaths)[-1])))
62 print "Changing eventcontent to RAW+AODSIM + misc. "
63 outputModule.outputCommands = cms.untracked.vstring(
"drop *")
64 outputModule.outputCommands.extend(process.RAWEventContent.outputCommands )
65 outputModule.outputCommands.extend(process.AODSIMEventContent.outputCommands )
67 keepMC = cms.untracked.vstring(
"keep *_*_zMusExtracted_*",
68 "keep *_*_zmmCands_*",
69 "keep *_removedInputMuons_*_*",
70 "keep *_generator_*_*",
71 "keep *_PhotonIDProd_*_*",
73 "keep *_photonCore_*_*",
74 "keep *_genParticles_*_*",
75 "keep *_particleFlow_*_*",
76 "keep *_generator_*_*",
77 "keep *_tmfTracks_*_EmbeddedRECO",
78 "keep *_offlinePrimaryVertices_*_EmbeddedRECO",
79 "keep *_offlinePrimaryVerticesWithBS_*_EmbeddedRECO",
80 "keep *_PhotonIDProd_*_*",
82 "keep *_photonCore_*_*",
83 "keep *_genParticles_*_*",
84 "keep *_particleFlow_*_*",
86 outputModule.outputCommands.extend(keepMC)
90 for item
in outputModule.outputCommands[:]:
91 if item ==
"drop *" and index != 0:
93 del outputModule.outputCommands[index]
98 hltProcessName =
"HLT"
102 hltProcessName = __HLT__
107 process.dimuonsHLTFilter.TriggerResultsTag.processName = hltProcessName
108 process.goodZToMuMuAtLeast1HLT.TrigTag.processName = hltProcessName
109 process.goodZToMuMuAtLeast1HLT.triggerEvent.processName = hltProcessName
110 process.hltTrigReport,HLTriggerResults.processName = hltProcessName
114 process.VtxSmeared = cms.EDProducer(
"FlatEvtVtxGenerator",
115 MaxZ = cms.double(0.0),
116 MaxX = cms.double(0.0),
117 MaxY = cms.double(0.0),
118 MinX = cms.double(0.0),
119 MinY = cms.double(0.0),
120 MinZ = cms.double(0.0),
121 TimeOffset = cms.double(0.0),
122 src = cms.InputTag(
"generator")
125 import FWCore.ParameterSet.VarParsing
as VarParsing
127 options.register (
'mdtau',
129 VarParsing.VarParsing.multiplicity.singleton,
130 VarParsing.VarParsing.varType.int,
131 "mdtau value for tauola")
133 options.register (
'transformationMode',
135 VarParsing.VarParsing.multiplicity.singleton,
136 VarParsing.VarParsing.varType.int,
137 "transformation mode. 0=mumu->mumu, 1=mumu->tautau")
139 options.register (
'minVisibleTransverseMomentum',
141 VarParsing.VarParsing.multiplicity.singleton,
142 VarParsing.VarParsing.varType.string,
143 "generator level cut on visible transverse momentum (typeN:pT,[...];[...])")
145 options.register (
'useJson',
147 VarParsing.VarParsing.multiplicity.singleton,
148 VarParsing.VarParsing.varType.int,
149 "should I enable json usage?")
151 options.register (
'overrideBeamSpot',
153 VarParsing.VarParsing.multiplicity.singleton,
154 VarParsing.VarParsing.varType.int,
155 "should I override beamspot in globaltag?")
165 if not hasattr(process,
"doNotParse"):
167 if hasattr(sys,
"argv") ==
True:
168 if not sys.argv[0].endswith(
'cmsDriver.py'):
169 options.parseArguments()
172 print "CL parsing disabled!"
174 print "Setting mdtau to ", options.mdtau
175 process.generator.ZTauTau.TauolaOptions.InputCards.mdtau = options.mdtau
176 process.newSource.ZTauTau.TauolaOptions.InputCards.mdtau = options.mdtau
177 process.generator.ParticleGun.ExternalDecays.Tauola.InputCards.mdtau = options.mdtau
178 process.newSource.ParticleGun.ExternalDecays.Tauola.InputCards.mdtau = options.mdtau
180 print "Setting minVisibleTransverseMomentum to ", options.minVisibleTransverseMomentum
181 process.newSource.ZTauTau.minVisibleTransverseMomentum = cms.untracked.string(options.minVisibleTransverseMomentum)
182 process.generator.ZTauTau.minVisibleTransverseMomentum = cms.untracked.string(options.minVisibleTransverseMomentum)
184 print "Setting transformationMode to ", options.transformationMode
185 process.generator.ZTauTau.transformationMode = cms.untracked.int32(options.transformationMode)
186 process.newSource.ZTauTau.transformationMode = cms.untracked.int32(options.transformationMode)
188 print "options.overrideBeamSpot", options.overrideBeamSpot
189 if options.overrideBeamSpot != 0:
190 bs = cms.string(
"BeamSpotObjects_2009_LumiBased_SigmaZ_v26_offline")
197 process.GlobalTag.toGet = cms.VPSet(
198 cms.PSet(record = cms.string(
"BeamSpotObjectsRcd"),
200 connect = cms.untracked.string(
"frontier://FrontierProd/CMS_COND_31X_BEAMSPOT")
203 print "BeamSpot in globaltag set to ", bs
205 print "BeamSpot in globaltag not changed"
207 if options.useJson != 0:
208 print "Enabling json usage"
209 import PhysicsTools.PythonAnalysis.LumiList
as LumiList
210 import FWCore.ParameterSet.Types
as CfgTypes
212 process.source.lumisToProcess = CfgTypes.untracked(CfgTypes.VLuminosityBlockRange())
213 process.source.lumisToProcess.extend(myLumis)
218 process.tmfTracks = cms.EDProducer(
"RecoTracksMixer",
219 trackCol1 = cms.InputTag(
"removedInputMuons",
"tracks"),
220 trackCol2 = cms.InputTag(
"generalTracks",
"",
"EmbeddedRECO")
223 process.offlinePrimaryVerticesWithBS.TrackLabel = cms.InputTag(
"tmfTracks")
224 process.offlinePrimaryVertices.TrackLabel = cms.InputTag(
"tmfTracks")
226 if hasattr(process.muons,
"TrackExtractorPSet"):
227 process.muons.TrackExtractorPSet.inputTrackCollection = cms.InputTag(
"tmfTracks")
228 elif hasattr(process,
"muons1stStep")
and hasattr(process.muons1stStep,
"TrackExtractorPSet"):
229 process.muons1stStep.TrackExtractorPSet.inputTrackCollection = cms.InputTag(
"tmfTracks")
231 raise "Problem with muons"
235 for s
in process.sequences:
236 seq = getattr(process,s)
237 seq.remove(process.offlineBeamSpot)
241 process.metreco.remove(process.BeamHaloId)
246 outputModule = process.output
250 outputModule = getattr(process,str(getattr(process,
list(process.endpaths)[-1])))
255 for p
in process.paths:
256 pth = getattr(process,p)
257 if "generalTracks" in pth.moduleNames():
258 pth.replace(process.generalTracks, process.generalTracks*process.tmfTracks)
262 process.gsfElectronsORG = process.gsfElectrons.clone()
266 for p
in process.paths:
267 pth = getattr(process,p)
269 if "gsfElectrons" in pth.moduleNames():
270 pth.replace(process.gsfElectrons, process.gsfElectronsORG*process.gsfElectrons)
274 process.gsfElectrons = cms.EDProducer(
"GSFElectronsMixer",
275 col1 = cms.InputTag(
"gsfElectronsORG"),
276 col2 = cms.InputTag(
"gsfElectrons",
"", RECOproc )
282 process.particleFlowORG = process.particleFlow.clone()
289 if hasattr(process,
'particleFlowTmp'):
290 process.particleFlowTmpMixed = cms.EDProducer(
'PFCandidateMixer',
291 col1 = cms.untracked.InputTag(
"removedInputMuons",
"pfCands"),
292 col2 = cms.untracked.InputTag(
"particleFlowTmp",
""),
293 trackCol = cms.untracked.InputTag(
"tmfTracks"),
296 muons = cms.untracked.InputTag(
""),
297 gsfElectrons = cms.untracked.InputTag(
"")
299 process.muons.PFCandidates = cms.InputTag(
"particleFlowTmpMixed")
301 for p
in process.paths:
302 if "particleFlow" in pth.moduleNames():
303 pth.replace(process.particleFlow, process.particleFlowORG*process.particleFlow)
304 if "muons" in pth.moduleNames():
305 pth.replace(process.muons, process.particleFlowTmpMixed*process.muons)
308 if hasattr(process,
"famosParticleFlowSequence"):
309 process.famosParticleFlowSequence.remove(process.pfPhotonTranslatorSequence)
310 process.famosParticleFlowSequence.remove(process.pfElectronTranslatorSequence)
311 process.famosParticleFlowSequence.remove(process.particleFlow)
312 process.famosParticleFlowSequence.__iadd__(process.particleFlowORG)
313 process.famosParticleFlowSequence.__iadd__(process.particleFlow)
314 process.famosParticleFlowSequence.__iadd__(process.pfElectronTranslatorSequence)
315 process.famosParticleFlowSequence.__iadd__(process.pfPhotonTranslatorSequence)
316 elif hasattr(process,
"particleFlowReco"):
317 process.particleFlowReco.remove(process.pfPhotonTranslatorSequence)
318 process.particleFlowReco.remove(process.pfElectronTranslatorSequence)
319 process.particleFlowReco.remove(process.particleFlow)
320 process.particleFlowReco.__iadd__(process.particleFlowORG)
321 process.particleFlowReco.__iadd__(process.particleFlow)
322 process.particleFlowReco.__iadd__(process.pfElectronTranslatorSequence)
323 process.particleFlowReco.__iadd__(process.pfPhotonTranslatorSequence)
325 raise "Cannot find particleFlow sequence"
327 process.pfSelectedElectrons.src = cms.InputTag(
"particleFlowORG")
328 process.pfSelectedPhotons.src = cms.InputTag(
"particleFlowORG")
331 process.particleFlow = cms.EDProducer(
'PFCandidateMixer',
332 col1 = cms.untracked.InputTag(
"removedInputMuons",
"pfCands"),
333 col2 = cms.untracked.InputTag(
"particleFlowORG",
""),
334 trackCol = cms.untracked.InputTag(
"tmfTracks"),
336 muons = cms.untracked.InputTag(
"muons"),
337 gsfElectrons = cms.untracked.InputTag(
"gsfElectrons")
341 process.filterEmptyEv.src = cms.untracked.InputTag(
"generator",
"",
"EmbeddedRECO")
343 from FWCore.ParameterSet.Types
import InputTag
344 for p
in process.paths:
345 i = getattr(process,p)
346 target = process.particleFlow
348 seqVis = SeqVisitor(target)
349 seqVis.prepareSearch()
350 seqVis.setLookFor(target)
352 while ( seqVis.catch != 1
and seqVis.found == 1 ):
354 target = seqVis.giveNext()
356 targetAttributes =
dir(target)
357 for targetAttribute
in targetAttributes:
358 attr=getattr(target,targetAttribute)
359 if isinstance(attr, InputTag)
and attr.getModuleLabel()==
"particleFlow":
360 if ( attr.getProductInstanceLabel()!=
"" ):
361 print "Changing: ", target,
" ", targetAttribute,
" ", attr,
" to particleFlowORG"
362 attr.setModuleLabel(
"particleFlowORG")
366 seqVis.prepareSearch()
367 seqVis.setLookFor(target)
375 if hasattr(process,
"DQM_FEDIntegrity_v3"):
376 process.schedule.remove(process.DQM_FEDIntegrity_v3)
379 if hasattr(process,
"doZmumuSkim"):
380 print "Enabling Zmumu skim"
383 cmssw_ver = os.environ[
"CMSSW_VERSION"]
384 if cmssw_ver.find(
"CMSSW_4_2") != -1:
386 print "Using legacy version of Zmumu skim. Note, that muon isolation is disabled"
388 process.load(
"TauAnalysis/MCEmbeddingTools/ZmumuStandalonSelectionLegacy_cff")
389 process.RandomNumberGeneratorService.dummy = cms.PSet(
390 initialSeed = cms.untracked.uint32(123456789),
391 engineName = cms.untracked.string(
'HepJamesRandom')
395 process.load(
"TauAnalysis/MCEmbeddingTools/ZmumuStandalonSelection_cff")
398 process.load(
"TrackingTools/TransientTrack/TransientTrackBuilder_cfi")
401 for path
in process.paths:
402 getattr(process,path)._seq = process.goldenZmumuSelectionSequence * getattr(process,path)._seq
410 print "Zmumu skim not enabled"
413 print "# ######################################################################################"
414 print " Following parameters can be added before customize function "
415 print " call in order to controll process customization: "
416 print " process.doNotParse = cms.PSet() # disables CL parsing for crab compat"
417 print " process.doZmumuSkim = cms.PSet() # adds Zmumu skimming before embedding is run"
418 print "# ######################################################################################"
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run