Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:42

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 static_config = 'L1Trigger.L1TCalorimeter.caloParams_2018_v1_4_cfi'
0004 
0005 def hwEmulCompHistos(process):
0006     
0007     process.TFileService = cms.Service("TFileService",
0008                                        fileName = cms.string("l1tCalo_2016_simHistos.root"),
0009                                        closeFileFast = cms.untracked.bool(True)
0010                                        )
0011     
0012     # histograms
0013     process.load('L1Trigger.L1TCalorimeter.l1tStage2CaloAnalyzer_cfi')
0014     process.l1tStage2CaloAnalyzer.doEvtDisp = False
0015     process.l1tStage2CaloAnalyzer.mpBx = 0
0016     process.l1tStage2CaloAnalyzer.dmxBx = 0
0017     process.l1tStage2CaloAnalyzer.allBx = False
0018     process.l1tStage2CaloAnalyzer.towerToken = cms.InputTag("simCaloStage2Digis", "MP")
0019     process.l1tStage2CaloAnalyzer.clusterToken = cms.InputTag("None")
0020     process.l1tStage2CaloAnalyzer.mpEGToken = cms.InputTag("simCaloStage2Digis", "MP")
0021     process.l1tStage2CaloAnalyzer.mpTauToken = cms.InputTag("simCaloStage2Digis", "MP")
0022     process.l1tStage2CaloAnalyzer.mpJetToken = cms.InputTag("simCaloStage2Digis", "MP")
0023     process.l1tStage2CaloAnalyzer.mpEtSumToken = cms.InputTag("simCaloStage2Digis", "MP")
0024     process.l1tStage2CaloAnalyzer.egToken = cms.InputTag("simCaloStage2Digis")
0025     process.l1tStage2CaloAnalyzer.tauToken = cms.InputTag("simCaloStage2Digis")
0026     process.l1tStage2CaloAnalyzer.jetToken = cms.InputTag("simCaloStage2Digis")
0027     process.l1tStage2CaloAnalyzer.etSumToken = cms.InputTag("simCaloStage2Digis")
0028     
0029     import L1Trigger.L1TCalorimeter.l1tStage2CaloAnalyzer_cfi
0030     process.l1tCaloStage2HwHistos =  L1Trigger.L1TCalorimeter.l1tStage2CaloAnalyzer_cfi.l1tStage2CaloAnalyzer.clone()
0031     process.l1tCaloStage2HwHistos.doEvtDisp = False
0032     process.l1tCaloStage2HwHistos.mpBx = 0
0033     process.l1tCaloStage2HwHistos.dmxBx = 0
0034     process.l1tCaloStage2HwHistos.allBx = False
0035     process.l1tCaloStage2HwHistos.towerToken = cms.InputTag("caloStage2Digis", "CaloTower")
0036     process.l1tCaloStage2HwHistos.clusterToken = cms.InputTag("None")
0037     process.l1tCaloStage2HwHistos.mpEGToken = cms.InputTag("caloStage2Digis", "MP")
0038     process.l1tCaloStage2HwHistos.mpTauToken = cms.InputTag("caloStage2Digis","MP")
0039     process.l1tCaloStage2HwHistos.mpJetToken = cms.InputTag("caloStage2Digis", "MP")
0040     process.l1tCaloStage2HwHistos.mpEtSumToken = cms.InputTag("caloStage2Digis", "MP")
0041     process.l1tCaloStage2HwHistos.egToken = cms.InputTag("caloStage2Digis", "EGamma")
0042     process.l1tCaloStage2HwHistos.tauToken = cms.InputTag("caloStage2Digis", "Tau")
0043     process.l1tCaloStage2HwHistos.jetToken = cms.InputTag("caloStage2Digis", "Jet")
0044     process.l1tCaloStage2HwHistos.etSumToken = cms.InputTag("caloStage2Digis", "EtSum")
0045 
0046     process.hwEmulHistos = cms.Path(
0047         process.l1tStage2CaloAnalyzer
0048         +process.l1tCaloStage2HwHistos
0049     )
0050 
0051     process.schedule.append(process.hwEmulHistos)
0052 
0053     return process
0054 
0055 
0056 def L1NtupleRAWEMU(process):
0057 
0058     process.load('L1Trigger.L1TNtuples.L1NtupleRAW_cff')
0059     process.load('L1Trigger.L1TNtuples.L1NtupleEMU_cff')
0060 
0061     process.l1ntuplerawemu = cms.Path( process.L1NtupleRAW
0062                                     + process.L1NtupleEMU )
0063     process.schedule.append(process.l1ntuplerawemu)
0064     
0065     return process
0066 
0067 def reEmul(process, useStatic=False, ntuple=False):
0068 
0069     process.load('EventFilter.L1TRawToDigi.caloTowersFilter_cfi')
0070     process.load('L1Trigger/L1TCalorimeter/simCaloStage2Digis_cfi')
0071     if useStatic:
0072         process.simCaloStage2Digis.useStaticConfig = True
0073         process.load(static_config)
0074     else:
0075         process.load('L1Trigger.Configuration.SimL1Emulator_cff')
0076 
0077     if not ntuple:
0078         process.filterPath = cms.Path(process.caloTowersFilter)
0079         process.skimOutput = cms.OutputModule("PoolOutputModule",
0080             #compressionAlgorithm = cms.untracked.string('LZMA'),
0081             #compressionLevel = cms.untracked.int32(4),
0082             #dropMetaData = cms.untracked.string('NONE'),
0083             #fastCloning = cms.untracked.bool(True),
0084             fileName = cms.untracked.string("comp.root"),
0085             #overrideInputFileSplitLevels = cms.untracked.bool(False),
0086             outputCommands = cms.untracked.vstring(
0087                 'keep *_caloStage2Digis_*_*',
0088                 'keep *_simCaloStage2Digis_*_*',
0089             ),
0090             SelectEvents = cms.untracked.PSet(
0091                 SelectEvents = cms.vstring(
0092                      'filterPath',
0093                 )
0094             ),
0095         )
0096         process.output_step = cms.EndPath(process.skimOutput)
0097 
0098         process.schedule = cms.Schedule(
0099             process.filterPath,
0100             process.output_step,
0101         )
0102 
0103     process.simCaloStage2Digis.towerToken = cms.InputTag("caloStage2Digis", "CaloTower")
0104     process.caloLayer2 = cms.Path(process.simCaloStage2Digis)
0105 
0106     process.schedule.append(process.caloLayer2)
0107 
0108     hwEmulCompHistos(process)
0109     if ntuple:
0110         L1NtupleRAWEMU(process)
0111         process.l1ntuplerawemu.insert(0,process.caloTowersFilter)
0112 
0113     process.caloLayer2.insert(0,process.caloTowersFilter)
0114     process.hwEmulHistos.insert(0,process.caloTowersFilter)
0115 
0116 
0117 def valHistosDB(process):
0118 
0119     reEmul(process, useStatic=False, ntuple=False)
0120     return process
0121 
0122 
0123 def valHistosStatic(process):
0124 
0125     reEmul(process, useStatic=True, ntuple=False)
0126     return process
0127 
0128 def valHistosDBL1Ntuple(process):
0129 
0130     reEmul(process, useStatic=False, ntuple=True)
0131     return process
0132 
0133 
0134 def valHistosStaticL1Ntuple(process):
0135 
0136     reEmul(process, useStatic=True, ntuple=True)
0137     return process
0138 
0139 
0140 
0141