File indexing completed on 2024-11-27 03:17:53
0001
0002
0003
0004
0005 import FWCore.ParameterSet.Config as cms
0006
0007 def customiseUnprescaleAlgoTriggers(process):
0008
0009
0010
0011 process.load("L1TriggerConfig.L1GtConfigProducers.L1GtPrescaleFactorsAlgoTrigConfig_cff")
0012 process.es_prefer_l1GtPrescaleFactorsAlgoTrig = cms.ESPrefer(
0013 "L1GtPrescaleFactorsAlgoTrigTrivialProducer", "l1GtPrescaleFactorsAlgoTrig")
0014
0015
0016 return (process)
0017
0018
0019
0020 def customiseUnprescaleTechTriggers(process):
0021
0022
0023
0024 process.load("L1TriggerConfig.L1GtConfigProducers.L1GtPrescaleFactorsTechTrigConfig_cff")
0025 process.es_prefer_l1GtPrescaleFactorsTechTrig = cms.ESPrefer(
0026 "L1GtPrescaleFactorsTechTrigTrivialProducer", "l1GtPrescaleFactorsTechTrig")
0027
0028 return (process)
0029
0030
0031
0032 def customiseResetMasksAlgoTriggers(process):
0033
0034 process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskAlgoTrigConfig_cff")
0035 process.es_prefer_l1GtTriggerMaskAlgoTrig = cms.ESPrefer(
0036 "L1GtTriggerMaskAlgoTrigTrivialProducer", "l1GtTriggerMaskAlgoTrig")
0037
0038 return (process)
0039
0040
0041
0042 def customiseResetMasksTechTriggers(process):
0043
0044 process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff")
0045 process.es_prefer_l1GtTriggerMaskTechTrig = cms.ESPrefer(
0046 "L1GtTriggerMaskTechTrigTrivialProducer", "l1GtTriggerMaskTechTrig")
0047
0048 return (process)
0049
0050
0051
0052 def customiseResetVetoMasksAlgoTriggers(process):
0053
0054 process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskVetoAlgoTrigConfig_cff")
0055 process.es_prefer_l1GtTriggerMaskVetoAlgoTrig = cms.ESPrefer(
0056 "L1GtTriggerMaskVetoAlgoTrigTrivialProducer", "l1GtTriggerMaskVetoAlgoTrig")
0057
0058 return (process)
0059
0060
0061
0062 def customiseResetVetoMasksTechTriggers(process):
0063
0064 process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskVetoTechTrigConfig_cff")
0065 process.es_prefer_l1GtTriggerMaskVetoTechTrig = cms.ESPrefer(
0066 "L1GtTriggerMaskVetoTechTrigTrivialProducer", "l1GtTriggerMaskVetoTechTrig")
0067
0068 return (process)
0069
0070
0071
0072 def customiseResetPrescalesAndMasks(process):
0073 process = customiseUnprescaleAlgoTriggers( process )
0074 process = customiseUnprescaleTechTriggers( process )
0075 process = customiseResetMasksAlgoTriggers( process )
0076 process = customiseResetMasksTechTriggers( process )
0077 process = customiseResetVetoMasksAlgoTriggers( process )
0078 process = customiseResetVetoMasksTechTriggers( process )
0079
0080 return (process)
0081
0082
0083
0084 def customiseL1Menu(process):
0085
0086
0087
0088
0089
0090
0091
0092 l1MenuSource='xmlFile'
0093
0094
0095 if l1MenuSource == 'sqlFile' :
0096
0097 useSqlFile = '/afs/cern.ch/user/g/ghete/public/L1Menu/L1Menu_Collisions2015_25ns_v2/sqlFile/L1Menu_Collisions2015_25ns_v2_mc.db'
0098 menuDbTag = 'L1GtTriggerMenu_L1Menu_Collisions2015_25ns_v2_mc'
0099 elif l1MenuSource == 'xmlFile' :
0100
0101 luminosityDirectory = "startup"
0102 useXmlFile = 'L1Menu_Collisions2015_25ns_v2_L1T_Scales_20141121_Imp0_0x1030.xml'
0103 else :
0104
0105 pass
0106
0107
0108
0109 if l1MenuSource == 'xmlFile' :
0110 process.load('L1TriggerConfig.L1GtConfigProducers.l1GtTriggerMenuXml_cfi')
0111 process.l1GtTriggerMenuXml.TriggerMenuLuminosity = luminosityDirectory
0112 process.l1GtTriggerMenuXml.DefXmlFile = useXmlFile
0113
0114 process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMenuConfig_cff')
0115 process.es_prefer_l1GtParameters = cms.ESPrefer('L1GtTriggerMenuXmlProducer','l1GtTriggerMenuXml')
0116
0117 elif l1MenuSource == 'sqlFile' :
0118 if useSqlFile != '' :
0119 from CondCore.DBCommon.CondDBSetup_cfi import CondDBSetup
0120 process.l1conddb = cms.ESSource("PoolDBESSource",
0121 CondDBSetup,
0122 connect = cms.string('sqlite_file:' + useSqlFile),
0123 toGet = cms.VPSet(cms.PSet(
0124 record = cms.string('L1GtTriggerMenuRcd'),
0125 tag = cms.string(menuDbTag))),
0126 BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService')
0127 )
0128 process.es_prefer_l1conddb = cms.ESPrefer("PoolDBESSource", "l1conddb")
0129
0130 else :
0131 print(' Error: no SQL file is given; please provide a valid SQL file for option sqlFile')
0132
0133 return process
0134
0135
0136
0137 def customiseOutputCommands(process):
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150 return process
0151
0152
0153
0154
0155 def customiseL1EmulatorFromRaw(process):
0156
0157
0158
0159 process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
0160
0161 process.CaloTPG_SimL1Emulator = cms.Sequence(
0162 process.CaloTriggerPrimitives +
0163 process.SimL1Emulator )
0164
0165 for path in process._Process__paths.values():
0166 path.replace(process.SimL1Emulator, process.CaloTPG_SimL1Emulator)
0167
0168
0169 process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
0170 process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
0171 cms.InputTag('hcalDigis'),
0172 cms.InputTag('hcalDigis')
0173 )
0174
0175 process.simDtTriggerPrimitiveDigis.digiTag = 'muonDTDigis'
0176 process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCComparatorDigi' )
0177 process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCWireDigi' )
0178 process.simRpcTriggerDigis.label = 'muonRPCDigis'
0179 process.simRpcTechTrigDigis.RPCDigiLabel = 'muonRPCDigis'
0180
0181 return process
0182
0183
0184
0185 def customiseL1GtEmulatorFromRaw(process):
0186
0187
0188
0189
0190
0191
0192
0193
0194
0195 import L1TriggerOffline.L1Analyzer.bscTrigger_cfi
0196 process.simBscDigis = L1TriggerOffline.L1Analyzer.bscTrigger_cfi.bscTrigger.clone()
0197
0198
0199 import L1Trigger.RPCTechnicalTrigger.rpcTechnicalTrigger_cfi
0200 process.simRpcTechTrigDigis = L1Trigger.RPCTechnicalTrigger.rpcTechnicalTrigger_cfi.rpcTechnicalTrigger.clone()
0201
0202 process.simRpcTriggerDigis.label = 'muonRPCDigis'
0203 process.simRpcTechTrigDigis.RPCDigiLabel = 'muonRPCDigis'
0204
0205
0206 import SimCalorimetry.HcalTrigPrimProducers.hcalTTPRecord_cfi
0207 process.simHcalTechTrigDigis = SimCalorimetry.HcalTrigPrimProducers.hcalTTPRecord_cfi.simHcalTTPRecord.clone()
0208
0209
0210
0211
0212
0213 process.simGtDigis.GctInputTag = 'gctDigis'
0214
0215
0216
0217 process.simGtDigis.GmtInputTag = 'gtDigis'
0218
0219
0220 process.simGtDigis.TechnicalTriggersInputTags = cms.VInputTag(
0221 cms.InputTag( 'simBscDigis' ),
0222 cms.InputTag( 'simRpcTechTrigDigis' ),
0223 cms.InputTag( 'simHcalTechTrigDigis' )
0224 )
0225
0226 process.SimL1TechnicalTriggers = cms.Sequence(
0227 process.simBscDigis +
0228 process.simRpcTechTrigDigis +
0229 process.simHcalTechTrigDigis
0230 )
0231
0232
0233 SimL1Emulator = cms.Sequence(
0234 process.SimL1TechnicalTriggers +
0235 process.simGtDigis )
0236
0237
0238 for iterable in process.sequences.values():
0239 iterable.replace( process.SimL1Emulator, SimL1Emulator)
0240 for iterable in process.paths.values():
0241 iterable.replace( process.SimL1Emulator, SimL1Emulator)
0242 for iterable in process.endpaths.values():
0243 iterable.replace( process.SimL1Emulator, SimL1Emulator)
0244 process.SimL1Emulator = SimL1Emulator
0245
0246 return process
0247
0248
0249
0250 def customiseL1CaloAndGtEmulatorsFromRaw(process):
0251
0252
0253
0254
0255
0256 process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
0257 process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
0258 process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
0259 cms.InputTag('hcalDigis'),
0260 cms.InputTag('hcalDigis')
0261 )
0262
0263
0264
0265 process.simRpcTechTrigDigis.RPCDigiLabel = 'muonRPCDigis'
0266 process.simGtDigis.GmtInputTag = 'gtDigis'
0267
0268
0269 SimL1Emulator = cms.Sequence(
0270 process.CaloTriggerPrimitives +
0271 process.simRctDigis +
0272 process.simGctDigis +
0273 process.SimL1TechnicalTriggers +
0274 process.simGtDigis )
0275
0276
0277 for iterable in process.sequences.values():
0278 iterable.replace( process.SimL1Emulator, SimL1Emulator)
0279 for iterable in process.paths.values():
0280 iterable.replace( process.SimL1Emulator, SimL1Emulator)
0281 for iterable in process.endpaths.values():
0282 iterable.replace( process.SimL1Emulator, SimL1Emulator)
0283 process.SimL1Emulator = SimL1Emulator
0284
0285 return process
0286
0287
0288
0289 def customiseL1TriggerReport(process):
0290
0291 process.load("L1Trigger.GlobalTriggerAnalyzer.l1GtTrigReport_cfi")
0292
0293
0294
0295
0296
0297
0298
0299
0300
0301 process.l1GtTrigReport.L1GtRecordInputTag = "gtDigis"
0302
0303 process.l1GtTrigReport.PrintVerbosity = 10
0304 process.l1GtTrigReport.PrintOutput = 0
0305
0306
0307
0308
0309 return (process)
0310
0311