Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-06-22 02:24:05

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     usePFThresholdsFromDB = cms.bool(False),
0081     recHitCleaners = cms.VPSet(),
0082     seedCleaners  = cms.VPSet(),
0083     seedFinder = _localMaxSeeds_HO,
0084     initialClusteringStep = _topoClusterizer_HO,
0085     pfClusterBuilder = _pfClusterizer_HO,
0086     positionReCalc = cms.PSet(),
0087     energyCorrector = cms.PSet()
0088 )
0089 
0090 #
0091 # Need to change the quality tests for Run 2
0092 #
0093 def _modifyParticleFlowClusterHOForRun2( object ) :
0094     """
0095     Customises PFClusterProducer for Run 2.
0096     """
0097     for p in object.seedFinder.thresholdsByDetector:
0098         p.seedingThreshold = cms.double(0.08)
0099 
0100     for p in object.initialClusteringStep.thresholdsByDetector:
0101         p.gatheringThreshold = cms.double(0.05)
0102 
0103     for p in object.pfClusterBuilder.recHitEnergyNorms:
0104         p.recHitEnergyNorm = cms.double(0.05)
0105 
0106     object.pfClusterBuilder.positionCalc.logWeightDenominator = cms.double(0.05)
0107     object.pfClusterBuilder.allCellsPositionCalc.logWeightDenominator = cms.double(0.05)
0108 
0109 # Call the function above to modify particleFlowClusterHO only if the run2 era is active
0110 from Configuration.Eras.Modifier_run2_common_cff import run2_common
0111 run2_common.toModify( particleFlowClusterHO, func=_modifyParticleFlowClusterHOForRun2 )