CMS 3D CMS Logo

particleFlowClusterHO_cfi.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 # Use this object to modify parameters specifically for Run 2
4 
5 #### PF CLUSTER HO ####
6 
7 #cleaning
8 
9 #seeding
10 _localMaxSeeds_HO = cms.PSet(
11  algoName = cms.string("LocalMaximumSeedFinder"),
12  thresholdsByDetector = cms.VPSet(
13  cms.PSet( detector = cms.string("HCAL_BARREL2_RING0"),
14  seedingThreshold = cms.double(1.0),
15  seedingThresholdPt = cms.double(0.0)
16  ),
17  cms.PSet( detector = cms.string("HCAL_BARREL2_RING1"),
18  seedingThreshold = cms.double(3.1),
19  seedingThresholdPt = cms.double(0.0)
20  )
21  ),
22  nNeighbours = cms.int32(4)
23 )
24 
25 #topo clusters
26 _topoClusterizer_HO = cms.PSet(
27  algoName = cms.string("Basic2DGenericTopoClusterizer"),
28  thresholdsByDetector = cms.VPSet(
29  cms.PSet( detector = cms.string("HCAL_BARREL2_RING0"),
30  gatheringThreshold = cms.double(0.5),
31  gatheringThresholdPt = cms.double(0.0)
32  ),
33  cms.PSet( detector = cms.string("HCAL_BARREL2_RING1"),
34  gatheringThreshold = cms.double(1.0),
35  gatheringThresholdPt = cms.double(0.0)
36  )
37  ),
38  useCornerCells = cms.bool(True)
39 )
40 
41 #position calc
42 _positionCalcHO_cross_nodepth = cms.PSet(
43  algoName = cms.string("Basic2DGenericPFlowPositionCalc"),
44 
45  minFractionInCalc = cms.double(1e-9),
46  posCalcNCrystals = cms.int32(5),
47  logWeightDenominator = cms.double(0.5), # same as gathering threshold
48  minAllowedNormalization = cms.double(1e-9)
49 )
50 
51 _positionCalcHO_all_nodepth = _positionCalcHO_cross_nodepth.clone(
52  posCalcNCrystals = cms.int32(-1)
53 )
54 
55 #pf clusters
56 _pfClusterizer_HO = cms.PSet(
57  algoName = cms.string("Basic2DGenericPFlowClusterizer"),
58  #pf clustering parameters
59  minFractionToKeep = cms.double(1e-7),
60  positionCalc = _positionCalcHO_cross_nodepth,
61  allCellsPositionCalc = _positionCalcHO_all_nodepth,
62  showerSigma = cms.double(10.0),
63  stoppingTolerance = cms.double(1e-8),
64  maxIterations = cms.uint32(50),
65  excludeOtherSeeds = cms.bool(True),
66  minFracTot = cms.double(1e-20), ## numerical stabilization
67  recHitEnergyNorms = cms.VPSet(
68  cms.PSet( detector = cms.string("HCAL_BARREL2_RING0"),
69  recHitEnergyNorm = cms.double(0.5)
70  ),
71  cms.PSet( detector = cms.string("HCAL_BARREL2_RING1"),
72  recHitEnergyNorm = cms.double(1.0)
73  )
74  )
75 )
76 
77 particleFlowClusterHO = cms.EDProducer(
78  "PFClusterProducer",
79  recHitsSource = cms.InputTag("particleFlowRecHitHO"),
80  recHitCleaners = cms.VPSet(),
81  seedCleaners = cms.VPSet(),
82  seedFinder = _localMaxSeeds_HO,
83  initialClusteringStep = _topoClusterizer_HO,
84  pfClusterBuilder = _pfClusterizer_HO,
85  positionReCalc = cms.PSet(),
86  energyCorrector = cms.PSet()
87 )
88 
89 #
90 # Need to change the quality tests for Run 2
91 #
93  """
94  Customises PFClusterProducer for Run 2.
95  """
96  for p in object.seedFinder.thresholdsByDetector:
97  p.seedingThreshold = cms.double(0.08)
98 
99  for p in object.initialClusteringStep.thresholdsByDetector:
100  p.gatheringThreshold = cms.double(0.05)
101 
102  for p in object.pfClusterBuilder.recHitEnergyNorms:
103  p.recHitEnergyNorm = cms.double(0.05)
104 
105  object.pfClusterBuilder.positionCalc.logWeightDenominator = cms.double(0.05)
106  object.pfClusterBuilder.allCellsPositionCalc.logWeightDenominator = cms.double(0.05)
107 
108 # Call the function above to modify particleFlowClusterHO only if the run2 era is active
109 from Configuration.Eras.Modifier_run2_common_cff import run2_common
110 run2_common.toModify( particleFlowClusterHO, func=_modifyParticleFlowClusterHOForRun2 )