Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:26:26

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 # Use this object to modify parameters specifically for Run 2
0004 
0005 #### PF CLUSTER HO ####
0006 
0007 #cleaning
0008 
0009 #seeding
0010 _localMaxSeeds_HO = cms.PSet(
0011     algoName = cms.string("LocalMaximumSeedFinder"),
0012     thresholdsByDetector = cms.VPSet(
0013     cms.PSet( detector = cms.string("HCAL_BARREL2_RING0"),
0014               seedingThreshold = cms.double(1.0),
0015               seedingThresholdPt = cms.double(0.0)
0016               ),
0017     cms.PSet( detector = cms.string("HCAL_BARREL2_RING1"),
0018               seedingThreshold = cms.double(3.1),
0019               seedingThresholdPt = cms.double(0.0)
0020               )
0021     ),
0022     nNeighbours = cms.int32(4)
0023 )
0024 
0025 #topo clusters
0026 _topoClusterizer_HO = cms.PSet(
0027     algoName = cms.string("Basic2DGenericTopoClusterizer"),
0028     thresholdsByDetector = cms.VPSet(
0029     cms.PSet( detector = cms.string("HCAL_BARREL2_RING0"),
0030               gatheringThreshold = cms.double(0.5),
0031               gatheringThresholdPt = cms.double(0.0)
0032               ),
0033     cms.PSet( detector = cms.string("HCAL_BARREL2_RING1"),
0034               gatheringThreshold = cms.double(1.0),
0035               gatheringThresholdPt = cms.double(0.0)
0036               )
0037     ),
0038     useCornerCells = cms.bool(True)
0039 )
0040 
0041 #position calc
0042 _positionCalcHO_cross_nodepth = cms.PSet(
0043     algoName = cms.string("Basic2DGenericPFlowPositionCalc"),
0044     ##
0045     minFractionInCalc = cms.double(1e-9),
0046     posCalcNCrystals = cms.int32(5),
0047     logWeightDenominator = cms.double(0.5), # same as gathering threshold
0048     minAllowedNormalization = cms.double(1e-9)    
0049 )
0050 
0051 _positionCalcHO_all_nodepth = _positionCalcHO_cross_nodepth.clone(
0052     posCalcNCrystals = -1
0053 )
0054 
0055 #pf clusters
0056 _pfClusterizer_HO = cms.PSet(
0057     algoName = cms.string("Basic2DGenericPFlowClusterizer"),
0058     #pf clustering parameters
0059     minFractionToKeep = cms.double(1e-7),
0060     positionCalc = _positionCalcHO_cross_nodepth,
0061     allCellsPositionCalc = _positionCalcHO_all_nodepth,
0062     showerSigma = cms.double(10.0),
0063     stoppingTolerance = cms.double(1e-8),
0064     maxIterations = cms.uint32(50),
0065     excludeOtherSeeds = cms.bool(True),
0066     minFracTot = cms.double(1e-20), ## numerical stabilization
0067     recHitEnergyNorms = cms.VPSet(
0068     cms.PSet( detector = cms.string("HCAL_BARREL2_RING0"),
0069               recHitEnergyNorm = cms.double(0.5)
0070               ),
0071     cms.PSet( detector = cms.string("HCAL_BARREL2_RING1"),
0072               recHitEnergyNorm = cms.double(1.0)
0073               )
0074     )
0075 )
0076 
0077 particleFlowClusterHO = cms.EDProducer(
0078     "PFClusterProducer",
0079     recHitsSource = cms.InputTag("particleFlowRecHitHO"),
0080     recHitCleaners = cms.VPSet(),
0081     seedCleaners  = cms.VPSet(),
0082     seedFinder = _localMaxSeeds_HO,
0083     initialClusteringStep = _topoClusterizer_HO,
0084     pfClusterBuilder = _pfClusterizer_HO,
0085     positionReCalc = cms.PSet(),
0086     energyCorrector = cms.PSet()
0087 )
0088 
0089 #
0090 # Need to change the quality tests for Run 2
0091 #
0092 def _modifyParticleFlowClusterHOForRun2( object ) :
0093     """
0094     Customises PFClusterProducer for Run 2.
0095     """
0096     for p in object.seedFinder.thresholdsByDetector:
0097         p.seedingThreshold = cms.double(0.08)
0098 
0099     for p in object.initialClusteringStep.thresholdsByDetector:
0100         p.gatheringThreshold = cms.double(0.05)
0101 
0102     for p in object.pfClusterBuilder.recHitEnergyNorms:
0103         p.recHitEnergyNorm = cms.double(0.05)
0104 
0105     object.pfClusterBuilder.positionCalc.logWeightDenominator = cms.double(0.05)
0106     object.pfClusterBuilder.allCellsPositionCalc.logWeightDenominator = cms.double(0.05)
0107 
0108 # Call the function above to modify particleFlowClusterHO only if the run2 era is active
0109 from Configuration.Eras.Modifier_run2_common_cff import run2_common
0110 run2_common.toModify( particleFlowClusterHO, func=_modifyParticleFlowClusterHOForRun2 )