51 process._Process__name=
"EmbeddedRECO"
52 process.TFileService = cms.Service(
"TFileService", fileName = cms.string(
"histo_embedded.root") )
55 outputModule = process.output
59 outputModule = getattr(process,str(getattr(process,
list(process.endpaths)[-1])))
63 print "Changing eventcontent to RAW+AODSIM + misc. "
64 outputModule.outputCommands = cms.untracked.vstring(
"drop *")
65 outputModule.outputCommands.extend(process.RAWEventContent.outputCommands )
66 outputModule.outputCommands.extend(process.AODSIMEventContent.outputCommands )
68 keepMC = cms.untracked.vstring(
"keep *_*_zMusExtracted_*",
69 "keep *_*_zmmCands_*",
70 "keep *_removedInputMuons_*_*",
71 "keep *_generator_*_*",
72 "keep *_PhotonIDProd_*_*",
74 "keep *_photonCore_*_*",
75 "keep *_genParticles_*_*",
76 "keep *_particleFlow_*_*",
77 "keep *_generator_*_*",
78 "keep *_tmfTracks_*_EmbeddedRECO",
79 "keep *_offlinePrimaryVertices_*_EmbeddedRECO",
80 "keep *_offlinePrimaryVerticesWithBS_*_EmbeddedRECO",
81 "keep *_PhotonIDProd_*_*",
83 "keep *_photonCore_*_*",
84 "keep *_genParticles_*_*",
85 "keep *_particleFlow_*_*",
87 outputModule.outputCommands.extend(keepMC)
91 for item
in outputModule.outputCommands[:]:
92 if item ==
"drop *" and index != 0:
94 del outputModule.outputCommands[index]
99 hltProcessName =
"HLT"
103 hltProcessName = __HLT__
108 process.dimuonsHLTFilter.TriggerResultsTag.processName = hltProcessName
109 process.goodZToMuMuAtLeast1HLT.TrigTag.processName = hltProcessName
110 process.goodZToMuMuAtLeast1HLT.triggerEvent.processName = hltProcessName
111 process.hltTrigReport,HLTriggerResults.processName = hltProcessName
115 process.VtxSmeared = cms.EDProducer(
"FlatEvtVtxGenerator",
116 MaxZ = cms.double(0.0),
117 MaxX = cms.double(0.0),
118 MaxY = cms.double(0.0),
119 MinX = cms.double(0.0),
120 MinY = cms.double(0.0),
121 MinZ = cms.double(0.0),
122 TimeOffset = cms.double(0.0),
123 src = cms.InputTag(
"generator")
126 import FWCore.ParameterSet.VarParsing
as VarParsing
128 options.register (
'mdtau',
130 VarParsing.VarParsing.multiplicity.singleton,
131 VarParsing.VarParsing.varType.int,
132 "mdtau value for tauola")
134 options.register (
'transformationMode',
136 VarParsing.VarParsing.multiplicity.singleton,
137 VarParsing.VarParsing.varType.int,
138 "transformation mode. 0=mumu->mumu, 1=mumu->tautau")
140 options.register (
'minVisibleTransverseMomentum',
142 VarParsing.VarParsing.multiplicity.singleton,
143 VarParsing.VarParsing.varType.string,
144 "generator level cut on visible transverse momentum (typeN:pT,[...];[...])")
146 options.register (
'useJson',
148 VarParsing.VarParsing.multiplicity.singleton,
149 VarParsing.VarParsing.varType.int,
150 "should I enable json usage?")
152 options.register (
'overrideBeamSpot',
154 VarParsing.VarParsing.multiplicity.singleton,
155 VarParsing.VarParsing.varType.int,
156 "should I override beamspot in globaltag?")
166 if not hasattr(process,
"doNotParse"):
168 if hasattr(sys,
"argv") ==
True:
169 if not sys.argv[0].endswith(
'cmsDriver.py'):
170 options.parseArguments()
173 print "CL parsing disabled!"
175 print "Setting mdtau to ", options.mdtau
176 process.generator.ZTauTau.TauolaOptions.InputCards.mdtau = options.mdtau
177 process.newSource.ZTauTau.TauolaOptions.InputCards.mdtau = options.mdtau
178 process.generator.ParticleGun.ExternalDecays.Tauola.InputCards.mdtau = options.mdtau
179 process.newSource.ParticleGun.ExternalDecays.Tauola.InputCards.mdtau = options.mdtau
181 print "Setting minVisibleTransverseMomentum to ", options.minVisibleTransverseMomentum
182 process.newSource.ZTauTau.minVisibleTransverseMomentum = cms.untracked.string(options.minVisibleTransverseMomentum)
183 process.generator.ZTauTau.minVisibleTransverseMomentum = cms.untracked.string(options.minVisibleTransverseMomentum)
185 print "Setting transformationMode to ", options.transformationMode
186 process.generator.ZTauTau.transformationMode = cms.untracked.int32(options.transformationMode)
187 process.newSource.ZTauTau.transformationMode = cms.untracked.int32(options.transformationMode)
189 print "options.overrideBeamSpot", options.overrideBeamSpot
190 if options.overrideBeamSpot != 0:
191 bs = cms.string(
"BeamSpotObjects_2009_LumiBased_SigmaZ_v26_offline")
198 process.GlobalTag.toGet = cms.VPSet(
199 cms.PSet(record = cms.string(
"BeamSpotObjectsRcd"),
201 connect = cms.untracked.string(
"frontier://FrontierProd/CMS_COND_31X_BEAMSPOT")
204 print "BeamSpot in globaltag set to ", bs
206 print "BeamSpot in globaltag not changed"
208 if options.useJson != 0:
209 print "Enabling json usage"
210 import PhysicsTools.PythonAnalysis.LumiList
as LumiList
211 import FWCore.ParameterSet.Types
as CfgTypes
213 process.source.lumisToProcess = CfgTypes.untracked(CfgTypes.VLuminosityBlockRange())
214 process.source.lumisToProcess.extend(myLumis)
219 process.tmfTracks = cms.EDProducer(
"RecoTracksMixer",
220 trackCol1 = cms.InputTag(
"removedInputMuons",
"tracks"),
221 trackCol2 = cms.InputTag(
"generalTracks",
"",
"EmbeddedRECO")
224 process.offlinePrimaryVerticesWithBS.TrackLabel = cms.InputTag(
"tmfTracks")
225 process.offlinePrimaryVertices.TrackLabel = cms.InputTag(
"tmfTracks")
227 if hasattr(process.muons,
"TrackExtractorPSet"):
228 process.muons.TrackExtractorPSet.inputTrackCollection = cms.InputTag(
"tmfTracks")
229 elif hasattr(process,
"muons1stStep")
and hasattr(process.muons1stStep,
"TrackExtractorPSet"):
230 process.muons1stStep.TrackExtractorPSet.inputTrackCollection = cms.InputTag(
"tmfTracks")
232 raise "Problem with muons"
236 for s
in process.sequences:
237 seq = getattr(process,s)
238 seq.remove(process.offlineBeamSpot)
242 process.metreco.remove(process.BeamHaloId)
247 outputModule = process.output
251 outputModule = getattr(process,str(getattr(process,
list(process.endpaths)[-1])))
256 for p
in process.paths:
257 pth = getattr(process,p)
258 if "generalTracks" in pth.moduleNames():
259 pth.replace(process.generalTracks, process.generalTracks*process.tmfTracks)
263 process.gsfElectronsORG = process.gsfElectrons.clone()
267 for p
in process.paths:
268 pth = getattr(process,p)
270 if "gsfElectrons" in pth.moduleNames():
271 pth.replace(process.gsfElectrons, process.gsfElectronsORG*process.gsfElectrons)
275 process.gsfElectrons = cms.EDProducer(
"GSFElectronsMixer",
276 col1 = cms.InputTag(
"gsfElectronsORG"),
277 col2 = cms.InputTag(
"gsfElectrons",
"", RECOproc )
283 process.particleFlowORG = process.particleFlow.clone()
290 if hasattr(process,
'particleFlowTmp'):
291 process.particleFlowTmpMixed = cms.EDProducer(
'PFCandidateMixer',
292 col1 = cms.untracked.InputTag(
"removedInputMuons",
"pfCands"),
293 col2 = cms.untracked.InputTag(
"particleFlowTmp",
""),
294 trackCol = cms.untracked.InputTag(
"tmfTracks"),
297 muons = cms.untracked.InputTag(
""),
298 gsfElectrons = cms.untracked.InputTag(
"")
300 process.muons.PFCandidates = cms.InputTag(
"particleFlowTmpMixed")
302 for p
in process.paths:
303 if "particleFlow" in pth.moduleNames():
304 pth.replace(process.particleFlow, process.particleFlowORG*process.particleFlow)
305 if "muons" in pth.moduleNames():
306 pth.replace(process.muons, process.particleFlowTmpMixed*process.muons)
309 if hasattr(process,
"famosParticleFlowSequence"):
310 process.famosParticleFlowSequence.remove(process.pfPhotonTranslatorSequence)
311 process.famosParticleFlowSequence.remove(process.pfElectronTranslatorSequence)
312 process.famosParticleFlowSequence.remove(process.particleFlow)
313 process.famosParticleFlowSequence.__iadd__(process.particleFlowORG)
314 process.famosParticleFlowSequence.__iadd__(process.particleFlow)
315 process.famosParticleFlowSequence.__iadd__(process.pfElectronTranslatorSequence)
316 process.famosParticleFlowSequence.__iadd__(process.pfPhotonTranslatorSequence)
317 elif hasattr(process,
"particleFlowReco"):
318 process.particleFlowReco.remove(process.pfPhotonTranslatorSequence)
319 process.particleFlowReco.remove(process.pfElectronTranslatorSequence)
320 process.particleFlowReco.remove(process.particleFlow)
321 process.particleFlowReco.__iadd__(process.particleFlowORG)
322 process.particleFlowReco.__iadd__(process.particleFlow)
323 process.particleFlowReco.__iadd__(process.pfElectronTranslatorSequence)
324 process.particleFlowReco.__iadd__(process.pfPhotonTranslatorSequence)
326 raise "Cannot find particleFlow sequence"
328 process.pfSelectedElectrons.src = cms.InputTag(
"particleFlowORG")
329 process.pfSelectedPhotons.src = cms.InputTag(
"particleFlowORG")
332 process.particleFlow = cms.EDProducer(
'PFCandidateMixer',
333 col1 = cms.untracked.InputTag(
"removedInputMuons",
"pfCands"),
334 col2 = cms.untracked.InputTag(
"particleFlowORG",
""),
335 trackCol = cms.untracked.InputTag(
"tmfTracks"),
337 muons = cms.untracked.InputTag(
"muons"),
338 gsfElectrons = cms.untracked.InputTag(
"gsfElectrons")
342 process.filterEmptyEv.src = cms.untracked.InputTag(
"generator",
"",
"EmbeddedRECO")
344 from FWCore.ParameterSet.Types
import InputTag
345 for p
in process.paths:
346 i = getattr(process,p)
347 target = process.particleFlow
350 seqVis.prepareSearch()
351 seqVis.setLookFor(target)
353 while ( seqVis.catch != 1
and seqVis.found == 1 ):
355 target = seqVis.giveNext()
357 targetAttributes =
dir(target)
358 for targetAttribute
in targetAttributes:
359 attr=getattr(target,targetAttribute)
360 if isinstance(attr, InputTag)
and attr.getModuleLabel()==
"particleFlow":
361 if ( attr.getProductInstanceLabel()!=
"" ):
362 print "Changing: ", target,
" ", targetAttribute,
" ", attr,
" to particleFlowORG"
363 attr.setModuleLabel(
"particleFlowORG")
367 seqVis.prepareSearch()
368 seqVis.setLookFor(target)
376 if hasattr(process,
"DQM_FEDIntegrity_v3"):
377 process.schedule.remove(process.DQM_FEDIntegrity_v3)
380 if hasattr(process,
"doZmumuSkim"):
381 print "Enabling Zmumu skim"
384 cmssw_ver = os.environ[
"CMSSW_VERSION"]
385 if cmssw_ver.find(
"CMSSW_4_2") != -1:
387 print "Using legacy version of Zmumu skim. Note, that muon isolation is disabled"
389 process.load(
"TauAnalysis/MCEmbeddingTools/ZmumuStandalonSelectionLegacy_cff")
390 process.RandomNumberGeneratorService.dummy = cms.PSet(
391 initialSeed = cms.untracked.uint32(123456789),
392 engineName = cms.untracked.string(
'HepJamesRandom')
396 process.load(
"TauAnalysis/MCEmbeddingTools/ZmumuStandalonSelection_cff")
399 process.load(
"TrackingTools/TransientTrack/TransientTrackBuilder_cfi")
402 for path
in process.paths:
403 getattr(process,path)._seq = process.goldenZmumuSelectionSequence * getattr(process,path)._seq
411 print "Zmumu skim not enabled"
414 print "# ######################################################################################"
415 print " Following parameters can be added before customize function "
416 print " call in order to controll process customization: "
417 print " process.doNotParse = cms.PSet() # disables CL parsing for crab compat"
418 print " process.doZmumuSkim = cms.PSet() # adds Zmumu skimming before embedding is run"
419 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