CMS 3D CMS Logo

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.

00265                                                  :
00266     # customization fragment to run calorimeter emulators (TPGs and L1 calorimeter emulators) 
00267     # and GT emulator starting from a RAW file assuming that "RawToDigi_cff" and "SimL1Emulator_cff" 
00268     # have already been loaded
00269 
00270     # run Calo TPGs on unpacked digis
00271     process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
00272     process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
00273     process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
00274         cms.InputTag('hcalDigis'), 
00275         cms.InputTag('hcalDigis')
00276     )
00277     
00278     # do not run muon emulators - instead, use unpacked GMT digis for GT input 
00279     # (GMT digis produced by same module as the GT digis, as GT and GMT have common unpacker)
00280     process.simRpcTechTrigDigis.RPCDigiLabel = 'muonRPCDigis'                                                                                                                                                                                           
00281     process.simGtDigis.GmtInputTag = 'gtDigis'                                                                                                                                                                                                          
00282 
00283     # run Calo TPGs, L1 GCT, technical triggers, L1 GT
00284     SimL1Emulator = cms.Sequence(
00285         process.CaloTriggerPrimitives +
00286         process.simRctDigis +
00287         process.simGctDigis +
00288         process.SimL1TechnicalTriggers +
00289         process.simGtDigis )
00290 
00291     # replace the SimL1Emulator in all paths and sequences
00292     for iterable in process.sequences.itervalues():
00293         iterable.replace( process.SimL1Emulator, SimL1Emulator)
00294     for iterable in process.paths.itervalues():
00295         iterable.replace( process.SimL1Emulator, SimL1Emulator)
00296     for iterable in process.endpaths.itervalues():
00297         iterable.replace( process.SimL1Emulator, SimL1Emulator)
00298     process.SimL1Emulator = SimL1Emulator
00299 
00300     return process

def L1Trigger_custom::customiseL1EmulatorFromRaw (   process)

Definition at line 169 of file L1Trigger_custom.py.

00170                                        :
00171     # customization fragment to run L1 emulator starting from a RAW file
00172 
00173     # run trigger primitive generation on unpacked digis
00174     process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
00175 
00176     process.CaloTPG_SimL1Emulator = cms.Sequence(
00177         process.CaloTriggerPrimitives + 
00178         process.SimL1Emulator )
00179 
00180     for path in process._Process__paths.itervalues():
00181         path.replace(process.SimL1Emulator, process.CaloTPG_SimL1Emulator)
00182 
00183     # set the new input tags after RawToDigi
00184     process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
00185     process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
00186         cms.InputTag('hcalDigis'),
00187         cms.InputTag('hcalDigis')
00188     )
00189 
00190     process.simDtTriggerPrimitiveDigis.digiTag = 'muonDTDigis'
00191     process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCComparatorDigi' )
00192     process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer       = cms.InputTag( 'muonCSCDigis', 'MuonCSCWireDigi' )
00193     process.simRpcTriggerDigis.label         = 'muonRPCDigis'
00194     process.simRpcTechTrigDigis.RPCDigiLabel = 'muonRPCDigis'
00195 
00196     return process

def L1Trigger_custom::customiseL1GtEmulatorFromRaw (   process)

Definition at line 199 of file L1Trigger_custom.py.

00200                                          :
00201     # customization fragment to run L1 GT emulator starting from a RAW file, with input from unpacked GCT and GMT products
00202     # assuming that "RawToDigi_cff" (or "RawToDigi_data_cff") and "SimL1Emulator_cff" have already been loaded
00203 
00204     # producers for technical triggers:
00205     # they must be re-run as their output is not available from RAW2DIGI
00206 
00207     # BSC Technical Trigger
00208     # Note: will normally not work, it requires SimHits (not available from RAW2DIGI)
00209     # works only on some MC samples where the SimHits are saved together with the FEDRaw
00210     import L1TriggerOffline.L1Analyzer.bscTrigger_cfi
00211     process.simBscDigis = L1TriggerOffline.L1Analyzer.bscTrigger_cfi.bscTrigger.clone()
00212 
00213     # RPC Technical Trigger
00214     import L1Trigger.RPCTechnicalTrigger.rpcTechnicalTrigger_cfi
00215     process.simRpcTechTrigDigis = L1Trigger.RPCTechnicalTrigger.rpcTechnicalTrigger_cfi.rpcTechnicalTrigger.clone()
00216     
00217     process.simRpcTriggerDigis.label = 'muonRPCDigis'
00218     process.simRpcTechTrigDigis.RPCDigiLabel = 'muonRPCDigis'
00219 
00220     # HCAL Technical Trigger
00221     import SimCalorimetry.HcalTrigPrimProducers.hcalTTPRecord_cfi
00222     process.simHcalTechTrigDigis = SimCalorimetry.HcalTrigPrimProducers.hcalTTPRecord_cfi.simHcalTTPRecord.clone()
00223      
00224 
00225     # Global Trigger emulator
00226     
00227     # do not run calo emulators - instead, use unpacked GCT digis for GT input
00228     process.simGtDigis.GctInputTag = 'gctDigis'
00229     
00230     # do not run muon emulators - instead, use unpacked GMT digis for GT input 
00231     # (GMT digis produced by same module as the GT digis, as GT and GMT have common unpacker)
00232     process.simGtDigis.GmtInputTag = 'gtDigis'                                                                                                                                                               
00233     
00234     # technical triggers
00235     process.simGtDigis.TechnicalTriggersInputTags = cms.VInputTag(
00236         cms.InputTag( 'simBscDigis' ), 
00237         cms.InputTag( 'simRpcTechTrigDigis' ),
00238         cms.InputTag( 'simHcalTechTrigDigis' )
00239         )
00240 
00241     process.SimL1TechnicalTriggers = cms.Sequence(
00242         process.simBscDigis +
00243         process.simRpcTechTrigDigis +
00244         process.simHcalTechTrigDigis
00245         )
00246 
00247     # run producers for technical triggers, L1 GT emulator only
00248     SimL1Emulator = cms.Sequence(
00249         process.SimL1TechnicalTriggers +
00250         process.simGtDigis )
00251 
00252     # replace the SimL1Emulator in all paths and sequences
00253     for iterable in process.sequences.itervalues():
00254         iterable.replace( process.SimL1Emulator, SimL1Emulator)
00255     for iterable in process.paths.itervalues():
00256         iterable.replace( process.SimL1Emulator, SimL1Emulator)
00257     for iterable in process.endpaths.itervalues():
00258         iterable.replace( process.SimL1Emulator, SimL1Emulator)
00259     process.SimL1Emulator = SimL1Emulator
00260 
00261     return process

