Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-05-01 22:52:10

0001 from __future__ import print_function
0002 #
0003 # cfg file to run some technical trigger emulators/simulation, L1 Global Trigger emulator 
0004 # on a file containing the output of the  GCT system and GMT system ("digi"), followed by 
0005 # the L1 trigger report
0006 #
0007 # V M Ghete 2009-03-04
0008 
0009 
0010 import FWCore.ParameterSet.Config as cms
0011 
0012 # process
0013 process = cms.Process('TestL1Gt')
0014 
0015 ###################### user choices ######################
0016 
0017 # choose the type of sample used (True for RelVal, False for data)
0018 useRelValSample = True 
0019 #useRelValSample=False 
0020 
0021 # release to be used
0022 useRelease = 'CMSSW_3_4_X'
0023 
0024 
0025 if useRelValSample == True :
0026     
0027     if useRelease == 'CMSSW_2_2_12' :
0028         
0029         useGlobalTag = 'IDEAL_V12'
0030         #useGlobalTag='STARTUP_V11'
0031     
0032     elif useRelease == 'CMSSW_3_1_1' :
0033          useGlobalTag = 'MC_31X_V2'
0034          #useGlobalTag = 'STARTUP31X_V1'
0035 
0036     elif useRelease == 'CMSSW_3_4_X' :
0037          useGlobalTag = 'MC_3XY_V10'
0038          #useGlobalTag = 'STARTUP3X_V9'
0039 
0040     # RelVals 
0041     useSample = 'RelValTTbar'
0042     #useSample = 'RelValZTT'
0043     
0044 else :
0045     # global tag for data
0046     
0047     if useRelease == 'CMSSW_2_2_12' :
0048         useGlobalTag = 'CRAFT_ALL_V11'
0049         
0050     elif useRelease == 'CMSSW_3_1_1' :
0051         #useGlobalTag = 'CRAFT0831X_V1'
0052         useGlobalTag = 'GR09_31X_V1P'
0053 
0054 
0055 # explicit choice of the L1 menu - available choices:
0056 # use menu from global tag
0057 l1Menu =''
0058 # use selected menu
0059 #l1Menu = 'L1Menu_Commissioning2009_v5'
0060 #l1Menu = 'L1Menu_MC2009_v0'
0061 #l1Menu = 'L1Menu_startup2_v4'
0062 #l1Menu = 'L1Menu_2008MC_2E30'
0063 #l1Menu = 'myMenu'
0064 
0065 # change to True to use local files
0066 #     the type of file should match the choice of useRelValSample and useGlobalTag
0067 useLocalFiles = False 
0068 
0069 ###################### end user choices ###################
0070 
0071 
0072 # number of events to be processed and source file
0073 process.maxEvents = cms.untracked.PSet(
0074     input=cms.untracked.int32(2000)
0075 )
0076 
0077 readFiles = cms.untracked.vstring()
0078 secFiles = cms.untracked.vstring() 
0079 process.source = cms.Source ('PoolSource', fileNames=readFiles, secondaryFileNames=secFiles)
0080 
0081 # type of sample used (True for RelVal, False for data)
0082 
0083 if useRelValSample == True :
0084     if useGlobalTag.count('IDEAL') or useGlobalTag.count('MC') :
0085         
0086         if (useRelease == 'CMSSW_3_4_X') and (useSample == 'RelValTTbar') :
0087 
0088             dataset = cms.untracked.vstring('/RelValTTbar/CMSSW_3_4_0_pre2-MC_3XY_V10-v1/GEN-SIM-DIGI-RAW-HLTDEBUG')       
0089             readFiles.extend([
0090                 '/store/relval/CMSSW_3_4_0_pre2/RelValTTbar/GEN-SIM-DIGI-RAW-HLTDEBUG/MC_3XY_V10-v1/0003/F4AC0278-96BD-DE11-8687-00261894392D.root',
0091                 '/store/relval/CMSSW_3_4_0_pre2/RelValTTbar/GEN-SIM-DIGI-RAW-HLTDEBUG/MC_3XY_V10-v1/0003/E2E078D8-C0BD-DE11-A77B-0026189438E0.root',
0092                 '/store/relval/CMSSW_3_4_0_pre2/RelValTTbar/GEN-SIM-DIGI-RAW-HLTDEBUG/MC_3XY_V10-v1/0003/E0D7EB2D-90BD-DE11-9BB6-0017312B5651.root'
0093                 ]);
0094 
0095 
0096             secFiles.extend([
0097                 ])
0098 
0099         else : 
0100             print('Error: no file list defined for release ', useRelease, ' global tag ', useGlobalTag, ' data sample ',  useSample)   
0101             sys.exit()
0102             
0103     elif useGlobalTag.count('STARTUP') :
0104 
0105         if (useRelease == 'CMSSW_3_4_X') and (useSample == 'RelValBeamHalo') :
0106 
0107             dataset = cms.untracked.vstring('/RelValBeamHalo/CMSSW_3_4_0_pre2-STARTUP3XY_V9-v1/GEN-SIM-DIGI-RAW-HLTDEBUG')
0108             readFiles.extend( [
0109                 '/store/relval/CMSSW_3_4_0_pre2/RelValBeamHalo/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP3XY_V9-v1/0003/BC5F1CA5-C0BD-DE11-B4BD-002618943982.root',
0110                 '/store/relval/CMSSW_3_4_0_pre2/RelValBeamHalo/GEN-SIM-DIGI-RAW-HLTDEBUG/STARTUP3XY_V9-v1/0003/663EED3C-89BD-DE11-97CF-001A92971B8E.root'
0111                 ]);
0112 
0113 
0114             secFiles.extend([
0115                 ])
0116         else :
0117             print('Error: no file list defined for release ', useRelease, ' global tag ', useGlobalTag, ' data sample ',  useSample)   
0118             sys.exit()
0119 
0120 else : 
0121 
0122     # CRAFT data FIXME
0123     print('Error: no file list defined for release ', useRelease, ' global tag ', useGlobalTag, ' data sample ',  useSample)   
0124     sys.exit()
0125     
0126     dataset = ''
0127     
0128     readFiles.extend([
0129         ]);
0130 
0131     secFiles.extend([
0132         ])
0133 
0134 if useLocalFiles :
0135     readFiles = 'file:/afs/cern.ch/user/g/ghete/scratch0/CmsswTestFiles/testGt_L1GtTrigReport_source.root'
0136 
0137 # technical triggers to be run and collected by GT
0138 
0139 # producers for Technical Trigger
0140 #
0141 # BSC Trigger
0142 import L1TriggerOffline.L1Analyzer.bscTrigger_cfi
0143 process.simBscDigis = L1TriggerOffline.L1Analyzer.bscTrigger_cfi.bscTrigger.clone()
0144 
0145 # RPC Technical Trigger
0146 import L1Trigger.RPCTechnicalTrigger.rpcTechnicalTrigger_cfi
0147 process.simRpcTechTrigDigis = L1Trigger.RPCTechnicalTrigger.rpcTechnicalTrigger_cfi.rpcTechnicalTrigger.clone()
0148 process.simRpcTechTrigDigis.RPCDigiLabel = 'simMuonRPCDigis'
0149 
0150 # Global Trigger emulator
0151 import L1Trigger.GlobalTrigger.gtDigis_cfi
0152 process.l1GtEmulDigis = L1Trigger.GlobalTrigger.gtDigis_cfi.gtDigis.clone()
0153 
0154 
0155 # input tag for GMT readout collection: 
0156 #     gmtDigis = GMT emulator (default)
0157 #     l1GtUnpack     = GT unpacker (common GT/GMT unpacker)
0158 process.l1GtEmulDigis.GmtInputTag = 'simGmtDigis'
0159 
0160 # input tag for GCT readout collections: 
0161 #     gctDigis = GCT emulator (default) 
0162 process.l1GtEmulDigis.GctInputTag = 'simGctDigis'
0163 
0164 # input tag for CASTOR record 
0165 #     castorL1Digis =  CASTOR
0166 #process.l1GtEmulDigis.CastorInputTag = cms.InputTag("castorL1Digis")
0167     
0168 # technical triggers: a vector of input tags, one tag per each technical 
0169 # trigger producer 
0170 # 
0171 # by default: empty vector
0172     
0173 # Example:
0174 # TechnicalTriggersInputTags = cms.VInputTag(cms.InputTag('aTechTrigDigis'), 
0175 #                                            cms.InputTag('anotherTechTriggerDigis')),
0176 process.l1GtEmulDigis.TechnicalTriggersInputTags = cms.VInputTag(cms.InputTag('simBscDigis'), 
0177                                                                  cms.InputTag('simRpcTechTrigDigis'))
0178 
0179 # logical flag to produce the L1 GT DAQ readout record
0180 #     if true, produce the record (default)
0181 #process.l1GtEmulDigis.ProduceL1GtDaqRecord = False
0182     
0183 # logical flag to produce the L1 GT EVM readout record
0184 #     if true, produce the record (default)
0185 #process.l1GtEmulDigis.ProduceL1GtEvmRecord = False
0186 
0187 # logical flag to produce the L1 GT object map record
0188 #     if true, produce the record (default)
0189 #process.l1GtEmulDigis.ProduceL1GtObjectMapRecord = False
0190 
0191 # logical flag to write the PSB content in the  L1 GT DAQ record
0192 #     if true, write the PSB content in the record (default)
0193 #process.l1GtEmulDigis.WritePsbL1GtDaqRecord = False
0194 
0195 # logical flag to read the technical trigger records
0196 #     if true, it will read via getMany the available records (default)
0197 #process.l1GtEmulDigis.ReadTechnicalTriggerRecords = False
0198 
0199 # number of "bunch crossing in the event" (BxInEvent) to be emulated
0200 # symmetric around L1Accept (BxInEvent = 0):
0201 #    1 (BxInEvent = 0); 3 (F 0 1) (standard record); 5 (E F 0 1 2) (debug record)
0202 # even numbers (except 0) "rounded" to the nearest lower odd number
0203 # negative value: emulate TotalBxInEvent as given in EventSetup  
0204 #process.l1GtEmulDigis.EmulateBxInEvent = 3
0205 
0206 # length of BST record (in bytes) from parameter set
0207 # negative value: take the value from EventSetup      
0208 #process.l1GtEmulDigis.BstLengthBytes = 52
0209 
0210 # load and configure modules via Global Tag
0211 # https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions
0212 
0213 process.load("Configuration.StandardSequences.GeometryDB_cff")
0214 process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
0215 
0216 process.GlobalTag.globaltag = useGlobalTag
0217 
0218 
0219 # explicit choice of the L1 menu
0220 
0221 if l1Menu == '' :
0222     print('Using menu from global tag', useGlobalTag)
0223 
0224 elif l1Menu == 'L1Menu_Commissioning2009_v5' :
0225     process.load('L1Trigger.Configuration.L1StartupConfig_cff')
0226     process.load('L1TriggerConfig.L1GtConfigProducers.Luminosity.startup.L1Menu_Commissioning2009_v5_L1T_Scales_20080926_startup_Imp0_Unprescaled_cff')
0227     
0228 elif l1Menu == 'L1Menu_startup2_v4' :
0229     process.load('L1Trigger.Configuration.L1StartupConfig_cff')
0230     process.load('L1TriggerConfig.L1GtConfigProducers.Luminosity.startup.L1Menu_startup2_v4_L1T_Scales_20080926_startup_Imp0_Unprescaled_cff')
0231     
0232 elif l1Menu == 'L1Menu_MC2009_v0' :
0233     process.load('L1TriggerConfig.L1GtConfigProducers.Luminosity.lumi1031.L1Menu_MC2009_v0_L1T_Scales_20080922_Imp0_Unprescaled_cff')
0234 
0235 elif l1Menu == 'L1Menu_2008MC_2E30' :
0236     process.load("L1TriggerConfig.L1GtConfigProducers.Luminosity.lumi1030.L1Menu_2008MC_2E30_Unprescaled_cff")
0237 
0238 elif l1Menu == 'myMenu' :
0239     #process.load("L1TriggerConfig.L1GtConfigProducers.Luminosity.startup.L1Menu_startup_v3_Unprescaled_cff")
0240     #process.load("L1TriggerConfig.L1GtConfigProducers.Luminosity.startup.L1Menu_startup_v4_Unprescaled_cff")
0241     #process.load("L1TriggerConfig.L1GtConfigProducers.Luminosity.startup.L1Menu_startup_v5_Unprescaled_cff")
0242     #process.load("L1TriggerConfig.L1GtConfigProducers.Luminosity.startup.L1Menu_startup2_v1_Unprescaled_cff")
0243     #process.load("L1TriggerConfig.L1GtConfigProducers.Luminosity.startup.L1Menu_startup2_v2_Unprescaled_cff")
0244     process.load("L1TriggerConfig.L1GtConfigProducers.Luminosity.startup.L1Menu_startup2_v3_Unprescaled_cff")
0245 else :
0246     print('No such L1 menu: ', l1Menu)  
0247       
0248 
0249 #
0250 # l1GtTrigReport module
0251 #
0252 
0253 process.load("L1Trigger.GlobalTriggerAnalyzer.l1GtTrigReport_cfi")
0254 
0255 # boolean flag to select the input record
0256 # if true, it will use L1GlobalTriggerRecord 
0257 #process.l1GtTrigReport.UseL1GlobalTriggerRecord = True
0258 
0259 # input tag for GT record: 
0260 #   GT emulator:    gtDigis (DAQ record)
0261 #   GT unpacker:    gtDigis (DAQ record)
0262 #   GT lite record: l1GtRecord 
0263 process.l1GtTrigReport.L1GtRecordInputTag = "l1GtEmulDigis"
0264 
0265 #process.l1GtTrigReport.PrintVerbosity = 10
0266 #process.l1GtTrigReport.PrintOutput = 1
0267 
0268 # path to be run
0269 process.p = cms.Path(process.simBscDigis 
0270                      + process.simRpcTechTrigDigis 
0271                      + process.l1GtEmulDigis 
0272                      + process.l1GtTrigReport)
0273 
0274 # Message Logger
0275 process.load('FWCore.MessageService.MessageLogger_cfi')
0276 process.MessageLogger.debugModules = ['l1GtEmulDigis', 'l1GtTrigReport']
0277 
0278 process.MessageLogger.cerr.threshold = 'DEBUG'
0279 #process.MessageLogger.cerr.threshold = 'INFO'
0280 #process.MessageLogger.cerr.threshold = 'WARNING'
0281 #process.MessageLogger.cerr.threshold = 'ERROR'
0282 
0283 process.MessageLogger.cerr.DEBUG = cms.untracked.PSet( limit = cms.untracked.int32(0) )
0284 process.MessageLogger.cerr.INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) )
0285 process.MessageLogger.cerr.WARNING = cms.untracked.PSet( limit = cms.untracked.int32(0) )
0286 process.MessageLogger.cerr.ERROR = cms.untracked.PSet( limit = cms.untracked.int32(0) )
0287 
0288 process.MessageLogger.cerr.L1GtTrigReport = cms.untracked.PSet( limit = cms.untracked.int32(-1) )
0289 
0290 # summary
0291 process.options = cms.untracked.PSet(
0292     wantSummary=cms.untracked.bool(True)
0293 )
0294 
0295 # output 
0296 
0297 # keep GMT, GCT and GT output records
0298 # update labels if InputTags are replaced above
0299 
0300 process.outputL1GlobalTrigger = cms.OutputModule("PoolOutputModule",
0301     fileName=cms.untracked.string('L1GtTechTrigL1GtEmulTrigReport.root'),
0302     outputCommands=cms.untracked.vstring('drop *',
0303         'keep *_simGmtDigis_*_*',
0304         'keep *_simGctDigis_*_*',
0305         'keep *_l1GtEmulDigis_*_*')
0306 )
0307 
0308 process.outpath = cms.EndPath(process.outputL1GlobalTrigger)