CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
customiseReEmul.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from Configuration.StandardSequences.Eras import eras
3 
5  process.load("L1Trigger.L1TCalorimeter.caloStage2Params_HWConfig_cfi")
6  return process
7 
8 def L1TAddBitwiseLayer1(process):
9  from L1Trigger.L1TCaloLayer1.simCaloStage2Layer1Digis_cfi import simCaloStage2Layer1Digis as simCaloStage2BitwiseLayer1Digis
10  from L1Trigger.L1TCalorimeter.simCaloStage2Digis_cfi import simCaloStage2Digis as simCaloStage2BitwiseDigis
11  process.simCaloStage2BitwiseLayer1Digis = simCaloStage2BitwiseLayer1Digis.clone()
12  process.simCaloStage2BitwiseLayer1Digis.ecalToken = cms.InputTag("ecalDigis:EcalTriggerPrimitives")
13  process.simCaloStage2BitwiseDigis = simCaloStage2BitwiseDigis.clone()
14  process.simCaloStage2BitwiseDigis.towerToken = cms.InputTag("simCaloStage2BitwiseLayer1Digis")
15  process.SimL1TCalorimeter = cms.Sequence( process.simCaloStage2Layer1Digis + process.simCaloStage2Digis + process.simCaloStage2BitwiseLayer1Digis + process.simCaloStage2BitwiseDigis)
16  from L1Trigger.L1TNtuples.l1UpgradeTree_cfi import l1UpgradeTree
17  process.l1UpgradeBitwiseTree = l1UpgradeTree.clone()
18  process.l1UpgradeBitwiseTree.egToken = cms.untracked.InputTag("simCaloStage2BitwiseDigis")
19  process.l1UpgradeBitwiseTree.tauTokens = cms.untracked.VInputTag("simCaloStage2BitwiseDigis")
20  process.l1UpgradeBitwiseTree.jetToken = cms.untracked.InputTag("simCaloStage2BitwiseDigis")
21  process.l1UpgradeBitwiseTree.muonToken = cms.untracked.InputTag("simGmtStage2Digis")
22  process.l1UpgradeBitwiseTree.sumToken = cms.untracked.InputTag("simCaloStage2BitwiseDigis")
23  process.l1ntuplebitwise = cms.Path(
24  process.l1UpgradeBitwiseTree
25  )
26  process.schedule.append(process.l1ntuplebitwise)
27  print "modified L1TReEmul: "
28  print process.L1TReEmul
29  return process
30 
31 # As of 80X, this ES configuration is needed for *data* GTs (mc tags work w/o)
33  process.es_pool_hf1x1 = cms.ESSource(
34  "PoolDBESSource",
35  #process.CondDBSetup,
36  timetype = cms.string('runnumber'),
37  toGet = cms.VPSet(
38  cms.PSet(record = cms.string("HcalLutMetadataRcd"),
39  tag = cms.string("HcalLutMetadata_HFTP_1x1")
40  ),
41  cms.PSet(record = cms.string("HcalElectronicsMapRcd"),
42  tag = cms.string("HcalElectronicsMap_HFTP_1x1")
43  )
44  ),
45  connect = cms.string('frontier://FrontierProd/CMS_CONDITIONS'),
46  authenticationMethod = cms.untracked.uint32(0)
47  )
48  process.es_prefer_es_pool_hf1x1 = cms.ESPrefer("PoolDBESSource", "es_pool_hf1x1")
49  return process
50 
51 def L1TReEmulFromRAW2015(process):
52  process.load('L1Trigger.Configuration.SimL1Emulator_cff')
53  process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
54  process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
55  process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
56  cms.InputTag('hcalDigis'),
57  cms.InputTag('hcalDigis')
58  )
59  process.L1TReEmul = cms.Sequence(process.simEcalTriggerPrimitiveDigis * process.simHcalTriggerPrimitiveDigis * process.SimL1Emulator)
60  process.simDtTriggerPrimitiveDigis.digiTag = 'muonDTDigis'
61  process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCComparatorDigi')
62  process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCWireDigi' )
63 
64  if eras.stage2L1Trigger.isChosen():
65  process.simTwinMuxDigis.RPC_Source = cms.InputTag('muonRPCDigis')
66  # When available, this will switch to TwinMux input Digis:
67  process.simTwinMuxDigis.DTDigi_Source = cms.InputTag("dttfDigis")
68  process.simTwinMuxDigis.DTThetaDigi_Source = cms.InputTag("dttfDigis")
69  process.simOmtfDigis.srcRPC = cms.InputTag('muonRPCDigis')
70  process.simBmtfDigis.DTDigi_Source = cms.InputTag("simTwinMuxDigis")
71  process.simBmtfDigis.DTDigi_Theta_Source = cms.InputTag("dttfDigis")
72  process.simEmtfDigis.CSCInput = cms.InputTag("csctfDigis")
73  process.simOmtfDigis.srcCSC = cms.InputTag("csctfDigis")
74  process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag("ecalDigis:EcalTriggerPrimitives")
75  process.L1TReEmulPath = cms.Path(process.L1TReEmul)
76  process.schedule.append(process.L1TReEmulPath)
77  print "L1TReEmul sequence: "
78  print process.L1TReEmul
79  print process.schedule
80  # quiet warning abouts missing Stage-2 payloads, since they won't reliably exist in 2015 data.
81  if hasattr(process, "caloStage2Digis"):
82  process.caloStage2Digis.MinFeds = cms.uint32(0)
83  if hasattr(process, "gmtStage2Digis"):
84  process.gmtStage2Digis.MinFeds = cms.uint32(0)
85  if hasattr(process, "gtStage2Digis"):
86  process.gtStage2Digis.MinFeds = cms.uint32(0)
87  return process
88  else:
89  process.simRctDigis.ecalDigis = cms.VInputTag('simEcalTriggerPrimitiveDigis')
90  process.simRctDigis.hcalDigis = cms.VInputTag('simHcalTriggerPrimitiveDigis')
91  process.simRpcTriggerDigis.label = 'muonRPCDigis'
92  process.simRpcTechTrigDigis.RPCDigiLabel = 'muonRPCDigis'
93  process.L1TReEmulPath = cms.Path(process.L1TReEmul)
94  process.schedule.append(process.L1TReEmulPath)
95  print "L1TReEmul sequence: "
96  print process.L1TReEmul
97  print process.schedule
98  return process
99 
101  L1TReEmulFromRAW2015(process)
102  if eras.stage2L1Trigger.isChosen():
103  process.simEmtfDigis.CSCInput = cms.InputTag('simCscTriggerPrimitiveDigis','MPCSORTED')
104  process.simOmtfDigis.srcCSC = cms.InputTag('simCscTriggerPrimitiveDigis','MPCSORTED')
105  return process
106 
108  L1TReEmulFromRAW2015(process)
109  if eras.stage2L1Trigger.isChosen():
110  process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag("simEcalTriggerPrimitiveDigis")
111  return process
112 
113 def L1TReEmulFromRAW(process):
114  process.load('L1Trigger.Configuration.SimL1Emulator_cff')
115  process.load('L1Trigger.Configuration.CaloTriggerPrimitives_cff')
116  process.simEcalTriggerPrimitiveDigis.Label = 'ecalDigis'
117  process.simHcalTriggerPrimitiveDigis.inputLabel = cms.VInputTag(
118  cms.InputTag('hcalDigis'),
119  cms.InputTag('hcalDigis')
120  )
121  process.simCscTriggerPrimitiveDigis.CSCComparatorDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCComparatorDigi')
122  process.simCscTriggerPrimitiveDigis.CSCWireDigiProducer = cms.InputTag( 'muonCSCDigis', 'MuonCSCWireDigi' )
123  process.L1TReEmul = cms.Sequence(process.simEcalTriggerPrimitiveDigis * process.simHcalTriggerPrimitiveDigis * process.SimL1Emulator)
124  if eras.stage2L1Trigger.isChosen():
125  #cutlist=['simDtTriggerPrimitiveDigis','simCscTriggerPrimitiveDigis']
126  #for b in cutlist:
127  # process.SimL1Emulator.remove(getattr(process,b))
128  # TwinMux
129  process.simTwinMuxDigis.RPC_Source = cms.InputTag('muonRPCDigis')
130  process.simTwinMuxDigis.DTDigi_Source = cms.InputTag('bmtfDigis')
131  process.simTwinMuxDigis.DTThetaDigi_Source = cms.InputTag('bmtfDigis')
132  # BMTF
133  process.simBmtfDigis.DTDigi_Source = cms.InputTag('bmtfDigis')
134  process.simBmtfDigis.DTDigi_Theta_Source = cms.InputTag('bmtfDigis')
135  # OMTF
136  process.simOmtfDigis.srcRPC = cms.InputTag('muonRPCDigis')
137  process.simOmtfDigis.srcCSC = cms.InputTag('csctfDigis')
138  process.simOmtfDigis.srcDTPh = cms.InputTag('bmtfDigis')
139  process.simOmtfDigis.srcDTTh = cms.InputTag('bmtfDigis')
140  # EMTF
141  process.simEmtfDigis.CSCInput = cms.InputTag('csctfDigis')
142  # Calo Layer1
143  process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag('ecalDigis:EcalTriggerPrimitives')
144  process.simCaloStage2Layer1Digis.hcalToken = cms.InputTag('hcalDigis:')
145  process.L1TReEmulPath = cms.Path(process.L1TReEmul)
146  process.schedule.append(process.L1TReEmulPath)
147  print "L1TReEmulPath sequence: "
148  print process.L1TReEmulPath
149  print process.schedule
150  return process
151  else:
152  process.simRctDigis.ecalDigis = cms.VInputTag( cms.InputTag( 'ecalDigis:EcalTriggerPrimitives' ) )
153  process.simRctDigis.hcalDigis = cms.VInputTag('hcalDigis:')
154  process.simRpcTriggerDigis.label = 'muonRPCDigis'
155  process.L1TReEmulPath = cms.Path(process.L1TReEmul)
156  process.schedule.append(process.L1TReEmulPath)
157  print "L1TReEmul sequence: "
158  print process.L1TReEmul
159  print process.schedule
160  return process
161 
162 def L1TReEmulMCFromRAW(process):
163  L1TReEmulFromRAW(process)
164  if eras.stage2L1Trigger.isChosen():
165  process.simEmtfDigis.CSCInput = cms.InputTag('simCscTriggerPrimitiveDigis','MPCSORTED')
166  process.simOmtfDigis.srcCSC = cms.InputTag('simCscTriggerPrimitiveDigis','MPCSORTED')
167  return process
168 
170  L1TReEmulFromRAW(process)
171  if eras.stage2L1Trigger.isChosen():
172  process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag("simEcalTriggerPrimitiveDigis")
173  return process
174 
176  L1TReEmulFromRAW(process)
177  if eras.stage2L1Trigger.isChosen():
178  # TwinMux
179  process.simTwinMuxDigis.RPC_Source = cms.InputTag('muonRPCDigis')
180  process.simTwinMuxDigis.DTDigi_Source = cms.InputTag('simDtTriggerPrimitiveDigis')
181  process.simTwinMuxDigis.DTThetaDigi_Source = cms.InputTag('simDtTriggerPrimitiveDigis')
182  # BMTF
183  process.simBmtfDigis.DTDigi_Source = cms.InputTag('simTwinMuxDigis')
184  process.simBmtfDigis.DTDigi_Theta_Source = cms.InputTag('simDtTriggerPrimitiveDigis')
185  # OMTF
186  process.simOmtfDigis.srcRPC = cms.InputTag('muonRPCDigis')
187  process.simOmtfDigis.srcCSC = cms.InputTag('simCscTriggerPrimitiveDigis')
188  process.simOmtfDigis.srcDTPh = cms.InputTag('simDtTriggerPrimitiveDigis')
189  process.simOmtfDigis.srcDTTh = cms.InputTag('simDtTriggerPrimitiveDigis')
190  # EMTF
191  process.simEmtfDigis.CSCInput = cms.InputTag('simCscTriggerPrimitiveDigis')
192  # Layer1
193  process.simCaloStage2Layer1Digis.ecalToken = cms.InputTag("simEcalTriggerPrimitiveDigis")
194  process.simCaloStage2Layer1Digis.hcalToken = cms.InputTag('simHcalTriggerPrimitiveDigis')
195  return process
196 
def L1TCaloStage2ParamsForHW
def L1TReEmulFromRAW2015simCaloTP