Skip to content

Commit

Permalink
Undo the renaming of gathering, seeding and reHitEnergyNorm double ve…
Browse files Browse the repository at this point in the history
…ctors
  • Loading branch information
Andre Govinda Stahl Leiton committed Jun 19, 2024
1 parent c85415b commit 9fee0bb
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
cms.PSet(
depths = cms.vint32(1, 2, 3, 4),
detector = cms.string('HCAL_BARREL1'),
gatheringThresholds = cms.vdouble(0.1, 0.2, 0.3, 0.3),
gatheringThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
gatheringThreshold = cms.vdouble(0.1, 0.2, 0.3, 0.3),
gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
),
cms.PSet(
depths = cms.vint32(
1, 2, 3, 4, 5,
6, 7
),
detector = cms.string('HCAL_ENDCAP'),
gatheringThresholds = cms.vdouble(
gatheringThreshold = cms.vdouble(
0.1, 0.2, 0.2, 0.2, 0.2,
0.2, 0.2
),
gatheringThresholdsPt = cms.vdouble(
gatheringThresholdPt = cms.vdouble(
0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0
)
Expand Down Expand Up @@ -92,15 +92,15 @@
cms.PSet(
depths = cms.vint32(1, 2, 3, 4),
detector = cms.string('HCAL_BARREL1'),
recHitEnergyNorms = cms.vdouble(0.1, 0.2, 0.3, 0.3)
recHitEnergyNorm = cms.vdouble(0.1, 0.2, 0.3, 0.3)
),
cms.PSet(
depths = cms.vint32(
1, 2, 3, 4, 5,
6, 7
),
detector = cms.string('HCAL_ENDCAP'),
recHitEnergyNorms = cms.vdouble(
recHitEnergyNorm = cms.vdouble(
0.1, 0.2, 0.2, 0.2, 0.2,
0.2, 0.2
)
Expand Down Expand Up @@ -142,20 +142,20 @@
cms.PSet(
depths = cms.vint32(1, 2, 3, 4),
detector = cms.string('HCAL_BARREL1'),
seedingThresholds = cms.vdouble(0.125, 0.25, 0.35, 0.35),
seedingThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
seedingThreshold = cms.vdouble(0.125, 0.25, 0.35, 0.35),
seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
),
cms.PSet(
depths = cms.vint32(
1, 2, 3, 4, 5,
6, 7
),
detector = cms.string('HCAL_ENDCAP'),
seedingThresholds = cms.vdouble(
seedingThreshold = cms.vdouble(
0.1375, 0.275, 0.275, 0.275, 0.275,
0.275, 0.275
),
seedingThresholdsPt = cms.vdouble(
seedingThresholdPt = cms.vdouble(
0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0
)
Expand Down
29 changes: 2 additions & 27 deletions HLTrigger/Configuration/python/customizeHLTforCMSSW.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ def customiseHCALFor2018Input(process):

for producer in producers_by_type(process, "PFClusterProducer"):
if producer.seedFinder.thresholdsByDetector[0].detector.value() == 'HCAL_BARREL1':
producer.seedFinder.thresholdsByDetector[0].seedingThresholds = _seedingThresholdsHB
producer.initialClusteringStep.thresholdsByDetector[0].gatheringThresholds = _thresholdsHB
producer.seedFinder.thresholdsByDetector[0].seedingThreshold = _seedingThresholdsHB
producer.initialClusteringStep.thresholdsByDetector[0].gatheringThreshold = _thresholdsHB
producer.pfClusterBuilder.recHitEnergyNorms[0].recHitEnergyNorm = _thresholdsHB
producer.pfClusterBuilder.positionCalc.logWeightDenominatorByDetector = logWeightDenominatorHCAL2018
producer.pfClusterBuilder.allCellsPositionCalc.logWeightDenominatorByDetector = logWeightDenominatorHCAL2018
Expand Down Expand Up @@ -314,30 +314,6 @@ def customizeHLTfor45063(process):
delattr(prod,"mvaScaleStdEL2")

return process

def customizeHLTfor45212(process):
# Fix types for gathering and seeding thresholds, and recHitEnergyNorm
for prod in producers_by_type(process, 'PFClusterProducer'):
if hasattr(prod, "initialClusteringStep") and hasattr(prod.initialClusteringStep, "thresholdsByDetector"):
if hasattr(prod.initialClusteringStep.thresholdsByDetector, "gatheringThreshold") and isinstance(prod.initialClusteringStep.thresholdsByDetector.gatheringThreshold, cms.vdouble):
prod.initialClusteringStep.thresholdsByDetector.gatheringThresholds = prod.initialClusteringStep.thresholdsByDetector.gatheringThreshold
delattr(prod.initialClusteringStep.thresholdsByDetector, "gatheringThreshold")
if hasattr(prod.initialClusteringStep.thresholdsByDetector, "gatheringThresholdPt") and isinstance(prod.initialClusteringStep.thresholdsByDetector.gatheringThresholdPt, cms.vdouble):
prod.initialClusteringStep.thresholdsByDetector.gatheringThresholdsPt = prod.initialClusteringStep.thresholdsByDetector.gatheringThresholdPt
delattr(prod.initialClusteringStep.thresholdsByDetector, "gatheringThresholdPt")
if hasattr(prod, "seedFinder") and hasattr(prod.seedFinder, "thresholdsByDetector"):
if hasattr(prod.seedFinder.thresholdsByDetector, "seedingThreshold") and isinstance(prod.seedFinder.thresholdsByDetector.seedingThreshold, cms.vdouble):
prod.seedFinder.thresholdsByDetector.seedingThresholds = prod.seedFinder.thresholdsByDetector.seedingThreshold
delattr(prod.seedFinder.thresholdsByDetector, "seedingThreshold")
if hasattr(prod.seedFinder.thresholdsByDetector, "seedingThresholdPt") and isinstance(prod.seedFinder.thresholdsByDetector.seedingThresholdPt, cms.vdouble):
prod.seedFinder.thresholdsByDetector.seedingThresholdsPt = prod.seedFinder.thresholdsByDetector.seedingThresholdPt
delattr(prod.seedFinder.thresholdsByDetector, "seedingThresholdPt")
for n in ["positionCalc", "allCellsPositionCalc"]:
if hasattr(prod, "pfClusterBuilder") and hasattr(prod.pfClusterBuilder, n) and hasattr(getattr(prod.pfClusterBuilder, n), "recHitEnergyNorms") and hasattr(getattr(prod.pfClusterBuilder, n).recHitEnergyNorms, "recHitEnergyNorm") and isinstance(getattr(prod.pfClusterBuilder, n).recHitEnergyNorms.recHitEnergyNorm, cms.vdouble):
getattr(prod.pfClusterBuilder, n).recHitEnergyNorms.recHitEnergyNorms = getattr(prod.pfClusterBuilder, n).recHitEnergyNorms.recHitEnergyNorm
delattr(getattr(prod.pfClusterBuilder, n).recHitEnergyNorms, "recHitEnergyNorm")

return process

# CMSSW version specific customizations
def customizeHLTforCMSSW(process, menuType="GRun"):
Expand All @@ -350,6 +326,5 @@ def customizeHLTforCMSSW(process, menuType="GRun"):
process = checkHLTfor43774(process)
process = customizeHLTfor44576(process)
process = customizeHLTfor45063(process)
process = customizeHLTfor45212(process)

return process
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class InitialClusteringStepBase {

if (det == std::string("HCAL_BARREL1") || det == std::string("HCAL_ENDCAP")) {
depths = pset.getParameter<std::vector<int> >("depths");
thresh_E = pset.getParameter<std::vector<double> >("gatheringThresholds");
thresh_pT = pset.getParameter<std::vector<double> >("gatheringThresholdsPt");
thresh_E = pset.getParameter<std::vector<double> >("gatheringThreshold");
thresh_pT = pset.getParameter<std::vector<double> >("gatheringThresholdPt");
if (thresh_E.size() != depths.size() || thresh_pT.size() != depths.size()) {
throw cms::Exception("InvalidGatheringThreshold")
<< "gatheringThresholds mismatch with the numbers of depths";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ Basic2DGenericPFlowClusterizer::Basic2DGenericPFlowClusterizer(const edm::Parame

if (det == std::string("HCAL_BARREL1") || det == std::string("HCAL_ENDCAP")) {
depths = pset.getParameter<std::vector<int> >("depths");
rhE_norm = pset.getParameter<std::vector<double> >("recHitEnergyNorms");
rhE_norm = pset.getParameter<std::vector<double> >("recHitEnergyNorm");
} else {
depths.push_back(0);
rhE_norm.push_back(pset.getParameter<double>("recHitEnergyNorm"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ LocalMaximumSeedFinder::LocalMaximumSeedFinder(const edm::ParameterSet& conf)

if (det == std::string("HCAL_BARREL1") || det == std::string("HCAL_ENDCAP")) {
depths = pset.getParameter<std::vector<int> >("depths");
thresh_E = pset.getParameter<std::vector<double> >("seedingThresholds");
thresh_pT = pset.getParameter<std::vector<double> >("seedingThresholdsPt");
thresh_E = pset.getParameter<std::vector<double> >("seedingThreshold");
thresh_pT = pset.getParameter<std::vector<double> >("seedingThresholdPt");
if (thresh_E.size() != depths.size() || thresh_pT.size() != depths.size()) {
throw cms::Exception("InvalidGatheringThreshold") << "gatheringThresholds mismatch with the numbers of depths";
}
Expand Down
26 changes: 13 additions & 13 deletions RecoParticleFlow/PFClusterProducer/plugins/PFClusterProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ void PFClusterProducer::fillDescriptions(edm::ConfigurationDescriptions& descrip
{
edm::ParameterSetDescription psd;
psd.add<std::string>("detector", "");
psd.add<double>("seedingThreshold", 0);
psd.add<double>("seedingThresholdPt", 0);
psd.add<std::vector<int>>("depths", {});
psd.add<std::vector<double>>("seedingThresholds", {});
psd.add<std::vector<double>>("seedingThresholdsPt", {});
psd.addNode((edm::ParameterDescription<double>("seedingThreshold", 0, true) and
edm::ParameterDescription<double>("seedingThresholdPt", 0, true)) xor
(edm::ParameterDescription<std::vector<int>>("depths", {}, true) and
edm::ParameterDescription<std::vector<double>>("seedingThreshold", {}, true) and
edm::ParameterDescription<std::vector<double>>("seedingThresholdPt", {}, true)));
pset.addVPSet("thresholdsByDetector", psd, {});
}
desc.add<edm::ParameterSetDescription>("seedFinder", pset);
Expand All @@ -83,11 +83,11 @@ void PFClusterProducer::fillDescriptions(edm::ConfigurationDescriptions& descrip
{
edm::ParameterSetDescription psd;
psd.add<std::string>("detector", "");
psd.add<double>("gatheringThreshold", 0);
psd.add<double>("gatheringThresholdPt", 0);
psd.add<std::vector<int>>("depths", {});
psd.add<std::vector<double>>("gatheringThresholds", {});
psd.add<std::vector<double>>("gatheringThresholdsPt", {});
psd.addNode((edm::ParameterDescription<double>("gatheringThreshold", 0, true) and
edm::ParameterDescription<double>("gatheringThresholdPt", 0, true)) xor
(edm::ParameterDescription<std::vector<int>>("depths", {}, true) and
edm::ParameterDescription<std::vector<double>>("gatheringThreshold", {}, true) and
edm::ParameterDescription<std::vector<double>>("gatheringThresholdPt", {}, true)));
pset.addVPSet("thresholdsByDetector", psd, {});
}
pset.add<bool>("useCornerCells", false);
Expand Down Expand Up @@ -167,9 +167,9 @@ void PFClusterProducer::fillDescriptions(edm::ConfigurationDescriptions& descrip
{
edm::ParameterSetDescription psd;
psd.add<std::string>("detector", "");
psd.add<double>("recHitEnergyNorm", 0);
psd.add<std::vector<int>>("depths", {});
psd.add<std::vector<double>>("recHitEnergyNorms", {});
psd.addNode(edm::ParameterDescription<double>("recHitEnergyNorm", 0, true) xor
(edm::ParameterDescription<std::vector<int>>("depths", {}, true) and
edm::ParameterDescription<std::vector<double>>("recHitEnergyNorm", {}, true)));
pset.addVPSet("recHitEnergyNorms", psd, {});
}
pset.add<double>("showerSigma", 1.5);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
minFractionInCalc = cms.double(1e-9),
posCalcNCrystals = cms.int32(-1),
logWeightDenominator = cms.double(0.08), # same as gathering threshold
logWeightDenominatorByDetector = cms.VPSet(),
minAllowedNormalization = cms.double(1e-9),
timeResolutionCalcBarrel = _timeResolutionECALBarrel,
timeResolutionCalcEndcap = _timeResolutionECALEndcap,
Expand All @@ -103,8 +102,7 @@
T0_EE = cms.double(3.1),
T0_ES = cms.double(1.2),
W0 = cms.double(4.2),
X0 = cms.double(0.89),
timeResolutionCalc = cms.PSet()
X0 = cms.double(0.89)
)

# pf clustering
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
thresholdsByDetector = cms.VPSet(
cms.PSet( detector = cms.string("HCAL_BARREL1"),
depths = cms.vint32(1, 2, 3, 4),
seedingThresholds = _seedingThresholdsHB,
seedingThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
seedingThreshold = _seedingThresholdsHB,
seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
),
cms.PSet( detector = cms.string("HCAL_ENDCAP"),
depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
seedingThresholds = _seedingThresholdsHE,
seedingThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
seedingThreshold = _seedingThresholdsHE,
seedingThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
)
),
nNeighbours = cms.int32(4),
Expand All @@ -43,13 +43,13 @@
thresholdsByDetector = cms.VPSet(
cms.PSet( detector = cms.string("HCAL_BARREL1"),
depths = cms.vint32(1, 2, 3, 4),
gatheringThresholds = _thresholdsHB,
gatheringThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
gatheringThreshold = _thresholdsHB,
gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0)
),
cms.PSet( detector = cms.string("HCAL_ENDCAP"),
depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
gatheringThresholds = _thresholdsHE,
gatheringThresholdsPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
gatheringThreshold = _thresholdsHE,
gatheringThresholdPt = cms.vdouble(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
)
),
useCornerCells = cms.bool(True)
Expand All @@ -73,9 +73,7 @@
logWeightDenominator = _thresholdsHE,
)
),
minAllowedNormalization = cms.double(1e-9),
timeResolutionCalcBarrel = cms.PSet(),
timeResolutionCalcEndcap = cms.PSet()
minAllowedNormalization = cms.double(1e-9)
),
allCellsPositionCalc =cms.PSet(
algoName = cms.string("Basic2DGenericPFlowPositionCalc"),
Expand All @@ -91,11 +89,9 @@
logWeightDenominator = _thresholdsHE,
)
),
minAllowedNormalization = cms.double(1e-9),
timeResolutionCalcBarrel = cms.PSet(),
timeResolutionCalcEndcap = cms.PSet()
minAllowedNormalization = cms.double(1e-9)
),
positionCalcForConvergence = cms.PSet(),


timeSigmaEB = cms.double(10.),
timeSigmaEE = cms.double(10.),
Expand All @@ -112,11 +108,11 @@
recHitEnergyNorms = cms.VPSet(
cms.PSet( detector = cms.string("HCAL_BARREL1"),
depths = cms.vint32(1, 2, 3, 4),
recHitEnergyNorms = _thresholdsHB,
recHitEnergyNorm = _thresholdsHB,
),
cms.PSet( detector = cms.string("HCAL_ENDCAP"),
depths = cms.vint32(1, 2, 3, 4, 5, 6, 7),
recHitEnergyNorms = _thresholdsHE,
recHitEnergyNorm = _thresholdsHE,
)
)
),
Expand All @@ -130,10 +126,10 @@
from Configuration.Eras.Modifier_run2_HE_2018_cff import run2_HE_2018
from Configuration.ProcessModifiers.run2_HECollapse_2018_cff import run2_HECollapse_2018
(run2_HE_2018 & ~run2_HECollapse_2018).toModify(particleFlowClusterHBHE,
seedFinder = dict(thresholdsByDetector = {1 : dict(seedingThresholds = _seedingThresholdsHEphase1) } ),
initialClusteringStep = dict(thresholdsByDetector = {1 : dict(gatheringThresholds = _thresholdsHEphase1) } ),
seedFinder = dict(thresholdsByDetector = {1 : dict(seedingThreshold = _seedingThresholdsHEphase1) } ),
initialClusteringStep = dict(thresholdsByDetector = {1 : dict(gatheringThreshold = _thresholdsHEphase1) } ),
pfClusterBuilder = dict(
recHitEnergyNorms = {1 : dict(recHitEnergyNorms = _thresholdsHEphase1) },
recHitEnergyNorms = {1 : dict(recHitEnergyNorm = _thresholdsHEphase1) },
positionCalc = dict(logWeightDenominatorByDetector = {1 : dict(logWeightDenominator = _thresholdsHEphase1) } ),
allCellsPositionCalc = dict(logWeightDenominatorByDetector = {1 : dict(logWeightDenominator = _thresholdsHEphase1) } ),
),
Expand All @@ -142,10 +138,10 @@
# offline 2019
from Configuration.Eras.Modifier_run3_HB_cff import run3_HB
run3_HB.toModify(particleFlowClusterHBHE,
seedFinder = dict(thresholdsByDetector = {0 : dict(seedingThresholds = _seedingThresholdsHBphase1) } ),
initialClusteringStep = dict(thresholdsByDetector = {0 : dict(gatheringThresholds = _thresholdsHBphase1) } ),
seedFinder = dict(thresholdsByDetector = {0 : dict(seedingThreshold = _seedingThresholdsHBphase1) } ),
initialClusteringStep = dict(thresholdsByDetector = {0 : dict(gatheringThreshold = _thresholdsHBphase1) } ),
pfClusterBuilder = dict(
recHitEnergyNorms = {0 : dict(recHitEnergyNorms = _thresholdsHBphase1) },
recHitEnergyNorms = {0 : dict(recHitEnergyNorm = _thresholdsHBphase1) },
positionCalc = dict(logWeightDenominatorByDetector = {0 : dict(logWeightDenominator = _thresholdsHBphase1) } ),
allCellsPositionCalc = dict(logWeightDenominatorByDetector = {0 : dict(logWeightDenominator = _thresholdsHBphase1) } ),
),
Expand All @@ -154,10 +150,10 @@
# offline 2023
from Configuration.Eras.Modifier_run3_egamma_2023_cff import run3_egamma_2023
run3_egamma_2023.toModify(particleFlowClusterHBHE,
seedFinder = dict(thresholdsByDetector = {0 : dict(seedingThresholds = _seedingThresholdsHBphase1_2023) } ),
initialClusteringStep = dict(thresholdsByDetector = {0 : dict(gatheringThresholds = _thresholdsHBphase1_2023) } ),
seedFinder = dict(thresholdsByDetector = {0 : dict(seedingThreshold = _seedingThresholdsHBphase1_2023) } ),
initialClusteringStep = dict(thresholdsByDetector = {0 : dict(gatheringThreshold = _thresholdsHBphase1_2023) } ),
pfClusterBuilder = dict(
recHitEnergyNorms = {0 : dict(recHitEnergyNorms = _thresholdsHBphase1_2023) },
recHitEnergyNorms = {0 : dict(recHitEnergyNorm = _thresholdsHBphase1_2023) },
positionCalc = dict(logWeightDenominatorByDetector = {0 : dict(logWeightDenominator = _thresholdsHBphase1_2023) } ),
allCellsPositionCalc = dict(logWeightDenominatorByDetector = {0 : dict(logWeightDenominator = _thresholdsHBphase1_2023) } ),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
nSigmaPhi = cms.double(2.),
#pf clustering parameters
minFractionToKeep = cms.double(1e-7),
positionCalc = cms.PSet(),
allCellsPositionCalc = cms.PSet(
algoName = cms.string("Basic2DGenericPFlowPositionCalc"),
minFractionInCalc = cms.double(1e-9),
Expand All @@ -31,9 +30,7 @@
logWeightDenominator = _thresholdsHE,
)
),
minAllowedNormalization = cms.double(1e-9),
timeResolutionCalcBarrel = cms.PSet(),
timeResolutionCalcEndcap = cms.PSet()
minAllowedNormalization = cms.double(1e-9)
)
),
positionReCalc = cms.PSet(),
Expand Down
Loading

0 comments on commit 9fee0bb

Please sign in to comment.