CMS 3D CMS Logo

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

Functions

def customiseL1CaloAndGtEmulatorsFromRaw
 
def customiseL1EmulatorFromRaw
 
def customiseL1GtEmulatorFromRaw
 
def customiseL1Menu
 
def customiseL1Menu_HI
 
def customiseL1TriggerReport
 
def customiseOutputCommands
 
def customiseResetMasksAlgoTriggers
 
def customiseResetMasksTechTriggers
 
def customiseResetPrescalesAndMasks
 
def customiseResetVetoMasksAlgoTriggers
 
def customiseResetVetoMasksTechTriggers
 
def customiseUnprescaleAlgoTriggers
 
def customiseUnprescaleTechTriggers
 

Function Documentation

def L1Trigger_custom.customiseL1CaloAndGtEmulatorsFromRaw (   process)

Definition at line 272 of file L1Trigger_custom.py.

274  # customization fragment to run calorimeter emulators (TPGs and L1 calorimeter emulators)
275  # and GT emulator starting from a RAW file assuming that "RawToDigi_cff" and "SimL1Emulator_cff"
276  # have already been loaded
277 
278  # run Calo TPGs on unpacked digis
279  process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
280  process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
281  process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
282  cms.InputTag('hcalDigis'),
283  cms.InputTag('hcalDigis')
284  )
285 
286  # do not run muon emulators - instead, use unpacked GMT digis for GT input
287  # (GMT digis produced by same module as the GT digis, as GT and GMT have common unpacker)
288  process.simRpcTechTrigDigis.RPCDigiLabel = 'muonRPCDigis'
289  process.simGtDigis.GmtInputTag = 'gtDigis'
290 
291  # run Calo TPGs, L1 GCT, technical triggers, L1 GT
292  SimL1Emulator = cms.Sequence(
293  process.CaloTriggerPrimitives +
294  process.simRctDigis +
295  process.simGctDigis +
296  process.SimL1TechnicalTriggers +
297  process.simGtDigis )
298 
299  # replace the SimL1Emulator in all paths and sequences
300  for iterable in process.sequences.itervalues():
301  iterable.replace( process.SimL1Emulator, SimL1Emulator)
302  for iterable in process.paths.itervalues():
303  iterable.replace( process.SimL1Emulator, SimL1Emulator)
304  for iterable in process.endpaths.itervalues():
305  iterable.replace( process.SimL1Emulator, SimL1Emulator)
306  process.SimL1Emulator = SimL1Emulator
307 
308  return process
def customiseL1CaloAndGtEmulatorsFromRaw
def L1Trigger_custom.customiseL1EmulatorFromRaw (   process)

Definition at line 177 of file L1Trigger_custom.py.

Referenced by customise_l1EmulatorFromRaw.customise(), and customise_l1GtPatternGeneratorFromRaw.customise().

178 def customiseL1EmulatorFromRaw(process):
179  # customization fragment to run L1 emulator starting from a RAW file
180 
181  # run trigger primitive generation on unpacked digis
182  process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
183 
184  process.CaloTPG_SimL1Emulator = cms.Sequence(
185  process.CaloTriggerPrimitives +
186  process.SimL1Emulator )
187 
188  for path in process._Process__paths.itervalues():
189  path.replace(process.SimL1Emulator, process.CaloTPG_SimL1Emulator)
190 
191  # set the new input tags after RawToDigi
192  process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
193  process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
194  cms.InputTag('hcalDigis'),
195  cms.InputTag('hcalDigis')
196  )
197 
198  process.simDtTriggerPrimitiveDigis.digiTag = 'muonDTDigis'
199  process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCComparatorDigi' )
200  process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCWireDigi' )
201  process.simRpcTriggerDigis.label = 'muonRPCDigis'
202  process.simRpcTechTrigDigis.RPCDigiLabel = 'muonRPCDigis'
203 
204  return process
def L1Trigger_custom.customiseL1GtEmulatorFromRaw (   process)

Definition at line 207 of file L1Trigger_custom.py.

Referenced by customise_l1GtEmulatorFromRaw.customise().

