CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
rh_customizeAll.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 import FWCore.ParameterSet.Config as cms
3 import os
4 
5 def customise(process):
6 
7  inputProcess="HLT" # some automagic check possible?
8  #inputProcess="RECO" # some automagic check possible?
9 
10  print "Input process set to", inputProcess
11  process._Process__name="EmbeddedRECO"
12  process.TFileService = cms.Service("TFileService", fileName = cms.string("histo_embedded.root") )
13 
14  try:
15  outputModule = process.output
16  except:
17  pass
18  try:
19  outputModule = getattr(process,str(getattr(process,list(process.endpaths)[-1])))
20  except:
21  pass
22 
23  print "Changing eventcontent to RAW+AODSIM + misc. "
24  outputModule.outputCommands = cms.untracked.vstring("drop *")
25  outputModule.outputCommands.extend(process.RAWEventContent.outputCommands )
26  outputModule.outputCommands.extend(process.AODSIMEventContent.outputCommands )
27 
28  keepMC = cms.untracked.vstring("keep *_*_zMusExtracted_*",
29  "keep *_*_zmmCands_*",
30  "keep *_removedInputMuons_*_*",
31  "keep *_generator_*_*",
32  "keep *_PhotonIDProd_*_*",
33  "keep *_photons_*_*",
34  "keep *_photonCore_*_*",
35  "keep *_genParticles_*_*",
36  "keep *_particleFlow_*_*",
37  "keep *_generator_*_*",
38  "keep *_tmfTracks_*_EmbeddedRECO",
39  "keep *_offlinePrimaryVertices_*_EmbeddedRECO",
40  "keep *_offlinePrimaryVerticesWithBS_*_EmbeddedRECO"
41  )
42  outputModule.outputCommands.extend(keepMC)
43 
44  # getRid of second "drop *"
45  index = 0
46  for item in outputModule.outputCommands[:]:
47  if item == "drop *" and index != 0:
48  #print index," ",outputModule.outputCommands[index]
49  del outputModule.outputCommands[index]
50  index -= 1
51  index += 1
52 
53  hltProcessName = "HLT" #"REDIGI38X"
54  # the following block can be used for more efficient processing by replacing the HLT variable below automatically
55  try:
56  hltProcessName = __HLT__
57  except:
58  pass
59 
60  try:
61  process.dimuonsHLTFilter.TriggerResultsTag.processName = hltProcessName
62  process.goodZToMuMuAtLeast1HLT.TrigTag.processName = hltProcessName
63  process.goodZToMuMuAtLeast1HLT.triggerEvent.processName = hltProcessName
64  process.hltTrigReport,HLTriggerResults.processName = hltProcessName
65  except:
66  pass
67 
68  process.VtxSmeared = cms.EDProducer("FlatEvtVtxGenerator",
69  MaxZ = cms.double(0.0),
70  MaxX = cms.double(0.0),
71  MaxY = cms.double(0.0),
72  MinX = cms.double(0.0),
73  MinY = cms.double(0.0),
74  MinZ = cms.double(0.0),
75  TimeOffset = cms.double(0.0),
76  src = cms.InputTag("generator")
77  )
78 
79  import FWCore.ParameterSet.VarParsing as VarParsing
80  options = VarParsing.VarParsing ('analysis')
81  options.register ('mdtau',
82  0, # default value
83  VarParsing.VarParsing.multiplicity.singleton,
84  VarParsing.VarParsing.varType.int,
85  "mdtau value for tauola")
86 
87  options.register ('transformationMode',
88  1, #default value
89  VarParsing.VarParsing.multiplicity.singleton,
90  VarParsing.VarParsing.varType.int,
91  "transformation mode. 0=mumu->mumu, 1=mumu->tautau")
92 
93  options.register ('minVisibleTransverseMomentum',
94  "", #default value
95  VarParsing.VarParsing.multiplicity.singleton,
96  VarParsing.VarParsing.varType.string,
97  "generator level cut on visible transverse momentum (typeN:pT,[...];[...])")
98 
99  options.register ('useJson',
100  0, # default value, false
101  VarParsing.VarParsing.multiplicity.singleton,
102  VarParsing.VarParsing.varType.int,
103  "should I enable json usage?")
104 
105  options.register ('overrideBeamSpot',
106  0, # default value, false
107  VarParsing.VarParsing.multiplicity.singleton,
108  VarParsing.VarParsing.varType.int,
109  "should I override beamspot in globaltag?")
110 
111 # options.register ('primaryProcess',
112 # 'RECO', # default value
113 # VarParsing.VarParsing.multiplicity.singleton,
114 # VarParsing.VarParsing.varType.string,
115 # "original processName")
116 
117  setFromCL = False
118  if not hasattr(process,"doNotParse"):
119  import sys
120  if hasattr(sys, "argv") == True:
121  if not sys.argv[0].endswith('cmsDriver.py'):
122  options.parseArguments()
123  setFromCL = True
124  else :
125  print "CL parsing disabled!"
126 
127 
128  if setFromCL:
129  print "Setting mdtau to ", options.mdtau
130  process.generator.ZTauTau.TauolaOptions.InputCards.mdtau = options.mdtau
131  process.newSource.ZTauTau.TauolaOptions.InputCards.mdtau = options.mdtau
132  process.generator.ParticleGun.ExternalDecays.Tauola.InputCards.mdtau = options.mdtau
133  process.newSource.ParticleGun.ExternalDecays.Tauola.InputCards.mdtau = options.mdtau
134 
135  print "Setting minVisibleTransverseMomentum to ", options.minVisibleTransverseMomentum
136  process.newSource.ZTauTau.minVisibleTransverseMomentum = cms.untracked.string(options.minVisibleTransverseMomentum)
137  process.generator.ZTauTau.minVisibleTransverseMomentum = cms.untracked.string(options.minVisibleTransverseMomentum)
138 
139  print "Setting transformationMode to ", options.transformationMode
140  process.generator.ZTauTau.transformationMode = cms.untracked.int32(options.transformationMode)
141  process.newSource.ZTauTau.transformationMode = cms.untracked.int32(options.transformationMode)
142 
143  changeBSfromPS=False
144  if hasattr(process,"changeBSfromPS"):
145  changeBSfromPS = True
146 
147  if setFromCL and options.overrideBeamSpot != 0 or changeBSfromPS :
148  print "options.overrideBeamSpot", options.overrideBeamSpot
149  # bs = cms.string("BeamSpotObjects_2009_LumiBased_SigmaZ_v26_offline") # 52x data PR gt
150  bs = cms.string("BeamSpotObjects_2009_LumiBased_SigmaZ_v21_offline") # 42x data PR gt
151  # bs = cms.string("BeamSpotObjects_2009_LumiBased_SigmaZ_v18_offline") # 41x data PR gt
152  # bs = cms.string("BeamSpotObjects_2009_LumiBased_v17_offline") # 38x data gt
153  #bs = cms.string("BeamSpotObjects_2009_v14_offline") # 36x data gt
154  # tag = cms.string("Early10TeVCollision_3p8cm_31X_v1_mc_START"), # 35 default
155  # tag = cms.string("Realistic900GeVCollisions_10cm_STARTUP_v1_mc"), # 36 default
156  process.GlobalTag.toGet = cms.VPSet(
157  cms.PSet(record = cms.string("BeamSpotObjectsRcd"),
158  tag = bs,
159  connect = cms.untracked.string("frontier://FrontierProd/CMS_COND_31X_BEAMSPOT")
160  )
161  )
162  print "BeamSpot in globaltag set to ", bs
163  else:
164  print "BeamSpot in globaltag not changed"
165 
166  if setFromCL and options.useJson != 0:
167  print "Enabling json usage"
168  import PhysicsTools.PythonAnalysis.LumiList as LumiList
169  import FWCore.ParameterSet.Types as CfgTypes
170  myLumis = LumiList.LumiList(filename = 'my.json').getCMSSWString().split(',')
171  process.source.lumisToProcess = CfgTypes.untracked(CfgTypes.VLuminosityBlockRange())
172  process.source.lumisToProcess.extend(myLumis)
173 
174  process.generalTracksORG = process.generalTracks.clone()
175 
176  process.generalTracks = cms.EDProducer("RecoTracksMixer",
177  trackCol1 = cms.InputTag("generalTracksORG","","EmbeddedRECO"),
178  trackCol2 = cms.InputTag("removedInputMuons","tracks")
179  )
180 
181  for p in process.paths:
182  pth = getattr(process,p)
183  if "generalTracks" in pth.moduleNames():
184  pth.replace(process.generalTracks, process.generalTracksORG*process.generalTracks)
185 
186  # We can try mixing seeds or keep std::vector<Trajectory> from Zmumu event and
187  # try mixing it.
188  # note - later approach may have no sense. Different geometries...
189  process.trackerDrivenElectronSeedsORG = process.trackerDrivenElectronSeeds.clone()
190  process.trackerDrivenElectronSeedsORG.TkColList = cms.VInputTag(cms.InputTag("generalTracksORG"))
191 
192  process.trackerDrivenElectronSeeds = cms.EDProducer("ElectronSeedTrackRefUpdater",
193  PreIdLabel = process.trackerDrivenElectronSeedsORG.PreIdLabel,
194  PreGsfLabel = process.trackerDrivenElectronSeedsORG.PreGsfLabel,
195  targetTracks = cms.InputTag("generalTracks"),
196  inSeeds = cms.InputTag("trackerDrivenElectronSeedsORG", process.trackerDrivenElectronSeedsORG.PreGsfLabel.value()),
197  inPreId = cms.InputTag("trackerDrivenElectronSeedsORG", process.trackerDrivenElectronSeedsORG.PreIdLabel.value()),
198  )
199 
200  for p in process.paths:
201  pth = getattr(process,p)
202  if "trackerDrivenElectronSeeds" in pth.moduleNames():
203  pth.replace(process.trackerDrivenElectronSeeds, process.trackerDrivenElectronSeedsORG*process.trackerDrivenElectronSeeds)
204 
205  # hack photonCore:
206 
207  print "TODO: check if photon core hack helps"
208  '''
209  process.trackerDrivenElectronSeedsMerged = cms.EDProducer("ElectronSeedTrackRefUpdaterAndMerger",
210  PreIdLabel = process.trackerDrivenElectronSeedsORG.PreIdLabel,
211  PreGsfLabel = process.trackerDrivenElectronSeedsORG.PreGsfLabel,
212  targetTracks = cms.InputTag("generalTracks"),
213  inSeeds1 = cms.InputTag("trackerDrivenElectronSeedsORG", process.trackerDrivenElectronSeeds.PreGsfLabel.value()),
214  inPreId1 = cms.InputTag("trackerDrivenElectronSeedsORG", process.trackerDrivenElectronSeeds.PreIdLabel.value()),
215  inSeeds2 = cms.InputTag("trackerDrivenElectronSeeds", process.trackerDrivenElectronSeeds.PreGsfLabel.value(), inputProcess ) ,
216  inPreId2 = cms.InputTag("trackerDrivenElectronSeeds", process.trackerDrivenElectronSeeds.PreIdLabel.value(), inputProcess)
217  )
218 
219  process.electronMergedSeedsPhotonCoreHack = cms.EDProducer("ElectronSeedMerger",
220  EcalBasedSeeds = cms.InputTag("ecalDrivenElectronSeeds"),
221  TkBasedSeeds = cms.InputTag("trackerDrivenElectronSeedsMerged","SeedsForGsf")
222  )
223 
224  process.photonCore.pixelSeedProducer = cms.string('electronMergedSeedsPhotonCoreHack')
225 
226 
227  for p in process.paths:
228  pth = getattr(process,p)
229  if "photonCore" in pth.moduleNames():
230  pth.replace(process.photonCore,
231  process.trackerDrivenElectronSeedsMerged * process.electronMergedSeedsPhotonCoreHack *process.photonCore)
232 
233 
234  '''
235 
236  # mix gsfTracks
237  process.electronGsfTracksORG = process.electronGsfTracks.clone()
238  process.electronGsfTracks = cms.EDProducer("GsfTrackMixer",
239  col1 = cms.InputTag("electronGsfTracksORG","","EmbeddedRECO"),
240  col2= cms.InputTag("electronGsfTracks","", inputProcess),
241  )
242 
243  # TODO: in 42x conversions seem not be used anywhere during reco. What about ana?
244  # what about 52X?
245  process.gsfConversionTrackProducer.TrackProducer = cms.string('electronGsfTracksORG')
246 
247  for p in process.paths:
248  pth = getattr(process,p)
249  if "electronGsfTracks" in pth.moduleNames():
250  pth.replace(process.electronGsfTracks, process.electronGsfTracksORG*process.electronGsfTracks)
251 
252  '''
253  process.electronMergedSeedsORG = process.electronMergedSeeds.clone()
254  process.electronMergedSeeds = cms.EDProducer("ElectronSeedsMixer",
255  col1 = cms.InputTag("electronMergedSeeds","", inputProcess),
256  col2 = cms.InputTag("electronMergedSeedsORG","","EmbeddedRECO")
257  )
258  for p in process.paths:
259  pth = getattr(process,p)
260  if "electronMergedSeeds" in pth.moduleNames():
261  pth.replace(process.electronMergedSeeds, process.electronMergedSeedsORG*process.electronMergedSeeds)
262  '''
263 
264  process.generalConversionTrackProducer.TrackProducer = cms.string('generalTracksORG')
265 
266  # 5_3
267  process.uncleanedOnlyGeneralConversionTrackProducer.TrackProducer = cms.string('generalTracksORG')
268  #process.TCTau = cms.Sequence()
269 
270  process.gsfElectronsORG = process.gsfElectrons.clone()
271  process.gsfElectrons = cms.EDProducer("GSFElectronsMixer",
272  col1 = cms.InputTag("gsfElectronsORG"),
273  col2 = cms.InputTag("gsfElectrons","",inputProcess),
274  )
275  for p in process.paths:
276  pth = getattr(process,p)
277  if "gsfElectrons" in pth.moduleNames():
278  pth.replace(process.gsfElectrons, process.gsfElectronsORG*process.gsfElectrons)
279 
280  for p in process.paths:
281  pth = getattr(process,p)
282  #print dir(pth)
283  #sys.exit(0)
284  for mod in pth.moduleNames():
285  if mod.find("dedx") != -1:
286  print "Removing", mod
287  module=getattr(process,mod)
288  pth.remove(module)
289 
290  # note - we should probably check this
291  clConfig = cms.PSet (
292  depsPlus = cms.InputTag("anaDeposits", "plus" ),
293  depsMinus = cms.InputTag("anaDeposits", "minus" ),
294  ZmumuCands = cms.InputTag("goldenZmumuCandidatesGe2IsoMuons")
295  )
296 
297  cleanerConfigTMVA = clConfig.clone()
298 
299  cleanerConfigTMVA.names = cms.vstring("H_Ecal_EcalBarrel", "H_Ecal_EcalEndcap",
300  "H_Hcal_HcalBarrel", "H_Hcal_HcalOuter", "H_Hcal_HcalEndcap" )
301 
302  # TODO: we should use separate config for all clenaers
303  cleanerConfigTMVA.H_Ecal_EcalBarrel = cms.vstring("MLP", "ToyCalo_MLP_ANN_H_Ecal_EcalBarrel.weights.xml" )
304  cleanerConfigTMVA.H_Ecal_EcalEndcap = cms.vstring("MLP", "ToyCalo_MLP_ANN_H_Ecal_EcalEndcap.weights.xml" )
305  cleanerConfigTMVA.H_Hcal_HcalBarrel = cms.vstring("MLP", "ToyCalo_MLP_ANN_H_Hcal_HcalBarrel.weights.xml" )
306  cleanerConfigTMVA.H_Hcal_HcalOuter = cms.vstring("MLP", "ToyCalo_MLP_ANN_H_Hcal_HcalOuter.weights.xml" )
307  cleanerConfigTMVA.H_Hcal_HcalEndcap = cms.vstring("MLP", "ToyCalo_MLP_ANN_H_Hcal_HcalEndcap.weights.xml" )
308 
309 
310  cleanerConfigConst = clConfig.clone()
311  cleanerConfigConst.names = cms.vstring("H_Ecal_EcalBarrel", "H_Ecal_EcalEndcap",
312  "H_Hcal_HcalBarrel", "H_Hcal_HcalOuter", "H_Hcal_HcalEndcap" )
313  cleanerConfigConst.H_Ecal_EcalBarrel = cms.double(0.26) # 0.29
314  cleanerConfigConst.H_Ecal_EcalEndcap = cms.double(1) # 0.33
315  cleanerConfigConst.H_Hcal_HcalBarrel = cms.double(2) # 6
316  cleanerConfigConst.H_Hcal_HcalOuter = cms.double(1.16) # 6
317  cleanerConfigConst.H_Hcal_HcalEndcap = cms.double(1.82) # 6
318 
319  cleanerConfigConst.H_Ecal_EcalBarrel = cms.double(0.2) # 0.29
320  #cleanerConfigConst.H_Ecal_EcalEndcap = cms.double(0.33) # 0.33
321  cleanerConfigConst.H_Ecal_EcalEndcap = cms.double(0.0) # 0.33
322  cleanerConfigConst.H_Hcal_HcalBarrel = cms.double(6) # 6
323  cleanerConfigConst.H_Hcal_HcalOuter = cms.double(6) # 6
324  cleanerConfigConst.H_Hcal_HcalEndcap = cms.double(6) # 6
325 
326 
327  process.castorrecoORG = process.castorreco.clone()
328  process.castorreco = cms.EDProducer("CastorRecHitMixer",
329  typeEnergyDepositMap = cms.string('absolute'),
330  srcEnergyDepositMapMuPlus = cms.InputTag("muonCaloEnergyDepositsAllCrossed","energyDepositsMuPlus"),
331  srcEnergyDepositMapMuMinus = cms.InputTag("muonCaloEnergyDepositsAllCrossed","energyDepositsMuMinus"),
332  todo = cms.VPSet(cms.PSet(
333  collection2 = cms.InputTag("castorrecoORG"),
334  collection1 = cms.InputTag("castorreco","","RECO")
335  ))
336  )
337  for p in process.paths:
338  pth = getattr(process,p)
339  if "castorreco" in pth.moduleNames():
340  pth.replace(process.castorreco, process.castorrecoORG*process.castorreco)
341 
342  process.ecalPreshowerRecHitORG = process.ecalPreshowerRecHit.clone()
343  process.ecalPreshowerRecHit = cms.EDProducer("EcalRecHitMixer",
344  typeEnergyDepositMap = cms.string('absolute'),
345  srcEnergyDepositMapMuPlus = cms.InputTag("muonCaloEnergyDepositsAllCrossed","energyDepositsMuPlus"),
346  srcEnergyDepositMapMuMinus = cms.InputTag("muonCaloEnergyDepositsAllCrossed","energyDepositsMuMinus"),
347  todo = cms.VPSet(cms.PSet(
348  collection2 = cms.InputTag("ecalPreshowerRecHitORG","EcalRecHitsES"),
349  collection1 = cms.InputTag("ecalPreshowerRecHit","EcalRecHitsES","RECO")
350  ))
351  )
352  for p in process.paths:
353  pth = getattr(process,p)
354  if "ecalPreshowerRecHit" in pth.moduleNames():
355  pth.replace(process.ecalPreshowerRecHit, process.ecalPreshowerRecHitORG*process.ecalPreshowerRecHit)
356 
357 
358 
359  process.ecalRecHitORG = process.ecalRecHit.clone()
360  process.ecalRecHit = cms.EDProducer("EcalRecHitMixer",
361  typeEnergyDepositMap = cms.string('absolute'),
362  srcEnergyDepositMapMuPlus = cms.InputTag("muonCaloEnergyDepositsByDistance","energyDepositsMuPlus"),
363  srcEnergyDepositMapMuMinus = cms.InputTag("muonCaloEnergyDepositsByDistance","energyDepositsMuMinus"),
364  todo = cms.VPSet(cms.PSet(
365  collection2 = cms.InputTag("ecalRecHitORG","EcalRecHitsEB"),
366  collection1 = cms.InputTag("ecalRecHit","EcalRecHitsEB","RECO")
367  ),
368  cms.PSet(
369  collection2 = cms.InputTag("ecalRecHitORG","EcalRecHitsEE"),
370  collection1 = cms.InputTag("ecalRecHit","EcalRecHitsEE","RECO")
371  ))
372  )
373  for p in process.paths:
374  pth = getattr(process,p)
375  if "ecalRecHit" in pth.moduleNames():
376  pth.replace(process.ecalRecHit, process.ecalRecHitORG*process.ecalRecHit)
377 
378 
379 
380  process.hbherecoORG = process.hbhereco.clone()
381  process.hbhereco = cms.EDProducer("HBHERecHitMixer",
382  typeEnergyDepositMap = cms.string('absolute'),
383  srcEnergyDepositMapMuPlus = cms.InputTag("muonCaloEnergyDepositsByDistance","energyDepositsMuPlus"),
384  srcEnergyDepositMapMuMinus = cms.InputTag("muonCaloEnergyDepositsByDistance","energyDepositsMuMinus"),
385  todo = cms.VPSet(cms.PSet(
386  collection2 = cms.InputTag("hbherecoORG"),
387  collection1 = cms.InputTag("hbhereco","","RECO")
388  ))
389  )
390  for p in process.paths:
391  pth = getattr(process,p)
392  if "hbhereco" in pth.moduleNames():
393  pth.replace(process.hbhereco, process.hbherecoORG*process.hbhereco)
394 
395  process.hfrecoORG = process.hfreco.clone()
396  process.hfreco = cms.EDProducer("HFRecHitMixer",
397  typeEnergyDepositMap = cms.string('absolute'),
398  srcEnergyDepositMapMuPlus = cms.InputTag("muonCaloEnergyDepositsAllCrossed","energyDepositsMuPlus"),
399  srcEnergyDepositMapMuMinus = cms.InputTag("muonCaloEnergyDepositsAllCrossed","energyDepositsMuMinus"),
400  todo = cms.VPSet(
401  cms.PSet(
402  collection1 = cms.InputTag("hfreco", "", inputProcess),
403  collection2 = cms.InputTag("hfrecoORG")
404  )
405  )
406  )
407  for p in process.paths:
408  pth = getattr(process, p)
409  if "hfreco" in pth.moduleNames():
410  pth.replace(process.hfreco, process.hfrecoORG*process.hfreco)
411 
412  process.horecoORG = process.horeco.clone()
413  process.horeco = cms.EDProducer("HORecHitMixer",
414  typeEnergyDepositMap = cms.string('absolute'),
415  srcEnergyDepositMapMuPlus = cms.InputTag("muonCaloEnergyDepositsByDistance","energyDepositsMuPlus"),
416  srcEnergyDepositMapMuMinus = cms.InputTag("muonCaloEnergyDepositsByDistance","energyDepositsMuMinus"),
417  todo = cms.VPSet(cms.PSet(
418  collection2 = cms.InputTag("horecoORG"),
419  collection1 = cms.InputTag("horeco","","RECO")
420  ))
421  )
422  for p in process.paths:
423  pth = getattr(process,p)
424  if "horeco" in pth.moduleNames():
425  pth.replace(process.horeco, process.horecoORG*process.horeco)
426 
427  # CV: mix L1Extra collections
428  l1ExtraCollections = [
429  [ "L1EmParticle", "Isolated" ],
430  [ "L1EmParticle", "NonIsolated" ],
431  [ "L1EtMissParticle", "MET" ],
432  [ "L1EtMissParticle", "MHT" ],
433  [ "L1JetParticle", "Central" ],
434  [ "L1JetParticle", "Forward" ],
435  [ "L1JetParticle", "Tau" ],
436  [ "L1MuonParticle", "" ]
437  ]
438  l1extraParticleCollections = []
439  for l1ExtraCollection in l1ExtraCollections:
440  inputType = l1ExtraCollection[0]
441  pluginType = None
442  if inputType == "L1EmParticle":
443  pluginType = "L1ExtraEmParticleMixerPlugin"
444  elif inputType == "L1EtMissParticle":
445  pluginType = "L1ExtraMEtMixerPlugin"
446  elif inputType == "L1JetParticle":
447  pluginType = "L1ExtraJetParticleMixerPlugin"
448  elif inputType == "L1MuonParticle":
449  pluginType = "L1ExtraMuonParticleMixerPlugin"
450  else:
451  raise ValueError("Invalid L1Extra type = %s !!" % inputType)
452  instanceLabel = l1ExtraCollection[1]
453  l1extraParticleCollections.append(cms.PSet(
454  pluginType = cms.string(pluginType),
455  instanceLabel = cms.string(instanceLabel)))
456  process.l1extraParticlesORG = process.l1extraParticles.clone()
457  process.l1extraParticles = cms.EDProducer('L1ExtraMixer',
458  src1 = cms.InputTag('l1extraParticles::HLT'),
459  src2 = cms.InputTag('l1extraParticlesORG'),
460  collections = cms.VPSet(l1extraParticleCollections)
461  )
462  for p in process.paths:
463  pth = getattr(process,p)
464  if "l1extraParticles" in pth.moduleNames():
465  pth.replace(process.l1extraParticles, process.l1extraParticlesORG*process.l1extraParticles)
466 
467  # it should be the best solution to take the original beam spot for the
468  # reconstruction of the new primary vertex
469  # use the one produced earlier, do not produce your own
470  for s in process.sequences:
471  seq = getattr(process,s)
472  seq.remove(process.offlineBeamSpot)
473 
474  try:
475  process.metreco.remove(process.BeamHaloId)
476  except:
477  pass
478 
479  try:
480  outputModule = process.output
481  except:
482  pass
483  try:
484  outputModule = getattr(process,str(getattr(process,list(process.endpaths)[-1])))
485  except:
486  pass
487 
488  process.filterEmptyEv.src = cms.untracked.InputTag("generator","","EmbeddedRECO")
489 
490  try:
491  process.schedule.remove(process.DQM_FEDIntegrity_v3)
492  except:
493  pass
494 
495  process.RECOSIMoutput.outputCommands.extend(['keep *_goldenZmumuCandidatesGe0IsoMuons_*_*'])
496  process.RECOSIMoutput.outputCommands.extend(['keep *_goldenZmumuCandidatesGe1IsoMuons_*_*'])
497  process.RECOSIMoutput.outputCommands.extend(['keep *_goldenZmumuCandidatesGe2IsoMuons_*_*'])
498 
499  # keep orginal collections, needed for PF2PAT - generalTracksORG, not sure for others
500  process.RECOSIMoutput.outputCommands.extend(['keep *_*ORG_*_*'])
501 
502  #xxx process.globalMuons.TrackerCollectionLabel = cms.InputTag("generalTracksORG")
503  #xxx process.globalSETMuons.TrackerCollectionLabel = cms.InputTag("generalTracksORG")
504  #print "TODO: add xcheck, that this is not changed"
505  #process.muons.inputCollectionLabels = cms.VInputTag(cms.InputTag("generalTracksORG"),
506  # cms.InputTag("globalMuons"),
507  # cms.InputTag("standAloneMuons","UpdatedAtVtx"))
508 
509  skimEnabled = False
510  if hasattr(process,"doZmumuSkim"):
511  print "Enabling Zmumu skim"
512  skimEnabled = True
513  #process.load("TauAnalysis/Skimming/goldenZmmSelectionVBTFrelPFIsolation_cfi")
514 
515  cmssw_ver = os.environ["CMSSW_VERSION"]
516  if cmssw_ver.find("CMSSW_4_2") != -1:
517  print
518  print "Using legacy version of Zmumu skim. Note, that muon isolation is disabled"
519  print
520  process.load("TauAnalysis/MCEmbeddingTools/ZmumuStandaloneSelectionLegacy_cff")
521  #'''
522  process.RandomNumberGeneratorService.dummy = cms.PSet(
523  initialSeed = cms.untracked.uint32(123456789),
524  engineName = cms.untracked.string('HepJamesRandom')
525  )
526  # '''
527  else:
528  process.load("TauAnalysis/MCEmbeddingTools/ZmumuStandaloneSelection_cff")
529  process.load("TrackingTools/TransientTrack/TransientTrackBuilder_cfi")
530 
531  # we are allready selecting events from generation step, so following way is ok
532  for path in process.paths:
533  getattr(process,path)._seq = process.goldenZmumuSelectionSequence * getattr(process,path)._seq
534 
535  process.options = cms.untracked.PSet(
536  wantSummary = cms.untracked.bool(True)
537  )
538 
539  if not skimEnabled:
540  print "Zmumu skim not enabled"
541 
542  print "# ######################################################################################"
543  print " Following parameters can be added before customize function "
544  print " call in order to controll process customization: "
545  print ""
546  print "process.doNotParse = cms.PSet() # disables CL parsing for crab compat"
547  print "process.doZmumuSkim = cms.PSet() # adds Zmumu skimming before embedding is run"
548  print "process.changeBSfromPS = cms.PSet() # overide bs"
549  print "# ######################################################################################"
550 
551  #print "Cleaning is off!"
552  '''
553  process.castorreco.cleaningAlgo = cms.string("CaloCleanerNone")
554  process.ecalPreshowerRecHit.cleaningAlgo = cms.string("CaloCleanerNone")
555  process.ecalRecHit.cleaningAlgo = cms.string("CaloCleanerNone")
556  process.hbhereco.cleaningAlgo = cms.string("CaloCleanerNone")
557  process.hfreco.cleaningAlgo = cms.string("CaloCleanerNone")
558  process.horeco.cleaningAlgo = cms.string("CaloCleanerNone")
559  '''
560 
561  '''
562  print "Cleaning set to all crossed!"
563  process.castorreco.cleaningAlgo = cms.string("CaloCleanerAllCrossed")
564  process.ecalPreshowerRecHit.cleaningAlgo = cms.string("CaloCleanerAllCrossed")
565  process.ecalRecHit.cleaningAlgo = cms.string("CaloCleanerAllCrossed")
566  process.hbhereco.cleaningAlgo = cms.string("CaloCleanerAllCrossed")
567  process.hfreco.cleaningAlgo = cms.string("CaloCleanerAllCrossed")
568  process.horeco.cleaningAlgo = cms.string("CaloCleanerAllCrossed")
569  # '''
570 
571  return(process)
return((rh^lh)&mask)
double split
Definition: MVATrainer.cc:139
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