CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
customsPostLS1.py
Go to the documentation of this file.
1 
2 import FWCore.ParameterSet.Config as cms
3 
4 
5 # customize to use upgrade L1 emulation
6 
7 from L1Trigger.Configuration.L1Trigger_custom import customiseL1Menu
8 
9 # customization of run L1 emulator for 2015 run configuration
11  #print "INFO: Customising L1T emulator for 2015 run configuration"
12  #print "INFO: Customize the L1 menu"
13  # the following line will break HLT if HLT menu is not updated with the corresponding menu
14  process=customiseL1Menu(process)
15  #print "INFO: loading RCT LUTs"
16  #process.load("L1Trigger.L1TCalorimeter.caloStage1RCTLuts_cff")
17 
18  process.load("L1Trigger.L1TCommon.l1tDigiToRaw_cfi")
19  process.load("L1Trigger.L1TCommon.l1tRawToDigi_cfi")
20  process.load("L1Trigger.L1TCommon.caloStage1LegacyFormatDigis_cfi")
21 
22  process.load('L1Trigger.L1TCalorimeter.caloStage1Params_cfi')
23  process.load('L1Trigger.L1TCalorimeter.L1TCaloStage1_cff')
24 
25  if hasattr(process, 'simGtDigis'):
26  process.simGtDigis.GmtInputTag = 'simGmtDigis'
27  process.simGtDigis.GctInputTag = 'simCaloStage1LegacyFormatDigis'
28  process.simGtDigis.TechnicalTriggersInputTags = cms.VInputTag( )
29  if hasattr(process, 'gctDigiToRaw'):
30  process.gctDigiToRaw.gctInputLabel = 'simCaloStage1LegacyFormatDigis'
31 
32  if hasattr(process, 'simGctDigis'):
33  for sequence in process.sequences:
34  #print "INFO: checking sequence ", sequence
35  #print "BEFORE: ", getattr(process,sequence)
36  getattr(process,sequence).replace(process.simGctDigis,process.L1TCaloStage1)
37  #print "AFTER: ", getattr(process,sequence)
38  for path in process.paths:
39  #print "INFO: checking path ", path
40  #print "BEFORE: ", getattr(process,path)
41  getattr(process,path).replace(process.simGctDigis,process.L1TCaloStage1)
42  #print "AFTER: ", getattr(process,path)
43 
44  if hasattr(process, 'DigiToRaw'):
45  #print "INFO: customizing DigiToRaw for Stage 1"
46  #print process.DigiToRaw
47  process.l1tDigiToRaw.InputLabel = cms.InputTag("simCaloStage1FinalDigis", "")
48  process.l1tDigiToRaw.TauInputLabel = cms.InputTag("simCaloStage1FinalDigis", "rlxTaus")
49  process.l1tDigiToRaw.IsoTauInputLabel = cms.InputTag("simCaloStage1FinalDigis", "isoTaus")
50  process.l1tDigiToRaw.HFBitCountsInputLabel = cms.InputTag("simCaloStage1FinalDigis", "HFBitCounts")
51  process.l1tDigiToRaw.HFRingSumsInputLabel = cms.InputTag("simCaloStage1FinalDigis", "HFRingSums")
52  process.l1tDigiToRawSeq = cms.Sequence(process.gctDigiToRaw + process.l1tDigiToRaw);
53  process.DigiToRaw.replace(process.gctDigiToRaw, process.l1tDigiToRawSeq)
54  #print process.DigiToRaw
55  if hasattr(process, 'rawDataCollector'):
56  #print "INFO: customizing rawDataCollector for Stage 1"
57  process.rawDataCollector.RawCollectionList.append(cms.InputTag("l1tDigiToRaw"))
58  if hasattr(process, 'RawToDigi'):
59  #print "INFO: customizing L1RawToDigi for Stage 1"
60  #print process.RawToDigi
61  process.L1RawToDigiSeq = cms.Sequence(process.gctDigis+process.caloStage1Digis+process.caloStage1LegacyFormatDigis)
62  process.RawToDigi.replace(process.gctDigis, process.L1RawToDigiSeq)
63  #print process.RawToDigi
64 
65  if hasattr(process, 'HLTL1UnpackerSequence'):
66  #print "INFO: customizing HLTL1UnpackerSequence for Stage 1"
67  #print process.HLTL1UnpackerSequence
68 
69  # extend sequence to add Layer 1 unpacking and conversion back to legacy format
70  process.hltCaloStage1Digis = process.caloStage1Digis.clone()
71  process.hltCaloStage1LegacyFormatDigis = process.caloStage1LegacyFormatDigis.clone()
72  process.hltCaloStage1LegacyFormatDigis.InputCollection = cms.InputTag("hltCaloStage1Digis")
73  process.hltCaloStage1LegacyFormatDigis.InputRlxTauCollection = cms.InputTag("hltCaloStage1Digis:rlxTaus")
74  process.hltCaloStage1LegacyFormatDigis.InputIsoTauCollection = cms.InputTag("hltCaloStage1Digis:isoTaus")
75  process.hltCaloStage1LegacyFormatDigis.InputHFSumsCollection = cms.InputTag("hltCaloStage1Digis:HFRingSums")
76  process.hltCaloStage1LegacyFormatDigis.InputHFCountsCollection = cms.InputTag("hltCaloStage1Digis:HFBitCounts")
77  #process.hltL1RawToDigiSeq = cms.Sequence(process.hltGctDigis+process.hltCaloStage1 + process.hltCaloStage1LegacyFormatDigis)
78  process.hltL1RawToDigiSeq = cms.Sequence(process.hltCaloStage1Digis + process.hltCaloStage1LegacyFormatDigis)
79  process.HLTL1UnpackerSequence.replace(process.hltGctDigis, process.hltL1RawToDigiSeq)
80 
81  alist=['hltL1GtObjectMap']
82  for a in alist:
83  #print "INFO: checking for", a, "in process."
84  if hasattr(process,a):
85  #print "INFO: customizing ", a, "to use new calo Stage 1 digis converted to legacy format"
86  getattr(process, a).GctInputTag = cms.InputTag("hltCaloStage1LegacyFormatDigis")
87 
88  alist=['hltL1extraParticles']
89  for a in alist:
90  #print "INFO: checking for", a, "in process."
91  if hasattr(process,a):
92  #print "INFO: customizing ", a, "to use new calo Stage 1 digis converted to legacy format"
93  getattr(process, a).etTotalSource = cms.InputTag("hltCaloStage1LegacyFormatDigis")
94  getattr(process, a).nonIsolatedEmSource = cms.InputTag("hltCaloStage1LegacyFormatDigis","nonIsoEm")
95  getattr(process, a).etMissSource = cms.InputTag("hltCaloStage1LegacyFormatDigis")
96  getattr(process, a).htMissSource = cms.InputTag("hltCaloStage1LegacyFormatDigis")
97  getattr(process, a).forwardJetSource = cms.InputTag("hltCaloStage1LegacyFormatDigis","forJets")
98  getattr(process, a).centralJetSource = cms.InputTag("hltCaloStage1LegacyFormatDigis","cenJets")
99  getattr(process, a).tauJetSource = cms.InputTag("hltCaloStage1LegacyFormatDigis","tauJets")
100  getattr(process, a).isoTauJetSource = cms.InputTag("hltCaloStage1LegacyFormatDigis","isoTauJets")
101  getattr(process, a).isolatedEmSource = cms.InputTag("hltCaloStage1LegacyFormatDigis","isoEm")
102  getattr(process, a).etHadSource = cms.InputTag("hltCaloStage1LegacyFormatDigis")
103  getattr(process, a).hfRingEtSumsSource = cms.InputTag("hltCaloStage1LegacyFormatDigis")
104  getattr(process, a).hfRingBitCountsSource = cms.InputTag("hltCaloStage1LegacyFormatDigis")
105 
106  blist=['l1extraParticles','recoL1extraParticles','dqmL1ExtraParticles']
107  for b in blist:
108  #print "INFO: checking for", b, "in process."
109  if hasattr(process,b):
110  #print "BEFORE: ", getattr(process, b).centralJetSource
111  if (getattr(process, b).centralJetSource == cms.InputTag("simGctDigis","cenJets")):
112  getattr(process, b).etTotalSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
113  getattr(process, b).nonIsolatedEmSource = cms.InputTag("simCaloStage1LegacyFormatDigis","nonIsoEm")
114  getattr(process, b).etMissSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
115  getattr(process, b).htMissSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
116  getattr(process, b).forwardJetSource = cms.InputTag("simCaloStage1LegacyFormatDigis","forJets")
117  getattr(process, b).centralJetSource = cms.InputTag("simCaloStage1LegacyFormatDigis","cenJets")
118  getattr(process, b).tauJetSource = cms.InputTag("simCaloStage1LegacyFormatDigis","tauJets")
119  getattr(process, b).isoTauJetSource = cms.InputTag("simCaloStage1LegacyFormatDigis","isoTauJets")
120  getattr(process, b).isolatedEmSource = cms.InputTag("simCaloStage1LegacyFormatDigis","isoEm")
121  getattr(process, b).etHadSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
122  getattr(process, b).hfRingEtSumsSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
123  getattr(process, b).hfRingBitCountsSource = cms.InputTag("simCaloStage1LegacyFormatDigis")
124  else:
125  #print "INFO: customizing ", b, "to use new calo Stage 1 digis converted to legacy format"
126  getattr(process, b).etTotalSource = cms.InputTag("caloStage1LegacyFormatDigis")
127  getattr(process, b).nonIsolatedEmSource = cms.InputTag("caloStage1LegacyFormatDigis","nonIsoEm")
128  getattr(process, b).etMissSource = cms.InputTag("caloStage1LegacyFormatDigis")
129  getattr(process, b).htMissSource = cms.InputTag("caloStage1LegacyFormatDigis")
130  getattr(process, b).forwardJetSource = cms.InputTag("caloStage1LegacyFormatDigis","forJets")
131  getattr(process, b).centralJetSource = cms.InputTag("caloStage1LegacyFormatDigis","cenJets")
132  getattr(process, b).tauJetSource = cms.InputTag("caloStage1LegacyFormatDigis","tauJets")
133  getattr(process, b).isoTauJetSource = cms.InputTag("caloStage1LegacyFormatDigis","isoTauJets")
134  getattr(process, b).isolatedEmSource = cms.InputTag("caloStage1LegacyFormatDigis","isoEm")
135  getattr(process, b).etHadSource = cms.InputTag("caloStage1LegacyFormatDigis")
136  getattr(process, b).hfRingEtSumsSource = cms.InputTag("caloStage1LegacyFormatDigis")
137  getattr(process, b).hfRingBitCountsSource = cms.InputTag("caloStage1LegacyFormatDigis")
138  #print "AFTER: ", getattr(process, b).centralJetSource
139 
140 # process.MessageLogger = cms.Service(
141 # "MessageLogger",
142 # destinations = cms.untracked.vstring(
143 # 'detailedInfo',
144 # 'critical'
145 # ),
146 # detailedInfo = cms.untracked.PSet(
147 # threshold = cms.untracked.string('DEBUG')
148 # ),
149 # debugModules = cms.untracked.vstring(
150 # 'l1tDigiToRaw', 'l1tRawToDigi'
151 # )
152 # )
153 # print process.HLTSchedule
154 
155  return process
def customiseSimL1EmulatorForPostLS1