CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
rh_customizeAll Namespace Reference

Functions

def customise
 

Function Documentation

def rh_customizeAll.customise (   process)

Definition at line 5 of file rh_customizeAll.py.

References list(), mathSSE.return(), and split.

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