208 def customiseL1GtEmulatorFromRaw(process):
209  # customization fragment to run L1 GT emulator starting from a RAW file, with input from unpacked GCT and GMT products
210  # assuming that "RawToDigi_cff" (or "RawToDigi_data_cff") and "SimL1Emulator_cff" have already been loaded
211 
212  # producers for technical triggers:
213  # they must be re-run as their output is not available from RAW2DIGI
214 
215  # BSC Technical Trigger
216  # Note: will normally not work, it requires SimHits (not available from RAW2DIGI)
217  # works only on some MC samples where the SimHits are saved together with the FEDRaw
218  import L1TriggerOffline.L1Analyzer.bscTrigger_cfi
219  process.simBscDigis = L1TriggerOffline.L1Analyzer.bscTrigger_cfi.bscTrigger.clone()
220 
221  # RPC Technical Trigger
222  import L1Trigger.RPCTechnicalTrigger.rpcTechnicalTrigger_cfi
223  process.simRpcTechTrigDigis = L1Trigger.RPCTechnicalTrigger.rpcTechnicalTrigger_cfi.rpcTechnicalTrigger.clone()
224 
225  process.simRpcTriggerDigis.label = 'muonRPCDigis'
226  process.simRpcTechTrigDigis.RPCDigiLabel = 'muonRPCDigis'
227 
228  # HCAL Technical Trigger
230  process.simHcalTechTrigDigis = SimCalorimetry.HcalTrigPrimProducers.hcalTTPRecord_cfi.simHcalTTPRecord.clone()
231 
232 
233  # Global Trigger emulator
234 
235  # do not run calo emulators - instead, use unpacked GCT digis for GT input
236  process.simGtDigis.GctInputTag = 'gctDigis'
237 
238  # do not run muon emulators - instead, use unpacked GMT digis for GT input
239  # (GMT digis produced by same module as the GT digis, as GT and GMT have common unpacker)
240  process.simGtDigis.GmtInputTag = 'gtDigis'
241 
242  # technical triggers
243  process.simGtDigis.TechnicalTriggersInputTags = cms.VInputTag(
244  cms.InputTag( 'simBscDigis' ),
245  cms.InputTag( 'simRpcTechTrigDigis' ),
246  cms.InputTag( 'simHcalTechTrigDigis' )
247  )
248 
249  process.SimL1TechnicalTriggers = cms.Sequence(
250  process.simBscDigis +
251  process.simRpcTechTrigDigis +
252  process.simHcalTechTrigDigis
253  )
254 
255  # run producers for technical triggers, L1 GT emulator only
256  SimL1Emulator = cms.Sequence(
257  process.SimL1TechnicalTriggers +
258  process.simGtDigis )
259 
260  # replace the SimL1Emulator in all paths and sequences
261  for iterable in process.sequences.itervalues():
262  iterable.replace( process.SimL1Emulator, SimL1Emulator)
263  for iterable in process.paths.itervalues():
264  iterable.replace( process.SimL1Emulator, SimL1Emulator)
265  for iterable in process.endpaths.itervalues():
266  iterable.replace( process.SimL1Emulator, SimL1Emulator)
267  process.SimL1Emulator = SimL1Emulator
268 
269  return process
def L1Trigger_custom.customiseL1Menu (   process)

Definition at line 84 of file L1Trigger_custom.py.

Referenced by customise_overwriteL1Menu.customise(), customise_l1TriggerConfiguration.customiseL1TriggerConfiguration(), and customsPostLS1.customiseSimL1EmulatorForPostLS1().

84 
85 def customiseL1Menu(process):
86 
87  # replace the L1 menu from the global tag with one of the following alternatives
88 
89  ####### user choices
90 
91  #l1MenuSource='globalTag'
92  #l1MenuSource='sqlFile'
93  l1MenuSource='xmlFile'
94 
95 
96  if l1MenuSource == 'sqlFile' :
97  # the menu will be read from the SQL file instead of the global tag
98  useSqlFile = '/afs/cern.ch/user/g/ghete/public/L1Menu/L1Menu_Collisions2015_25ns_v1/sqlFile/L1Menu_Collisions2015_25ns_v1_mc.db'
99  menuDbTag = 'L1GtTriggerMenu_L1Menu_Collisions2015_25ns_v1_mc'
100  elif l1MenuSource == 'xmlFile' :
101  # the menu will be read from an XML file instead of the global tag - must copy the file in luminosityDirectory
102  luminosityDirectory = "startup"
103  useXmlFile = 'L1Menu_Collisions2015_25ns_v1_L1T_Scales_20101224_Imp0_0x102f.xml'
104  else :
105  # use the default L1 trigger menu from the global tag
106  pass
107 
108  ####### end of user choices - do not change the following
109 
110  if l1MenuSource == 'xmlFile' :
111  process.load('L1TriggerConfig.L1GtConfigProducers.l1GtTriggerMenuXml_cfi')
112  process.l1GtTriggerMenuXml.TriggerMenuLuminosity = luminosityDirectory
113  process.l1GtTriggerMenuXml.DefXmlFile = useXmlFile
114 
115  process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMenuConfig_cff')
116  process.es_prefer_l1GtParameters = cms.ESPrefer('L1GtTriggerMenuXmlProducer','l1GtTriggerMenuXml')
117 
118  elif l1MenuSource == 'sqlFile' :
119  if useSqlFile != '' :
120  from CondCore.DBCommon.CondDBSetup_cfi import CondDBSetup
121  process.l1conddb = cms.ESSource("PoolDBESSource",
122  CondDBSetup,
123  connect = cms.string('sqlite_file:' + useSqlFile),
124  toGet = cms.VPSet(cms.PSet(
125  record = cms.string('L1GtTriggerMenuRcd'),
126  tag = cms.string(menuDbTag))),
127  BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService')
128  )
129  process.es_prefer_l1conddb = cms.ESPrefer("PoolDBESSource", "l1conddb")
130 
131  else :
132  print ' Error: no SQL file is given; please provide a valid SQL file for option sqlFile'
133 
134  return process
def L1Trigger_custom.customiseL1Menu_HI (   process)

