CMS 3D CMS Logo

particleFlowClusterHBHE_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 from RecoParticleFlow.PFClusterProducer.particleFlowCaloResolution_cfi import _timeResolutionHCALMaxSample
3 
4 _thresholdsHB = cms.vdouble(0.8, 0.8, 0.8, 0.8)
5 _thresholdsHE = cms.vdouble(0.8, 0.8, 0.8, 0.8, 0.8, 0.8, 0.8)
6 _thresholdsHBphase1 = cms.vdouble(0.1, 0.2, 0.3, 0.3)
7 _thresholdsHEphase1 = cms.vdouble(0.1, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2)
8 
9 #### PF CLUSTER HCAL ####
10 particleFlowClusterHBHE = cms.EDProducer(
11  "PFClusterProducer",
12  recHitsSource = cms.InputTag("particleFlowRecHitHBHE"),
13  recHitCleaners = cms.VPSet(),
14  seedFinder = cms.PSet(
15  algoName = cms.string("LocalMaximumSeedFinder"),
16  thresholdsByDetector = cms.VPSet(
17  cms.PSet( detector = cms.string("HCAL_BARREL1"),
18  depths = cms.vint32(1, 2, 3, 4),
19  seedingThreshold = cms.vdouble(1.0, 1.0, 1.0, 1.0),
20  seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
21  ),
22  cms.PSet( detector = cms.string("HCAL_ENDCAP"),
23  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
24  seedingThreshold = cms.vdouble(1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1),
25  seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
26  )
27  ),
28  nNeighbours = cms.int32(4)
29  ),
30  initialClusteringStep = cms.PSet(
31  algoName = cms.string("Basic2DGenericTopoClusterizer"),
32  thresholdsByDetector = cms.VPSet(
33  cms.PSet( detector = cms.string("HCAL_BARREL1"),
34  depths = cms.vint32(1, 2, 3, 4),
35  gatheringThreshold = _thresholdsHB,
36  gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
37  ),
38  cms.PSet( detector = cms.string("HCAL_ENDCAP"),
39  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
40  gatheringThreshold = _thresholdsHE,
41  gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
42  )
43  ),
44  useCornerCells = cms.bool(True)
45  ),
46 
47  pfClusterBuilder = cms.PSet(
48  algoName = cms.string("Basic2DGenericPFlowClusterizer"),
49  #pf clustering parameters
50  minFractionToKeep = cms.double(1e-7),
51  positionCalc = cms.PSet(
52  algoName = cms.string("Basic2DGenericPFlowPositionCalc"),
53  minFractionInCalc = cms.double(1e-9),
54  posCalcNCrystals = cms.int32(5),
55 # logWeightDenominator = cms.double(0.8),#same as gathering threshold
56  logWeightDenominatorByDetector = cms.VPSet(
57  cms.PSet( detector = cms.string("HCAL_BARREL1"),
58  depths = cms.vint32(1, 2, 3, 4),
59  logWeightDenominator = _thresholdsHB,
60  ),
61  cms.PSet( detector = cms.string("HCAL_ENDCAP"),
62  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
63  logWeightDenominator = _thresholdsHE,
64  )
65  ),
66  minAllowedNormalization = cms.double(1e-9)
67  ),
68  allCellsPositionCalc =cms.PSet(
69  algoName = cms.string("Basic2DGenericPFlowPositionCalc"),
70  minFractionInCalc = cms.double(1e-9),
71  posCalcNCrystals = cms.int32(-1),
72 ## logWeightDenominator = cms.double(0.8),#same as gathering threshold
73  logWeightDenominatorByDetector = cms.VPSet(
74  cms.PSet( detector = cms.string("HCAL_BARREL1"),
75  depths = cms.vint32(1, 2, 3, 4),
76  logWeightDenominator = _thresholdsHB,
77  ),
78  cms.PSet( detector = cms.string("HCAL_ENDCAP"),
79  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
80  logWeightDenominator = _thresholdsHE,
81  )
82  ),
83  minAllowedNormalization = cms.double(1e-9)
84  ),
85 
86 
87  timeSigmaEB = cms.double(10.),
88  timeSigmaEE = cms.double(10.),
89  maxNSigmaTime = cms.double(10.),
90  minChi2Prob = cms.double(0.),
91  clusterTimeResFromSeed = cms.bool(False),
92  timeResolutionCalcBarrel = _timeResolutionHCALMaxSample,
93  timeResolutionCalcEndcap = _timeResolutionHCALMaxSample,
94  showerSigma = cms.double(10.0),
95  stoppingTolerance = cms.double(1e-8),
96  maxIterations = cms.uint32(50),
97  excludeOtherSeeds = cms.bool(True),
98  minFracTot = cms.double(1e-20), ## numerical stabilization
99  recHitEnergyNorms = cms.VPSet(
100  cms.PSet( detector = cms.string("HCAL_BARREL1"),
101  depths = cms.vint32(1, 2, 3, 4),
102  recHitEnergyNorm = _thresholdsHB,
103  ),
104  cms.PSet( detector = cms.string("HCAL_ENDCAP"),
105  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
106  recHitEnergyNorm = _thresholdsHE,
107  )
108  )
109  ),
110  positionReCalc = cms.PSet(),
111  energyCorrector = cms.PSet()
112 )
113 
114 #####
115 
116 seedFinderThresholdsByDetector2017 = particleFlowClusterHBHE.seedFinder.thresholdsByDetector
117 
118 seedFinderThresholdsByDetector2018 = cms.VPSet(
119  cms.PSet(
120  detector = cms.string("HCAL_BARREL1"),
121  depths = cms.vint32(1, 2, 3, 4),
122  seedingThreshold = cms.vdouble(1.0, 1.0, 1.0, 1.0),
123  seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
124  ),
125  cms.PSet(
126  detector = cms.string("HCAL_ENDCAP"),
127  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
128  seedingThreshold = cms.vdouble(0.1375, 0.275, 0.275, 0.275, 0.275, 0.275, 0.275),
129  seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
130  )
131 )
132 
133 seedFinderThresholdsByDetector2019 = cms.VPSet(
134  cms.PSet(
135  detector = cms.string("HCAL_BARREL1"),
136  depths = cms.vint32(1, 2, 3, 4),
137  seedingThreshold = cms.vdouble(0.125, 0.25, 0.25, 0.25),
138  seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
139  ),
140  cms.PSet(
141  detector = cms.string("HCAL_ENDCAP"),
142  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
143  seedingThreshold = cms.vdouble(0.1375, 0.275, 0.275, 0.275, 0.275, 0.275, 0.275),
144  seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
145  )
146 )
147 
148 seedFinderThresholdsByDetectorPhase2 = cms.VPSet(
149  cms.PSet(
150  detector = cms.string("HCAL_BARREL1"),
151  depths = cms.vint32(1, 2, 3, 4),
152  seedingThreshold = cms.vdouble(1.0, 1.0, 1.0, 1.0),
153  seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
154  ),
155  cms.PSet(
156  detector = cms.string("HCAL_ENDCAP"),
157  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
158  seedingThreshold = cms.vdouble(1.1, 1.1, 1.1, 1.1, 1.1, 1.1, 1.1),
159  seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
160  )
161  )
162 
163 #######################
164 
165 initialClusteringStepThresholdsByDetector2017 = particleFlowClusterHBHE.initialClusteringStep.thresholdsByDetector
166 
167 initialClusteringStepThresholdsByDetector2018 = cms.VPSet(
168  cms.PSet(
169  detector = cms.string("HCAL_BARREL1"),
170  depths = cms.vint32(1, 2, 3, 4),
171  gatheringThreshold = _thresholdsHB,
172  gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
173  ),
174  cms.PSet(
175  detector = cms.string("HCAL_ENDCAP"),
176  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
177  gatheringThreshold = _thresholdsHEphase1,
178  gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
179  )
180 )
181 
182 initialClusteringStepThresholdsByDetector2019 = cms.VPSet(
183  cms.PSet(
184  detector = cms.string("HCAL_BARREL1"),
185  depths = cms.vint32(1, 2, 3, 4),
186  gatheringThreshold = _thresholdsHBphase1,
187  gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
188  ),
189  cms.PSet(
190  detector = cms.string("HCAL_ENDCAP"),
191  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
192  gatheringThreshold = _thresholdsHEphase1,
193  gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
194  )
195 )
196 
197 initialClusteringStepThresholdsByDetectorPhase2 = cms.VPSet(
198  cms.PSet(
199  detector = cms.string("HCAL_BARREL1"),
200  depths = cms.vint32(1, 2, 3, 4),
201  gatheringThreshold = _thresholdsHB,
202  gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
203  ),
204  cms.PSet(
205  detector = cms.string("HCAL_ENDCAP"),
206  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
207  gatheringThreshold = _thresholdsHE,
208  gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
209  )
210  )
211 
212 #######################
213 
214 recHitEnergyNorms2017 = particleFlowClusterHBHE.pfClusterBuilder.recHitEnergyNorms
215 
216 recHitEnergyNorms2018 = cms.VPSet(
217  cms.PSet(
218  detector = cms.string("HCAL_BARREL1"),
219  depths = cms.vint32(1, 2, 3, 4),
220  recHitEnergyNorm = _thresholdsHB,
221  ),
222  cms.PSet(
223  detector = cms.string("HCAL_ENDCAP"),
224  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
225  recHitEnergyNorm = _thresholdsHEphase1,
226  )
227 )
228 
229 recHitEnergyNorms2019 = cms.VPSet(
230  cms.PSet(
231  detector = cms.string("HCAL_BARREL1"),
232  depths = cms.vint32(1, 2, 3, 4),
233  recHitEnergyNorm = _thresholdsHBphase1,
234  ),
235  cms.PSet(
236  detector = cms.string("HCAL_ENDCAP"),
237  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
238  recHitEnergyNorm = _thresholdsHEphase1,
239  )
240  )
241 
242 recHitEnergyNormsPhase2 = cms.VPSet(
243  cms.PSet(
244  detector = cms.string("HCAL_BARREL1"),
245  depths = cms.vint32(1, 2, 3, 4),
246  recHitEnergyNorm = _thresholdsHB,
247  ),
248  cms.PSet(
249  detector = cms.string("HCAL_ENDCAP"),
250  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
251  recHitEnergyNorm = _thresholdsHE,
252  )
253  )
254 
255 #######################
256 
257 logWeightDenominatorByDetector2017= particleFlowClusterHBHE.pfClusterBuilder.positionCalc.logWeightDenominatorByDetector
258 
259 logWeightDenominatorByDetector2018 = cms.VPSet(
260  cms.PSet( detector = cms.string("HCAL_BARREL1"),
261  depths = cms.vint32(1, 2, 3, 4),
262  logWeightDenominator = _thresholdsHB
263  ),
264  cms.PSet( detector = cms.string("HCAL_ENDCAP"),
265  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
266  logWeightDenominator = _thresholdsHEphase1,
267  )
268  )
269 
270 logWeightDenominatorByDetector2019 = cms.VPSet(
271  cms.PSet( detector = cms.string("HCAL_BARREL1"),
272  depths = cms.vint32(1, 2, 3, 4),
273  logWeightDenominator = _thresholdsHBphase1,
274  ),
275  cms.PSet( detector = cms.string("HCAL_ENDCAP"),
276  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
277  logWeightDenominator = _thresholdsHEphase1,
278  )
279  )
280 
281 logWeightDenominatorByDetectorPhase2 = cms.VPSet(
282  cms.PSet( detector = cms.string("HCAL_BARREL1"),
283  depths = cms.vint32(1, 2, 3, 4),
284  logWeightDenominator = _thresholdsHB,
285  ),
286  cms.PSet( detector = cms.string("HCAL_ENDCAP"),
287  depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
288  logWeightDenominator = _thresholdsHE,
289  )
290  )
291 
292 #######################
293 
294 # offline 2018 -- uncollapsed
295 from Configuration.Eras.Modifier_run2_HCAL_2018_cff import run2_HCAL_2018
296 run2_HCAL_2018.toModify(particleFlowClusterHBHE.pfClusterBuilder, recHitEnergyNorms = recHitEnergyNorms2018)
297 run2_HCAL_2018.toModify(particleFlowClusterHBHE.seedFinder, thresholdsByDetector = seedFinderThresholdsByDetector2018)
298 run2_HCAL_2018.toModify(particleFlowClusterHBHE.initialClusteringStep, thresholdsByDetector = initialClusteringStepThresholdsByDetector2018)
299 run2_HCAL_2018.toModify(particleFlowClusterHBHE.pfClusterBuilder.positionCalc, logWeightDenominatorByDetector= logWeightDenominatorByDetector2018)
300 run2_HCAL_2018.toModify(particleFlowClusterHBHE.pfClusterBuilder.allCellsPositionCalc, logWeightDenominatorByDetector= logWeightDenominatorByDetector2018)
301 
302 
303 from Configuration.Eras.Modifier_run2_HE_2018_cff import run2_HE_2018
304 run2_HE_2018.toModify(particleFlowClusterHBHE.pfClusterBuilder, recHitEnergyNorms = recHitEnergyNorms2018)
305 run2_HE_2018.toModify(particleFlowClusterHBHE.seedFinder, thresholdsByDetector = seedFinderThresholdsByDetector2018)
306 run2_HE_2018.toModify(particleFlowClusterHBHE.initialClusteringStep, thresholdsByDetector = initialClusteringStepThresholdsByDetector2018)
307 run2_HE_2018.toModify(particleFlowClusterHBHE.pfClusterBuilder.positionCalc, logWeightDenominatorByDetector= logWeightDenominatorByDetector2018)
308 run2_HE_2018.toModify(particleFlowClusterHBHE.pfClusterBuilder.allCellsPositionCalc, logWeightDenominatorByDetector= logWeightDenominatorByDetector2018)
309 
310 # offline 2018 -- collapsed
311 run2_HECollapse_2018 = cms.Modifier()
312 run2_HECollapse_2018.toModify(particleFlowClusterHBHE.pfClusterBuilder, recHitEnergyNorms = recHitEnergyNorms2017)
313 run2_HECollapse_2018.toModify(particleFlowClusterHBHE.seedFinder, thresholdsByDetector = seedFinderThresholdsByDetector2017)
314 run2_HECollapse_2018.toModify(particleFlowClusterHBHE.initialClusteringStep, thresholdsByDetector = initialClusteringStepThresholdsByDetector2017)
315 run2_HECollapse_2018.toModify(particleFlowClusterHBHE.pfClusterBuilder.positionCalc, logWeightDenominatorByDetector= logWeightDenominatorByDetector2017)
316 run2_HECollapse_2018.toModify(particleFlowClusterHBHE.pfClusterBuilder.allCellsPositionCalc, logWeightDenominatorByDetector= logWeightDenominatorByDetector2017)
317 
318 
319 # offline 2019
320 from Configuration.Eras.Modifier_run3_HB_cff import run3_HB
321 run3_HB.toModify(particleFlowClusterHBHE.pfClusterBuilder, recHitEnergyNorms = recHitEnergyNorms2019)
322 run3_HB.toModify(particleFlowClusterHBHE.seedFinder, thresholdsByDetector = seedFinderThresholdsByDetector2019)
323 run3_HB.toModify(particleFlowClusterHBHE.initialClusteringStep, thresholdsByDetector = initialClusteringStepThresholdsByDetector2019)
324 run3_HB.toModify(particleFlowClusterHBHE.pfClusterBuilder.positionCalc, logWeightDenominatorByDetector= logWeightDenominatorByDetector2019)
325 run3_HB.toModify(particleFlowClusterHBHE.pfClusterBuilder.allCellsPositionCalc, logWeightDenominatorByDetector= logWeightDenominatorByDetector2019)
326 
327 # offline phase2 restore what has been studied in the TDR
328 from Configuration.Eras.Modifier_phase2_hcal_cff import phase2_hcal
329 phase2_hcal.toModify(particleFlowClusterHBHE.pfClusterBuilder, recHitEnergyNorms = recHitEnergyNormsPhase2)
330 phase2_hcal.toModify(particleFlowClusterHBHE.seedFinder, thresholdsByDetector = seedFinderThresholdsByDetectorPhase2)
331 phase2_hcal.toModify(particleFlowClusterHBHE.initialClusteringStep, thresholdsByDetector = initialClusteringStepThresholdsByDetectorPhase2)
332 phase2_hcal.toModify(particleFlowClusterHBHE.pfClusterBuilder.positionCalc, logWeightDenominatorByDetector= logWeightDenominatorByDetectorPhase2)
333 phase2_hcal.toModify(particleFlowClusterHBHE.pfClusterBuilder.allCellsPositionCalc, logWeightDenominatorByDetector= logWeightDenominatorByDetectorPhase2)