45 process._Process__name=
"EmbeddedRECO"
46 process.TFileService = cms.Service(
"TFileService", fileName = cms.string(
"histo_embedded.root") )
49 outputModule = process.output
53 outputModule = getattr(process,str(getattr(process,
list(process.endpaths)[-1])))
57 print "Changing eventcontent to RAW+AODSIM + misc. "
58 outputModule.outputCommands = cms.untracked.vstring(
"drop *")
59 outputModule.outputCommands.extend(process.RAWEventContent.outputCommands )
60 outputModule.outputCommands.extend(process.AODSIMEventContent.outputCommands )
62 keepMC = cms.untracked.vstring(
"keep *_*_zMusExtracted_*",
63 "keep *_*_zmmCands_*",
64 "keep *_removedInputMuons_*_*",
65 "keep *_generator_*_*",
66 "keep *_PhotonIDProd_*_*",
68 "keep *_photonCore_*_*",
69 "keep *_genParticles_*_*",
70 "keep *_particleFlow_*_*",
71 "keep *_generator_*_*",
72 "keep *_tmfTracks_*_EmbeddedRECO",
73 "keep *_offlinePrimaryVertices_*_EmbeddedRECO",
74 "keep *_offlinePrimaryVerticesWithBS_*_EmbeddedRECO",
75 "keep *_PhotonIDProd_*_*",
77 "keep *_photonCore_*_*",
78 "keep *_genParticles_*_*",
79 "keep *_particleFlow_*_*",
81 outputModule.outputCommands.extend(keepMC)
85 for item
in outputModule.outputCommands[:]:
86 if item ==
"drop *" and index != 0:
88 del outputModule.outputCommands[index]
93 hltProcessName =
"HLT"
97 hltProcessName = __HLT__
102 process.dimuonsHLTFilter.TriggerResultsTag.processName = hltProcessName
103 process.goodZToMuMuAtLeast1HLT.TrigTag.processName = hltProcessName
104 process.goodZToMuMuAtLeast1HLT.triggerEvent.processName = hltProcessName
105 process.hltTrigReport,HLTriggerResults.processName = hltProcessName
109 process.VtxSmeared = cms.EDProducer(
"FlatEvtVtxGenerator",
110 MaxZ = cms.double(0.0),
111 MaxX = cms.double(0.0),
112 MaxY = cms.double(0.0),
113 MinX = cms.double(0.0),
114 MinY = cms.double(0.0),
115 MinZ = cms.double(0.0),
116 TimeOffset = cms.double(0.0),
117 src = cms.InputTag(
"generator")
120 import FWCore.ParameterSet.VarParsing
as VarParsing
122 options.register (
'mdtau',
124 VarParsing.VarParsing.multiplicity.singleton,
125 VarParsing.VarParsing.varType.int,
126 "mdtau value for tauola")
128 options.register (
'transformationMode',
130 VarParsing.VarParsing.multiplicity.singleton,
131 VarParsing.VarParsing.varType.int,
132 "transformation mode. 0=mumu->mumu, 1=mumu->tautau")
134 options.register (
'minVisibleTransverseMomentum',
136 VarParsing.VarParsing.multiplicity.singleton,
137 VarParsing.VarParsing.varType.string,
138 "generator level cut on visible transverse momentum (typeN:pT,[...];[...])")
140 options.register (
'useJson',
142 VarParsing.VarParsing.multiplicity.singleton,
143 VarParsing.VarParsing.varType.int,
144 "should I enable json usage?")
146 options.register (
'overrideBeamSpot',
148 VarParsing.VarParsing.multiplicity.singleton,
149 VarParsing.VarParsing.varType.int,
150 "should I override beamspot in globaltag?")
152 options.register (
'skimEnabled',
154 VarParsing.VarParsing.multiplicity.singleton,
155 VarParsing.VarParsing.varType.int,
156 "should I apply Zmumu event selection cuts?")
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)
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)
240 process.metreco.remove(process.BeamHaloId)
245 outputModule = process.output
249 outputModule = getattr(process,str(getattr(process,
list(process.endpaths)[-1])))
253 for p
in process.paths:
254 pth = getattr(process,p)
255 if "generalTracks" in pth.moduleNames():
256 pth.replace(process.generalTracks, process.generalTracks*process.tmfTracks)
259 process.gsfElectronsORG = process.gsfElectrons.clone()
263 for p
in process.paths:
264 pth = getattr(process,p)
266 if "gsfElectrons" in pth.moduleNames():
267 pth.replace(process.gsfElectrons, process.gsfElectronsORG*process.gsfElectrons)
271 process.gsfElectrons = cms.EDProducer(
"GSFElectronsMixer",
272 col1 = cms.InputTag(
"gsfElectronsORG"),
273 col2 = cms.InputTag(
"gsfElectrons",
"", RECOproc )
277 process.particleFlowORG = process.particleFlow.clone()
284 if hasattr(process,
'particleFlowTmp'):
285 process.particleFlowTmpMixed = cms.EDProducer(
'PFCandidateMixer',
286 col1 = cms.untracked.InputTag(
"removedInputMuons",
"pfCands"),
287 col2 = cms.untracked.InputTag(
"particleFlowTmp",
""),
288 trackCol = cms.untracked.InputTag(
"tmfTracks"),
291 muons = cms.untracked.InputTag(
""),
292 gsfElectrons = cms.untracked.InputTag(
"")
294 process.muons.PFCandidates = cms.InputTag(
"particleFlowTmpMixed")
296 for p
in process.paths:
297 if "particleFlow" in pth.moduleNames():
298 pth.replace(process.particleFlow, process.particleFlowORG*process.particleFlow)
299 if "muons" in pth.moduleNames():
300 pth.replace(process.muons, process.particleFlowTmpMixed*process.muons)
303 if hasattr(process,
"famosParticleFlowSequence"):
304 process.famosParticleFlowSequence.remove(process.pfPhotonTranslatorSequence)
305 process.famosParticleFlowSequence.remove(process.pfElectronTranslatorSequence)
306 process.famosParticleFlowSequence.remove(process.particleFlow)
307 process.famosParticleFlowSequence.__iadd__(process.particleFlowORG)
308 process.famosParticleFlowSequence.__iadd__(process.particleFlow)
309 process.famosParticleFlowSequence.__iadd__(process.pfElectronTranslatorSequence)
310 process.famosParticleFlowSequence.__iadd__(process.pfPhotonTranslatorSequence)
311 elif hasattr(process,
"particleFlowReco"):
312 process.particleFlowReco.remove(process.pfPhotonTranslatorSequence)
313 process.particleFlowReco.remove(process.pfElectronTranslatorSequence)
314 process.particleFlowReco.remove(process.particleFlow)
315 process.particleFlowReco.__iadd__(process.particleFlowORG)
316 process.particleFlowReco.__iadd__(process.particleFlow)
317 process.particleFlowReco.__iadd__(process.pfElectronTranslatorSequence)
318 process.particleFlowReco.__iadd__(process.pfPhotonTranslatorSequence)
320 raise "Cannot find particleFlow sequence"
322 process.pfSelectedElectrons.src = cms.InputTag(
"particleFlowORG")
323 process.pfSelectedPhotons.src = cms.InputTag(
"particleFlowORG")
325 process.particleFlow = cms.EDProducer(
'PFCandidateMixer',
326 col1 = cms.untracked.InputTag(
"removedInputMuons",
"pfCands"),
327 col2 = cms.untracked.InputTag(
"particleFlowORG",
""),
328 trackCol = cms.untracked.InputTag(
"tmfTracks"),
330 muons = cms.untracked.InputTag(
"muons"),
331 gsfElectrons = cms.untracked.InputTag(
"gsfElectrons")
335 process.filterEmptyEv.src = cms.untracked.InputTag(
"generator",
"",
"EmbeddedRECO")
337 from FWCore.ParameterSet.Types
import InputTag
338 for p
in process.paths:
339 i = getattr(process,p)
340 target = process.particleFlow
343 seqVis.prepareSearch()
344 seqVis.setLookFor(target)
346 while ( seqVis.catch != 1
and seqVis.found == 1 ):
348 target = seqVis.giveNext()
350 targetAttributes =
dir(target)
351 for targetAttribute
in targetAttributes:
352 attr=getattr(target,targetAttribute)
353 if isinstance(attr, InputTag)
and attr.getModuleLabel()==
"particleFlow":
354 if ( attr.getProductInstanceLabel()!=
"" ):
355 print "Changing: ", target,
" ", targetAttribute,
" ", attr,
" to particleFlowORG"
356 attr.setModuleLabel(
"particleFlowORG")
359 seqVis.prepareSearch()
360 seqVis.setLookFor(target)
368 l1ExtraCollections = [
369 [
"L1EmParticle",
"Isolated" ],
370 [
"L1EmParticle",
"NonIsolated" ],
371 [
"L1EtMissParticle",
"MET" ],
372 [
"L1EtMissParticle",
"MHT" ],
373 [
"L1JetParticle",
"Central" ],
374 [
"L1JetParticle",
"Forward" ],
375 [
"L1JetParticle",
"Tau" ],
376 [
"L1MuonParticle",
"" ]
378 l1extraParticleCollections = []
379 for l1ExtraCollection
in l1ExtraCollections:
380 inputType = l1ExtraCollection[0]
382 if inputType ==
"L1EmParticle":
383 pluginType =
"L1ExtraEmParticleMixerPlugin"
384 elif inputType ==
"L1EtMissParticle":
385 pluginType =
"L1ExtraMEtMixerPlugin"
386 elif inputType ==
"L1JetParticle":
387 pluginType =
"L1ExtraJetParticleMixerPlugin"
388 elif inputType ==
"L1MuonParticle":
389 pluginType =
"L1ExtraMuonParticleMixerPlugin"
391 raise ValueError(
"Invalid L1Extra type = %s !!" % inputType)
392 instanceLabel = l1ExtraCollection[1]
393 l1extraParticleCollections.append(cms.PSet(
394 pluginType = cms.string(pluginType),
395 instanceLabel = cms.string(instanceLabel)))
396 process.l1extraParticlesORG = process.l1extraParticles.clone()
397 process.l1extraParticles = cms.EDProducer(
'L1ExtraMixer',
398 src1 = cms.InputTag(
'l1extraParticles::HLT'),
399 src2 = cms.InputTag(
'l1extraParticlesORG'),
400 collections = cms.VPSet(l1extraParticleCollections)
402 for p
in process.paths:
403 pth = getattr(process,p)
404 if "l1extraParticles" in pth.moduleNames():
405 pth.replace(process.l1extraParticles, process.l1extraParticlesORG*process.l1extraParticles)
409 fedIntRemoved =
False
410 for i
in range(1,30):
411 attrName =
"DQM_FEDIntegrity_v"+str(i)
412 if hasattr(process, attrName ):
413 process.schedule.remove(process.DQM_FEDIntegrity_v11)
414 del process.DTDataIntegrityTask
419 print "Removed", attrName
421 print "DQM_FEDIntegrity_vXX not found, expect problems"
425 if options.skimEnabled != 0:
428 if hasattr(process,
"doZmumuSkim"):
431 print "Enabling Zmumu skim"
434 cmssw_ver = os.environ[
"CMSSW_VERSION"]
435 if cmssw_ver.find(
"CMSSW_4_2") != -1:
437 print "Using legacy version of Zmumu skim. Note, that muon isolation is disabled"
439 process.load(
"TauAnalysis/MCEmbeddingTools/ZmumuStandalonSelectionLegacy_cff")
440 process.RandomNumberGeneratorService.dummy = cms.PSet(
441 initialSeed = cms.untracked.uint32(123456789),
442 engineName = cms.untracked.string(
'HepJamesRandom')
446 process.load(
"TauAnalysis/MCEmbeddingTools/ZmumuStandalonSelection_cff")
449 process.load(
"TrackingTools/TransientTrack/TransientTrackBuilder_cfi")
452 for path
in process.paths:
453 getattr(process,path)._seq = process.goldenZmumuSelectionSequence * getattr(process,path)._seq
459 print "Zmumu skim not enabled"
461 process.load(
"TauAnalysis/MCEmbeddingTools/ZmumuStandalonSelection_cff")
462 process.skimEffFlag = cms.EDProducer(
"DummyBoolEventSelFlagProducer")
463 process.skimEffPath = cms.Path(process.goldenZmumuSelectionSequence * process.skimEffFlag)
465 process.load(
"TrackingTools/TransientTrack/TransientTrackBuilder_cfi")
467 print "# ######################################################################################"
468 print " Following parameters can be added before customize function "
469 print " call in order to controll process customization: "
470 print " process.doNotParse = cms.PSet() # disables CL parsing for crab compat"
471 print " process.doZmumuSkim = cms.PSet() # adds Zmumu skimming before embedding is run"
472 print "# ######################################################################################"
return(e1-e2)*(e1-e2)+dp *dp
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