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 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 264 of file L1Trigger_custom.py.

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

Definition at line 169 of file L1Trigger_custom.py.

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

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

Definition at line 199 of file L1Trigger_custom.py.

Referenced by customise_l1GtEmulatorFromRaw.customise().

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

Definition at line 84 of file L1Trigger_custom.py.

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

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_CollisionsHeavyIons2013_v0/sqlFile/L1Menu_CollisionsHeavyIons2013_v0_mc.db'
99  menuDbTag = 'L1GtTriggerMenu_L1Menu_CollisionsHeavyIons2013_v0_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_CollisionsHeavyIons2013_v0_L1T_Scales_20101224_Imp0_0x102c.xml'
104 
105  else :
106  print ' Using default L1 trigger menu from Global Tag '
107 
108  ####### end of user choices - do not change the following
109 
110  if l1MenuSource == 'xmlFile' :
111  print ' Retrieve L1 trigger menu only from XML file '
112  print ' ', useXmlFile
113  print ' '
114 
115  process.load('L1TriggerConfig.L1GtConfigProducers.l1GtTriggerMenuXml_cfi')
116  process.l1GtTriggerMenuXml.TriggerMenuLuminosity = luminosityDirectory
117  process.l1GtTriggerMenuXml.DefXmlFile = useXmlFile
118 
119  process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMenuConfig_cff')
120  process.es_prefer_l1GtParameters = cms.ESPrefer('L1GtTriggerMenuXmlProducer','l1GtTriggerMenuXml')
121 
122 
123 
124  elif l1MenuSource == 'sqlFile' :
125  if useSqlFile != '' :
126  print ' Retrieve L1 trigger menu only from SQLlite file '
127  print ' ', useSqlFile
128  print ' '
129 
130  from CondCore.DBCommon.CondDBSetup_cfi import CondDBSetup
131  process.l1conddb = cms.ESSource("PoolDBESSource",
132  CondDBSetup,
133  connect = cms.string('sqlite_file:' + useSqlFile),
134  toGet = cms.VPSet(cms.PSet(
135  record = cms.string('L1GtTriggerMenuRcd'),
136  tag = cms.string(menuDbTag))),
137  BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService')
138  )
139  process.es_prefer_l1conddb = cms.ESPrefer("PoolDBESSource", "l1conddb")
140 
141  else :
142  print ' Error: no SQL file is given; please provide a valid SQL file for option sqlFile'
143 
144  else :
145  print ''
146 
147 
148  return process
def L1Trigger_custom.customiseL1TriggerReport (   process)

Definition at line 303 of file L1Trigger_custom.py.

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

304 def customiseL1TriggerReport(process):
305 
306  process.load("L1Trigger.GlobalTriggerAnalyzer.l1GtTrigReport_cfi")
307 
308  # boolean flag to select the input record
309  # if true, it will use L1GlobalTriggerRecord
310  #process.l1GtTrigReport.UseL1GlobalTriggerRecord = True
311 
312  # input tag for GT record:
313  # GT emulator: gtDigis (DAQ record)
314  # GT unpacker: gtDigis (DAQ record)
315  # GT lite record: l1GtRecord
316  process.l1GtTrigReport.L1GtRecordInputTag = "gtDigis"
317 
318  process.l1GtTrigReport.PrintVerbosity = 10
319  process.l1GtTrigReport.PrintOutput = 0
320 
321 
322 
323  #
324  return (process)
def L1Trigger_custom.customiseOutputCommands (   process)

Definition at line 151 of file L1Trigger_custom.py.

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

152 def customiseOutputCommands(process):
153 
154  # customization of output commands, on top of the output commands selected
155  # in cmsDriver command
156 
157  # examples
158 
159  # drop all products, keep only the products from L1EmulRaw process and the FEDRawDataCollection_
160  #process.output.outputCommands.append('drop *_*_*_*')
161  #process.output.outputCommands.append('keep *_*_*_L1EmulRaw')
162  #process.output.outputCommands.append('keep FEDRawDataCollection_*_*_*')
163 
164 
165  return process
166 
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