def L1Trigger_custom::customiseL1Menu (   process)

Definition at line 84 of file L1Trigger_custom.py.

00085                             :
00086 
00087     # replace the L1 menu from the global tag with one of the following alternatives
00088 
00089     ####### user choices
00090 
00091     #l1MenuSource='globalTag'
00092     #l1MenuSource='sqlFile'
00093     l1MenuSource='xmlFile'
00094 
00095 
00096     if l1MenuSource == 'sqlFile' :
00097         # the menu will be read from the SQL file instead of the global tag
00098         useSqlFile = '/afs/cern.ch/user/g/ghete/public/L1Menu/L1Menu_Collisions2012_v2/sqlFile/L1Menu_Collisions2012_v2_mc.db'
00099         menuDbTag = 'L1GtTriggerMenu_L1Menu_Collisions2012_v2_mc'
00100     elif l1MenuSource == 'xmlFile' :
00101         # the menu will be read from an XML file instead of the global tag - must copy the file in luminosityDirectory
00102         luminosityDirectory = "startup"
00103         useXmlFile = 'L1Menu_Collisions2012_v2_L1T_Scales_20101224_Imp0_0x102a.xml'
00104 
00105     else :
00106         print '   Using default L1 trigger menu from Global Tag '
00107 
00108     ####### end of user choices - do not change the
00109 
00110     if l1MenuSource == 'xmlFile' :
00111         print '   Retrieve L1 trigger menu only from XML file '
00112         print '       ', useXmlFile
00113         print '       '
00114 
00115         process.load('L1TriggerConfig.L1GtConfigProducers.l1GtTriggerMenuXml_cfi')
00116         process.l1GtTriggerMenuXml.TriggerMenuLuminosity = luminosityDirectory
00117         process.l1GtTriggerMenuXml.DefXmlFile = useXmlFile
00118 
00119         process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMenuConfig_cff')
00120         process.es_prefer_l1GtParameters = cms.ESPrefer('L1GtTriggerMenuXmlProducer','l1GtTriggerMenuXml')
00121 
00122 
00123 
00124     elif l1MenuSource == 'sqlFile' :
00125         if useSqlFile != '' :
00126             print '   Retrieve L1 trigger menu only from SQLlite file '
00127             print '       ', useSqlFile
00128             print '       '
00129 
00130             from CondCore.DBCommon.CondDBSetup_cfi import CondDBSetup
00131             process.l1conddb = cms.ESSource("PoolDBESSource",
00132                                     CondDBSetup,
00133                                     connect = cms.string('sqlite_file:' + useSqlFile),
00134                                     toGet = cms.VPSet(cms.PSet(
00135                                                 record = cms.string('L1GtTriggerMenuRcd'),
00136                                                 tag = cms.string(menuDbTag))),
00137                                                 BlobStreamerName = cms.untracked.string('TBufferBlobStreamingService')
00138                                             )
00139             process.es_prefer_l1conddb = cms.ESPrefer("PoolDBESSource", "l1conddb")
00140 
00141         else :
00142             print '   Error: no SQL file is given; please provide a valid SQL file for option sqlFile'
00143 
00144     else :
00145         print ''
00146 
00147 
00148     return process

def L1Trigger_custom::customiseL1TriggerReport (   process)

Definition at line 303 of file L1Trigger_custom.py.

