From 77d47040d80c58cef7e5aeb18948309f534493c9 Mon Sep 17 00:00:00 2001 From: ruse-traveler Date: Mon, 15 Sep 2025 16:55:49 -0400 Subject: [PATCH 01/11] Add new cluster types to enum, and cluster type to Reco CoG config --- src/algorithms/calorimetry/CalorimeterClusterRecoCoG.cc | 1 + .../calorimetry/CalorimeterClusterRecoCoGConfig.h | 8 ++++++++ .../calorimetry/CalorimeterClusterRecoCoG_factory.h | 1 + 3 files changed, 10 insertions(+) diff --git a/src/algorithms/calorimetry/CalorimeterClusterRecoCoG.cc b/src/algorithms/calorimetry/CalorimeterClusterRecoCoG.cc index 72da2df966..e84fab0041 100644 --- a/src/algorithms/calorimetry/CalorimeterClusterRecoCoG.cc +++ b/src/algorithms/calorimetry/CalorimeterClusterRecoCoG.cc @@ -121,6 +121,7 @@ CalorimeterClusterRecoCoG::reconstruct(const edm4eic::ProtoCluster& pcl) const { cl.setEnergyError(0.); cl.setTime(time); cl.setTimeError(timeError); + cl.setType(m_cfg.clusterType); // center of gravity with logarithmic weighting float tw = 0.; diff --git a/src/algorithms/calorimetry/CalorimeterClusterRecoCoGConfig.h b/src/algorithms/calorimetry/CalorimeterClusterRecoCoGConfig.h index df38aca48c..d97686afbb 100644 --- a/src/algorithms/calorimetry/CalorimeterClusterRecoCoGConfig.h +++ b/src/algorithms/calorimetry/CalorimeterClusterRecoCoGConfig.h @@ -7,6 +7,8 @@ #include #include +#include "ClusterTypes.h" + namespace eicrecon { struct CalorimeterClusterRecoCoGConfig { @@ -27,6 +29,12 @@ struct CalorimeterClusterRecoCoGConfig { // the eta of the contributing hits. This is useful to avoid edge effects // for endcaps. bool enableEtaBounds = false; + + // cluster type: can be used to flag clusters + // as being a type specified by the Jug::Reco::ClusterType + // enum in ./ClusterTypes.h + int32_t clusterType = Jug::Reco::ClusterType::kCluster2D; + }; } // namespace eicrecon diff --git a/src/factories/calorimetry/CalorimeterClusterRecoCoG_factory.h b/src/factories/calorimetry/CalorimeterClusterRecoCoG_factory.h index 8513bd2707..284ed2ab79 100644 --- a/src/factories/calorimetry/CalorimeterClusterRecoCoG_factory.h +++ b/src/factories/calorimetry/CalorimeterClusterRecoCoG_factory.h @@ -32,6 +32,7 @@ class CalorimeterClusterRecoCoG_factory ParameterRef m_logWeightBase_Eref{this, "logWeightBase_Eref", config().logWeightBase_Eref}; ParameterRef m_enableEtaBounds{this, "enableEtaBounds", config().enableEtaBounds}; + ParameterRef m_systemID{this, "clusterType", config().clusterType}; Service m_algorithmsInit{this}; From d175ad08a166313bcbeb1ab34f6dfd8996d4ab6a Mon Sep 17 00:00:00 2001 From: ruse-traveler Date: Mon, 15 Sep 2025 18:13:19 -0400 Subject: [PATCH 02/11] Make comment more descriptive --- src/algorithms/calorimetry/CalorimeterClusterRecoCoGConfig.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/algorithms/calorimetry/CalorimeterClusterRecoCoGConfig.h b/src/algorithms/calorimetry/CalorimeterClusterRecoCoGConfig.h index d97686afbb..9c1e25436e 100644 --- a/src/algorithms/calorimetry/CalorimeterClusterRecoCoGConfig.h +++ b/src/algorithms/calorimetry/CalorimeterClusterRecoCoGConfig.h @@ -32,7 +32,8 @@ struct CalorimeterClusterRecoCoGConfig { // cluster type: can be used to flag clusters // as being a type specified by the Jug::Reco::ClusterType - // enum in ./ClusterTypes.h + // enum in ClusterTypes.h. This can be useful for, eg., + // flagging EMCal vs. HCal clusters in downstream algorithms int32_t clusterType = Jug::Reco::ClusterType::kCluster2D; }; From 00b6734b13b6489886a29488b67eaee849926228 Mon Sep 17 00:00:00 2001 From: ruse-traveler Date: Mon, 15 Sep 2025 18:14:03 -0400 Subject: [PATCH 03/11] Add EMCal, HCal types --- src/algorithms/calorimetry/ClusterTypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/calorimetry/ClusterTypes.h b/src/algorithms/calorimetry/ClusterTypes.h index 9b91fceaa8..fb296255db 100644 --- a/src/algorithms/calorimetry/ClusterTypes.h +++ b/src/algorithms/calorimetry/ClusterTypes.h @@ -3,5 +3,5 @@ #pragma once namespace Jug::Reco { -enum ClusterType : int32_t { kCluster2D = 0, kCluster3D = 1, kClusterSlice = 2 }; +enum ClusterType : int32_t { kCluster2D = 0, kCluster3D = 1, kClusterSlice = 2, kClusterEMCal = 3, kClusterHCal = 4 }; } From ebf40bffeadd0370652fec299f69408940cd9440 Mon Sep 17 00:00:00 2001 From: ruse-traveler Date: Mon, 15 Sep 2025 18:16:33 -0400 Subject: [PATCH 04/11] Add cluster type to relevant RecoCoG factories --- src/detectors/B0ECAL/B0ECAL.cc | 5 +++-- src/detectors/BHCAL/BHCAL.cc | 7 ++++--- src/detectors/EEMC/EEMC.cc | 6 ++++-- src/detectors/EHCAL/EHCAL.cc | 6 ++++-- src/detectors/FEMC/FEMC.cc | 6 ++++-- src/detectors/FHCAL/FHCAL.cc | 9 ++++++--- src/detectors/LUMISPECCAL/LUMISPECCAL.cc | 5 +++-- src/detectors/ZDC/ZDC.cc | 10 +++++++--- 8 files changed, 35 insertions(+), 19 deletions(-) diff --git a/src/detectors/B0ECAL/B0ECAL.cc b/src/detectors/B0ECAL/B0ECAL.cc index 59aaa32ecb..620aca94bc 100644 --- a/src/detectors/B0ECAL/B0ECAL.cc +++ b/src/detectors/B0ECAL/B0ECAL.cc @@ -9,6 +9,7 @@ #include #include +#include "algorithms/calorimetry/ClusterTypes.h" #include "extensions/jana/JOmniFactoryGeneratorT.h" #include "factories/calorimetry/CalorimeterClusterRecoCoG_factory.h" #include "factories/calorimetry/CalorimeterClusterShape_factory.h" @@ -88,7 +89,7 @@ void InitPlugin(JApplication* app) { }, {"B0ECalClustersWithoutShapes", // edm4eic::Cluster "B0ECalClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterEMCal }, app)); app->Add(new JOmniFactoryGeneratorT( @@ -104,7 +105,7 @@ void InitPlugin(JApplication* app) { }, {"B0ECalTruthClustersWithoutShapes", // edm4eic::Cluster "B0ECalTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterEMCal }, app)); app->Add(new JOmniFactoryGeneratorT( diff --git a/src/detectors/BHCAL/BHCAL.cc b/src/detectors/BHCAL/BHCAL.cc index 7cff7bfd97..6f2a35b8b8 100644 --- a/src/detectors/BHCAL/BHCAL.cc +++ b/src/detectors/BHCAL/BHCAL.cc @@ -10,6 +10,7 @@ #include "algorithms/calorimetry/CalorimeterHitDigiConfig.h" #include "algorithms/calorimetry/CalorimeterIslandClusterConfig.h" +#include "algorithms/calorimetry/ClusterTypes.h" #include "extensions/jana/JOmniFactoryGeneratorT.h" #include "factories/calorimetry/CalorimeterClusterRecoCoG_factory.h" #include "factories/calorimetry/CalorimeterClusterShape_factory.h" @@ -130,7 +131,7 @@ void InitPlugin(JApplication* app) { }, {"HcalBarrelClustersWithoutShapes", // edm4eic::Cluster "HcalBarrelClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); @@ -148,7 +149,7 @@ void InitPlugin(JApplication* app) { }, {"HcalBarrelTruthClustersWithoutShapes", // edm4eic::Cluster "HcalBarrelTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); @@ -180,7 +181,7 @@ void InitPlugin(JApplication* app) { }, {"HcalBarrelSplitMergeClustersWithoutShapes", // edm4eic::Cluster "HcalBarrelSplitMergeClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); diff --git a/src/detectors/EEMC/EEMC.cc b/src/detectors/EEMC/EEMC.cc index 1d9189c863..72890ed92c 100644 --- a/src/detectors/EEMC/EEMC.cc +++ b/src/detectors/EEMC/EEMC.cc @@ -11,6 +11,7 @@ #include #include "algorithms/calorimetry/CalorimeterHitDigiConfig.h" +#include "algorithms/calorimetry/ClusterTypes.h" #include "extensions/jana/JOmniFactoryGeneratorT.h" #include "factories/calorimetry/CalorimeterClusterRecoCoG_factory.h" #include "factories/calorimetry/CalorimeterHitDigi_factory.h" @@ -116,7 +117,7 @@ void InitPlugin(JApplication* app) { }, {"EcalEndcapNTruthClustersWithoutShapes", // edm4eic::Cluster "EcalEndcapNTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 4.6, .enableEtaBounds = false}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 4.6, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); @@ -148,6 +149,7 @@ void InitPlugin(JApplication* app) { .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterEMCal }, app // TODO: Remove me once fixed )); @@ -227,7 +229,7 @@ void InitPlugin(JApplication* app) { }, {"EcalEndcapNSplitMergeClustersWithoutShapes", // edm4eic::Cluster "EcalEndcapNSplitMergeClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); diff --git a/src/detectors/EHCAL/EHCAL.cc b/src/detectors/EHCAL/EHCAL.cc index 8c8855297d..866c80aa3c 100644 --- a/src/detectors/EHCAL/EHCAL.cc +++ b/src/detectors/EHCAL/EHCAL.cc @@ -9,6 +9,7 @@ #include #include "algorithms/calorimetry/CalorimeterHitDigiConfig.h" +#include "algorithms/calorimetry/ClusterTypes.h" #include "extensions/jana/JOmniFactoryGeneratorT.h" #include "factories/calorimetry/CalorimeterClusterRecoCoG_factory.h" #include "factories/calorimetry/CalorimeterClusterShape_factory.h" @@ -110,7 +111,7 @@ void InitPlugin(JApplication* app) { }, {"HcalEndcapNTruthClustersWithoutShapes", // edm4eic::Cluster "HcalEndcapNTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); app->Add(new JOmniFactoryGeneratorT( @@ -131,6 +132,7 @@ void InitPlugin(JApplication* app) { .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal }, app // TODO: Remove me once fixed )); @@ -160,7 +162,7 @@ void InitPlugin(JApplication* app) { }, {"HcalEndcapNSplitMergeClustersWithoutShapes", // edm4eic::Cluster "HcalEndcapNSplitMergeClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); app->Add(new JOmniFactoryGeneratorT( diff --git a/src/detectors/FEMC/FEMC.cc b/src/detectors/FEMC/FEMC.cc index a8d4a3b4aa..4ab4a05c6f 100644 --- a/src/detectors/FEMC/FEMC.cc +++ b/src/detectors/FEMC/FEMC.cc @@ -10,6 +10,7 @@ #include #include "algorithms/calorimetry/CalorimeterHitDigiConfig.h" +#include "algorithms/calorimetry/ClusterTypes.h" #include "extensions/jana/JOmniFactoryGeneratorT.h" #include "factories/calorimetry/CalorimeterClusterRecoCoG_factory.h" #include "factories/calorimetry/CalorimeterClusterShape_factory.h" @@ -103,7 +104,7 @@ void InitPlugin(JApplication* app) { }, {"EcalEndcapPTruthClustersWithoutShapes", // edm4eic::Cluster "EcalEndcapPTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = true}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = true, .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); @@ -126,6 +127,7 @@ void InitPlugin(JApplication* app) { .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterEMCal }, app // TODO: Remove me once fixed )); @@ -158,7 +160,7 @@ void InitPlugin(JApplication* app) { }, {"EcalEndcapPSplitMergeClustersWithoutShapes", // edm4eic::Cluster "EcalEndcapPSplitMergeClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); diff --git a/src/detectors/FHCAL/FHCAL.cc b/src/detectors/FHCAL/FHCAL.cc index de6369cb6d..5b857b2dda 100644 --- a/src/detectors/FHCAL/FHCAL.cc +++ b/src/detectors/FHCAL/FHCAL.cc @@ -10,6 +10,7 @@ #include #include "algorithms/calorimetry/CalorimeterHitDigiConfig.h" +#include "algorithms/calorimetry/ClusterTypes.h" #include "algorithms/calorimetry/ImagingTopoClusterConfig.h" #include "extensions/jana/JOmniFactoryGeneratorT.h" #include "factories/calorimetry/CalorimeterClusterRecoCoG_factory.h" @@ -126,7 +127,7 @@ void InitPlugin(JApplication* app) { }, {"HcalEndcapPInsertTruthClustersWithoutShapes", // edm4eic::Cluster "HcalEndcapPInsertTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 0.0257, .logWeightBase = 3.6, .enableEtaBounds = true}, + {.energyWeight = "log", .sampFrac = 0.0257, .logWeightBase = 3.6, .enableEtaBounds = true, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); @@ -150,6 +151,7 @@ void InitPlugin(JApplication* app) { .sampFrac = 0.0257, .logWeightBase = 6.2, .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal }, app // TODO: Remove me once fixed )); @@ -260,7 +262,7 @@ void InitPlugin(JApplication* app) { }, {"LFHCALTruthClustersWithoutShapes", // edm4eic::Cluster "LFHCALTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 4.5, .enableEtaBounds = false}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 4.5, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); @@ -283,6 +285,7 @@ void InitPlugin(JApplication* app) { .sampFrac = 1.0, .logWeightBase = 4.5, .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal }, app // TODO: Remove me once fixed )); @@ -313,7 +316,7 @@ void InitPlugin(JApplication* app) { }, {"LFHCALSplitMergeClustersWithoutShapes", // edm4eic::Cluster "LFHCALSplitMergeClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 4.5, .enableEtaBounds = false}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 4.5, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); diff --git a/src/detectors/LUMISPECCAL/LUMISPECCAL.cc b/src/detectors/LUMISPECCAL/LUMISPECCAL.cc index 590a3dfda6..b3fb3d076d 100644 --- a/src/detectors/LUMISPECCAL/LUMISPECCAL.cc +++ b/src/detectors/LUMISPECCAL/LUMISPECCAL.cc @@ -9,6 +9,7 @@ #include #include +#include "algorithms/calorimetry/ClusterTypes.h" #include "extensions/jana/JOmniFactoryGeneratorT.h" #include "factories/calorimetry/CalorimeterClusterRecoCoG_factory.h" #include "factories/calorimetry/CalorimeterClusterShape_factory.h" @@ -94,7 +95,7 @@ void InitPlugin(JApplication* app) { }, {"EcalLumiSpecClustersWithoutShapes", // edm4eic::Cluster "EcalLumiSpecClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); app->Add(new JOmniFactoryGeneratorT( @@ -111,7 +112,7 @@ void InitPlugin(JApplication* app) { }, {"EcalLumiSpecTruthClustersWithoutShapes", // edm4eic::Cluster "EcalLumiSpecTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 4.6, .enableEtaBounds = false}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 4.6, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); app->Add(new JOmniFactoryGeneratorT( diff --git a/src/detectors/ZDC/ZDC.cc b/src/detectors/ZDC/ZDC.cc index 0bce2a0f53..f0b49ebe3c 100644 --- a/src/detectors/ZDC/ZDC.cc +++ b/src/detectors/ZDC/ZDC.cc @@ -8,6 +8,7 @@ #include #include +#include "algorithms/calorimetry/ClusterTypes.h" #include "algorithms/calorimetry/ImagingTopoClusterConfig.h" #include "extensions/jana/JOmniFactoryGeneratorT.h" #include "factories/calorimetry/CalorimeterClusterRecoCoG_factory.h" @@ -95,7 +96,7 @@ void InitPlugin(JApplication* app) { }, {"EcalFarForwardZDCTruthClustersWithoutShapes", // edm4eic::Cluster "EcalFarForwardZDCTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); @@ -119,6 +120,7 @@ void InitPlugin(JApplication* app) { .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterEMCal }, app // TODO: Remove me once fixed )); @@ -229,7 +231,8 @@ void InitPlugin(JApplication* app) { {.energyWeight = "log", .sampFrac = 0.0203, .logWeightBaseCoeffs = {5.8, 0.65, 0.31}, - .logWeightBase_Eref = 50 * dd4hep::GeV}, + .logWeightBase_Eref = 50 * dd4hep::GeV, + .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); @@ -282,7 +285,7 @@ void InitPlugin(JApplication* app) { }, {"HcalFarForwardZDCTruthClustersWithoutShapes", // edm4eic::Cluster "HcalFarForwardZDCTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false}, + {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); @@ -306,6 +309,7 @@ void InitPlugin(JApplication* app) { .sampFrac = 0.0203, .logWeightBase = 6.2, .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal }, app // TODO: Remove me once fixed )); From 68b84a44efdb1ae6fdc2100c3d65a04adb2cac96 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 15 Sep 2025 22:32:54 +0000 Subject: [PATCH 05/11] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../CalorimeterClusterRecoCoGConfig.h | 1 - src/algorithms/calorimetry/ClusterTypes.h | 8 +++- src/detectors/B0ECAL/B0ECAL.cc | 12 +++++- src/detectors/BHCAL/BHCAL.cc | 18 ++++++-- src/detectors/EEMC/EEMC.cc | 24 +++++++---- src/detectors/EHCAL/EHCAL.cc | 24 +++++++---- src/detectors/FEMC/FEMC.cc | 24 +++++++---- src/detectors/FHCAL/FHCAL.cc | 42 +++++++++++-------- src/detectors/LUMISPECCAL/LUMISPECCAL.cc | 12 +++++- src/detectors/ZDC/ZDC.cc | 36 +++++++++------- 10 files changed, 132 insertions(+), 69 deletions(-) diff --git a/src/algorithms/calorimetry/CalorimeterClusterRecoCoGConfig.h b/src/algorithms/calorimetry/CalorimeterClusterRecoCoGConfig.h index 9c1e25436e..b3c722a07b 100644 --- a/src/algorithms/calorimetry/CalorimeterClusterRecoCoGConfig.h +++ b/src/algorithms/calorimetry/CalorimeterClusterRecoCoGConfig.h @@ -35,7 +35,6 @@ struct CalorimeterClusterRecoCoGConfig { // enum in ClusterTypes.h. This can be useful for, eg., // flagging EMCal vs. HCal clusters in downstream algorithms int32_t clusterType = Jug::Reco::ClusterType::kCluster2D; - }; } // namespace eicrecon diff --git a/src/algorithms/calorimetry/ClusterTypes.h b/src/algorithms/calorimetry/ClusterTypes.h index fb296255db..413890609d 100644 --- a/src/algorithms/calorimetry/ClusterTypes.h +++ b/src/algorithms/calorimetry/ClusterTypes.h @@ -3,5 +3,11 @@ #pragma once namespace Jug::Reco { -enum ClusterType : int32_t { kCluster2D = 0, kCluster3D = 1, kClusterSlice = 2, kClusterEMCal = 3, kClusterHCal = 4 }; +enum ClusterType : int32_t { + kCluster2D = 0, + kCluster3D = 1, + kClusterSlice = 2, + kClusterEMCal = 3, + kClusterHCal = 4 +}; } diff --git a/src/detectors/B0ECAL/B0ECAL.cc b/src/detectors/B0ECAL/B0ECAL.cc index 620aca94bc..6fba4a5ccc 100644 --- a/src/detectors/B0ECAL/B0ECAL.cc +++ b/src/detectors/B0ECAL/B0ECAL.cc @@ -89,7 +89,11 @@ void InitPlugin(JApplication* app) { }, {"B0ECalClustersWithoutShapes", // edm4eic::Cluster "B0ECalClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterEMCal }, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 3.6, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app)); app->Add(new JOmniFactoryGeneratorT( @@ -105,7 +109,11 @@ void InitPlugin(JApplication* app) { }, {"B0ECalTruthClustersWithoutShapes", // edm4eic::Cluster "B0ECalTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterEMCal }, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 6.2, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app)); app->Add(new JOmniFactoryGeneratorT( diff --git a/src/detectors/BHCAL/BHCAL.cc b/src/detectors/BHCAL/BHCAL.cc index 6f2a35b8b8..ea70b1f6d1 100644 --- a/src/detectors/BHCAL/BHCAL.cc +++ b/src/detectors/BHCAL/BHCAL.cc @@ -131,7 +131,11 @@ void InitPlugin(JApplication* app) { }, {"HcalBarrelClustersWithoutShapes", // edm4eic::Cluster "HcalBarrelClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 6.2, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); @@ -149,7 +153,11 @@ void InitPlugin(JApplication* app) { }, {"HcalBarrelTruthClustersWithoutShapes", // edm4eic::Cluster "HcalBarrelTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 6.2, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); @@ -181,7 +189,11 @@ void InitPlugin(JApplication* app) { }, {"HcalBarrelSplitMergeClustersWithoutShapes", // edm4eic::Cluster "HcalBarrelSplitMergeClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 6.2, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); diff --git a/src/detectors/EEMC/EEMC.cc b/src/detectors/EEMC/EEMC.cc index 72890ed92c..a40b71fa96 100644 --- a/src/detectors/EEMC/EEMC.cc +++ b/src/detectors/EEMC/EEMC.cc @@ -117,7 +117,11 @@ void InitPlugin(JApplication* app) { }, {"EcalEndcapNTruthClustersWithoutShapes", // edm4eic::Cluster "EcalEndcapNTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 4.6, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 4.6, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); @@ -144,13 +148,11 @@ void InitPlugin(JApplication* app) { {"EcalEndcapNClustersWithoutShapes", // edm4eic::Cluster "EcalEndcapNClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation #endif - { - .energyWeight = "log", - .sampFrac = 1.0, - .logWeightBase = 3.6, - .enableEtaBounds = false, - .clusterType = Jug::Reco::ClusterType::kClusterEMCal - }, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 3.6, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); @@ -229,7 +231,11 @@ void InitPlugin(JApplication* app) { }, {"EcalEndcapNSplitMergeClustersWithoutShapes", // edm4eic::Cluster "EcalEndcapNSplitMergeClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 3.6, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); diff --git a/src/detectors/EHCAL/EHCAL.cc b/src/detectors/EHCAL/EHCAL.cc index 866c80aa3c..2b233d9421 100644 --- a/src/detectors/EHCAL/EHCAL.cc +++ b/src/detectors/EHCAL/EHCAL.cc @@ -111,7 +111,11 @@ void InitPlugin(JApplication* app) { }, {"HcalEndcapNTruthClustersWithoutShapes", // edm4eic::Cluster "HcalEndcapNTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 6.2, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); app->Add(new JOmniFactoryGeneratorT( @@ -127,13 +131,11 @@ void InitPlugin(JApplication* app) { }, {"HcalEndcapNClustersWithoutShapes", // edm4eic::Cluster "HcalEndcapNClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - { - .energyWeight = "log", - .sampFrac = 1.0, - .logWeightBase = 6.2, - .enableEtaBounds = false, - .clusterType = Jug::Reco::ClusterType::kClusterHCal - }, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 6.2, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); app->Add(new JOmniFactoryGeneratorT( @@ -162,7 +164,11 @@ void InitPlugin(JApplication* app) { }, {"HcalEndcapNSplitMergeClustersWithoutShapes", // edm4eic::Cluster "HcalEndcapNSplitMergeClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 6.2, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); app->Add(new JOmniFactoryGeneratorT( diff --git a/src/detectors/FEMC/FEMC.cc b/src/detectors/FEMC/FEMC.cc index 4ab4a05c6f..53c992fd50 100644 --- a/src/detectors/FEMC/FEMC.cc +++ b/src/detectors/FEMC/FEMC.cc @@ -104,7 +104,11 @@ void InitPlugin(JApplication* app) { }, {"EcalEndcapPTruthClustersWithoutShapes", // edm4eic::Cluster "EcalEndcapPTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = true, .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 6.2, + .enableEtaBounds = true, + .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); @@ -122,13 +126,11 @@ void InitPlugin(JApplication* app) { }, {"EcalEndcapPClustersWithoutShapes", // edm4eic::Cluster "EcalEndcapPClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - { - .energyWeight = "log", - .sampFrac = 1.0, - .logWeightBase = 3.6, - .enableEtaBounds = false, - .clusterType = Jug::Reco::ClusterType::kClusterEMCal - }, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 3.6, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); @@ -160,7 +162,11 @@ void InitPlugin(JApplication* app) { }, {"EcalEndcapPSplitMergeClustersWithoutShapes", // edm4eic::Cluster "EcalEndcapPSplitMergeClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 3.6, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); diff --git a/src/detectors/FHCAL/FHCAL.cc b/src/detectors/FHCAL/FHCAL.cc index 5b857b2dda..726ac49318 100644 --- a/src/detectors/FHCAL/FHCAL.cc +++ b/src/detectors/FHCAL/FHCAL.cc @@ -127,7 +127,11 @@ void InitPlugin(JApplication* app) { }, {"HcalEndcapPInsertTruthClustersWithoutShapes", // edm4eic::Cluster "HcalEndcapPInsertTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 0.0257, .logWeightBase = 3.6, .enableEtaBounds = true, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, + {.energyWeight = "log", + .sampFrac = 0.0257, + .logWeightBase = 3.6, + .enableEtaBounds = true, + .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); @@ -146,13 +150,11 @@ void InitPlugin(JApplication* app) { }, {"HcalEndcapPInsertClustersWithoutShapes", // edm4eic::Cluster "HcalEndcapPInsertClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - { - .energyWeight = "log", - .sampFrac = 0.0257, - .logWeightBase = 6.2, - .enableEtaBounds = false, - .clusterType = Jug::Reco::ClusterType::kClusterHCal - }, + {.energyWeight = "log", + .sampFrac = 0.0257, + .logWeightBase = 6.2, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); @@ -262,7 +264,11 @@ void InitPlugin(JApplication* app) { }, {"LFHCALTruthClustersWithoutShapes", // edm4eic::Cluster "LFHCALTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 4.5, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 4.5, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); @@ -280,13 +286,11 @@ void InitPlugin(JApplication* app) { }, {"LFHCALClustersWithoutShapes", // edm4eic::Cluster "LFHCALClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - { - .energyWeight = "log", - .sampFrac = 1.0, - .logWeightBase = 4.5, - .enableEtaBounds = false, - .clusterType = Jug::Reco::ClusterType::kClusterHCal - }, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 4.5, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); @@ -316,7 +320,11 @@ void InitPlugin(JApplication* app) { }, {"LFHCALSplitMergeClustersWithoutShapes", // edm4eic::Cluster "LFHCALSplitMergeClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 4.5, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 4.5, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); diff --git a/src/detectors/LUMISPECCAL/LUMISPECCAL.cc b/src/detectors/LUMISPECCAL/LUMISPECCAL.cc index b3fb3d076d..9b3cf2234c 100644 --- a/src/detectors/LUMISPECCAL/LUMISPECCAL.cc +++ b/src/detectors/LUMISPECCAL/LUMISPECCAL.cc @@ -95,7 +95,11 @@ void InitPlugin(JApplication* app) { }, {"EcalLumiSpecClustersWithoutShapes", // edm4eic::Cluster "EcalLumiSpecClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 3.6, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); app->Add(new JOmniFactoryGeneratorT( @@ -112,7 +116,11 @@ void InitPlugin(JApplication* app) { }, {"EcalLumiSpecTruthClustersWithoutShapes", // edm4eic::Cluster "EcalLumiSpecTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 4.6, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 4.6, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); app->Add(new JOmniFactoryGeneratorT( diff --git a/src/detectors/ZDC/ZDC.cc b/src/detectors/ZDC/ZDC.cc index f0b49ebe3c..06b32b51df 100644 --- a/src/detectors/ZDC/ZDC.cc +++ b/src/detectors/ZDC/ZDC.cc @@ -96,7 +96,11 @@ void InitPlugin(JApplication* app) { }, {"EcalFarForwardZDCTruthClustersWithoutShapes", // edm4eic::Cluster "EcalFarForwardZDCTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 3.6, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); @@ -115,13 +119,11 @@ void InitPlugin(JApplication* app) { }, {"EcalFarForwardZDCClustersWithoutShapes", // edm4eic::Cluster "EcalFarForwardZDCClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - { - .energyWeight = "log", - .sampFrac = 1.0, - .logWeightBase = 6.2, - .enableEtaBounds = false, - .clusterType = Jug::Reco::ClusterType::kClusterEMCal - }, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 6.2, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); @@ -285,7 +287,11 @@ void InitPlugin(JApplication* app) { }, {"HcalFarForwardZDCTruthClustersWithoutShapes", // edm4eic::Cluster "HcalFarForwardZDCTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false, .clusterType = Jug::Reco::ClusterType::kClusterHCal}, + {.energyWeight = "log", + .sampFrac = 1.0, + .logWeightBase = 3.6, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); @@ -304,13 +310,11 @@ void InitPlugin(JApplication* app) { }, {"HcalFarForwardZDCClustersBaselineWithoutShapes", // edm4eic::Cluster "HcalFarForwardZDCClusterAssociationsBaselineWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - { - .energyWeight = "log", - .sampFrac = 0.0203, - .logWeightBase = 6.2, - .enableEtaBounds = false, - .clusterType = Jug::Reco::ClusterType::kClusterHCal - }, + {.energyWeight = "log", + .sampFrac = 0.0203, + .logWeightBase = 6.2, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); From fbc630c16dca23253b8fd5ed12e9160eb8189442 Mon Sep 17 00:00:00 2001 From: ruse-traveler Date: Thu, 18 Sep 2025 15:50:08 -0400 Subject: [PATCH 06/11] Add type option to reco energy-position merger --- src/algorithms/calorimetry/EnergyPositionClusterMerger.cc | 1 + .../calorimetry/EnergyPositionClusterMergerConfig.h | 8 ++++++++ src/detectors/BEMC/BEMC.cc | 2 ++ .../calorimetry/EnergyPositionClusterMerger_factory.h | 1 + 4 files changed, 12 insertions(+) diff --git a/src/algorithms/calorimetry/EnergyPositionClusterMerger.cc b/src/algorithms/calorimetry/EnergyPositionClusterMerger.cc index 35b986cae1..4c403a83ab 100644 --- a/src/algorithms/calorimetry/EnergyPositionClusterMerger.cc +++ b/src/algorithms/calorimetry/EnergyPositionClusterMerger.cc @@ -86,6 +86,7 @@ void EnergyPositionClusterMerger::process(const Input& input, const Output& outp auto new_clus = merged_clus->create(); new_clus.setEnergy(ec.getEnergy()); new_clus.setEnergyError(ec.getEnergyError()); + new_clus.setType(m_cfg.clusterType); new_clus.setTime(pc.getTime()); new_clus.setNhits(pc.getNhits() + ec.getNhits()); new_clus.setPosition(pc.getPosition()); diff --git a/src/algorithms/calorimetry/EnergyPositionClusterMergerConfig.h b/src/algorithms/calorimetry/EnergyPositionClusterMergerConfig.h index 32a8464d5a..97dfef9e58 100644 --- a/src/algorithms/calorimetry/EnergyPositionClusterMergerConfig.h +++ b/src/algorithms/calorimetry/EnergyPositionClusterMergerConfig.h @@ -3,6 +3,8 @@ #pragma once +#include "ClusterTypes.h" + namespace eicrecon { struct EnergyPositionClusterMergerConfig { @@ -10,6 +12,12 @@ struct EnergyPositionClusterMergerConfig { double energyRelTolerance{0.5}; double phiTolerance{0.1}; double etaTolerance{0.2}; + + // cluster type: can be used to flag clusters + // as being a type specified by the Jug::Reco::ClusterType + // enum in ClusterTypes.h. This can be useful for, eg., + // flagging EMCal vs. HCal clusters in downstream algorithms + int32_t clusterType{Jug::Reco::ClusterType::kCluster3D}; }; } // namespace eicrecon diff --git a/src/detectors/BEMC/BEMC.cc b/src/detectors/BEMC/BEMC.cc index f35938b388..b403a8fc12 100644 --- a/src/detectors/BEMC/BEMC.cc +++ b/src/detectors/BEMC/BEMC.cc @@ -15,6 +15,7 @@ #include #include "algorithms/calorimetry/CalorimeterHitDigiConfig.h" +#include "algorithms/calorimetry/ClusterTypes.h" #include "algorithms/calorimetry/ImagingTopoClusterConfig.h" #include "algorithms/calorimetry/SimCalorimeterHitProcessorConfig.h" #include "algorithms/digi/PulseGenerationConfig.h" @@ -279,6 +280,7 @@ void InitPlugin(JApplication* app) { .energyRelTolerance = 0.5, .phiTolerance = 0.1, .etaTolerance = 0.2, + .clusterType = Jug::Reco::ClusterType::kClusterEMCal, }, app // TODO: Remove me once fixed )); diff --git a/src/factories/calorimetry/EnergyPositionClusterMerger_factory.h b/src/factories/calorimetry/EnergyPositionClusterMerger_factory.h index 31bb8d9646..6a6cd669bd 100644 --- a/src/factories/calorimetry/EnergyPositionClusterMerger_factory.h +++ b/src/factories/calorimetry/EnergyPositionClusterMerger_factory.h @@ -30,6 +30,7 @@ class EnergyPositionClusterMerger_factory config().energyRelTolerance}; ParameterRef m_phiTolerance{this, "phiTolerance", config().phiTolerance}; ParameterRef m_etaTolerance{this, "etaTolerance", config().etaTolerance}; + ParameterRef m_systemID{this, "clusterType", config().clusterType}; Service m_algorithmsInit{this}; From a796759e05e571946da9ccd270f57ddab6ea86ac Mon Sep 17 00:00:00 2001 From: ruse-traveler Date: Thu, 18 Sep 2025 16:35:04 -0400 Subject: [PATCH 07/11] Add cluster type to truth energ-position merger --- .../TruthEnergyPositionClusterMerger.cc | 6 ++++++ .../TruthEnergyPositionClusterMerger.h | 20 +++++++++++-------- .../TruthEnergyPositionClusterMergerConfig.h | 19 ++++++++++++++++++ src/detectors/BEMC/BEMC.cc | 1 + ...TruthEnergyPositionClusterMerger_factory.h | 5 ++++- 5 files changed, 42 insertions(+), 9 deletions(-) create mode 100644 src/algorithms/calorimetry/TruthEnergyPositionClusterMergerConfig.h diff --git a/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc b/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc index bdbf4b5fd0..cc8bf9bfb6 100644 --- a/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc +++ b/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc @@ -16,6 +16,8 @@ #include #include +#include "algorithms/calorimetry/TruthEnergyPositionClusterMergerConfig.h" + namespace eicrecon { void TruthEnergyPositionClusterMerger::process(const Input& input, const Output& output) const { @@ -54,6 +56,7 @@ void TruthEnergyPositionClusterMerger::process(const Input& input, const Output& debug(" --> Processing position cluster {}, mcID: {}, energy: {}", pclus.getObjectID().index, mcID, pclus.getEnergy()); + if (energyMap.count(mcID)) { const auto& eclus = energyMap[mcID]; @@ -61,6 +64,7 @@ void TruthEnergyPositionClusterMerger::process(const Input& input, const Output& auto new_clus = merged_clus->create(); new_clus.setEnergy(eclus.getEnergy()); new_clus.setEnergyError(eclus.getEnergyError()); + new_clus.setType(m_cfg.clusterType); new_clus.setTime(pclus.getTime()); new_clus.setNhits(pclus.getNhits() + eclus.getNhits()); new_clus.setPosition(pclus.getPosition()); @@ -96,6 +100,7 @@ void TruthEnergyPositionClusterMerger::process(const Input& input, const Output& debug(" --> No matching energy cluster found, copying over position cluster"); auto new_clus = pclus.clone(); new_clus.addToClusters(pclus); + new_clus.setType(m_cfg.clusterType); merged_clus->push_back(new_clus); // set association @@ -120,6 +125,7 @@ void TruthEnergyPositionClusterMerger::process(const Input& input, const Output& auto new_clus = merged_clus->create(); new_clus.setEnergy(eclus.getEnergy()); new_clus.setEnergyError(eclus.getEnergyError()); + new_clus.setType(m_cfg.clusterType); new_clus.setTime(eclus.getTime()); new_clus.setNhits(eclus.getNhits()); // FIXME use nominal dd4hep::radius of 110cm, and use start vertex theta and phi diff --git a/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.h b/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.h index c13d31280d..a54f1b1f55 100644 --- a/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.h +++ b/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.h @@ -11,6 +11,9 @@ #include #include +#include "TruthEnergyPositionClusterMergerConfig.h" +#include "algorithms/interfaces/WithPodConfig.h" + namespace eicrecon { using TruthEnergyPositionClusterMergerAlgorithm = algorithms::Algorithm< @@ -22,14 +25,15 @@ using TruthEnergyPositionClusterMergerAlgorithm = algorithms::Algorithm< edm4eic::MCRecoClusterParticleAssociationCollection>>; /** Simple algorithm to merge the energy measurement from cluster1 with the position - * measurement of cluster2 (in case matching clusters are found). If not, it will - * propagate the raw cluster from cluster1 or cluster2 - * - * Matching occurs based on the mc truth information of the clusters. - * - * \ingroup reco - */ -class TruthEnergyPositionClusterMerger : public TruthEnergyPositionClusterMergerAlgorithm { + * measurement of cluster2 (in case matching clusters are found). If not, it will + * propagate the raw cluster from cluster1 or cluster2 + * + * Matching occurs based on the mc truth information of the clusters. + * + * \ingroup reco + */ +class TruthEnergyPositionClusterMerger : public TruthEnergyPositionClusterMergerAlgorithm, + public WithPodConfig { public: TruthEnergyPositionClusterMerger(std::string_view name) diff --git a/src/algorithms/calorimetry/TruthEnergyPositionClusterMergerConfig.h b/src/algorithms/calorimetry/TruthEnergyPositionClusterMergerConfig.h new file mode 100644 index 0000000000..20a294389a --- /dev/null +++ b/src/algorithms/calorimetry/TruthEnergyPositionClusterMergerConfig.h @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: LGPL-3.0-or-later +// Copyright (C) 2025 Derek Anderson + +#pragma once + +#include "ClusterTypes.h" + +namespace eicrecon { + +struct TruthEnergyPositionClusterMergerConfig { + + // cluster type: can be used to flag clusters + // as being a type specified by the Jug::Reco::ClusterType + // enum in ClusterTypes.h. This can be useful for, eg., + // flagging EMCal vs. HCal clusters in downstream algorithms + int32_t clusterType{Jug::Reco::ClusterType::kCluster3D}; +}; + +} // namespace eicrecon diff --git a/src/detectors/BEMC/BEMC.cc b/src/detectors/BEMC/BEMC.cc index b403a8fc12..49f914105d 100644 --- a/src/detectors/BEMC/BEMC.cc +++ b/src/detectors/BEMC/BEMC.cc @@ -289,6 +289,7 @@ void InitPlugin(JApplication* app) { {"MCParticles", "EcalBarrelScFiClusters", "EcalBarrelScFiClusterAssociations", "EcalBarrelImagingClusters", "EcalBarrelImagingClusterAssociations"}, {"EcalBarrelTruthClusters", "EcalBarrelTruthClusterAssociations"}, + {.clusterType = Jug::Reco::ClusterType::kClusterEMCal}, app // TODO: Remove me once fixed )); } diff --git a/src/factories/calorimetry/TruthEnergyPositionClusterMerger_factory.h b/src/factories/calorimetry/TruthEnergyPositionClusterMerger_factory.h index 73a218a6c2..8313b1dba0 100644 --- a/src/factories/calorimetry/TruthEnergyPositionClusterMerger_factory.h +++ b/src/factories/calorimetry/TruthEnergyPositionClusterMerger_factory.h @@ -10,7 +10,7 @@ namespace eicrecon { class TruthEnergyPositionClusterMerger_factory - : public JOmniFactory { + : public JOmniFactory { public: using AlgoT = eicrecon::TruthEnergyPositionClusterMerger; @@ -26,12 +26,15 @@ class TruthEnergyPositionClusterMerger_factory PodioOutput m_clusters_output{this}; PodioOutput m_assocs_output{this}; + ParameterRef m_systemID{this, "clusterType", config().clusterType}; + Service m_algorithmsInit{this}; public: void Configure() { m_algo = std::make_unique(GetPrefix()); m_algo->level(static_cast(logger()->level())); + m_algo->applyConfig(config()); m_algo->init(); } From c2d341c4c6f83978a6eba930298b3c601fbbb211 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 18 Sep 2025 20:35:25 +0000 Subject: [PATCH 08/11] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../calorimetry/TruthEnergyPositionClusterMerger.h | 5 +++-- .../calorimetry/TruthEnergyPositionClusterMergerConfig.h | 2 +- .../calorimetry/TruthEnergyPositionClusterMerger_factory.h | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.h b/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.h index a54f1b1f55..c8e032a52e 100644 --- a/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.h +++ b/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.h @@ -32,8 +32,9 @@ using TruthEnergyPositionClusterMergerAlgorithm = algorithms::Algorithm< * * \ingroup reco */ -class TruthEnergyPositionClusterMerger : public TruthEnergyPositionClusterMergerAlgorithm, - public WithPodConfig { +class TruthEnergyPositionClusterMerger + : public TruthEnergyPositionClusterMergerAlgorithm, + public WithPodConfig { public: TruthEnergyPositionClusterMerger(std::string_view name) diff --git a/src/algorithms/calorimetry/TruthEnergyPositionClusterMergerConfig.h b/src/algorithms/calorimetry/TruthEnergyPositionClusterMergerConfig.h index 20a294389a..d1ec3c90b5 100644 --- a/src/algorithms/calorimetry/TruthEnergyPositionClusterMergerConfig.h +++ b/src/algorithms/calorimetry/TruthEnergyPositionClusterMergerConfig.h @@ -1,5 +1,5 @@ // SPDX-License-Identifier: LGPL-3.0-or-later -// Copyright (C) 2025 Derek Anderson +// Copyright (C) 2025 Derek Anderson #pragma once diff --git a/src/factories/calorimetry/TruthEnergyPositionClusterMerger_factory.h b/src/factories/calorimetry/TruthEnergyPositionClusterMerger_factory.h index 8313b1dba0..7a2919c75d 100644 --- a/src/factories/calorimetry/TruthEnergyPositionClusterMerger_factory.h +++ b/src/factories/calorimetry/TruthEnergyPositionClusterMerger_factory.h @@ -10,7 +10,8 @@ namespace eicrecon { class TruthEnergyPositionClusterMerger_factory - : public JOmniFactory { + : public JOmniFactory { public: using AlgoT = eicrecon::TruthEnergyPositionClusterMerger; From c92b607f32830b16fc2ca74bf3b3f69966303273 Mon Sep 17 00:00:00 2001 From: Wouter Deconinck Date: Thu, 18 Sep 2025 16:36:38 -0500 Subject: [PATCH 09/11] Flag clusters as EMCal or HCal (fix: iwyu) (#2088) This PR applies the include-what-you-use fixes as suggested by https://github.com/eic/EICrecon/actions/runs/17840742667. Please merge this PR into the branch `for-calo-type-flag` to resolve failures in PR #2078. Auto-generated by [create-pull-request][1] [1]: https://github.com/peter-evans/create-pull-request Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/algorithms/calorimetry/EnergyPositionClusterMerger.cc | 1 - src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/algorithms/calorimetry/EnergyPositionClusterMerger.cc b/src/algorithms/calorimetry/EnergyPositionClusterMerger.cc index 4c403a83ab..42a86d4515 100644 --- a/src/algorithms/calorimetry/EnergyPositionClusterMerger.cc +++ b/src/algorithms/calorimetry/EnergyPositionClusterMerger.cc @@ -3,7 +3,6 @@ #include "algorithms/calorimetry/EnergyPositionClusterMerger.h" -#include #include #include #include diff --git a/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc b/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc index cc8bf9bfb6..1e7a6be5a3 100644 --- a/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc +++ b/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc @@ -4,9 +4,7 @@ #include "algorithms/calorimetry/TruthEnergyPositionClusterMerger.h" #include -#include #include -#include #include #include #include From af0f5a09b5e6ac0c244a4de44dc848b6a13686fe Mon Sep 17 00:00:00 2001 From: Derek M Anderson Date: Tue, 23 Sep 2025 11:19:15 -0400 Subject: [PATCH 10/11] Use contains vs. count Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc b/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc index 1e7a6be5a3..c8863afdc1 100644 --- a/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc +++ b/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc @@ -55,7 +55,7 @@ void TruthEnergyPositionClusterMerger::process(const Input& input, const Output& debug(" --> Processing position cluster {}, mcID: {}, energy: {}", pclus.getObjectID().index, mcID, pclus.getEnergy()); - if (energyMap.count(mcID)) { + if (energyMap.contains(mcID)) { const auto& eclus = energyMap[mcID]; From 0959e87e2de7c2df195e31bb60cd9e301f78d4eb Mon Sep 17 00:00:00 2001 From: ruse-traveler Date: Tue, 23 Sep 2025 11:23:22 -0400 Subject: [PATCH 11/11] Make sure use of count vs. contains is consistent --- src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc b/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc index c8863afdc1..5c9774f936 100644 --- a/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc +++ b/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc @@ -173,7 +173,7 @@ std::map TruthEnergyPositionClusterMerger::indexedCluster continue; } - const bool duplicate = matched.count(mcID); + const bool duplicate = matched.contains(mcID); if (duplicate) { trace(" --> WARNING: this is a duplicate mcID, keeping the higher energy cluster"); if (cluster.getEnergy() < matched[mcID].getEnergy()) {