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

00248                                                  :
00249     # customization fragment to run calorimeter emulators (TPGs and L1 calorimeter emulators) 
00250     # and GT emulator starting from a RAW file assuming that "RawToDigi_cff" and "SimL1Emulator_cff" 
00251     # have already been loaded
00252 
00253     # run Calo TPGs on unpacked digis
00254     process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
00255     process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
00256     process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
00257         cms.InputTag('hcalDigis'), 
00258         cms.InputTag('hcalDigis')
00259     )
00260     
00261     # do not run muon emulators - instead, use unpacked GMT digis for GT input 
00262     # (GMT digis produced by same module as the GT digis, as GT and GMT have common unpacker)
00263     process.simRpcTechTrigDigis.RPCDigiLabel = 'muonRPCDigis'                                                                                                                                                                                           
00264     process.simGtDigis.GmtInputTag = 'gtDigis'                                                                                                                                                                                                          
00265 
00266     # run Calo TPGs, L1 GCT, technical triggers, L1 GT
00267     SimL1Emulator = cms.Sequence(
00268         process.CaloTriggerPrimitives +
00269         process.simRctDigis +
00270         process.simGctDigis +
00271         process.SimL1TechnicalTriggers +
00272         process.simGtDigis )
00273 
00274     # replace the SimL1Emulator in all paths and sequences
00275     for iterable in process.sequences.itervalues():
00276         iterable.replace( process.SimL1Emulator, SimL1Emulator)
00277     for iterable in process.paths.itervalues():
00278         iterable.replace( process.SimL1Emulator, SimL1Emulator)
00279     for iterable in process.endpaths.itervalues():
00280         iterable.replace( process.SimL1Emulator, SimL1Emulator)
00281     process.SimL1Emulator = SimL1Emulator
00282 
00283     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
00202 
00203     # producers for technical triggers:
00204     # they must be re-run as their output is not available from RAW2DIGI
00205 
00206     # BSC Technical Trigger
00207     # Note: will normally not work, it requires SimHits (not available from RAW2DIGI)
00208     # works only on some MC samples where the SimHits are saved together with the FEDRaw
00209     import L1TriggerOffline.L1Analyzer.bscTrigger_cfi
00210     process.simBscDigis = L1TriggerOffline.L1Analyzer.bscTrigger_cfi.bscTrigger.clone()
00211 
00212     # RPC Technical Trigger
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     # HCAL Technical Trigger
00220     import SimCalorimetry.HcalTrigPrimProducers.hcalTTPRecord_cfi
00221     process.simHcalTechTrigDigis = SimCalorimetry.HcalTrigPrimProducers.hcalTTPRecord_cfi.simHcalTTPRecord.clone()
00222      
00223 
00224     # Global Trigger emulator
00225     simGtDigis.TechnicalTriggersInputTags = cms.VInputTag(
00226         cms.InputTag( 'simBscDigis' ), 
00227         cms.InputTag( 'simRpcTechTrigDigis' ),
00228         cms.InputTag( 'simHcalTechTrigDigis' )
00229         )
00230 
00231     process.SimL1TechnicalTriggers = cms.Sequence(
00232         process.simBscDigis +
00233         process.simRpcTechTrigDigis +
00234         process.simHcalTechTrigDigis
00235         )
00236 
00237     process.L1GtEmulator = cms.Sequence(
00238         process.SimL1TechnicalTriggers +
00239         process.simGtDigis )
00240 
00241     for path in process._Process__paths.itervalues():
00242         path.replace(process.SimL1Emulator, process.L1GtEmulator)
00243 
00244     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/sqlFile/L1Menu_CollisionsHeavyIons2010_v0_mc.db'
00099         menuDbTag = 'L1GtTriggerMenu_L1Menu_CollisionsHeavyIons2010_v0_mc'
00100     elif l1MenuSource == 'xmlFile' :
00101         # the menu will be read from an XML file instead of the global tag
00102         luminosityDirectory = "startup"
00103         useXmlFile = 'L1Menu_CollisionsHeavyIons2010_v0_L1T_Scales_20080926_startup_Imp0_0x101b.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 286 of file L1Trigger_custom.py.

00287                                      :
00288 
00289     process.load("L1Trigger.GlobalTriggerAnalyzer.l1GtTrigReport_cfi")
00290 
00291     # boolean flag to select the input record
00292     # if true, it will use L1GlobalTriggerRecord
00293     #process.l1GtTrigReport.UseL1GlobalTriggerRecord = True
00294 
00295     # input tag for GT record:
00296     #   GT emulator:    gtDigis (DAQ record)
00297     #   GT unpacker:    gtDigis (DAQ record)
00298     #   GT lite record: l1GtRecord
00299     process.l1GtTrigReport.L1GtRecordInputTag = "gtDigis"
00300 
00301     process.l1GtTrigReport.PrintVerbosity = 2
00302     process.l1GtTrigReport.PrintOutput = 0
00303 
00304 
00305 
00306     #
00307     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)