Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-27 03:17:54

0001 #
0002 # cfg file to run L1 Global Trigger emulator on a file containing the output of the 
0003 # GCT system and GMT system ("digi"), followed by the L1 trigger report
0004 # options set in "user choices"
0005 #
0006 #
0007 # V M Ghete 2009-03-03
0008 
0009 import FWCore.ParameterSet.Config as cms
0010 import sys
0011 
0012 process = cms.Process("L1GtEmulTrigReport")
0013 
0014 # import number of events, sample and global tag 
0015 print('\n')
0016 from L1Trigger.GlobalTriggerAnalyzer.UserOptions_cff import *
0017 if errorUserOptions == True :
0018     print('\nError returned by UserOptions_cff\n')
0019     sys.exit()
0020 
0021 # L1 menu selection via L1Trigger_custom - expert choice, do it only if you know what you do
0022 # if True, modify correspondingly L1Trigger_custom
0023 
0024 customL1Menu = True
0025 customL1Menu = False
0026 
0027 if customL1Menu == True :
0028     from L1Trigger.Configuration.L1Trigger_custom import customiseL1Menu
0029     process=customiseL1Menu(process)
0030 
0031 # reset all prescale factors and masks
0032 from L1Trigger.Configuration.L1Trigger_custom import customiseResetPrescalesAndMasks
0033 process = customiseResetPrescalesAndMasks(process)
0034 
0035 # source according to data type
0036 if dataType == 'StreamFile' :
0037     process.source = cms.Source("NewEventStreamFileReader", fileNames=readFiles)
0038 else :        
0039     process.source = cms.Source ('PoolSource', 
0040                                  fileNames=readFiles, 
0041                                  secondaryFileNames=secFiles,
0042                                  lumisToProcess = selectedLumis,
0043                                  eventsToProcess = selectedEvents
0044                                  )
0045 
0046 
0047 # number of events to be processed and source file
0048 process.maxEvents = cms.untracked.PSet(
0049     input=cms.untracked.int32(maxNumberEvents)
0050 )
0051 
0052 #
0053 # load and configure modules via Global Tag
0054 # https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions
0055 
0056 process.load('Configuration.StandardSequences.GeometryDB_cff')
0057 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0058 
0059 process.GlobalTag.globaltag = useGlobalTag
0060 
0061 # processes to be run
0062 
0063 # Global Trigger emulator
0064 import L1Trigger.GlobalTrigger.gtDigis_cfi
0065 process.l1GtEmulDigis = L1Trigger.GlobalTrigger.gtDigis_cfi.gtDigis.clone()
0066 
0067 
0068 # input tag for GMT readout collection: 
0069 #     gmtDigis = GMT emulator (default)
0070 #     l1GtUnpack     = GT unpacker (common GT/GMT unpacker)
0071 if useRelValSample == True :
0072     process.l1GtEmulDigis.GmtInputTag = 'simGmtDigis'
0073 else :
0074     process.l1GtEmulDigis.GmtInputTag = 'gtDigis'
0075    
0076 
0077 # input tag for GCT readout collections: 
0078 #     gctDigis = GCT emulator (default) 
0079 if useRelValSample == True :
0080     process.l1GtEmulDigis.GctInputTag = 'simGctDigis'
0081 else :
0082     process.l1GtEmulDigis.GctInputTag = 'gctDigis'
0083 
0084 # input tag for CASTOR record 
0085 #     castorL1Digis =  CASTOR
0086 #process.l1GtEmulDigis.CastorInputTag = cms.InputTag("castorL1Digis")
0087     
0088 # technical triggers: a vector of input tags, one tag per each technical 
0089 # trigger producer 
0090 # 
0091 # by default: empty vector
0092     
0093 # Example:
0094 # TechnicalTriggersInputTags = cms.VInputTag(cms.InputTag('aTechTrigDigis'), 
0095 #                                            cms.InputTag('anotherTechTriggerDigis')),
0096 if useRelValSample == True :
0097     process.l1GtEmulDigis.TechnicalTriggersInputTags = cms.VInputTag(
0098                                         cms.InputTag( 'simBscDigis' ), 
0099                                         cms.InputTag( 'simRpcTechTrigDigis' ),
0100                                         cms.InputTag( 'simHcalTechTrigDigis' )
0101                                         )
0102 else :
0103     process.l1GtEmulDigis.TechnicalTriggersInputTags = cms.VInputTag()
0104     
0105 
0106 # logical flag to produce the L1 GT DAQ readout record
0107 #     if true, produce the record (default)
0108 #process.l1GtEmulDigis.ProduceL1GtDaqRecord = False
0109     
0110 # logical flag to produce the L1 GT EVM readout record
0111 #     if true, produce the record (default)
0112 #process.l1GtEmulDigis.ProduceL1GtEvmRecord = False
0113 
0114 # logical flag to produce the L1 GT object map record
0115 #     if true, produce the record (default)
0116 #process.l1GtEmulDigis.ProduceL1GtObjectMapRecord = False
0117 
0118 # logical flag to write the PSB content in the  L1 GT DAQ record
0119 #     if true, write the PSB content in the record (default)
0120 #process.l1GtEmulDigis.WritePsbL1GtDaqRecord = False
0121 
0122 # logical flag to read the technical trigger records
0123 #     if true, it will read via getMany the available records (default)
0124 #process.l1GtEmulDigis.ReadTechnicalTriggerRecords = False
0125 
0126 # number of "bunch crossing in the event" (BxInEvent) to be emulated
0127 # symmetric around L1Accept (BxInEvent = 0):
0128 #    1 (BxInEvent = 0); 3 (F 0 1) (standard record); 5 (E F 0 1 2) (debug record)
0129 # even numbers (except 0) "rounded" to the nearest lower odd number
0130 # negative value: emulate TotalBxInEvent as given in EventSetup  
0131 process.l1GtEmulDigis.EmulateBxInEvent = 1
0132  
0133 # number of BXs in the event corresponding to alternative 0 and 1 in altNrBxBoard()
0134 # EmulateBxInEvent >= max(RecordLength[0], RecordLength[1])
0135 # negative values: take the numbers from event setup, from L1GtParameters
0136 process.l1GtEmulDigis.RecordLength = cms.vint32(3, 5)
0137 
0138 # alternative for number of BX per active board in GT DAQ record: 0 or 1
0139 # the position is identical with the active board bit
0140 process.l1GtEmulDigis.AlternativeNrBxBoardDaq = 0x101 
0141 
0142 # alternative for number of BX per active board in GT EVM record: 0 or 1
0143 # the position is identical with the active board bit
0144 process.l1GtEmulDigis.AlternativeNrBxBoardEvm = 0x2 
0145 
0146 # length of BST record (in bytes) from parameter set
0147 # negative value: take the value from EventSetup      
0148 #process.l1GtEmulDigis.BstLengthBytes = 52
0149 
0150 # run algorithm triggers 
0151 #     if true, unprescaled (all prescale factors 1)
0152 #     will overwrite the event setup
0153 process.l1GtEmulDigis.AlgorithmTriggersUnprescaled = True
0154     
0155 #     if true, unmasked - all enabled (all trigger masks set to 0)
0156 #     will overwrite the event setup
0157 process.l1GtEmulDigis.AlgorithmTriggersUnmasked = True
0158 
0159 # run technical triggers
0160 #     if true, unprescaled (all prescale factors 1)
0161 #     will overwrite the event setup
0162 process.l1GtEmulDigis.TechnicalTriggersUnprescaled = True
0163     
0164 #     if true, unmasked - all enabled (all trigger masks set to 0)
0165 #     will overwrite the event setup
0166 process.l1GtEmulDigis.TechnicalTriggersUnmasked = True
0167 
0168 #     if true, veto unmasked - all enabled (all trigger veto masks set to 0)
0169 #     will overwrite the event setup
0170 process.l1GtEmulDigis.TechnicalTriggersVetoUnmasked = True
0171 
0172 
0173 # 
0174 process.l1GtEmulDigis.Verbosity = cms.untracked.int32(1)
0175 
0176 #
0177 # l1GtTrigReport module
0178 #
0179 
0180 process.load("L1Trigger.GlobalTriggerAnalyzer.l1GtTrigReport_cfi")
0181  
0182 # boolean flag to select the input record
0183 # if true, it will use L1GlobalTriggerRecord 
0184 #process.l1GtTrigReport.UseL1GlobalTriggerRecord = True
0185 
0186 # input tag for GT record: 
0187 #   GT emulator:    gtDigis (DAQ record)
0188 #   GT unpacker:    gtDigis (DAQ record)
0189 #   GT lite record: l1GtRecord 
0190 process.l1GtTrigReport.L1GtRecordInputTag = "l1GtEmulDigis"
0191 
0192 #process.l1GtTrigReport.PrintVerbosity = 10
0193 #process.l1GtTrigReport.PrintOutput = 1
0194 
0195 # path to be run
0196 
0197 # for RAW data, run first the RAWTODIGI 
0198 if (dataType == 'RAW') and not (useRelValSample) :
0199     process.load('Configuration/StandardSequences/RawToDigi_Data_cff')
0200     # unpack five BX for GCT
0201     process.gctDigis.numberOfGctSamplesToUnpack = cms.uint32(5)
0202     #
0203     process.p = cms.Path(process.RawToDigi+process.l1GtEmulDigis*process.l1GtTrigReport)
0204 elif (dataType == 'RAW') and (useRelValSample) :
0205     process.load('Configuration/StandardSequences/RawToDigi_cff')
0206     process.p = cms.Path(process.RawToDigi+process.l1GtEmulDigis*process.l1GtTrigReport)    
0207 else :        
0208     # path to be run for RECO
0209     process.p = cms.Path(process.l1GtEmulDigis*process.l1GtTrigReport)
0210 
0211 
0212 # Message Logger
0213 process.load('FWCore.MessageService.MessageLogger_cfi')
0214 process.MessageLogger.debugModules = ['l1GtEmulDigis', 'l1GtTrigReport']
0215 process.MessageLogger.cerr.enable = False
0216 
0217 process.MessageLogger.files.L1GtEmulTrigReport_errors = cms.untracked.PSet( 
0218         threshold = cms.untracked.string('ERROR'),
0219         ERROR = cms.untracked.PSet( limit = cms.untracked.int32(-1) ),
0220         L1GlobalTrigger = cms.untracked.PSet( limit = cms.untracked.int32(-1) ) 
0221        )
0222 
0223 process.MessageLogger.files.L1GtEmulTrigReport_warnings = cms.untracked.PSet( 
0224         threshold = cms.untracked.string('WARNING'),
0225         WARNING = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0226         ERROR = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0227         L1GlobalTrigger = cms.untracked.PSet( limit = cms.untracked.int32(-1) ) 
0228         )
0229 
0230 process.MessageLogger.files.L1GtEmulTrigReport_info = cms.untracked.PSet( 
0231         threshold = cms.untracked.string('INFO'),
0232         INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0233         WARNING = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0234         ERROR = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0235         L1GtTrigReport = cms.untracked.PSet( limit = cms.untracked.int32(-1) ) 
0236         )
0237 
0238 process.MessageLogger.files.L1GtEmulTrigReport = cms.untracked.PSet( 
0239         threshold = cms.untracked.string('DEBUG'),
0240         DEBUG = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0241         INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0242         WARNING = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0243         ERROR = cms.untracked.PSet( limit = cms.untracked.int32(0) ),
0244         L1GlobalTrigger = cms.untracked.PSet( limit = cms.untracked.int32(-1) ) 
0245         )
0246 
0247 # output 
0248 
0249 # keep GMT, GCT and GT output records
0250 # update labels if InputTags are replaced above
0251 
0252 process.outputL1GlobalTrigger = cms.OutputModule("PoolOutputModule",
0253     fileName = cms.untracked.string('testGt_Emulator_GctGmtFile_output.root'),
0254     outputCommands = cms.untracked.vstring('drop *', 
0255         'keep *_simGmtDigis_*_*', 
0256         'keep *_simGctDigis_*_*', 
0257         'keep *_l1GtEmulDigis_*_*')
0258 )
0259 
0260 process.outpath = cms.EndPath(process.outputL1GlobalTrigger)