CMS 3D CMS Logo

l1ParticleFlow_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 from L1Trigger.Phase2L1ParticleFlow.pfTracksFromL1Tracks_cfi import pfTracksFromL1Tracks
4 from L1Trigger.Phase2L1ParticleFlow.pfClustersFromL1EGClusters_cfi import pfClustersFromL1EGClusters
5 from L1Trigger.Phase2L1ParticleFlow.pfClustersFromCombinedCalo_cfi import pfClustersFromCombinedCalo
6 from L1Trigger.Phase2L1ParticleFlow.l1pfProducer_cfi import l1pfProducer
7 
8 # Using phase2_hgcalV10 to customize the config for all 106X samples, since there's no other modifier for it
9 from Configuration.Eras.Modifier_phase2_hgcalV10_cff import phase2_hgcalV10
10 from Configuration.Eras.Modifier_phase2_hgcalV11_cff import phase2_hgcalV11
11 
12 # Calorimeter part: ecal + hcal + hf only
13 pfClustersFromCombinedCaloHCal = pfClustersFromCombinedCalo.clone(
14  hcalHGCTowers = [], hcalDigis = [],
15  hcalDigisBarrel = True, hcalDigisHF = False,
16  hadCorrector = cms.string("L1Trigger/Phase2L1ParticleFlow/data/hadcorr_barrel.root"),
17  resol = cms.PSet(
18  etaBins = cms.vdouble( 0.700, 1.200, 1.600),
19  offset = cms.vdouble( 2.582, 2.191, -0.077),
20  scale = cms.vdouble( 0.122, 0.143, 0.465),
21  kind = cms.string('calo'),
22  ))
23 phase2_hgcalV10.toModify(pfClustersFromCombinedCaloHCal,
24  hadCorrector = "L1Trigger/Phase2L1ParticleFlow/data/hadcorr_barrel_106X.root",
25  resol = cms.PSet(
26  etaBins = cms.vdouble( 0.700, 1.200, 1.600),
27  offset = cms.vdouble( 3.084, 2.715, 0.107),
28  scale = cms.vdouble( 0.118, 0.130, 0.442),
29  kind = cms.string('calo'),
30  )
31 )
32 phase2_hgcalV11.toModify(pfClustersFromCombinedCaloHCal,
33  hadCorrector = "L1Trigger/Phase2L1ParticleFlow/data/hadcorr_barrel_110X.root",
34  resol = cms.PSet(
35  etaBins = cms.vdouble( 0.700, 1.200, 1.600),
36  offset = cms.vdouble( 2.909, 2.864, 0.294),
37  scale = cms.vdouble( 0.119, 0.127, 0.442),
38  kind = cms.string('calo'),
39  )
40 )
41 
42 pfTracksFromL1TracksBarrel = pfTracksFromL1Tracks.clone(
43  resolCalo = pfClustersFromCombinedCaloHCal.resol.clone(),
44 )
45 
46 pfClustersFromCombinedCaloHF = pfClustersFromCombinedCalo.clone(
47  ecalCandidates = [], hcalHGCTowers = [],
48  phase2barrelCaloTowers = [],
49  hadCorrector = cms.string("L1Trigger/Phase2L1ParticleFlow/data/hfcorr.root"),
50  resol = cms.PSet(
51  etaBins = cms.vdouble( 3.500, 4.000, 4.500, 5.000),
52  offset = cms.vdouble( 1.099, 0.930, 1.009, 1.369),
53  scale = cms.vdouble( 0.152, 0.151, 0.144, 0.179),
54  kind = cms.string('calo'),
55  ))
56 phase2_hgcalV10.toModify(pfClustersFromCombinedCaloHF,
57  hcalCandidates = cms.VInputTag(cms.InputTag("hgcalBackEndLayer2Producer","HGCalBackendLayer2Processor3DClustering")),
58  hadCorrector = "L1Trigger/Phase2L1ParticleFlow/data/hfcorr_106X.root",
59  resol = cms.PSet(
60  etaBins = cms.vdouble( 3.500, 4.000, 4.500, 5.000),
61  offset = cms.vdouble(-0.846, 0.696, 1.313, 1.044),
62  scale = cms.vdouble( 0.815, 0.164, 0.146, 0.192),
63  kind = cms.string('calo'),
64  )
65 )
66 phase2_hgcalV11.toModify(pfClustersFromCombinedCaloHF,
67  hcalCandidates = cms.VInputTag(cms.InputTag("hgcalBackEndLayer2Producer","HGCalBackendLayer2Processor3DClustering")),
68  hadCorrector = "L1Trigger/Phase2L1ParticleFlow/data/hfcorr_110X.root",
69  resol = cms.PSet(
70  etaBins = cms.vdouble( 3.500, 4.000, 4.500, 5.000),
71  offset = cms.vdouble(-1.125, 1.220, 1.514, 1.414),
72  scale = cms.vdouble( 0.868, 0.159, 0.148, 0.194),
73  kind = cms.string('calo'),
74  )
75 )
76 
77 # Calorimeter part: hgcal
78 from L1Trigger.Phase2L1ParticleFlow.pfClustersFromHGC3DClusters_cfi import pfClustersFromHGC3DClusters
79 
80 l1ParticleFlow_calo_Task = cms.Task(
81  pfClustersFromL1EGClusters ,
82  pfClustersFromCombinedCaloHCal ,
83  pfClustersFromCombinedCaloHF ,
84  pfClustersFromHGC3DClusters
85 )
86 l1ParticleFlow_calo = cms.Sequence(l1ParticleFlow_calo_Task)
87 
88 
89 # PF in the barrel
90 l1pfProducerBarrel = l1pfProducer.clone(
91  # inputs
92  tracks = cms.InputTag('pfTracksFromL1TracksBarrel'),
93  emClusters = [ cms.InputTag('pfClustersFromL1EGClusters') ],
94  hadClusters = [ cms.InputTag('pfClustersFromCombinedCaloHCal:calibrated') ],
95  # track-based PUPPI
96  puppiUsingBareTracks = True,
97  puppiDrMin = 0.07,
98  puppiPtMax = 50.,
99  vtxAlgo = "external",
100  vtxFormat = cms.string("TkPrimaryVertex"),
101  vtxCollection = cms.InputTag("L1TkPrimaryVertex",""),
102  # puppi tuning
103  puAlgo = "LinearizedPuppi",
104  puppiEtaCuts = cms.vdouble( 1.6 ), # just one bin
105  puppiPtCuts = cms.vdouble( 1.0 ),
106  puppiPtCutsPhotons = cms.vdouble( 1.0 ),
107  puppiPtSlopes = cms.vdouble( 0.3 ), # coefficient for pT
108  puppiPtSlopesPhotons = cms.vdouble( 0.3 ),
109  puppiPtZeros = cms.vdouble( 4.0 ), # ballpark pT from PU
110  puppiPtZerosPhotons = cms.vdouble( 2.5 ),
111  puppiAlphaSlopes = cms.vdouble( 0.7 ), # coefficient for alpha
112  puppiAlphaSlopesPhotons = cms.vdouble( 0.7 ),
113  puppiAlphaZeros = cms.vdouble( 6.0 ), # ballpark alpha from PU
114  puppiAlphaZerosPhotons = cms.vdouble( 6.0 ),
115  puppiAlphaCrops = cms.vdouble( 4 ), # max. absolute value for alpha term
116  puppiAlphaCropsPhotons = cms.vdouble( 4 ),
117  puppiPriors = cms.vdouble( 5.0 ),
118  puppiPriorsPhotons = cms.vdouble( 1.0 ),
119  # regionalize
120  useRelativeRegionalCoordinates = cms.bool(False),
121  trackRegionMode = cms.string("atCalo"),
122  regions = cms.VPSet(
123  cms.PSet(
124  etaBoundaries = cms.vdouble(-1.5,1.5),
125  phiSlices = cms.uint32(1),
126  etaExtra = cms.double(0.3),
127  phiExtra = cms.double(0.0)
128  ),
129  ),
130 )
131 l1ParticleFlow_pf_barrel_Task = cms.Task(
132  pfTracksFromL1TracksBarrel ,
133  l1pfProducerBarrel
134 )
135 l1ParticleFlow_pf_barrel = cms.Sequence(l1ParticleFlow_pf_barrel_Task)
136 
137 
138 
139 # PF in HGCal
140 pfTracksFromL1TracksHGCal = pfTracksFromL1Tracks.clone(
141  resolCalo = pfClustersFromHGC3DClusters.resol.clone(),
142 )
143 l1pfProducerHGCal = l1pfProducer.clone(
144  # algo
145  pfAlgo = "PFAlgo2HGC",
146  # inputs
147  tracks = cms.InputTag('pfTracksFromL1TracksHGCal'),
148  emClusters = [ ], # EM clusters are not used (only added to NTuple for calibration/monitoring)
149  hadClusters = [ cms.InputTag("pfClustersFromHGC3DClusters") ],
150  # track-based PUPPI
151  puppiDrMin = 0.04,
152  puppiPtMax = 50.,
153  puppiUsingBareTracks = True,
154  vtxAlgo = "external",
155  vtxFormat = cms.string("TkPrimaryVertex"),
156  vtxCollection = cms.InputTag("L1TkPrimaryVertex",""),
157  # puppi tuning
158  puAlgo = "LinearizedPuppi",
159  puppiEtaCuts = cms.vdouble( 2.0, 2.4, 3.1 ), # two bins in the tracker (different pT), one outside
160  puppiPtCuts = cms.vdouble( 1.0, 2.0, 4.0 ),
161  puppiPtCutsPhotons = cms.vdouble( 1.0, 2.0, 4.0 ),
162  puppiPtSlopes = cms.vdouble( 0.3, 0.3, 0.3 ), # coefficient for pT
163  puppiPtSlopesPhotons = cms.vdouble( 0.4, 0.4, 0.4 ), #When e/g ID not applied, use: cms.vdouble( 0.3, 0.3, 0.3 ),
164  puppiPtZeros = cms.vdouble( 5.0, 7.0, 9.0 ), # ballpark pT from PU
165  puppiPtZerosPhotons = cms.vdouble( 3.0, 4.0, 5.0 ),
166  puppiAlphaSlopes = cms.vdouble( 1.5, 1.5, 2.2 ),
167  puppiAlphaSlopesPhotons = cms.vdouble( 1.5, 1.5, 2.2 ),
168  puppiAlphaZeros = cms.vdouble( 6.0, 6.0, 9.0 ),
169  puppiAlphaZerosPhotons = cms.vdouble( 6.0, 6.0, 9.0 ),
170  puppiAlphaCrops = cms.vdouble( 3 , 3 , 4 ), # max. absolute value for alpha term
171  puppiAlphaCropsPhotons = cms.vdouble( 3 , 3 , 4 ),
172  puppiPriors = cms.vdouble( 5.0, 5.0, 7.0 ),
173  puppiPriorsPhotons = cms.vdouble( 1.5, 1.5, 5.0 ), #When e/g ID not applied, use: cms.vdouble( 3.5, 3.5, 7.0 ),
174  # regionalize
175  useRelativeRegionalCoordinates = cms.bool(False),
176  trackRegionMode = cms.string("atCalo"),
177  regions = cms.VPSet(
178  cms.PSet(
179  etaBoundaries = cms.vdouble(-2.5,-1.5),
180  phiSlices = cms.uint32(1),
181  etaExtra = cms.double(0.3),
182  phiExtra = cms.double(0.0)
183  ),
184  cms.PSet(
185  etaBoundaries = cms.vdouble(1.5,2.5),
186  phiSlices = cms.uint32(1),
187  etaExtra = cms.double(0.3),
188  phiExtra = cms.double(0.0)
189  ),
190  ),
191 )
192 l1pfProducerHGCal.linking.trackCaloDR = 0.1 # more precise cluster positions
193 l1pfProducerHGCal.linking.ecalPriority = False
194 l1pfProducerHGCalNoTK = l1pfProducerHGCal.clone(regions = cms.VPSet(
195  cms.PSet(
196  etaBoundaries = cms.vdouble(-3,-2.5),
197  phiSlices = cms.uint32(1),
198  etaExtra = cms.double(0.3),
199  phiExtra = cms.double(0.0)
200  ),
201  cms.PSet(
202  etaBoundaries = cms.vdouble(2.5,3),
203  phiSlices = cms.uint32(1),
204  etaExtra = cms.double(0.3),
205  phiExtra = cms.double(0.0)
206  ),
207 ))
208 
209 l1ParticleFlow_pf_hgcal_Task = cms.Task(
210  pfTracksFromL1TracksHGCal ,
211  l1pfProducerHGCal ,
212  l1pfProducerHGCalNoTK
213 )
214 l1ParticleFlow_pf_hgcal = cms.Sequence(l1ParticleFlow_pf_hgcal_Task)
215 
216 
217 
218 # PF in HF
219 l1pfProducerHF = l1pfProducer.clone(
220  # inputs
221  tracks = cms.InputTag(''), # no tracks
222  emClusters = [ ],
223  hadClusters = [ cms.InputTag('pfClustersFromCombinedCaloHF:calibrated') ],
224  hadPtCut = 15,
225  # not really useful, but for consistency
226  puppiDrMin = 0.1,
227  puppiPtMax = 100.,
228  vtxAlgo = "external",
229  vtxFormat = cms.string("TkPrimaryVertex"),
230  vtxCollection = cms.InputTag("L1TkPrimaryVertex",""),
231  # puppi tuning
232  puAlgo = "LinearizedPuppi",
233  puppiEtaCuts = cms.vdouble( 5.5 ), # one bin
234  puppiPtCuts = cms.vdouble( 10. ),
235  puppiPtCutsPhotons = cms.vdouble( 10. ), # not used (no photons in HF)
236  puppiPtSlopes = cms.vdouble( 0.25),
237  puppiPtSlopesPhotons = cms.vdouble( 0.25), # not used (no photons in HF)
238  puppiPtZeros = cms.vdouble( 14. ), # ballpark pT from PU
239  puppiPtZerosPhotons = cms.vdouble( 14. ), # not used (no photons in HF)
240  puppiAlphaSlopes = cms.vdouble( 0.6 ),
241  puppiAlphaSlopesPhotons = cms.vdouble( 0.6 ), # not used (no photons in HF)
242  puppiAlphaZeros = cms.vdouble( 9.0 ),
243  puppiAlphaZerosPhotons = cms.vdouble( 9.0 ), # not used (no photons in HF)
244  puppiAlphaCrops = cms.vdouble( 4 ),
245  puppiAlphaCropsPhotons = cms.vdouble( 4 ), # not used (no photons in HF)
246  puppiPriors = cms.vdouble( 6.0 ),
247  puppiPriorsPhotons = cms.vdouble( 6.0 ), # not used (no photons in HF)
248  # regionalize
249  useRelativeRegionalCoordinates = cms.bool(False),
250  trackRegionMode = cms.string("atCalo"),
251  regions = cms.VPSet(
252  cms.PSet(
253  etaBoundaries = cms.vdouble(-5.5,-3),
254  phiSlices = cms.uint32(1),
255  etaExtra = cms.double(0.0),
256  phiExtra = cms.double(0.0)
257  ),
258  cms.PSet(
259  etaBoundaries = cms.vdouble(3,5.5),
260  phiSlices = cms.uint32(1),
261  etaExtra = cms.double(0.0),
262  phiExtra = cms.double(0.0)
263  ),
264  )
265 )
266 l1ParticleFlow_pf_hf_Task = cms.Task(
267  l1pfProducerHF
268 )
269 l1ParticleFlow_pf_hf = cms.Sequence(l1ParticleFlow_pf_hf_Task)
270 
271 
272 # PF in the TSA Region
273 l1pfProducerTSA = l1pfProducerBarrel.clone(
274  trackRegionMode = cms.string("atVertex"),
275  regions = cms.VPSet(
276  cms.PSet(
277  etaBoundaries = cms.vdouble(-3,3),
278  phiSlices = cms.uint32(18),
279  etaExtra = cms.double(0.0),
280  phiExtra = cms.double(0.0)
281  ),
282  ),
283 )
284 l1ParticleFlow_pf_tsa = cms.Sequence(
285  pfTracksFromL1TracksBarrel +
286  l1pfProducerTSA
287 )
288 
289 # Merging all outputs
290 l1pfCandidates = cms.EDProducer("L1TPFCandMultiMerger",
291  pfProducers = cms.VInputTag(
292  cms.InputTag("l1pfProducerBarrel"),
293  cms.InputTag("l1pfProducerHGCal"),
294  cms.InputTag("l1pfProducerHGCalNoTK"),
295  cms.InputTag("l1pfProducerHF")
296  ),
297  labelsToMerge = cms.vstring("Calo", "TK", "TKVtx", "PF", "Puppi"),
298 )
299 
300 l1ParticleFlow_proper = cms.Sequence(
301  l1ParticleFlow_calo +
302  l1ParticleFlow_pf_barrel +
303  l1ParticleFlow_pf_hgcal +
304  l1ParticleFlow_pf_hf +
305  l1pfCandidates
306 )
307 
308 l1ParticleFlow = cms.Sequence(l1ParticleFlow_proper)
309 
310 l1ParticleFlowTask = cms.Task(
311  l1ParticleFlow_calo_Task,
312  l1ParticleFlow_pf_barrel_Task,
313  l1ParticleFlow_pf_hgcal_Task,
314  l1ParticleFlow_pf_hf_Task,
315  cms.Task(l1pfCandidates)
316 )