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 
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 = -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),
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  usePFThresholdsFromDB = cms.bool(False),
81  recHitCleaners = cms.VPSet(),
82  seedCleaners = cms.VPSet(),
83  seedFinder = _localMaxSeeds_HO,
84  initialClusteringStep = _topoClusterizer_HO,
85  pfClusterBuilder = _pfClusterizer_HO,
86  positionReCalc = cms.PSet(),
87  energyCorrector = cms.PSet()
88 )
89 
90 #
91 # Need to change the quality tests for Run 2
92 #
94  """
95  Customises PFClusterProducer for Run 2.
96  """
97  for p in object.seedFinder.thresholdsByDetector:
98  p.seedingThreshold = cms.double(0.08)
99 
100  for p in object.initialClusteringStep.thresholdsByDetector:
101  p.gatheringThreshold = cms.double(0.05)
102 
103  for p in object.pfClusterBuilder.recHitEnergyNorms:
104  p.recHitEnergyNorm = cms.double(0.05)
105 
106  object.pfClusterBuilder.positionCalc.logWeightDenominator = cms.double(0.05)
107  object.pfClusterBuilder.allCellsPositionCalc.logWeightDenominator = cms.double(0.05)
108 
109 # Call the function above to modify particleFlowClusterHO only if the run2 era is active
110 from Configuration.Eras.Modifier_run2_common_cff import run2_common
111 run2_common.toModify( particleFlowClusterHO, func=_modifyParticleFlowClusterHOForRun2 )