Go to the documentation of this file.00001
00002
00003
00004
00005 import FWCore.ParameterSet.Config as cms
00006
00007 def customiseUnprescaleAlgoTriggers(process):
00008
00009
00010
00011 process.load("L1TriggerConfig.L1GtConfigProducers.L1GtPrescaleFactorsAlgoTrigConfig_cff")
00012 process.es_prefer_l1GtPrescaleFactorsAlgoTrig = cms.ESPrefer(
00013 "L1GtPrescaleFactorsAlgoTrigTrivialProducer", "l1GtPrescaleFactorsAlgoTrig")
00014
00015
00016 return (process)
00017
00018
00019
00020 def customiseUnprescaleTechTriggers(process):
00021
00022
00023
00024 process.load("L1TriggerConfig.L1GtConfigProducers.L1GtPrescaleFactorsTechTrigConfig_cff")
00025 process.es_prefer_l1GtPrescaleFactorsTechTrig = cms.ESPrefer(
00026 "L1GtPrescaleFactorsTechTrigTrivialProducer", "l1GtPrescaleFactorsTechTrig")
00027
00028 return (process)
00029
00030
00031
00032 def customiseResetMasksAlgoTriggers(process):
00033
00034 process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskAlgoTrigConfig_cff")
00035 process.es_prefer_l1GtTriggerMaskAlgoTrig = cms.ESPrefer(
00036 "L1GtTriggerMaskAlgoTrigTrivialProducer", "l1GtTriggerMaskAlgoTrig")
00037
00038 return (process)
00039
00040
00041
00042 def customiseResetMasksTechTriggers(process):
00043
00044 process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff")
00045 process.es_prefer_l1GtTriggerMaskTechTrig = cms.ESPrefer(
00046 "L1GtTriggerMaskTechTrigTrivialProducer", "l1GtTriggerMaskTechTrig")
00047
00048 return (process)
00049
00050
00051
00052 def customiseResetVetoMasksAlgoTriggers(process):
00053
00054 process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskVetoAlgoTrigConfig_cff")
00055 process.es_prefer_l1GtTriggerMaskVetoAlgoTrig = cms.ESPrefer(
00056 "L1GtTriggerMaskVetoAlgoTrigTrivialProducer", "l1GtTriggerMaskVetoAlgoTrig")
00057
00058 return (process)
00059
00060
00061
00062 def customiseResetVetoMasksTechTriggers(process):
00063
00064 process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskVetoTechTrigConfig_cff")
00065 process.es_prefer_l1GtTriggerMaskVetoTechTrig = cms.ESPrefer(
00066 "L1GtTriggerMaskVetoTechTrigTrivialProducer", "l1GtTriggerMaskVetoTechTrig")
00067
00068 return (process)
00069
00070
00071
00072 def customiseResetPrescalesAndMasks(process):
00073 process = customiseUnprescaleAlgoTriggers( process )
00074 process = customiseUnprescaleTechTriggers( process )
00075 process = customiseResetMasksAlgoTriggers( process )
00076 process = customiseResetMasksTechTriggers( process )
00077 process = customiseResetVetoMasksAlgoTriggers( process )
00078 process = customiseResetVetoMasksTechTriggers( process )
00079
00080 return (process)
00081
00082
00083
00084 def customiseL1Menu(process):
00085
00086
00087
00088
00089
00090
00091
00092 l1MenuSource='xmlFile'
00093
00094
00095 if l1MenuSource == 'sqlFile' :
00096
00097 useSqlFile = '/afs/cern.ch/user/g/ghete/public/L1Menu/L1Menu_CollisionsHeavyIons2013_v0/sqlFile/L1Menu_CollisionsHeavyIons2013_v0_mc.db'
00098 menuDbTag = 'L1GtTriggerMenu_L1Menu_CollisionsHeavyIons2013_v0_mc'
00099 elif l1MenuSource == 'xmlFile' :
00100
00101 luminosityDirectory = "startup"
00102 useXmlFile = 'L1Menu_CollisionsHeavyIons2013_v0_L1T_Scales_20101224_Imp0_0x102c.xml'
00103
00104 else :
00105 print ' Using default L1 trigger menu from Global Tag '
00106
00107
00108
00109 if l1MenuSource == 'xmlFile' :
00110 print ' Retrieve L1 trigger menu only from XML file '
00111 print ' ', useXmlFile
00112 print ' '
00113
00114 process.load('L1TriggerConfig.L1GtConfigProducers.l1GtTriggerMenuXml_cfi')
00115 process.l1GtTriggerMenuXml.TriggerMenuLuminosity = luminosityDirectory
00116 process.l1GtTriggerMenuXml.DefXmlFile = useXmlFile
00117
00118 process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMenuConfig_cff')
00119 process.es_prefer_l1GtParameters = cms.ESPrefer('L1GtTriggerMenuXmlProducer','l1GtTriggerMenuXml')
00120
00121
00122
00123 elif l1MenuSource == 'sqlFile' :
00124 if useSqlFile != '' :
00125 print ' Retrieve L1 trigger menu only from SQLlite file '
00126 print ' ', useSqlFile
00127 print ' '
00128
00129 from CondCore.DBCommon.CondDBSetup_cfi import CondDBSetup
00130 process.l1conddb = cms.ESSource("PoolDBESSource",
00131 CondDBSetup,
00132 connect = cms.string('sqlite_file:' + useSqlFile),
00133 toGet = cms.VPSet(cms.PSet(
00134 record = cms.string('L1GtTriggerMenuRcd'),
00135 tag = cms.string(menuDbTag))),
00136 BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService')
00137 )
00138 process.es_prefer_l1conddb = cms.ESPrefer("PoolDBESSource", "l1conddb")
00139
00140 else :
00141 print ' Error: no SQL file is given; please provide a valid SQL file for option sqlFile'
00142
00143 else :
00144 print ''
00145
00146
00147 return process
00148
00149
00150
00151 def customiseOutputCommands(process):
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164 return process
00165
00166
00167
00168
00169 def customiseL1EmulatorFromRaw(process):
00170
00171
00172
00173 process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
00174
00175 process.CaloTPG_SimL1Emulator = cms.Sequence(
00176 process.CaloTriggerPrimitives +
00177 process.SimL1Emulator )
00178
00179 for path in process._Process__paths.itervalues():
00180 path.replace(process.SimL1Emulator, process.CaloTPG_SimL1Emulator)
00181
00182
00183 process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
00184 process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
00185 cms.InputTag('hcalDigis'),
00186 cms.InputTag('hcalDigis')
00187 )
00188
00189 process.simDtTriggerPrimitiveDigis.digiTag = 'muonDTDigis'
00190 process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCComparatorDigi' )
00191 process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCWireDigi' )
00192 process.simRpcTriggerDigis.label = 'muonRPCDigis'
00193 process.simRpcTechTrigDigis.RPCDigiLabel = 'muonRPCDigis'
00194
00195 return process
00196
00197
00198
00199 def customiseL1GtEmulatorFromRaw(process):
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209 import L1TriggerOffline.L1Analyzer.bscTrigger_cfi
00210 process.simBscDigis = L1TriggerOffline.L1Analyzer.bscTrigger_cfi.bscTrigger.clone()
00211
00212
00213 import L1Trigger.RPCTechnicalTrigger.rpcTechnicalTrigger_cfi
00214 process.simRpcTechTrigDigis = L1Trigger.RPCTechnicalTrigger.rpcTechnicalTrigger_cfi.rpcTechnicalTrigger.clone()
00215
00216 process.simRpcTriggerDigis.label = 'muonRPCDigis'
00217 process.simRpcTechTrigDigis.RPCDigiLabel = 'muonRPCDigis'
00218
00219
00220 import SimCalorimetry.HcalTrigPrimProducers.hcalTTPRecord_cfi
00221 process.simHcalTechTrigDigis = SimCalorimetry.HcalTrigPrimProducers.hcalTTPRecord_cfi.simHcalTTPRecord.clone()
00222
00223
00224
00225
00226
00227 process.simGtDigis.GctInputTag = 'gctDigis'
00228
00229
00230
00231 process.simGtDigis.GmtInputTag = 'gtDigis'
00232
00233
00234 process.simGtDigis.TechnicalTriggersInputTags = cms.VInputTag(
00235 cms.InputTag( 'simBscDigis' ),
00236 cms.InputTag( 'simRpcTechTrigDigis' ),
00237 cms.InputTag( 'simHcalTechTrigDigis' )
00238 )
00239
00240 process.SimL1TechnicalTriggers = cms.Sequence(
00241 process.simBscDigis +
00242 process.simRpcTechTrigDigis +
00243 process.simHcalTechTrigDigis
00244 )
00245
00246
00247 SimL1Emulator = cms.Sequence(
00248 process.SimL1TechnicalTriggers +
00249 process.simGtDigis )
00250
00251
00252 for iterable in process.sequences.itervalues():
00253 iterable.replace( process.SimL1Emulator, SimL1Emulator)
00254 for iterable in process.paths.itervalues():
00255 iterable.replace( process.SimL1Emulator, SimL1Emulator)
00256 for iterable in process.endpaths.itervalues():
00257 iterable.replace( process.SimL1Emulator, SimL1Emulator)
00258 process.SimL1Emulator = SimL1Emulator
00259
00260 return process
00261
00262
00263
00264 def customiseL1CaloAndGtEmulatorsFromRaw(process):
00265
00266
00267
00268
00269
00270 process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
00271 process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
00272 process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
00273 cms.InputTag('hcalDigis'),
00274 cms.InputTag('hcalDigis')
00275 )
00276
00277
00278
00279 process.simRpcTechTrigDigis.RPCDigiLabel = 'muonRPCDigis'
00280 process.simGtDigis.GmtInputTag = 'gtDigis'
00281
00282
00283 SimL1Emulator = cms.Sequence(
00284 process.CaloTriggerPrimitives +
00285 process.simRctDigis +
00286 process.simGctDigis +
00287 process.SimL1TechnicalTriggers +
00288 process.simGtDigis )
00289
00290
00291 for iterable in process.sequences.itervalues():
00292 iterable.replace( process.SimL1Emulator, SimL1Emulator)
00293 for iterable in process.paths.itervalues():
00294 iterable.replace( process.SimL1Emulator, SimL1Emulator)
00295 for iterable in process.endpaths.itervalues():
00296 iterable.replace( process.SimL1Emulator, SimL1Emulator)
00297 process.SimL1Emulator = SimL1Emulator
00298
00299 return process
00300
00301
00302
00303 def customiseL1TriggerReport(process):
00304
00305 process.load("L1Trigger.GlobalTriggerAnalyzer.l1GtTrigReport_cfi")
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315 process.l1GtTrigReport.L1GtRecordInputTag = "gtDigis"
00316
00317 process.l1GtTrigReport.PrintVerbosity = 10
00318 process.l1GtTrigReport.PrintOutput = 0
00319
00320
00321
00322
00323 return (process)
00324
00325