00304                                      :
00305 
00306     process.load("L1Trigger.GlobalTriggerAnalyzer.l1GtTrigReport_cfi")
00307 
00308     # boolean flag to select the input record
00309     # if true, it will use L1GlobalTriggerRecord
00310     #process.l1GtTrigReport.UseL1GlobalTriggerRecord = True
00311 
00312     # input tag for GT record:
00313     #   GT emulator:    gtDigis (DAQ record)
00314     #   GT unpacker:    gtDigis (DAQ record)
00315     #   GT lite record: l1GtRecord
00316     process.l1GtTrigReport.L1GtRecordInputTag = "gtDigis"
00317 
00318     process.l1GtTrigReport.PrintVerbosity = 10
00319     process.l1GtTrigReport.PrintOutput = 0
00320 
00321 
00322 
00323     #
00324     return (process)

def L1Trigger_custom::customiseOutputCommands (   process)

Definition at line 151 of file L1Trigger_custom.py.

00152                                     :
00153 
00154     # customization of output commands, on top of the output commands selected
00155     # in cmsDriver command
00156 
00157     # examples
00158 
00159     # drop all products, keep only the products from L1EmulRaw process and the FEDRawDataCollection_
00160     #process.output.outputCommands.append('drop *_*_*_*')
00161     #process.output.outputCommands.append('keep *_*_*_L1EmulRaw')
00162     #process.output.outputCommands.append('keep FEDRawDataCollection_*_*_*')
00163 
00164 
00165     return process
00166 

def L1Trigger_custom::customiseResetMasksAlgoTriggers (   process)

Definition at line 32 of file L1Trigger_custom.py.

00033                                             :
00034 
00035     process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskAlgoTrigConfig_cff")
00036     process.es_prefer_l1GtTriggerMaskAlgoTrig = cms.ESPrefer(
00037         "L1GtTriggerMaskAlgoTrigTrivialProducer", "l1GtTriggerMaskAlgoTrig")
00038 
00039     return (process)

def L1Trigger_custom::customiseResetMasksTechTriggers (   process)

Definition at line 42 of file L1Trigger_custom.py.

00043                                             :
00044 
00045     process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskTechTrigConfig_cff")
00046     process.es_prefer_l1GtTriggerMaskTechTrig = cms.ESPrefer(
00047         "L1GtTriggerMaskTechTrigTrivialProducer", "l1GtTriggerMaskTechTrig")
00048 
00049     return (process)

def L1Trigger_custom::customiseResetPrescalesAndMasks (   process)

Definition at line 72 of file L1Trigger_custom.py.

00073                                             :
00074     process = customiseUnprescaleAlgoTriggers( process )
00075     process = customiseUnprescaleTechTriggers( process )
00076     process = customiseResetMasksAlgoTriggers( process )
00077     process = customiseResetMasksTechTriggers( process )
00078     process = customiseResetVetoMasksAlgoTriggers( process )
00079     process = customiseResetVetoMasksTechTriggers( process )
00080 
00081     return (process)

def L1Trigger_custom::customiseResetVetoMasksAlgoTriggers (   process)

Definition at line 52 of file L1Trigger_custom.py.

00053                                                 :
00054 
00055     process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskVetoAlgoTrigConfig_cff")
00056     process.es_prefer_l1GtTriggerMaskVetoAlgoTrig = cms.ESPrefer(
00057         "L1GtTriggerMaskVetoAlgoTrigTrivialProducer", "l1GtTriggerMaskVetoAlgoTrig")
00058 
00059     return (process)

def L1Trigger_custom::customiseResetVetoMasksTechTriggers (   process)

Definition at line 62 of file L1Trigger_custom.py.

00063                                                 :
00064 
00065     process.load("L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMaskVetoTechTrigConfig_cff")
00066     process.es_prefer_l1GtTriggerMaskVetoTechTrig = cms.ESPrefer(
00067         "L1GtTriggerMaskVetoTechTrigTrivialProducer", "l1GtTriggerMaskVetoTechTrig")
00068 
00069     return (process)

def L1Trigger_custom::customiseUnprescaleAlgoTriggers (   process)

Definition at line 7 of file L1Trigger_custom.py.

00008                                             :
00009 
00010     # temporary solution FIXME
00011 
00012     process.load("L1TriggerConfig.L1GtConfigProducers.L1GtPrescaleFactorsAlgoTrigConfig_cff")
00013     process.es_prefer_l1GtPrescaleFactorsAlgoTrig = cms.ESPrefer(
00014         "L1GtPrescaleFactorsAlgoTrigTrivialProducer", "l1GtPrescaleFactorsAlgoTrig")
00015 
00016 
00017     return (process)

def L1Trigger_custom::customiseUnprescaleTechTriggers (   process)

Definition at line 20 of file L1Trigger_custom.py.

00021                                             :
00022 
00023     # temporary solution FIXME
00024 
00025     process.load("L1TriggerConfig.L1GtConfigProducers.L1GtPrescaleFactorsTechTrigConfig_cff")
00026     process.es_prefer_l1GtPrescaleFactorsTechTrig = cms.ESPrefer(
00027         "L1GtPrescaleFactorsTechTrigTrivialProducer", "l1GtPrescaleFactorsTechTrig")
00028 
00029     return (process)