Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:18:29

0001 #
0002 # cfg file to run on L1 GT output file, with GCT and GMT EDM products included
0003 #
0004 
0005 import FWCore.ParameterSet.Config as cms
0006 
0007 # process
0008 process = cms.Process('TestHLTLevel1GTSeed')
0009 
0010 useMC = False
0011 
0012 # explicit choice of the L1 menu,
0013 # use l1Menu='' for default menu from GT
0014 l1Menu = ''
0015 
0016 # other available choices (must be compatible with the GlobalTag)
0017 #l1Menu = 'L1Menu_Commissioning2009_v0'
0018 #l1Menu = 'L1Menu_MC2009_v0'
0019 #l1Menu = 'L1Menu_startup2_v4'
0020 #l1Menu = 'L1Menu_2008MC_2E30'
0021 
0022 # private menu (must edit the corresponding part in the menu list)
0023 # must be compatible with the GlobalTag
0024 #l1Menu = 'myMenu'
0025 
0026 ###################### end user choices ###################
0027 
0028 # number of events to be processed and source file
0029 process.maxEvents.input = 100
0030 
0031 process.source = cms.Source('PoolSource', fileNames = cms.untracked.vstring())
0032 
0033 if useMC:
0034     gtName = 'auto:run2_mc_l1stage1'
0035     process.source.fileNames = ['/store/relval/CMSSW_8_0_0/RelValTTbar_13/GEN-SIM-RECO/PU25ns_80X_mcRun2_asymptotic_v4-v1/10000/42D6DF66-9DDA-E511-9200-0CC47A4D7670.root']
0036 else:
0037     gtName = 'auto:run2_data'
0038     process.source.fileNames = ['/store/data/Run2015D/SingleMuon/RAW-RECO/ZMu-PromptReco-v3/000/256/677/00000/0EC78D60-1E5F-E511-B77F-02163E0123C5.root']
0039 
0040 # load and configure modules via GlobalTag
0041 # https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions
0042 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0043 from Configuration.AlCa.GlobalTag import GlobalTag
0044 process.GlobalTag = GlobalTag(process.GlobalTag, gtName, '')
0045 
0046 # [UNTESTED] explicit choice of the L1 menu, overwriting the GlobalTag menu
0047 if l1Menu != '':
0048 
0049     process.load('L1TriggerConfig.L1GtConfigProducers.L1GtTriggerMenuConfig_cff')
0050     process.es_prefer_l1GtParameters = cms.ESPrefer('L1GtTriggerMenuXmlProducer','l1GtTriggerMenuXml')
0051 
0052     if l1Menu == 'L1Menu_MC2009_v2':
0053         process.load('L1TriggerConfig.L1GtConfigProducers.Luminosity.lumi1031.L1Menu_MC2009_v2_L1T_Scales_20080922_Imp0_Unprescaled_cff')
0054 
0055     elif l1Menu == 'L1Menu_2008MC_2E30':
0056         process.load("L1TriggerConfig.L1GtConfigProducers.Luminosity.lumi1030.L1Menu_2008MC_2E30_Unprescaled_cff")
0057 
0058     elif l1Menu == 'L1Menu_Commissioning2009_v0':
0059         process.load('L1TriggerConfig.L1GtConfigProducers.Luminosity.startup.L1Menu_Commissioning2009_v0_L1T_Scales_20080926_startup_Imp0_Unprescaled_cff')
0060 
0061     elif l1Menu == 'myMenu':
0062         process.load("L1TriggerConfig.L1GtConfigProducers.Luminosity.startup.L1Menu_startup2_v4_L1T_Scales_20080926_startup_Imp0_Unprescaled_cff")
0063 
0064     else :
0065         print('No such L1T menu: ', l1Menu)
0066         sys.exit(1)
0067 
0068 else :
0069     print('# Using default L1 trigger menu from GlobalTag:', gtName)
0070 
0071 
0072 # Global Trigger emulator to produce the trigger object maps
0073 
0074 import L1Trigger.GlobalTrigger.gtDigis_cfi
0075 process.hltL1GtObjectMap = L1Trigger.GlobalTrigger.gtDigis_cfi.gtDigis.clone()
0076 
0077 # input tag for GMT readout collection: 
0078 #     gmtDigis = GMT emulator (default)
0079 #     l1GtUnpack     = GT unpacker (common GT/GMT unpacker)
0080 process.hltL1GtObjectMap.GmtInputTag = 'gtDigis'
0081 
0082 # input tag for GCT readout collections: 
0083 #     gctDigis = GCT emulator (default) 
0084 process.hltL1GtObjectMap.GctInputTag = 'gctDigis'
0085 
0086 # input tag for CASTOR record 
0087 #     castorL1Digis =  CASTOR
0088 #process.hltL1GtObjectMap.CastorInputTag = cms.InputTag("castorL1Digis")
0089     
0090 # technical triggers: a vector of input tags, one tag per each technical 
0091 # trigger producer 
0092 # 
0093 # by default: empty vector
0094     
0095 # Example:
0096 # TechnicalTriggersInputTags = cms.VInputTag(cms.InputTag('aTechTrigDigis'), 
0097 #                                            cms.InputTag('anotherTechTriggerDigis')),
0098 process.hltL1GtObjectMap.TechnicalTriggersInputTags = cms.VInputTag(cms.InputTag('bscTrigger'))
0099 
0100 # logical flag to produce the L1 GT DAQ readout record
0101 #     if true, produce the record (default)
0102 process.hltL1GtObjectMap.ProduceL1GtDaqRecord = False
0103     
0104 # logical flag to produce the L1 GT EVM readout record
0105 #     if true, produce the record (default)
0106 process.hltL1GtObjectMap.ProduceL1GtEvmRecord = False
0107 
0108 # logical flag to produce the L1 GT object map record
0109 #     if true, produce the record (default)
0110 #process.hltL1GtObjectMap.ProduceL1GtObjectMapRecord = False
0111 
0112 # logical flag to write the PSB content in the  L1 GT DAQ record
0113 #     if true, write the PSB content in the record (default)
0114 process.hltL1GtObjectMap.WritePsbL1GtDaqRecord = False
0115 
0116 # logical flag to read the technical trigger records
0117 #     if true, it will read via getMany the available records (default)
0118 process.hltL1GtObjectMap.ReadTechnicalTriggerRecords = True
0119 
0120 # number of "bunch crossing in the event" (BxInEvent) to be emulated
0121 # symmetric around L1Accept (BxInEvent = 0):
0122 #    1 (BxInEvent = 0); 3 (F 0 1) (standard record); 5 (E F 0 1 2) (debug record)
0123 # even numbers (except 0) "rounded" to the nearest lower odd number
0124 # negative value: emulate TotalBxInEvent as given in EventSetup  
0125 process.hltL1GtObjectMap.EmulateBxInEvent = 1
0126 
0127 # length of BST record (in bytes) from parameter set
0128 # negative value: take the value from EventSetup      
0129 process.hltL1GtObjectMap.BstLengthBytes = -1
0130 
0131 # L1 Extra
0132 process.load('L1Trigger.Configuration.L1Extra_cff')
0133 
0134 # replacing arguments for L1Extra
0135 process.l1extraParticles.muonSource = cms.InputTag('gtDigis')
0136 process.l1extraParticles.isolatedEmSource = cms.InputTag('gctDigis', 'isoEm')
0137 process.l1extraParticles.nonIsolatedEmSource = cms.InputTag('gctDigis', 'nonIsoEm')
0138 process.l1extraParticles.centralJetSource = cms.InputTag('gctDigis', 'cenJets')
0139 process.l1extraParticles.forwardJetSource = cms.InputTag('gctDigis', 'forJets')
0140 process.l1extraParticles.tauJetSource = cms.InputTag('gctDigis', 'tauJets')
0141 process.l1extraParticles.etTotalSource = cms.InputTag('gctDigis')
0142 process.l1extraParticles.etHadSource = cms.InputTag('gctDigis')
0143 process.l1extraParticles.etMissSource = cms.InputTag('gctDigis')
0144 process.l1extraParticles.htMissSource = cms.InputTag("gctDigis")
0145 process.l1extraParticles.hfRingEtSumsSource = cms.InputTag("gctDigis")
0146 process.l1extraParticles.hfRingBitCountsSource = cms.InputTag("gctDigis")
0147 process.l1extraParticles.ignoreHtMiss = cms.bool(False)
0148 process.l1extraParticles.centralBxOnly = cms.bool(False)
0149 
0150 # this module
0151 process.load('HLTrigger.HLTfilters.hltLevel1GTSeed_cfi')
0152 
0153 # replacing arguments for hltLevel1GTSeed
0154 
0155 # default: true
0156 #    seeding done via L1 trigger object maps, with objects that fired 
0157 #    only objects from the central BxInEvent (L1A) are used
0158 # if false:
0159 #    seeding is done ignoring if a L1 object fired or not, 
0160 #    adding all L1EXtra objects corresponding to the object types 
0161 #    used in all conditions from the algorithms in logical expression 
0162 #    for a given number of BxInEvent
0163 process.hltLevel1GTSeed.L1UseL1TriggerObjectMaps = cms.bool(False)
0164 #
0165 # option used forL1UseL1TriggerObjectMaps = False only
0166 # number of BxInEvent: 1: L1A=0; 3: -1, L1A=0, 1; 5: -2, -1, L1A=0, 1, 2
0167 process.hltLevel1GTSeed.L1NrBxInEvent = cms.int32(3)
0168 
0169 # seeding done via technical trigger bits, if value is 'True';
0170 # default: false (seeding via physics algorithms)
0171 #process.hltLevel1GTSeed.L1TechTriggerSeeding = True
0172 
0173 # seeding done with aliases for physics algorithms
0174 #process.hltLevel1GTSeed.L1UseAliasesForSeeding = cms.bool(False)
0175 
0176 # logical expression for the required L1 algorithms;
0177 # the algorithms are specified by name
0178 # allowed operators: 'AND', 'OR', 'NOT', '(', ')'
0179 #
0180 # by convention, 'L1GlobalDecision' logical expression means global decision
0181 # 
0182 
0183 l1SeedLogicalExprs = [
0184     'L1_SingleJet50',                                     # 0
0185     'L1_SingleJet50U',                                    # 1
0186     'L1_HTT200 OR L1_ETM20 OR L1_ETT60 OR L1_SingleEG15', # 2
0187     'L1_HTT250 OR L1_HTT300 OR L1_SingleEG15',            # 3
0188     'NOT L1_SingleEG15',                                  # 4
0189     'L1_ZeroBias',                                        # 5
0190     'L1_SingleEG15 AND L1_HTT200',                        # 6
0191     'L1_SingleEG15 AND (L1_HTT100 OR L1_SingleMu0) OR L1_SingleJet6U', # 7
0192     '(L1_SingleEG15 OR L1_QuadJet40) AND (L1_HTT300 AND NOT L1_SingleMu7)', # 8
0193     '(L1_SingleEG15 OR L1_QuadJet40) AND ((L1_HTT300 AND NOT L1_SingleMu7) OR NOT L1_SingleMu20)', # 9
0194     'L1_SingleJet6U',                                     # 10
0195     'L1_SingleJet6U',                                     # 11
0196     'L1_IsoEG10_Jet6U_ForJet6U',                          # 12
0197     '1 AND 15 AND NOT (29 OR 55)',                        # 13 (for technical triggers, one specifies by bit number)
0198     '(L1_SingleEG15 OR L1_QuadJet6U) AND ((L1_HTT200 AND NOT L1_SingleMu7) OR NOT L1_SingleMu20)', # 14
0199 ]
0200 
0201 process.hltLevel1GTSeed.L1SeedsLogicalExpression = l1SeedLogicalExprs[6]
0202 
0203 # InputTag for the L1 Global Trigger DAQ readout record
0204 #   GT Emulator = gtDigis
0205 #   GT Unpacker = l1GtUnpack
0206 #
0207 #   cloned GT unpacker in HLT = gtDigis
0208 #
0209 process.hltLevel1GTSeed.L1GtReadoutRecordTag = cms.InputTag('gtDigis')
0210 
0211 # InputTag for L1 Global Trigger object maps
0212 #   only the emulator produces the object maps
0213 #   GT Emulator = gtDigis
0214 #
0215 #   cloned GT emulator in HLT = l1GtObjectMap
0216 #
0217 process.hltLevel1GTSeed.L1GtObjectMapTag = cms.InputTag('hltL1GtObjectMap')
0218 
0219 # InputTag for L1 particle collections (except muon)
0220 #   L1 Extra = l1extraParticles
0221 #
0222 #process.hltLevel1GTSeed.L1CollectionsTag = cms.InputTag('l1extraParticles')
0223 
0224 # InputTag for L1 muon collection
0225 #process.hltLevel1GTSeed.L1MuonCollectionTag = cms.InputTag('l1extraParticles')
0226 
0227 # saveTags for AOD book-keeping
0228 #process.hltLevel1GTSeed.saveTags = cms.bool( True )
0229 
0230 # path to be run
0231 process.p = cms.Path(process.hltL1GtObjectMap * process.L1Extra * process.hltLevel1GTSeed)
0232 
0233 # services
0234 
0235 # Message Logger
0236 process.load('FWCore.MessageService.MessageLogger_cfi')
0237 process.MessageLogger.debugModules = ['hltLevel1GTSeed']
0238 process.MessageLogger.HLTLevel1GTSeed = dict()
0239 
0240 process.MessageLogger.cerr.threshold = 'DEBUG'
0241 #process.MessageLogger.cerr.threshold = 'INFO'
0242 #process.MessageLogger.cerr.threshold = 'WARNING'
0243 #process.MessageLogger.cerr.threshold = 'ERROR'
0244 
0245 process.MessageLogger.cerr.DEBUG = cms.untracked.PSet( limit = cms.untracked.int32(0) )
0246 process.MessageLogger.cerr.INFO = cms.untracked.PSet( limit = cms.untracked.int32(0) )
0247 process.MessageLogger.cerr.WARNING = cms.untracked.PSet( limit = cms.untracked.int32(0) )
0248 process.MessageLogger.cerr.ERROR = cms.untracked.PSet( limit = cms.untracked.int32(0) )
0249 
0250 process.MessageLogger.cerr.HLTLevel1GTSeed = cms.untracked.PSet( limit = cms.untracked.int32(-1) )