CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
particleFlowClusterHO_cfi.py
Go to the documentation of this file.
2 
3 # Use this object to modify parameters specifically for Run 2
4 from Configuration.StandardSequences.Eras import eras
5 
6 #### PF CLUSTER HO ####
7 
8 #cleaning
9 
10 #seeding
11 _localMaxSeeds_HO = cms.PSet(
12  algoName = cms.string("LocalMaximumSeedFinder"),
13  thresholdsByDetector = cms.VPSet(
14  cms.PSet( detector = cms.string("HCAL_BARREL2_RING0"),
15  seedingThreshold = cms.double(1.0),
16  seedingThresholdPt = cms.double(0.0)
17  ),
18  cms.PSet( detector = cms.string("HCAL_BARREL2_RING1"),
19  seedingThreshold = cms.double(3.1),
20  seedingThresholdPt = cms.double(0.0)
21  )
22  ),
23  nNeighbours = cms.int32(4)
24 )
25 
26 #topo clusters
27 _topoClusterizer_HO = cms.PSet(
28  algoName = cms.string("Basic2DGenericTopoClusterizer"),
29  thresholdsByDetector = cms.VPSet(
30  cms.PSet( detector = cms.string("HCAL_BARREL2_RING0"),
31  gatheringThreshold = cms.double(0.5),
32  gatheringThresholdPt = cms.double(0.0)
33  ),
34  cms.PSet( detector = cms.string("HCAL_BARREL2_RING1"),
35  gatheringThreshold = cms.double(1.0),
36  gatheringThresholdPt = cms.double(0.0)
37  )
38  ),
39  useCornerCells = cms.bool(True)
40 )
41 
42 #position calc
43 _positionCalcHO_cross_nodepth = cms.PSet(
44  algoName = cms.string("Basic2DGenericPFlowPositionCalc"),
45  ##
46  minFractionInCalc = cms.double(1e-9),
47  posCalcNCrystals = cms.int32(5),
48  logWeightDenominator = cms.double(0.5), # same as gathering threshold
49  minAllowedNormalization = cms.double(1e-9)
50 )
51 
52 _positionCalcHO_all_nodepth = _positionCalcHO_cross_nodepth.clone(
53  posCalcNCrystals = cms.int32(-1)
54 )
55 
56 #pf clusters
57 _pfClusterizer_HO = cms.PSet(
58  algoName = cms.string("Basic2DGenericPFlowClusterizer"),
59  #pf clustering parameters
60  minFractionToKeep = cms.double(1e-7),
61  positionCalc = _positionCalcHO_cross_nodepth,
62  allCellsPositionCalc = _positionCalcHO_all_nodepth,
63  showerSigma = cms.double(10.0),
64  stoppingTolerance = cms.double(1e-8),
65  maxIterations = cms.uint32(50),
66  excludeOtherSeeds = cms.bool(True),
67  minFracTot = cms.double(1e-20), ## numerical stabilization
68  recHitEnergyNorms = cms.VPSet(
69  cms.PSet( detector = cms.string("HCAL_BARREL2_RING0"),
70  recHitEnergyNorm = cms.double(0.5)
71  ),
72  cms.PSet( detector = cms.string("HCAL_BARREL2_RING1"),
73  recHitEnergyNorm = cms.double(1.0)
74  )
75  )
76 )
77 
78 particleFlowClusterHO = cms.EDProducer(
79  "PFClusterProducer",
80  recHitsSource = cms.InputTag("particleFlowRecHitHO"),
81  recHitCleaners = 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 eras.run2_common.toModify( particleFlowClusterHO, func=_modifyParticleFlowClusterHOForRun2 )