Definition at line 137 of file L1Trigger_custom.py.

138 def customiseL1Menu_HI(process):
139 
140  # replace the L1 menu from the global tag with one of the following alternatives
141 
142  luminosityDirectory = "startup"
143  useXmlFile = 'L1Menu_CollisionsHeavyIons2011_v0_nobsc_notau_centrality_q2_singletrack.v1.xml'
144 
145  print ' Retrieve L1 trigger menu only from XML file '
146  print ' ', useXmlFile
147  print ' '
148 
149  process.load('L1TriggerConfig.L1GtConfigProducers.l1GtTriggerMenuXml_cfi')
150  process.l1GtTriggerMenuXml.TriggerMenuLuminosity = luminosityDirectory
151  process.l1GtTriggerMenuXml.DefXmlFile = useXmlFile
152 
153  process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMenuConfig_cff')
154  process.es_prefer_l1GtParameters = cms.ESPrefer('L1GtTriggerMenuXmlProducer','l1GtTriggerMenuXml')
155 
156  return process
def L1Trigger_custom.customiseL1TriggerReport (   process)

Definition at line 311 of file L1Trigger_custom.py.

Referenced by customise_l1EmulatorFromRaw.customise(), customise_l1GtEmulatorFromRaw.customise(), and customise_l1GtPatternGeneratorFromRaw.customise().

312 def customiseL1TriggerReport(process):
313 
314  process.load("L1Trigger.GlobalTriggerAnalyzer.l1GtTrigReport_cfi")
315 
316  # boolean flag to select the input record
317  # if true, it will use L1GlobalTriggerRecord
318  #process.l1GtTrigReport.UseL1GlobalTriggerRecord = True
319 
320  # input tag for GT record:
321  # GT emulator: gtDigis (DAQ record)
322  # GT unpacker: gtDigis (DAQ record)
323  # GT lite record: l1GtRecord
324  process.l1GtTrigReport.L1GtRecordInputTag = "gtDigis"
325 
326  process.l1GtTrigReport.PrintVerbosity = 10
327  process.l1GtTrigReport.PrintOutput = 0
328 
329 
330 
331  #
332  return (process)
def L1Trigger_custom.customiseOutputCommands (   process)

Definition at line 159 of file L1Trigger_custom.py.

Referenced by customise_l1EmulatorFromRaw.customise(), customise_l1GtEmulatorFromRaw.customise(), and customise_l1GtPatternGeneratorFromRaw.customise().

160 def customiseOutputCommands(process):
161 
162  # customization of output commands, on top of the output commands selected
163  # in cmsDriver command
164 
165  # examples
166 
167  # drop all products, keep only the products from L1EmulRaw process and the FEDRawDataCollection_
168  #process.output.outputCommands.append('drop *_*_*_*')
169  #process.output.outputCommands.append('keep *_*_*_L1EmulRaw')
170  #process.output.outputCommands.append('keep FEDRawDataCollection_*_*_*')
171 
172 
173  return process
174 
def L1Trigger_custom.customiseResetMasksAlgoTriggers (   process)

Definition at line 32 of file L1Trigger_custom.py.

Referenced by customise_l1TriggerConfiguration.customiseL1TriggerConfiguration(), and customiseResetPrescalesAndMasks().

32 
34 
35  process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskAlgoTrigConfig_cff")
36  process.es_prefer_l1GtTriggerMaskAlgoTrig = cms.ESPrefer(
37  "L1GtTriggerMaskAlgoTrigTrivialProducer", "l1GtTriggerMaskAlgoTrig")
38 
39  return (process)
def customiseResetMasksAlgoTriggers
def L1Trigger_custom.customiseResetMasksTechTriggers (   process)

