CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
pf_01_customize_HLT.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 
3 from FWCore.ParameterSet.Modules import _Module
4 
5 
6 def customise(process):
7 
8 
9 
10  process._Process__name="HLT2"
11  process.TFileService = cms.Service("TFileService", fileName = cms.string("histo_simulation.root") )
12 
13  # Add the production filter sequence to all paths so that the empty event
14  # filter is actually applied and events with no HepMC product are skipped.
15  # Also add process.pgen for the generation_step which is not inserted by
16  # cmsDriver for some reason.
17  for path in process.paths:
18  if path != 'generation_step':
19  getattr(process,path)._seq = process.ProductionFilterSequence*getattr(process,path)._seq
20  else:
21  getattr(process,path)._seq = getattr(process,path)._seq*cms.Sequence(process.pgen)
22 
23  try:
24  outputModule = process.output
25  except:
26  pass
27  try:
28  outputModule = getattr(process,str(getattr(process,list(process.endpaths)[-1])))
29  except:
30  pass
31 
32  print "Changing eventcontent to RAW+AODSIM + misc. "
33  outputModule.outputCommands = cms.untracked.vstring("drop *")
34  outputModule.outputCommands.extend(process.RAWEventContent.outputCommands )
35  outputModule.outputCommands.extend(process.AODSIMEventContent.outputCommands )
36 
37  keepMC = cms.untracked.vstring("keep *_*_zMusExtracted_*",
38  "keep *_*_zmmCands_*",
39  "keep *_removedInputMuons_*_*",
40  "keep *_generator_*_*",
41  "keep *_PhotonIDProd_*_*",
42  "keep *_photons_*_*",
43  "keep *_photonCore_*_*",
44  "keep *_genParticles_*_*",
45  "keep *_particleFlow_*_*",
46  )
47  outputModule.outputCommands.extend(keepMC)
48 
49  # getRid of second "drop *"
50  index = 0
51  for item in outputModule.outputCommands[:]:
52  if item == "drop *" and index != 0:
53  #print index," ",outputModule.outputCommands[index]
54  del outputModule.outputCommands[index]
55  index -= 1
56  index += 1
57 
58 
59  hltProcessName = "HLT" #"REDIGI38X"
60  # the following block can be used for more efficient processing by replacing the HLT variable below automatically
61  try:
62  hltProcessName = __HLT__
63  except:
64  pass
65 
66  try:
67  process.dimuonsHLTFilter.TriggerResultsTag.processName = hltProcessName
68  process.goodZToMuMuAtLeast1HLT.TrigTag.processName = hltProcessName
69  process.goodZToMuMuAtLeast1HLT.triggerEvent.processName = hltProcessName
70  process.hltTrigReport,HLTriggerResults.processName = hltProcessName
71  except:
72  pass
73 
74  process.VtxSmeared = cms.EDProducer("FlatEvtVtxGenerator",
75  MaxZ = cms.double(0.0),
76  MaxX = cms.double(0.0),
77  MaxY = cms.double(0.0),
78  MinX = cms.double(0.0),
79  MinY = cms.double(0.0),
80  MinZ = cms.double(0.0),
81  TimeOffset = cms.double(0.0),
82  src = cms.InputTag("generator","unsmeared")
83  )
84 
85  import FWCore.ParameterSet.VarParsing as VarParsing
86  options = VarParsing.VarParsing ('analysis')
87  options.register ('mdtau',
88  0, # default value
89  VarParsing.VarParsing.multiplicity.singleton,
90  VarParsing.VarParsing.varType.int,
91  "mdtau value for tauola")
92 
93  options.register ('useJson',
94  0, # default value, false
95  VarParsing.VarParsing.multiplicity.singleton,
96  VarParsing.VarParsing.varType.int,
97  "should I enable json usage?")
98 
99  options.register ('overrideBeamSpot',
100  0, # default value, false
101  VarParsing.VarParsing.multiplicity.singleton,
102  VarParsing.VarParsing.varType.int,
103  "should I override beamspot in globaltag?")
104 
105  # Set this to REDIGI311X for Spring11 MC:
106  # (not actually used in this step but we define it so that both config files
107  # can be called with the same arguments):
108  options.register ('primaryProcess',
109  'RECO', # default value
110  VarParsing.VarParsing.multiplicity.singleton,
111  VarParsing.VarParsing.varType.string,
112  "original processName")
113 
114  # Workaround so that edmConfigHash does not fail with this config file.
115  # cf. https://hypernews.cern.ch/HyperNews/CMS/get/crabFeedback/3852/1/1/1/1/1.html
116  import sys
117  if hasattr(sys, "argv") == True:
118  options.parseArguments()
119 
120  print "Setting mdtau to ", options.mdtau
121  process.generator.ZTauTau.TauolaOptions.InputCards.mdtau = options.mdtau
122  process.newSource.ZTauTau.TauolaOptions.InputCards.mdtau = options.mdtau
123  process.generator.ParticleGun.ExternalDecays.Tauola.InputCards.mdtau = options.mdtau
124  process.newSource.ParticleGun.ExternalDecays.Tauola.InputCards.mdtau = options.mdtau
125 
126  print "options.overrideBeamSpot", options.overrideBeamSpot
127  if options.overrideBeamSpot != 0:
128  bs = cms.string("BeamSpotObjects_2009_LumiBased_SigmaZ_v18_offline") # 41x data PR gt
129  #bs = cms.string("BeamSpotObjects_2009_LumiBased_v17_offline") # 38x data gt
130  #bs = cms.string("BeamSpotObjects_2009_v14_offline") # 36x data gt
131  # tag = cms.string("Early10TeVCollision_3p8cm_31X_v1_mc_START"), # 35 default
132  # tag = cms.string("Realistic900GeVCollisions_10cm_STARTUP_v1_mc"), # 36 default
133  process.GlobalTag.toGet = cms.VPSet(
134  cms.PSet(record = cms.string("BeamSpotObjectsRcd"),
135  tag = bs,
136  connect = cms.untracked.string("frontier://FrontierProd/CMS_COND_31X_BEAMSPOT")
137  )
138  )
139  print "BeamSpot in globaltag set to ", bs
140  else:
141  print "BeamSpot in globaltag not changed"
142 
143  if options.useJson != 0:
144  print "Enabling json usage"
145  import PhysicsTools.PythonAnalysis.LumiList as LumiList
146  import FWCore.ParameterSet.Types as CfgTypes
147  myLumis = LumiList.LumiList(filename = 'my.json').getCMSSWString().split(',')
148  process.source.lumisToProcess = CfgTypes.untracked(CfgTypes.VLuminosityBlockRange())
149  process.source.lumisToProcess.extend(myLumis)
150 
151  try:
152  process.newSource.ZTauTau.minVisibleTransverseMomentum = cms.untracked.double(__MINVISPT__)
153  process.generator.ZTauTau.minVisibleTransverseMomentum = cms.untracked.double(__MINVISPT__)
154  except:
155  pass
156  try:
157  process.generator.ZTauTau.TauolaOptions.InputCards.mdtau = __MDTAU__
158  process.generator.ParticleGun.ExternalDecays.Tauola.InputCards.mdtau = __MDTAU__
159  process.newSource.ZTauTau.TauolaOptions.InputCards.mdtau = __MDTAU__
160  process.newSource.ParticleGun.ExternalDecays.Tauola.InputCards.mdtau = __MDTAU__
161  except:
162  pass
163 
164  try:
165  process.generator.ZTauTau.transformationMode = cms.untracked.int32(__TRANSFORMATIONMODE__)
166  process.generator.ZTauTau.transformationMode = cms.untracked.int32(__TRANSFORMATIONMODE__)
167  except:
168  pass
169 
170  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