CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
customiseL1Ntuple.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 import os
3 
4 ##############################################################################
5 # customisations for L1 ntuple generation
6 #
7 # Add new customisations to this file!
8 #
9 # Example usage :
10 # cmsDriver.py testNtuple -s NONE --customise=L1Trigger/L1TNtuples/customiseL1Ntuple.customiseL1NtupleAOD --conditions=auto:run2_mc_50ns --filein='/store/relval/CMSSW_7_5_0_pre1/RelValProdTTbar_13/AODSIM/MCRUN2_74_V7-v1/00000/48159643-5EE3-E411-818F-0025905A48F0.root' -n 100
11 #
12 ##############################################################################
13 
14 def L1NtupleTFileOut(process):
15 
16  process.TFileService = cms.Service(
17  "TFileService",
18  fileName = cms.string('L1Ntuple.root')
19  )
20 
21  return process
22 
24 
25 
26 def L1NtupleAOD(process):
27 
28  L1NtupleTFileOut(process)
29  L1NtupleCustomReco(process)
30 
31  process.load('L1Trigger.L1TNtuples.L1NtupleAOD_cff')
32  process.l1ntupleaod = cms.Path(
33  process.L1NtupleAOD
34  )
35 
36  process.schedule.append(process.l1ntupleaod)
37 
38  return process
39 
40 def L1NtupleAODCalo(process):
41 
42  L1NtupleTFileOut(process)
43  L1NtupleCustomReco(process)
44 
45  process.load('L1Trigger.L1TNtuples.L1NtupleAODCalo_cff')
46  process.l1ntupleaodcalo = cms.Path(
47  process.L1NtupleAODCalo
48  )
49 
50  process.schedule.append(process.l1ntupleaodcalo)
51 
52  return process
53 
54 
55 def L1NtupleAOD_MC(process):
56 
57  L1NtupleAOD(process)
58 
59  process.l1JetRecoTree.jecToken = cms.untracked.InputTag("ak4PFCHSL1FastL2L3Corrector")
60 
61  return process
62 
63 
64 
65 def L1NtupleRAW(process):
66 
67  L1NtupleTFileOut(process)
68 
69  process.load('L1Trigger.L1TNtuples.L1NtupleRAW_cff')
70  process.l1ntupleraw = cms.Path(
71  process.L1NtupleRAW
72  )
73 
74  process.schedule.append(process.l1ntupleraw)
75 
76  # for 5 BX of candidates in L1Extra
77  if "gctDigis" in process.producers:
78  process.gctDigis.numberOfGctSamplesToUnpack = cms.uint32(5)
79 
80  if "l1extraParticles" in process.producers:
81  process.l1extraParticles.centralBxOnly = cms.bool(False)
82 
83  return process
84 
85 def L1NtupleNANO(process):
86 
87  L1NtupleTFileOut(process)
88 
89  process.load('L1Trigger.L1TNtuples.L1NtupleNANO_cff')
90  process.l1ntuplenano = cms.Path(
91  process.L1NtupleNANO
92  )
93 
94  process.schedule.append(process.l1ntuplenano)
95 
96  return process
97 
98 def L1NtupleRAWCalo(process):
99 
100  L1NtupleTFileOut(process)
101 
102  process.load('L1Trigger.L1TNtuples.L1NtupleRAWCalo_cff')
103  process.l1ntuplerawcalo = cms.Path(
104  process.L1NtupleRAWCalo
105  )
106 
107  process.schedule.append(process.l1ntuplerawcalo)
108 
109  return process
110 
111 
112 def L1NtupleEMU(process):
113 
114  L1NtupleTFileOut(process)
115 
116  process.load('L1Trigger.L1TNtuples.L1NtupleEMU_cff')
117  process.l1ntupleemu = cms.Path(
118  process.L1NtupleEMU
119  )
120 
121  process.schedule.append(process.l1ntupleemu)
122 
123  return process
124 
125 def L1NtupleEMUCalo(process):
126 
127  L1NtupleTFileOut(process)
128 
129  process.load('L1Trigger.L1TNtuples.L1NtupleEMUCalo_cff')
130  process.l1ntupleemucalo = cms.Path(
131  process.L1NtupleEMUCalo
132  )
133 
134  process.schedule.append(process.l1ntupleemucalo)
135 
136  return process
137 
138 
139 def L1NtupleEMULegacy(process):
140 
141  L1NtupleTFileOut(process)
142 
143  process.load('L1Trigger.L1TNtuples.L1NtupleEMULegacy_cff')
144  process.l1ntupleemulegacy = cms.Path(
145  process.L1NtupleEMULegacy
146  )
147 
148  process.schedule.append(process.l1ntupleemulegacy)
149 
150  return process
151 
152 
153 def L1NtupleGEN(process):
154 
155  L1NtupleTFileOut(process)
156 
157  process.load('L1Trigger.L1TNtuples.L1NtupleGEN_cff')
158  process.l1ntuplegen = cms.Path(
159  process.L1NtupleGEN
160  )
161 
162  process.schedule.append(process.l1ntuplegen)
163 
164  return process
165 
166 
167 def L1NtupleRAWEMU(process):
168 
169  L1NtupleRAW(process)
170  L1NtupleEMU(process)
171 
172  return process
173 
174 def L1NtupleRAWEMUCalo(process):
175 
176  L1NtupleRAWCalo(process)
177  L1NtupleEMUCalo(process)
178 
179  return process
180 
181 def L1NtupleNANOEMU(process):
182 
183  L1NtupleNANO(process)
184  process.load('L1Trigger.L1TNtuples.L1NtupleEMU_cff')
185 
186  process.L1NtupleGTEMU = cms.Sequence( process.l1uGTEmuTree )
187  process.l1ntuplegtemu = cms.Path(
188  process.L1NtupleGTEMU
189  )
190  process.schedule.append(process.l1ntuplegtemu)
191 
192  return process
193 
194 def L1NtupleRAWEMULegacy(process):
195 
196  L1NtupleRAW(process)
197  L1NtupleEMU(process)
198  L1NtupleEMULegacy(process)
199 
200  return process
201 
202 
203 def L1NtupleAODRAW(process):
204 
205  L1NtupleRAW(process)
206  L1NtupleAOD(process)
207 
208  return process
209 
210 def L1NtupleAODRAWCalo(process):
211 
212  L1NtupleRAWCalo(process)
213  L1NtupleAODCalo(process)
214 
215  return process
216 
218 
219  L1NtupleRAW(process)
220  L1NtupleEMU(process)
221  L1NtupleEMULegacy(process)
222  L1NtupleAOD(process)
223 
224  return process
225 
226 
227 def L1NtupleAODRAWEMU(process):
228 
229  L1NtupleRAW(process)
230  L1NtupleEMU(process)
231  L1NtupleAOD(process)
232 
233  return process
234 
236 
237  L1NtupleRAWCalo(process)
238  L1NtupleEMUCalo(process)
239  L1NtupleAODCalo(process)
240 
241  return process
242 
243 def L1NtupleAODEMU(process):
244 
245  L1NtupleEMU(process)
246  L1NtupleAOD(process)
247 
248  return process
249 
250 def L1NtupleAODEMUCalo(process):
251 
252  L1NtupleEMUCalo(process)
253  L1NtupleAODCalo(process)
254 
255  return process
256 
257 
258 def L1NtupleAODEMU_MC(process):
259 
260  L1NtupleEMU(process)
261  L1NtupleAOD_MC(process)
262 
263  return process
264 
265 
266 def L1NtupleRAWEMUGEN_MC(process):
267 
268  L1NtupleRAW(process)
269  L1NtupleEMU(process)
270  L1NtupleGEN(process)
271 
272  return process
273 
274 def L1NtupleAODEMUGEN_MC(process):
275 
276  L1NtupleEMU(process)
277  L1NtupleAOD_MC(process)
278  L1NtupleGEN(process)
279 
280  return process
281 
283 
284  L1NtupleRAW(process)
285  L1NtupleEMU(process)
286  L1NtupleAOD_MC(process)
287  L1NtupleGEN(process)
288 
289  return process
290 
292 
293  L1NtupleTFileOut(process)
294 
295  process.load('L1Trigger.L1TNtuples.L1NtupleEMU_cff')
296  process.L1NtupleEMU = cms.Sequence( process.l1CaloTowerEmuTree+process.l1UpgradeEmuTree+process.l1UpgradeTfMuonEmuTree )
297  process.l1ntuplesim = cms.Path(
298  process.L1NtupleEMU
299  )
300  process.schedule.append(process.l1ntuplesim)
301 
302  return process
303 
304 def PrefireVetoFilter(process):
305 
306  process.load('EventFilter.L1TRawToDigi.triggerRulePrefireVetoFilter_cfi')
307 
308  if hasattr(process, 'l1ntupleraw'):
309  process.l1ntupleraw.insert(0,process.triggerRulePrefireVetoFilter)
310  if hasattr(process, 'l1ntupleemu'):
311  process.l1ntupleemu.insert(0,process.triggerRulePrefireVetoFilter)
312  if hasattr(process, 'l1ntupleaod'):
313  process.l1ntupleaod.insert(0,process.triggerRulePrefireVetoFilter)
314  if hasattr(process, 'l1ntuplerawcalo'):
315  process.l1ntuplerawcalo.insert(0,process.triggerRulePrefireVetoFilter)
316  if hasattr(process, 'l1ntupleemucalo'):
317  process.l1ntupleemucalo.insert(0,process.triggerRulePrefireVetoFilter)
318  if hasattr(process, 'l1ntupleaodcalo'):
319  process.l1ntupleaodcalo.insert(0,process.triggerRulePrefireVetoFilter)
320 
321  return process
def L1NtupleTFileOut
customisations for L1 ntuple generation