Definition at line 42 of file L1Trigger_custom.py.

Referenced by customise_l1TriggerConfiguration.customiseL1TriggerConfiguration(), and customiseResetPrescalesAndMasks().

42 
44 
45  process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff")
46  process.es_prefer_l1GtTriggerMaskTechTrig = cms.ESPrefer(
47  "L1GtTriggerMaskTechTrigTrivialProducer", "l1GtTriggerMaskTechTrig")
48 
49  return (process)
def customiseResetMasksTechTriggers
def L1Trigger_custom.customiseResetPrescalesAndMasks (   process)

Definition at line 72 of file L1Trigger_custom.py.

References customiseResetMasksAlgoTriggers(), customiseResetMasksTechTriggers(), customiseResetVetoMasksAlgoTriggers(), customiseResetVetoMasksTechTriggers(), customiseUnprescaleAlgoTriggers(), and customiseUnprescaleTechTriggers().

72 
74  process = customiseUnprescaleAlgoTriggers( process )
75  process = customiseUnprescaleTechTriggers( process )
76  process = customiseResetMasksAlgoTriggers( process )
77  process = customiseResetMasksTechTriggers( process )
78  process = customiseResetVetoMasksAlgoTriggers( process )
79  process = customiseResetVetoMasksTechTriggers( process )
80 
81  return (process)
def customiseResetPrescalesAndMasks
def customiseResetMasksAlgoTriggers
def customiseUnprescaleTechTriggers
def customiseUnprescaleAlgoTriggers
def customiseResetVetoMasksAlgoTriggers
def customiseResetMasksTechTriggers
def customiseResetVetoMasksTechTriggers
def L1Trigger_custom.customiseResetVetoMasksAlgoTriggers (   process)

Definition at line 52 of file L1Trigger_custom.py.

Referenced by customise_l1TriggerConfiguration.customiseL1TriggerConfiguration(), and customiseResetPrescalesAndMasks().

52 
54 
55  process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskVetoAlgoTrigConfig_cff")
56  process.es_prefer_l1GtTriggerMaskVetoAlgoTrig = cms.ESPrefer(
57  "L1GtTriggerMaskVetoAlgoTrigTrivialProducer", "l1GtTriggerMaskVetoAlgoTrig")
58 
59  return (process)
def customiseResetVetoMasksAlgoTriggers
def L1Trigger_custom.customiseResetVetoMasksTechTriggers (   process)

Definition at line 62 of file L1Trigger_custom.py.

Referenced by customise_l1TriggerConfiguration.customiseL1TriggerConfiguration(), and customiseResetPrescalesAndMasks().

62 
64 
65  process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskVetoTechTrigConfig_cff")
66  process.es_prefer_l1GtTriggerMaskVetoTechTrig = cms.ESPrefer(
67  "L1GtTriggerMaskVetoTechTrigTrivialProducer", "l1GtTriggerMaskVetoTechTrig")
68 
69  return (process)
def customiseResetVetoMasksTechTriggers
def L1Trigger_custom.customiseUnprescaleAlgoTriggers (   process)

Definition at line 7 of file L1Trigger_custom.py.

Referenced by customise_l1TriggerConfiguration.customiseL1TriggerConfiguration(), and customiseResetPrescalesAndMasks().

7 
9 
10  # temporary solution FIXME
11 
12  process.load("L1TriggerConfig.L1GtConfigProducers.L1GtPrescaleFactorsAlgoTrigConfig_cff")
13  process.es_prefer_l1GtPrescaleFactorsAlgoTrig = cms.ESPrefer(
14  "L1GtPrescaleFactorsAlgoTrigTrivialProducer", "l1GtPrescaleFactorsAlgoTrig")
15 
16 
17  return (process)
def customiseUnprescaleAlgoTriggers
def L1Trigger_custom.customiseUnprescaleTechTriggers (   process)

Definition at line 20 of file L1Trigger_custom.py.

Referenced by customise_l1TriggerConfiguration.customiseL1TriggerConfiguration(), and customiseResetPrescalesAndMasks().

20 
22 
23  # temporary solution FIXME
24 
25  process.load("L1TriggerConfig.L1GtConfigProducers.L1GtPrescaleFactorsTechTrigConfig_cff")
26  process.es_prefer_l1GtPrescaleFactorsTechTrig = cms.ESPrefer(
27  "L1GtPrescaleFactorsTechTrigTrivialProducer", "l1GtPrescaleFactorsTechTrig")
28 
29  return (process)
def customiseUnprescaleTechTriggers