CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 251 of file L1Trigger_custom.py.

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

Definition at line 156 of file L1Trigger_custom.py.

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

157 def customiseL1EmulatorFromRaw(process):
158  # customization fragment to run L1 emulator starting from a RAW file
159 
160  # run trigger primitive generation on unpacked digis
161  process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
162 
163  process.CaloTPG_SimL1Emulator = cms.Sequence(
164  process.CaloTriggerPrimitives +
165  process.SimL1Emulator )
166 
167  for path in process._Process__paths.values():
168  path.replace(process.SimL1Emulator, process.CaloTPG_SimL1Emulator)
169 
170  # set the new input tags after RawToDigi
171  process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
172  process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
173  cms.InputTag('hcalDigis'),
174  cms.InputTag('hcalDigis')
175  )
176 
177  process.simDtTriggerPrimitiveDigis.digiTag = 'muonDTDigis'
178  process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCComparatorDigi' )
179  process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCWireDigi' )
180  process.simRpcTriggerDigis.label = 'muonRPCDigis'
181  process.simRpcTechTrigDigis.RPCDigiLabel = 'muonRPCDigis'
182 
183  return process
def L1Trigger_custom.customiseL1GtEmulatorFromRaw (   process)

Definition at line 186 of file L1Trigger_custom.py.

Referenced by customise_l1GtEmulatorFromRaw.customise().

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

Definition at line 85 of file L1Trigger_custom.py.

References print().

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

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

Definition at line 290 of file L1Trigger_custom.py.

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

291 def customiseL1TriggerReport(process):
292 
293  process.load("L1Trigger.GlobalTriggerAnalyzer.l1GtTrigReport_cfi")
294 
295  # boolean flag to select the input record
296  # if true, it will use L1GlobalTriggerRecord
297  #process.l1GtTrigReport.UseL1GlobalTriggerRecord = True
298 
299  # input tag for GT record:
300  # GT emulator: gtDigis (DAQ record)
301  # GT unpacker: gtDigis (DAQ record)
302  # GT lite record: l1GtRecord
303  process.l1GtTrigReport.L1GtRecordInputTag = "gtDigis"
304 
305  process.l1GtTrigReport.PrintVerbosity = 10
306  process.l1GtTrigReport.PrintOutput = 0
307 
308 
309 
310  #
311  return (process)
def L1Trigger_custom.customiseOutputCommands (   process)

Definition at line 138 of file L1Trigger_custom.py.

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

139 def customiseOutputCommands(process):
140 
141  # customization of output commands, on top of the output commands selected
142  # in cmsDriver command
143 
144  # examples
145 
146  # drop all products, keep only the products from L1EmulRaw process and the FEDRawDataCollection_
147  #process.output.outputCommands.append('drop *_*_*_*')
148  #process.output.outputCommands.append('keep *_*_*_L1EmulRaw')
149  #process.output.outputCommands.append('keep FEDRawDataCollection_*_*_*')
150 
151 
152  return process
153 
def L1Trigger_custom.customiseResetMasksAlgoTriggers (   process)

Definition at line 33 of file L1Trigger_custom.py.

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

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

Definition at line 43 of file L1Trigger_custom.py.

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

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

Definition at line 73 of file L1Trigger_custom.py.

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

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

Definition at line 53 of file L1Trigger_custom.py.

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

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

Definition at line 63 of file L1Trigger_custom.py.

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

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

Definition at line 8 of file L1Trigger_custom.py.

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

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

Definition at line 21 of file L1Trigger_custom.py.

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

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