Skip to content

Commit

Permalink
feat: Calorimeter Truth Clustering simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
wdconinc committed Jul 27, 2023
1 parent 9c7d781 commit 3ae0f74
Show file tree
Hide file tree
Showing 24 changed files with 139 additions and 711 deletions.
20 changes: 5 additions & 15 deletions src/algorithms/calorimetry/CalorimeterTruthClustering.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,14 @@

using namespace dd4hep;

//------------------------
// AlgorithmInit
//------------------------
void CalorimeterTruthClustering::AlgorithmInit(std::shared_ptr<spdlog::logger> &logger) {
namespace eicrecon{

void CalorimeterTruthClustering::init(std::shared_ptr<spdlog::logger> &logger) {
m_log = logger;

return;
}

//------------------------
// AlgorithmChangeRun
//------------------------
void CalorimeterTruthClustering::AlgorithmChangeRun() {
}

//------------------------
// AlgorithmProcess
//------------------------
std::unique_ptr<edm4eic::ProtoClusterCollection> CalorimeterTruthClustering::AlgorithmProcess(const edm4eic::CalorimeterHitCollection &hits, const edm4hep::SimCalorimeterHitCollection &mc) {
std::unique_ptr<edm4eic::ProtoClusterCollection> CalorimeterTruthClustering::process(const edm4eic::CalorimeterHitCollection &hits, const edm4hep::SimCalorimeterHitCollection &mc) {
// Create output collections
auto output = std::make_unique<edm4eic::ProtoClusterCollection>();

Expand Down Expand Up @@ -87,3 +75,5 @@ std::unique_ptr<edm4eic::ProtoClusterCollection> CalorimeterTruthClustering::Alg

return std::move(output);
}

} // namespace eicrecon
19 changes: 10 additions & 9 deletions src/algorithms/calorimetry/CalorimeterTruthClustering.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@
#include <edm4eic/ProtoClusterCollection.h>
#include <spdlog/spdlog.h>

namespace eicrecon {

class CalorimeterTruthClustering {

class CalorimeterTruthClustering {

protected:
protected:
// Insert any member variables here
std::shared_ptr<spdlog::logger> m_log;

public:
CalorimeterTruthClustering() = default;
void AlgorithmInit(std::shared_ptr<spdlog::logger> &logger);
void AlgorithmChangeRun();
std::unique_ptr<edm4eic::ProtoClusterCollection> AlgorithmProcess(const edm4eic::CalorimeterHitCollection &hits, const edm4hep::SimCalorimeterHitCollection &mc);
};
public:
void init(std::shared_ptr<spdlog::logger> &logger);
std::unique_ptr<edm4eic::ProtoClusterCollection> process(const edm4eic::CalorimeterHitCollection &hits, const edm4hep::SimCalorimeterHitCollection &mc);

};

} // namespace eicrecon
8 changes: 5 additions & 3 deletions src/detectors/B0ECAL/B0ECAL.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
#include "factories/calorimetry/CalorimeterClusterRecoCoG_factoryT.h"
#include "factories/calorimetry/CalorimeterHitDigi_factoryT.h"
#include "factories/calorimetry/CalorimeterHitReco_factoryT.h"
#include "factories/calorimetry/CalorimeterTruthClustering_factoryT.h"

#include "ProtoCluster_factory_B0ECalTruthProtoClusters.h"
#include "ProtoCluster_factory_B0ECalIslandProtoClusters.h"


namespace eicrecon {
using RawCalorimeterHit_factory_B0ECalRawHits = CalorimeterHitDigi_factoryT<>;
using CalorimeterHit_factory_B0ECalRecHits = CalorimeterHitReco_factoryT<>;
using ProtoCluster_factory_B0ECalTruthProtoClusters = CalorimeterTruthClustering_factoryT<>;
using Cluster_factory_B0ECalTruthClusters = CalorimeterClusterRecoCoG_factoryT<>;
using Cluster_factory_B0ECalClusters = CalorimeterClusterRecoCoG_factoryT<>;
}
Expand Down Expand Up @@ -59,8 +60,9 @@ extern "C" {
},
app // TODO: Remove me once fixed
));
app->Add(new JChainFactoryGeneratorT<ProtoCluster_factory_B0ECalTruthProtoClusters>(
{"B0ECalRecHits", "B0ECalHits"}, "B0ECalTruthProtoClusters"
app->Add(new JChainMultifactoryGeneratorT<ProtoCluster_factory_B0ECalTruthProtoClusters>(
"B0ECalTruthProtoClusters", {"B0ECalRecHits", "B0ECalHits"}, {"B0ECalTruthProtoClusters"},
app // TODO: Remove me once fixed
));
app->Add(new JChainFactoryGeneratorT<ProtoCluster_factory_B0ECalIslandProtoClusters>(
{"B0ECalRecHits"}, "B0ECalIslandProtoClusters"
Expand Down

This file was deleted.

16 changes: 8 additions & 8 deletions src/detectors/BEMC/BEMC.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include "factories/calorimetry/CalorimeterHitDigi_factoryT.h"
#include "factories/calorimetry/CalorimeterHitReco_factoryT.h"
#include "factories/calorimetry/CalorimeterHitsMerger_factoryT.h"
#include "factories/calorimetry/CalorimeterTruthClustering_factoryT.h"

#include "ProtoCluster_factory_EcalBarrelSciGlassTruthProtoClusters.h"
#include "ProtoCluster_factory_EcalBarrelSciGlassProtoClusters.h"
#include "Cluster_factory_EcalBarrelSciGlassMergedTruthClusters.h"

Expand All @@ -29,6 +29,7 @@ namespace eicrecon {
using CalorimeterHit_factory_EcalBarrelSciGlassRecHits = CalorimeterHitReco_factoryT<>;
using CalorimeterHit_factory_EcalBarrelScFiRecHits = CalorimeterHitReco_factoryT<>;
using CalorimeterHit_factory_EcalBarrelScFiMergedHits = CalorimeterHitsMerger_factoryT<>;
using ProtoCluster_factory_EcalBarrelSciGlassTruthProtoClusters = CalorimeterTruthClustering_factoryT<>;
using Cluster_factory_EcalBarrelSciGlassTruthClusters = CalorimeterClusterRecoCoG_factoryT<>;
using Cluster_factory_EcalBarrelSciGlassClusters = CalorimeterClusterRecoCoG_factoryT<>;
using Cluster_factory_EcalBarrelScFiClusters = CalorimeterClusterRecoCoG_factoryT<>;
Expand Down Expand Up @@ -200,13 +201,12 @@ extern "C" {
app->Add(new JFactoryGeneratorT<JFactoryT<edm4eic::Cluster>>("EcalBarrelImagingLayers"));
app->Add(new JFactoryGeneratorT<JFactoryT<edm4eic::MCRecoClusterParticleAssociation>>("EcalBarrelImagingClusterAssociations"));

app->Add(new JChainFactoryGeneratorT<ProtoCluster_factory_EcalBarrelSciGlassTruthProtoClusters>(
{
"EcalBarrelSciGlassRecHits",
"EcalBarrelSciGlassHits",
},
"EcalBarrelSciGlassTruthProtoClusters"
));
app->Add(new JChainMultifactoryGeneratorT<ProtoCluster_factory_EcalBarrelSciGlassTruthProtoClusters>(
"EcalBarrelSciGlassTruthProtoClusters",
{"EcalBarrelSciGlassRecHits", "EcalBarrelSciGlassHits"},
{"EcalBarrelSciGlassTruthProtoClusters"},
app // TODO: Remove me once fixed
));
app->Add(
new JChainMultifactoryGeneratorT<Cluster_factory_EcalBarrelSciGlassTruthClusters>(
"EcalBarrelSciGlassTruthClusters",
Expand Down

This file was deleted.

8 changes: 5 additions & 3 deletions src/detectors/BHCAL/BHCAL.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@
#include "factories/calorimetry/CalorimeterClusterRecoCoG_factoryT.h"
#include "factories/calorimetry/CalorimeterHitDigi_factoryT.h"
#include "factories/calorimetry/CalorimeterHitReco_factoryT.h"
#include "factories/calorimetry/CalorimeterTruthClustering_factoryT.h"

#include "ProtoCluster_factory_HcalBarrelTruthProtoClusters.h"
#include "ProtoCluster_factory_HcalBarrelIslandProtoClusters.h"


namespace eicrecon {
using RawCalorimeterHit_factory_HcalBarrelRawHits = CalorimeterHitDigi_factoryT<>;
using CalorimeterHit_factory_HcalBarrelRecHits = CalorimeterHitReco_factoryT<>;
using ProtoCluster_factory_HcalBarrelTruthProtoClusters = CalorimeterTruthClustering_factoryT<>;
using Cluster_factory_HcalBarrelTruthClusters = CalorimeterClusterRecoCoG_factoryT<>;
using Cluster_factory_HcalBarrelClusters = CalorimeterClusterRecoCoG_factoryT<>;
}
Expand Down Expand Up @@ -61,8 +62,9 @@ extern "C" {
},
app // TODO: Remove me once fixed
));
app->Add(new JChainFactoryGeneratorT<ProtoCluster_factory_HcalBarrelTruthProtoClusters>(
{"HcalBarrelRecHits", "HcalBarrelHits"}, "HcalBarrelTruthProtoClusters"
app->Add(new JChainMultifactoryGeneratorT<ProtoCluster_factory_HcalBarrelTruthProtoClusters>(
"HcalBarrelTruthProtoClusters", {"HcalBarrelRecHits", "HcalBarrelHits"}, {"HcalBarrelTruthProtoClusters"},
app // TODO: Remove me once fixed
));
app->Add(new JChainFactoryGeneratorT<ProtoCluster_factory_HcalBarrelIslandProtoClusters>(
{"HcalBarrelRecHits"}, "HcalBarrelIslandProtoClusters"
Expand Down

This file was deleted.

8 changes: 5 additions & 3 deletions src/detectors/EEMC/EEMC.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
#include "factories/calorimetry/CalorimeterClusterRecoCoG_factoryT.h"
#include "factories/calorimetry/CalorimeterHitDigi_factoryT.h"
#include "factories/calorimetry/CalorimeterHitReco_factoryT.h"
#include "factories/calorimetry/CalorimeterTruthClustering_factoryT.h"

#include "ProtoCluster_factory_EcalEndcapNTruthProtoClusters.h"
#include "ProtoCluster_factory_EcalEndcapNIslandProtoClusters.h"

namespace eicrecon {
using RawCalorimeterHit_factory_EcalEndcapNRawHits = CalorimeterHitDigi_factoryT<>;
using CalorimeterHit_factory_EcalEndcapNRecHits = CalorimeterHitReco_factoryT<>;
using ProtoCluster_factory_EcalEndcapNTruthProtoClusters = CalorimeterTruthClustering_factoryT<>;
using Cluster_factory_EcalEndcapNTruthClusters = CalorimeterClusterRecoCoG_factoryT<>;
using Cluster_factory_EcalEndcapNClusters = CalorimeterClusterRecoCoG_factoryT<>;
}
Expand Down Expand Up @@ -57,8 +58,9 @@ extern "C" {
},
app // TODO: Remove me once fixed
));
app->Add(new JChainFactoryGeneratorT<ProtoCluster_factory_EcalEndcapNTruthProtoClusters>(
{"EcalEndcapNRecHits", "EcalEndcapNHits"}, "EcalEndcapNTruthProtoClusters"
app->Add(new JChainMultifactoryGeneratorT<ProtoCluster_factory_EcalEndcapNTruthProtoClusters>(
"EcalEndcapNTruthProtoClusters", {"EcalEndcapNRecHits", "EcalEndcapNHits"}, {"EcalEndcapNTruthProtoClusters"},
app // TODO: Remove me once fixed
));
app->Add(new JChainFactoryGeneratorT<ProtoCluster_factory_EcalEndcapNIslandProtoClusters>(
{"EcalEndcapNRecHits"}, "EcalEndcapNIslandProtoClusters"
Expand Down
Loading

0 comments on commit 3ae0f74

Please sign in to comment.