CMS 3D CMS Logo

customiseReEmulateCaloLayer2.py
Go to the documentation of this file.
1 
2 import FWCore.ParameterSet.Config as cms
3 
4 def reEmulateLayer2(process):
5 
6  process.load('L1Trigger/L1TCalorimeter/simCaloStage2Digis_cfi')
7  #process.load('L1Trigger.L1TCalorimeter.caloStage2Params_2016_v3_3_1_HI_cfi')
8  process.load('L1Trigger.L1TCalorimeter.caloStage2Params_2017_v2_1_cfi')
9 
10  process.simCaloStage2Digis.towerToken = cms.InputTag("caloStage2Digis", "CaloTower")
11 
12  process.caloLayer2 = cms.Path(process.simCaloStage2Digis)
13 
14  process.schedule.append(process.caloLayer2)
15 
16  return process
17 
18 
19 def hwEmulCompHistos(process):
20 
21  process.TFileService = cms.Service("TFileService",
22  fileName = cms.string("l1tCalo_2016_simHistos.root"),
23  closeFileFast = cms.untracked.bool(True)
24  )
25 
26  # histograms
27  process.load('L1Trigger.L1TCalorimeter.l1tStage2CaloAnalyzer_cfi')
28  process.l1tStage2CaloAnalyzer.doEvtDisp = False
29  process.l1tStage2CaloAnalyzer.mpBx = 0
30  process.l1tStage2CaloAnalyzer.dmxBx = 0
31  process.l1tStage2CaloAnalyzer.allBx = False
32  process.l1tStage2CaloAnalyzer.towerToken = cms.InputTag("simCaloStage2Digis", "MP")
33  process.l1tStage2CaloAnalyzer.clusterToken = cms.InputTag("None")
34  process.l1tStage2CaloAnalyzer.mpEGToken = cms.InputTag("simCaloStage2Digis", "MP")
35  process.l1tStage2CaloAnalyzer.mpTauToken = cms.InputTag("simCaloStage2Digis", "MP")
36  process.l1tStage2CaloAnalyzer.mpJetToken = cms.InputTag("simCaloStage2Digis", "MP")
37  process.l1tStage2CaloAnalyzer.mpEtSumToken = cms.InputTag("simCaloStage2Digis", "MP")
38  process.l1tStage2CaloAnalyzer.egToken = cms.InputTag("simCaloStage2Digis")
39  process.l1tStage2CaloAnalyzer.tauToken = cms.InputTag("simCaloStage2Digis")
40  process.l1tStage2CaloAnalyzer.jetToken = cms.InputTag("simCaloStage2Digis")
41  process.l1tStage2CaloAnalyzer.etSumToken = cms.InputTag("simCaloStage2Digis")
42 
43  import L1Trigger.L1TCalorimeter.l1tStage2CaloAnalyzer_cfi
44  process.l1tCaloStage2HwHistos = L1Trigger.L1TCalorimeter.l1tStage2CaloAnalyzer_cfi.l1tStage2CaloAnalyzer.clone()
45  process.l1tCaloStage2HwHistos.doEvtDisp = False
46  process.l1tCaloStage2HwHistos.mpBx = 0
47  process.l1tCaloStage2HwHistos.dmxBx = 0
48  process.l1tCaloStage2HwHistos.allBx = False
49  process.l1tCaloStage2HwHistos.towerToken = cms.InputTag("caloStage2Digis", "CaloTower")
50  process.l1tCaloStage2HwHistos.clusterToken = cms.InputTag("None")
51  process.l1tCaloStage2HwHistos.mpEGToken = cms.InputTag("caloStage2Digis", "MP")
52  process.l1tCaloStage2HwHistos.mpTauToken = cms.InputTag("caloStage2Digis","MP")
53  process.l1tCaloStage2HwHistos.mpJetToken = cms.InputTag("caloStage2Digis", "MP")
54  process.l1tCaloStage2HwHistos.mpEtSumToken = cms.InputTag("caloStage2Digis", "MP")
55  process.l1tCaloStage2HwHistos.egToken = cms.InputTag("caloStage2Digis", "EGamma")
56  process.l1tCaloStage2HwHistos.tauToken = cms.InputTag("caloStage2Digis", "Tau")
57  process.l1tCaloStage2HwHistos.jetToken = cms.InputTag("caloStage2Digis", "Jet")
58  process.l1tCaloStage2HwHistos.etSumToken = cms.InputTag("caloStage2Digis", "EtSum")
59 
60  process.hwEmulHistos = cms.Path(
61  process.l1tStage2CaloAnalyzer
62  +process.l1tCaloStage2HwHistos
63  )
64 
65  process.schedule.append(process.hwEmulHistos)
66 
67  return process
68 
69 
71 
72  process.load('EventFilter.L1TRawToDigi.caloTowersFilter_cfi')
73 
74  reEmulateLayer2(process)
75  hwEmulCompHistos(process)
76 
77  #process.l1ntupleraw.insert(0,process.caloTowersFilter)
78  #process.l1ntuplesim.insert(0,process.caloTowersFilter)
79  process.caloLayer2.insert(0,process.caloTowersFilter)
80  process.hwEmulHistos.insert(0,process.caloTowersFilter)
81 
82  return process
83