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..b3c722a07b 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. 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 9b91fceaa8..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 }; +enum ClusterType : int32_t { + kCluster2D = 0, + kCluster3D = 1, + kClusterSlice = 2, + kClusterEMCal = 3, + kClusterHCal = 4 +}; } diff --git a/src/algorithms/calorimetry/EnergyPositionClusterMerger.cc b/src/algorithms/calorimetry/EnergyPositionClusterMerger.cc index 35b986cae1..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 @@ -86,6 +85,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/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc b/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.cc index bdbf4b5fd0..5c9774f936 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 @@ -16,6 +14,8 @@ #include #include +#include "algorithms/calorimetry/TruthEnergyPositionClusterMergerConfig.h" + namespace eicrecon { void TruthEnergyPositionClusterMerger::process(const Input& input, const Output& output) const { @@ -54,13 +54,15 @@ 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]; 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 +98,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 +123,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 @@ -169,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()) { diff --git a/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.h b/src/algorithms/calorimetry/TruthEnergyPositionClusterMerger.h index c13d31280d..c8e032a52e 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,16 @@ 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..d1ec3c90b5 --- /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/B0ECAL/B0ECAL.cc b/src/detectors/B0ECAL/B0ECAL.cc index 59aaa32ecb..6fba4a5ccc 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,11 @@ 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 +109,11 @@ 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/BEMC/BEMC.cc b/src/detectors/BEMC/BEMC.cc index f35938b388..49f914105d 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 )); @@ -287,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/detectors/BHCAL/BHCAL.cc b/src/detectors/BHCAL/BHCAL.cc index 7cff7bfd97..ea70b1f6d1 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,11 @@ 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 +153,11 @@ 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 +189,11 @@ 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..a40b71fa96 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,11 @@ 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 )); @@ -143,12 +148,11 @@ void InitPlugin(JApplication* app) { {"EcalEndcapNClustersWithoutShapes", // edm4eic::Cluster "EcalEndcapNClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation #endif - { - .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 )); @@ -227,7 +231,11 @@ 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..2b233d9421 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,11 @@ 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( @@ -126,12 +131,11 @@ void InitPlugin(JApplication* app) { }, {"HcalEndcapNClustersWithoutShapes", // edm4eic::Cluster "HcalEndcapNClusterAssociationsWithoutShapes"}, // 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( @@ -160,7 +164,11 @@ 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..53c992fd50 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,11 @@ 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 )); @@ -121,12 +126,11 @@ void InitPlugin(JApplication* app) { }, {"EcalEndcapPClustersWithoutShapes", // edm4eic::Cluster "EcalEndcapPClusterAssociationsWithoutShapes"}, // 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 )); @@ -158,7 +162,11 @@ 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..726ac49318 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,11 @@ 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 )); @@ -145,12 +150,11 @@ void InitPlugin(JApplication* app) { }, {"HcalEndcapPInsertClustersWithoutShapes", // edm4eic::Cluster "HcalEndcapPInsertClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - { - .energyWeight = "log", - .sampFrac = 0.0257, - .logWeightBase = 6.2, - .enableEtaBounds = false, - }, + {.energyWeight = "log", + .sampFrac = 0.0257, + .logWeightBase = 6.2, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); @@ -260,7 +264,11 @@ 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 )); @@ -278,12 +286,11 @@ void InitPlugin(JApplication* app) { }, {"LFHCALClustersWithoutShapes", // edm4eic::Cluster "LFHCALClusterAssociationsWithoutShapes"}, // 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 )); @@ -313,7 +320,11 @@ 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..9b3cf2234c 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,11 @@ 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 +116,11 @@ 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..06b32b51df 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,11 @@ 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 )); @@ -114,12 +119,11 @@ void InitPlugin(JApplication* app) { }, {"EcalFarForwardZDCClustersWithoutShapes", // edm4eic::Cluster "EcalFarForwardZDCClusterAssociationsWithoutShapes"}, // 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 // TODO: Remove me once fixed )); @@ -229,7 +233,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 +287,11 @@ 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 )); @@ -301,12 +310,11 @@ void InitPlugin(JApplication* app) { }, {"HcalFarForwardZDCClustersBaselineWithoutShapes", // edm4eic::Cluster "HcalFarForwardZDCClusterAssociationsBaselineWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation - { - .energyWeight = "log", - .sampFrac = 0.0203, - .logWeightBase = 6.2, - .enableEtaBounds = false, - }, + {.energyWeight = "log", + .sampFrac = 0.0203, + .logWeightBase = 6.2, + .enableEtaBounds = false, + .clusterType = Jug::Reco::ClusterType::kClusterHCal}, app // TODO: Remove me once fixed )); 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}; 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}; diff --git a/src/factories/calorimetry/TruthEnergyPositionClusterMerger_factory.h b/src/factories/calorimetry/TruthEnergyPositionClusterMerger_factory.h index 73a218a6c2..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; @@ -26,12 +27,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(); }