CMS 3D CMS Logo

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

Functions

def customise
 

Function Documentation

def pf_01_customize_HLT.customise (   process)

Definition at line 6 of file pf_01_customize_HLT.py.

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

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