diff --git a/src/detectors/B0ECAL/B0ECAL.cc b/src/detectors/B0ECAL/B0ECAL.cc index 0a347fdfd1..172576bec9 100644 --- a/src/detectors/B0ECAL/B0ECAL.cc +++ b/src/detectors/B0ECAL/B0ECAL.cc @@ -3,6 +3,7 @@ // // +#include #include #include @@ -26,10 +27,18 @@ extern "C" { InitJANAPlugin(app); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); + app->Add(new JChainFactoryGeneratorT( + {"B0ECalHits"}, "B0ECalRawHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"B0ECalRawHits"}, "B0ECalRecHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"B0ECalRecHits", "B0ECalHits"}, "B0ECalTruthProtoClusters" + )); + app->Add(new JChainFactoryGeneratorT( + {"B0ECalRecHits"}, "B0ECalIslandProtoClusters" + )); app->Add( new JChainMultifactoryGeneratorT( diff --git a/src/detectors/B0ECAL/CalorimeterHit_factory_B0ECalRecHits.h b/src/detectors/B0ECAL/CalorimeterHit_factory_B0ECalRecHits.h index 0b22bc8d4e..1fcd672641 100644 --- a/src/detectors/B0ECAL/CalorimeterHit_factory_B0ECalRecHits.h +++ b/src/detectors/B0ECAL/CalorimeterHit_factory_B0ECalRecHits.h @@ -4,27 +4,27 @@ #include -#include +#include #include #include #include -class CalorimeterHit_factory_B0ECalRecHits : public eicrecon::JFactoryPodioT, CalorimeterHitReco { +class CalorimeterHit_factory_B0ECalRecHits : public JChainFactoryT, CalorimeterHitReco { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_B0ECalRecHits(){ - SetTag("B0ECalRecHits"); + CalorimeterHit_factory_B0ECalRecHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); + InitDataTags(GetPluginName() + ":" + GetTag()); - m_input_tag = "B0ECalRawHits"; + auto app = GetApplication(); // digitization settings, must be consistent with digi class m_capADC=16384;//{this, "capacityADC", 8096}; @@ -49,7 +49,6 @@ class CalorimeterHit_factory_B0ECalRecHits : public eicrecon::JFactoryPodioTSetDefaultParameter("B0ECAL:B0ECalRecHits:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("B0ECAL:B0ECalRecHits:capacityADC", m_capADC); app->SetDefaultParameter("B0ECAL:B0ECalRecHits:dynamicRangeADC", m_dyRangeADC); app->SetDefaultParameter("B0ECAL:B0ECalRecHits:pedestalMean", m_pedMeanADC); @@ -79,7 +78,7 @@ class CalorimeterHit_factory_B0ECalRecHits : public eicrecon::JFactoryPodioT &event) override{ // Prefill inputs - rawhits = event->Get(m_input_tag); + rawhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/B0ECAL/ProtoCluster_factory_B0ECalIslandProtoClusters.h b/src/detectors/B0ECAL/ProtoCluster_factory_B0ECalIslandProtoClusters.h index f48960d469..112c7cd7a4 100644 --- a/src/detectors/B0ECAL/ProtoCluster_factory_B0ECalIslandProtoClusters.h +++ b/src/detectors/B0ECAL/ProtoCluster_factory_B0ECalIslandProtoClusters.h @@ -6,27 +6,28 @@ #include -#include +#include #include #include #include #include -class ProtoCluster_factory_B0ECalIslandProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterIslandCluster { +class ProtoCluster_factory_B0ECalIslandProtoClusters : public JChainFactoryT, CalorimeterIslandCluster { public: //------------------------------------------ // Constructor - ProtoCluster_factory_B0ECalIslandProtoClusters(){ - SetTag("B0ECalIslandProtoClusters"); + ProtoCluster_factory_B0ECalIslandProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); - m_input_tag = "B0ECalRecHits"; // adjacency matrix m_geoSvcName = "GeoSvc"; @@ -51,7 +52,6 @@ class ProtoCluster_factory_B0ECalIslandProtoClusters : public eicrecon::JFactory u_transverseEnergyProfileMetric = "globalDistEtaPhi"; u_transverseEnergyProfileScale = 1.; - app->SetDefaultParameter("B0ECAL:B0ECalIslandProtoClusters:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("B0ECAL:B0ECalIslandProtoClusters:geoServiceName", m_geoSvcName); app->SetDefaultParameter("B0ECAL:B0ECalIslandProtoClusters:readoutClass", m_readout); app->SetDefaultParameter("B0ECAL:B0ECalIslandProtoClusters:sectorDist", m_sectorDist); @@ -82,7 +82,7 @@ class ProtoCluster_factory_B0ECalIslandProtoClusters : public eicrecon::JFactory // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - hits = event->Get(m_input_tag); + hits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/B0ECAL/ProtoCluster_factory_B0ECalTruthProtoClusters.h b/src/detectors/B0ECAL/ProtoCluster_factory_B0ECalTruthProtoClusters.h index ce7f4ea534..46d9b30049 100644 --- a/src/detectors/B0ECAL/ProtoCluster_factory_B0ECalTruthProtoClusters.h +++ b/src/detectors/B0ECAL/ProtoCluster_factory_B0ECalTruthProtoClusters.h @@ -8,30 +8,26 @@ #include -#include +#include #include #include -class ProtoCluster_factory_B0ECalTruthProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterTruthClustering { +class ProtoCluster_factory_B0ECalTruthProtoClusters : public JChainFactoryT, CalorimeterTruthClustering { public: //------------------------------------------ // Constructor - ProtoCluster_factory_B0ECalTruthProtoClusters(){ - SetTag("B0ECalTruthProtoClusters"); + ProtoCluster_factory_B0ECalTruthProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); - m_inputHit_tag="B0ECalRecHits"; - m_inputMCHit_tag="B0ECalHits"; - - app->SetDefaultParameter("EEMC:B0ECalTruthProtoClusters:inputHit_tag", m_inputHit_tag, "Name of input collection to use"); + InitDataTags(GetPluginName() + ":" + GetTag()); AlgorithmInit(m_log); } @@ -46,8 +42,8 @@ class ProtoCluster_factory_B0ECalTruthProtoClusters : public eicrecon::JFactoryP // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputHits = event->Get(m_inputHit_tag); - m_mcHits = event->Get(m_inputMCHit_tag); + m_inputHits = event->Get(GetInputTags()[0]); + m_mcHits = event->Get(GetInputTags()[1]); // Call Process for generic algorithm AlgorithmProcess(); @@ -56,9 +52,4 @@ class ProtoCluster_factory_B0ECalTruthProtoClusters : public eicrecon::JFactoryP Set(m_outputProtoClusters); m_outputProtoClusters.clear(); // not really needed, but better to not leave dangling pointers around } - -private: - // Name of input data type (collection) - std::string m_inputHit_tag; - std::string m_inputMCHit_tag; }; diff --git a/src/detectors/B0ECAL/RawCalorimeterHit_factory_B0ECalRawHits.h b/src/detectors/B0ECAL/RawCalorimeterHit_factory_B0ECalRawHits.h index c315962b01..3b9cf785ab 100644 --- a/src/detectors/B0ECAL/RawCalorimeterHit_factory_B0ECalRawHits.h +++ b/src/detectors/B0ECAL/RawCalorimeterHit_factory_B0ECalRawHits.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include @@ -20,24 +20,25 @@ -class RawCalorimeterHit_factory_B0ECalRawHits : public eicrecon::JFactoryPodioT, CalorimeterHitDigi { +class RawCalorimeterHit_factory_B0ECalRawHits : public JChainFactoryT, CalorimeterHitDigi { public: //------------------------------------------ // Constructor - RawCalorimeterHit_factory_B0ECalRawHits() { - SetTag("B0ECalRawHits"); + RawCalorimeterHit_factory_B0ECalRawHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override { + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); // Set default values for all config. parameters in CalorimeterHitDigi algorithm - m_input_tag = "B0ECalHits"; u_eRes = {0.0 * sqrt(dd4hep::GeV), 0.02, 0.0 * dd4hep::GeV}; m_tRes = 0.0 * dd4hep::ns; m_capADC = 16384; @@ -54,7 +55,6 @@ class RawCalorimeterHit_factory_B0ECalRawHits : public eicrecon::JFactoryPodioT< // This is another option for exposing the data members as JANA configuration parameters. - app->SetDefaultParameter("B0ECAL:B0ECalRawHits:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("B0ECAL:B0ECalRawHits:energyResolutions",u_eRes); app->SetDefaultParameter("B0ECAL:B0ECalRawHits:timeResolution", m_tRes); app->SetDefaultParameter("B0ECAL:B0ECalRawHits:capacityADC", m_capADC); @@ -81,7 +81,7 @@ class RawCalorimeterHit_factory_B0ECalRawHits : public eicrecon::JFactoryPodioT< // Process void Process(const std::shared_ptr &event) override { // Prefill inputs - simhits = event->Get(m_input_tag); + simhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/B0ECAL/TruthCluster_factory_B0ECalTruthProtoClusters.h b/src/detectors/B0ECAL/TruthCluster_factory_B0ECalTruthProtoClusters.h index d2620e238f..3bc5930c96 100644 --- a/src/detectors/B0ECAL/TruthCluster_factory_B0ECalTruthProtoClusters.h +++ b/src/detectors/B0ECAL/TruthCluster_factory_B0ECalTruthProtoClusters.h @@ -6,28 +6,24 @@ #include -#include +#include #include #include -class TruthCluster_factory_B0ECalTruthProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterTruthClustering { +class TruthCluster_factory_B0ECalTruthProtoClusters : public JChainFactoryT, CalorimeterTruthClustering { public: //------------------------------------------ // Constructor - TruthCluster_factory_B0ECalTruthProtoClusters(){ - SetTag("B0ECalTruthProtoClusters"); + TruthCluster_factory_B0ECalTruthProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); - m_inputHit_tag = "B0ECalTruthProtoClusters"; - m_inputMCHit_tag = "B0ECalHits"; - - app->SetDefaultParameter("EEMC:B0ECalTruthProtoClusters:inputHit_tag", m_inputHit_tag, "Name of input collection to use"); + InitDataTags(GetPluginName() + ":" + GetTag()); AlgorithmInit(m_log); } @@ -42,8 +38,8 @@ class TruthCluster_factory_B0ECalTruthProtoClusters : public eicrecon::JFactoryP // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputHits = event->Get(m_inputHit_tag); - m_mcHits = event->Get(m_inputMCHit_tag); + m_inputHits = event->Get(GetInputTags()[0][0]); + m_mcHits = event->Get(GetInputTags()[0][1]); // Call Process for generic algorithm AlgorithmProcess(); @@ -52,10 +48,4 @@ class TruthCluster_factory_B0ECalTruthProtoClusters : public eicrecon::JFactoryP Set(m_outputProtoClusters); m_outputProtoClusters.clear(); // not really needed, but better to not leave dangling pointers around } - -private: - // Name of input data type (collection) - std::string m_inputHit_tag; - std::string m_inputMCHit_tag; - }; diff --git a/src/detectors/BEMC/BEMC.cc b/src/detectors/BEMC/BEMC.cc index e6a210527f..aa3664403f 100644 --- a/src/detectors/BEMC/BEMC.cc +++ b/src/detectors/BEMC/BEMC.cc @@ -3,6 +3,7 @@ // // +#include #include #include @@ -38,9 +39,15 @@ extern "C" { InitJANAPlugin(app); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); + app->Add(new JChainFactoryGeneratorT( + {"EcalBarrelSciGlassHits"}, "EcalBarrelSciGlassRawHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalBarrelSciGlassRawHits"}, "EcalBarrelSciGlassRecHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalBarrelSciGlassRecHits"}, "EcalBarrelSciGlassProtoClusters" + )); app->Add( new JChainMultifactoryGeneratorT( "EcalBarrelSciGlassClusters", @@ -61,9 +68,15 @@ extern "C" { ); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); + app->Add(new JChainFactoryGeneratorT( + {"EcalBarrelScFiHits"}, "EcalBarrelScFiRawHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalBarrelScFiRawHits"}, "EcalBarrelScFiRecHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalBarrelScFiRecHits"}, "EcalBarrelScFiProtoClusters" + )); app->Add( new JChainMultifactoryGeneratorT( "EcalBarrelScFiClusters", @@ -83,18 +96,41 @@ extern "C" { ) ); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); + app->Add(new JChainFactoryGeneratorT( + {"EcalBarrelImagingHits"}, "EcalBarrelImagingRawHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalBarrelImagingRawHits"}, "EcalBarrelImagingRecHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalBarrelImagingRecHits"}, "EcalBarrelImagingProtoClusters" + )); + + app->Add(new JChainFactoryGeneratorT( + {"EcalBarrelImagingProtoClusters"}, "EcalBarrelImagingClusters" + )); + app->Add(new JChainFactoryGeneratorT( + { + "MCParticles", + "EcalBarrelScFiClusters", + "EcalBarrelScFiClusterAssociations", + "EcalBarrelImagingClusters", + "EcalBarrelImagingClusterAssociations" + }, + "EcalBarrelImagingMergedClusters" + )); // Inserted types (so they can be written to output podio file) app->Add(new JFactoryGeneratorT>("EcalBarrelImagingLayers")); app->Add(new JFactoryGeneratorT>("EcalBarrelImagingClusterAssociations")); - app->Add(new JFactoryGeneratorT()); + app->Add(new JChainFactoryGeneratorT( + { + "EcalBarrelSciGlassRecHits", + "EcalBarrelSciGlassHits", + }, + "EcalBarrelSciGlassTruthProtoClusters" + )); app->Add( new JChainMultifactoryGeneratorT( "EcalBarrelSciGlassTruthClusters", @@ -113,6 +149,12 @@ extern "C" { app // TODO: Remove me once fixed ) ); - app->Add(new JFactoryGeneratorT()); + app->Add(new JChainFactoryGeneratorT( + { + "EcalBarrelSciGlassTruthClusters", + "EcalBarrelSciGlassTruthClusterAssociations" + }, + "EcalBarrelSciGlassMergedTruthCluster" + )); } } diff --git a/src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelImagingRecHits.h b/src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelImagingRecHits.h index dfb2429216..396be67926 100644 --- a/src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelImagingRecHits.h +++ b/src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelImagingRecHits.h @@ -1,29 +1,27 @@ #pragma once -#include +#include #include #include #include -class CalorimeterHit_factory_EcalBarrelImagingRecHits : public eicrecon::JFactoryPodioT, ImagingPixelReco { +class CalorimeterHit_factory_EcalBarrelImagingRecHits : public JChainFactoryT, ImagingPixelReco { public: - - std::string m_input_tag = "EcalBarrelImagingRawHits"; - - //------------------------------------------ // Constructor - CalorimeterHit_factory_EcalBarrelImagingRecHits(){ - SetTag("EcalBarrelImagingRecHits"); + CalorimeterHit_factory_EcalBarrelImagingRecHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); m_readout = "EcalBarrelImagingHits"; @@ -40,7 +38,6 @@ class CalorimeterHit_factory_EcalBarrelImagingRecHits : public eicrecon::JFactor // Calibration! m_sampFrac=0.00619766;// from ${DETECTOR_PATH}/calibrations/emcal_barrel_calibration.json - app->SetDefaultParameter("BEMC:EcalBarrelImagingRecHits:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("BEMC:EcalBarrelImagingRecHits:layerField", m_layerField); app->SetDefaultParameter("BEMC:EcalBarrelImagingRecHits:sectorField", m_sectorField); app->SetDefaultParameter("BEMC:EcalBarrelImagingRecHits:capacityADC", m_capADC); @@ -59,7 +56,7 @@ class CalorimeterHit_factory_EcalBarrelImagingRecHits : public eicrecon::JFactor // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputHits = event->Get(m_input_tag); + m_inputHits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm execute(); diff --git a/src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelScFiMergedHits.h b/src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelScFiMergedHits.h index 05f96de4e8..40eaf5ec77 100644 --- a/src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelScFiMergedHits.h +++ b/src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelScFiMergedHits.h @@ -1,29 +1,30 @@ #pragma once -#include +#include #include #include #include -class CalorimeterHit_factory_EcalBarrelScFiMergedHits : public eicrecon::JFactoryPodioT, CalorimeterHitsMerger { +class CalorimeterHit_factory_EcalBarrelScFiMergedHits : public JChainFactoryT, CalorimeterHitsMerger { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_EcalBarrelScFiMergedHits(){ - SetTag("EcalBarrelScFiMergedHits"); + CalorimeterHit_factory_EcalBarrelScFiMergedHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); m_log = app->GetService()->logger(GetTag()); - m_input_tag = "EcalBarrelScFiRecHits"; m_readout="EcalBarrelScFiHits"; u_fields={"fiber","z"}; @@ -31,7 +32,6 @@ class CalorimeterHit_factory_EcalBarrelScFiMergedHits : public eicrecon::JFactor m_geoSvc= app->GetService(); - app->SetDefaultParameter("BEMC:EcalBarrelscFiMergedHits:input_tag", m_input_tag); app->SetDefaultParameter("BEMC:EcalBarrelscFiMergedHits:fields", u_fields); app->SetDefaultParameter("BEMC:EcalBarrelscFiMergedHits:refs", u_refs); @@ -46,7 +46,7 @@ class CalorimeterHit_factory_EcalBarrelScFiMergedHits : public eicrecon::JFactor // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputs = event->Get(m_input_tag); + m_inputs = event->Get(GetInputTags()[0]); // Call Process for generic algorithm execute(); @@ -55,7 +55,4 @@ class CalorimeterHit_factory_EcalBarrelScFiMergedHits : public eicrecon::JFactor Set(m_outputs); m_outputs.clear(); // not really needed, but better to not leave dangling pointers around } - -private: - std::string m_input_tag; }; diff --git a/src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelScFiRecHits.h b/src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelScFiRecHits.h index d08196773b..395ad8bc39 100644 --- a/src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelScFiRecHits.h +++ b/src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelScFiRecHits.h @@ -1,28 +1,28 @@ #pragma once -#include +#include #include #include #include -class CalorimeterHit_factory_EcalBarrelScFiRecHits : public eicrecon::JFactoryPodioT, CalorimeterHitReco { +class CalorimeterHit_factory_EcalBarrelScFiRecHits : public JChainFactoryT, CalorimeterHitReco { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_EcalBarrelScFiRecHits(){ - SetTag("EcalBarrelScFiRecHits"); + CalorimeterHit_factory_EcalBarrelScFiRecHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); + InitDataTags(GetPluginName() + ":" + GetTag()); - m_input_tag = "EcalBarrelScFiRawHits"; + auto app = GetApplication(); // digitization settings, must be consistent with digi class m_capADC=16384;//{this, "capacityADC", 8096}; @@ -53,8 +53,6 @@ class CalorimeterHit_factory_EcalBarrelScFiRecHits : public eicrecon::JFactoryPo u_maskPosFields = {"fiber", "z"}; -// app->SetDefaultParameter("BEMC:tag", m_input_tag); - app->SetDefaultParameter("BEMC:EcalBarrelScFiRecHits:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("BEMC:EcalBarrelScFiRecHits:readout", m_readout ); app->SetDefaultParameter("BEMC:EcalBarrelScFiRecHits:layerField", m_layerField ); app->SetDefaultParameter("BEMC:EcalBarrelScFiRecHits:sectorField", m_sectorField ); @@ -82,7 +80,7 @@ class CalorimeterHit_factory_EcalBarrelScFiRecHits : public eicrecon::JFactoryPo // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - rawhits = event->Get(m_input_tag); + rawhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelSciGlassRecHits.h b/src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelSciGlassRecHits.h index 7fd689da70..8dd49d5bf5 100644 --- a/src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelSciGlassRecHits.h +++ b/src/detectors/BEMC/CalorimeterHit_factory_EcalBarrelSciGlassRecHits.h @@ -1,28 +1,28 @@ #pragma once -#include +#include #include #include #include -class CalorimeterHit_factory_EcalBarrelSciGlassRecHits : public eicrecon::JFactoryPodioT, CalorimeterHitReco { +class CalorimeterHit_factory_EcalBarrelSciGlassRecHits : public JChainFactoryT, CalorimeterHitReco { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_EcalBarrelSciGlassRecHits(){ - SetTag("EcalBarrelSciGlassRecHits"); + CalorimeterHit_factory_EcalBarrelSciGlassRecHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); + InitDataTags(GetPluginName() + ":" + GetTag()); - m_input_tag = "EcalBarrelSciGlassRawHits"; + auto app = GetApplication(); // digitization settings, must be consistent with digi class m_capADC=16384;//{this, "capacityADC", 8096}; @@ -47,8 +47,6 @@ class CalorimeterHit_factory_EcalBarrelSciGlassRecHits : public eicrecon::JFacto m_localDetElement=""; // from ATHENA's reconstruction.py (i.e. not defined there) u_localDetFields={}; // from ATHENA's reconstruction.py (i.e. not defined there) -// app->SetDefaultParameter("BEMC:tag", m_input_tag); - app->SetDefaultParameter("BEMC:EcalBarrelSciGlassRecHits:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("BEMC:EcalBarrelSciGlassRecHits:capacityADC", m_capADC); app->SetDefaultParameter("BEMC:EcalBarrelSciGlassRecHits:dynamicRangeADC", m_dyRangeADC); app->SetDefaultParameter("BEMC:EcalBarrelSciGlassRecHits:pedestalMean", m_pedMeanADC); @@ -72,7 +70,7 @@ class CalorimeterHit_factory_EcalBarrelSciGlassRecHits : public eicrecon::JFacto // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - rawhits = event->Get(m_input_tag); + rawhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/BEMC/Cluster_factory_EcalBarrelImagingClusters.h b/src/detectors/BEMC/Cluster_factory_EcalBarrelImagingClusters.h index 81e9f84404..edb62c117c 100644 --- a/src/detectors/BEMC/Cluster_factory_EcalBarrelImagingClusters.h +++ b/src/detectors/BEMC/Cluster_factory_EcalBarrelImagingClusters.h @@ -6,7 +6,7 @@ #include -#include +#include #include #include #include @@ -14,7 +14,7 @@ -class Cluster_factory_EcalBarrelImagingClusters : public eicrecon::JFactoryPodioT, ImagingClusterReco { +class Cluster_factory_EcalBarrelImagingClusters : public JChainFactoryT, ImagingClusterReco { public: @@ -23,14 +23,16 @@ class Cluster_factory_EcalBarrelImagingClusters : public eicrecon::JFactoryPodio //------------------------------------------ // Constructor - Cluster_factory_EcalBarrelImagingClusters(){ - SetTag("EcalBarrelImagingClusters"); + Cluster_factory_EcalBarrelImagingClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); //-------- Configuration Parameters ------------ m_input_simhit_tag="EcalBarrelImagingHits"; diff --git a/src/detectors/BEMC/Cluster_factory_EcalBarrelImagingMergedClusters.h b/src/detectors/BEMC/Cluster_factory_EcalBarrelImagingMergedClusters.h index 271c7eec21..54542c27f1 100644 --- a/src/detectors/BEMC/Cluster_factory_EcalBarrelImagingMergedClusters.h +++ b/src/detectors/BEMC/Cluster_factory_EcalBarrelImagingMergedClusters.h @@ -5,39 +5,27 @@ #include -#include +#include #include #include #include #include -class Cluster_factory_EcalBarrelImagingMergedClusters : public eicrecon::JFactoryPodioT, TruthEnergyPositionClusterMerger { +class Cluster_factory_EcalBarrelImagingMergedClusters : public JChainFactoryT, TruthEnergyPositionClusterMerger { public: //------------------------------------------ // Constructor - Cluster_factory_EcalBarrelImagingMergedClusters(){ - SetTag("EcalBarrelImagingMergedClusters"); + Cluster_factory_EcalBarrelImagingMergedClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); - //-------- Configuration Parameters ------------ - m_inputMCParticles_tag = "MCParticles"; - m_energyClusters_tag = "EcalBarrelScFiClusters"; - m_energyAssociation_tag = "EcalBarrelScFiClusterAssociations"; - m_positionClusters_tag = "EcalBarrelImagingClusters"; - m_positionAssociations_tag = "EcalBarrelImagingClusterAssociations"; - - app->SetDefaultParameter("BEMC:EcalBarrelImagingMergedClusters:inputMCParticles_tag", m_inputMCParticles_tag); - app->SetDefaultParameter("BEMC:EcalBarrelImagingMergedClusters:energyClusters_tag", m_energyClusters_tag); - app->SetDefaultParameter("BEMC:EcalBarrelImagingMergedClusters:energyAssociation_tag", m_energyAssociation_tag); - app->SetDefaultParameter("BEMC:EcalBarrelImagingMergedClusters:positionClusters_tag", m_positionClusters_tag); - app->SetDefaultParameter("BEMC:EcalBarrelImagingMergedClusters:positionAssociations_tag", m_positionAssociations_tag); + InitDataTags(GetPluginName() + ":" + GetTag()); initialize(); } @@ -48,11 +36,11 @@ class Cluster_factory_EcalBarrelImagingMergedClusters : public eicrecon::JFactor void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputMCParticles = event->Get(m_inputMCParticles_tag);; - m_energyClusters = event->Get(m_energyClusters_tag);; - m_energyAssociations = event->Get(m_energyAssociation_tag);; - m_positionClusters = event->Get(m_positionClusters_tag);; - m_positionAssociations = event->Get(m_positionAssociations_tag);; + m_inputMCParticles = event->Get(GetInputTags()[0]); + m_energyClusters = event->Get(GetInputTags()[1]); + m_energyAssociations = event->Get(GetInputTags()[2]); + m_positionClusters = event->Get(GetInputTags()[3]); + m_positionAssociations = event->Get(GetInputTags()[4]); // Call Process for generic algorithm execute(); @@ -63,12 +51,4 @@ class Cluster_factory_EcalBarrelImagingMergedClusters : public eicrecon::JFactor m_outputClusters.clear(); // not really needed, but better to not leave dangling pointers around m_outputAssociations.clear(); } - -private: - // Name of input data type (collection) - std::string m_inputMCParticles_tag; - std::string m_energyClusters_tag; - std::string m_energyAssociation_tag; - std::string m_positionClusters_tag; - std::string m_positionAssociations_tag; }; diff --git a/src/detectors/BEMC/Cluster_factory_EcalBarrelSciGlassMergedTruthClusters.h b/src/detectors/BEMC/Cluster_factory_EcalBarrelSciGlassMergedTruthClusters.h index b530a21949..4c892fe2cc 100644 --- a/src/detectors/BEMC/Cluster_factory_EcalBarrelSciGlassMergedTruthClusters.h +++ b/src/detectors/BEMC/Cluster_factory_EcalBarrelSciGlassMergedTruthClusters.h @@ -5,7 +5,7 @@ #include -#include +#include #include #include #include @@ -13,30 +13,26 @@ -class Cluster_factory_EcalBarrelSciGlassMergedTruthClusters : public eicrecon::JFactoryPodioT, CalorimeterClusterMerger { +class Cluster_factory_EcalBarrelSciGlassMergedTruthClusters : public JChainFactoryT, CalorimeterClusterMerger { public: //------------------------------------------ // Constructor - Cluster_factory_EcalBarrelSciGlassMergedTruthClusters(){ - SetTag("EcalBarrelSciGlassMergedTruthClusters"); + Cluster_factory_EcalBarrelSciGlassMergedTruthClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); - //-------- Configuration Parameters ------------ - m_input_tag="EcalBarrelSciGlassTruthClusters"; - m_inputAssociations_tag="EcalBarrelSciGlassTruthClusterAssociations"; std::string tag=this->GetTag(); std::shared_ptr m_log = app->GetService()->logger(tag); - app->SetDefaultParameter("BEMC:EcalBarrelMergedSciGlassTruthClusters:input_tag", m_input_tag, "Name of input collection to use"); - app->SetDefaultParameter("BEMC:EcalBarrelMergedSciGlassTruthClusters:inputAssociations_tag", m_inputAssociations_tag); - AlgorithmInit(m_log); } @@ -52,8 +48,8 @@ class Cluster_factory_EcalBarrelSciGlassMergedTruthClusters : public eicrecon::J // Prefill inputs - m_inputClusters=event->Get(m_input_tag); - m_inputAssociations=event->Get(m_inputAssociations_tag); + m_inputClusters=event->Get(GetInputTags()[0]); + m_inputAssociations=event->Get(GetInputTags()[1]); // Call Process for generic algorithm AlgorithmProcess(); @@ -65,9 +61,4 @@ class Cluster_factory_EcalBarrelSciGlassMergedTruthClusters : public eicrecon::J m_outputClusters.clear(); // not really needed, but better to not leave dangling pointers around m_outputAssociations.clear(); } - -private: - // Name of input data type (collection) - std::string m_input_tag; - std::string m_inputAssociations_tag; }; diff --git a/src/detectors/BEMC/ProtoCluster_factory_EcalBarrelImagingProtoClusters.h b/src/detectors/BEMC/ProtoCluster_factory_EcalBarrelImagingProtoClusters.h index d9b66f7bc5..4ec8ec5801 100644 --- a/src/detectors/BEMC/ProtoCluster_factory_EcalBarrelImagingProtoClusters.h +++ b/src/detectors/BEMC/ProtoCluster_factory_EcalBarrelImagingProtoClusters.h @@ -6,31 +6,28 @@ #include -#include +#include #include #include #include #include -class ProtoCluster_factory_EcalBarrelImagingProtoClusters : public eicrecon::JFactoryPodioT, ImagingTopoCluster { +class ProtoCluster_factory_EcalBarrelImagingProtoClusters : public JChainFactoryT, ImagingTopoCluster { public: - - std::string m_input_tag; - //------------------------------------------ // Constructor - ProtoCluster_factory_EcalBarrelImagingProtoClusters(){ - SetTag("EcalBarrelImagingProtoClusters"); + ProtoCluster_factory_EcalBarrelImagingProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); + InitDataTags(GetPluginName() + ":" + GetTag()); - m_input_tag = "EcalBarrelImagingRecHits"; + auto app = GetApplication(); // from https://eicweb.phy.anl.gov/EIC/benchmarks/physics_benchmarks/-/blob/master/options/reconstruction.py#L593 u_localDistXY = {2.0 * dd4hep::mm, 2 * dd4hep::mm}; // # same layer @@ -42,7 +39,6 @@ class ProtoCluster_factory_EcalBarrelImagingProtoClusters : public eicrecon::JFa m_minClusterCenterEdep = 0; m_minClusterHitEdep = 0; - app->SetDefaultParameter("BEMC:EcalBarrelImagingProtoClusters:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("BEMC:EcalBarrelImagingProtoClusters::localDistXY", u_localDistXY); app->SetDefaultParameter("BEMC:EcalBarrelImagingProtoClusters::layerDistEtaPhi", u_layerDistEtaPhi); app->SetDefaultParameter("BEMC:EcalBarrelImagingProtoClusters::neighbourLayersRange", m_neighbourLayersRange); @@ -59,7 +55,7 @@ class ProtoCluster_factory_EcalBarrelImagingProtoClusters : public eicrecon::JFa // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputHits = event->Get(m_input_tag); + m_inputHits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm execute(); diff --git a/src/detectors/BEMC/ProtoCluster_factory_EcalBarrelScFiProtoClusters.h b/src/detectors/BEMC/ProtoCluster_factory_EcalBarrelScFiProtoClusters.h index 6bc0d98470..3f7237d013 100644 --- a/src/detectors/BEMC/ProtoCluster_factory_EcalBarrelScFiProtoClusters.h +++ b/src/detectors/BEMC/ProtoCluster_factory_EcalBarrelScFiProtoClusters.h @@ -6,27 +6,28 @@ #include -#include +#include #include #include #include #include -class ProtoCluster_factory_EcalBarrelScFiProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterIslandCluster { +class ProtoCluster_factory_EcalBarrelScFiProtoClusters : public JChainFactoryT, CalorimeterIslandCluster { public: //------------------------------------------ // Constructor - ProtoCluster_factory_EcalBarrelScFiProtoClusters(){ - SetTag("EcalBarrelScFiProtoClusters"); + ProtoCluster_factory_EcalBarrelScFiProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); - m_input_tag = "EcalBarrelScFiRecHits"; m_splitCluster=false; // from ATHENA reconstruction.py m_minClusterHitEdep=1.0 * dd4hep::MeV; // from ATHENA reconstruction.py @@ -49,7 +50,6 @@ class ProtoCluster_factory_EcalBarrelScFiProtoClusters : public eicrecon::JFacto u_globalDistEtaPhi={};//{this, "globalDistEtaPhi", {}}; u_dimScaledLocalDistXY={};// from ATHENA reconstruction.py - app->SetDefaultParameter("BEMC:EcalBarrelScFiProtoClusters:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("BEMC:EcalBarrelScFiProtoClusters:splitCluster", m_splitCluster); app->SetDefaultParameter("BEMC:EcalBarrelScFiProtoClusters:minClusterHitEdep", m_minClusterHitEdep); app->SetDefaultParameter("BEMC:EcalBarrelScFiProtoClusters:minClusterCenterEdep", m_minClusterCenterEdep); @@ -78,7 +78,7 @@ class ProtoCluster_factory_EcalBarrelScFiProtoClusters : public eicrecon::JFacto // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - hits = event->Get(m_input_tag); + hits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/BEMC/ProtoCluster_factory_EcalBarrelSciGlassProtoClusters.h b/src/detectors/BEMC/ProtoCluster_factory_EcalBarrelSciGlassProtoClusters.h index 26847e8649..20cb2faa48 100644 --- a/src/detectors/BEMC/ProtoCluster_factory_EcalBarrelSciGlassProtoClusters.h +++ b/src/detectors/BEMC/ProtoCluster_factory_EcalBarrelSciGlassProtoClusters.h @@ -6,27 +6,28 @@ #include -#include +#include #include #include #include #include -class ProtoCluster_factory_EcalBarrelSciGlassProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterIslandCluster { +class ProtoCluster_factory_EcalBarrelSciGlassProtoClusters : public JChainFactoryT, CalorimeterIslandCluster { public: //------------------------------------------ // Constructor - ProtoCluster_factory_EcalBarrelSciGlassProtoClusters(){ - SetTag("EcalBarrelSciGlassProtoClusters"); + ProtoCluster_factory_EcalBarrelSciGlassProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); - m_input_tag = "EcalBarrelSciGlassRecHits"; // adjacency matrix m_geoSvcName = "GeoSvc"; @@ -62,7 +63,6 @@ class ProtoCluster_factory_EcalBarrelSciGlassProtoClusters : public eicrecon::JF u_transverseEnergyProfileMetric = "globalDistEtaPhi"; u_transverseEnergyProfileScale = 0.06; - app->SetDefaultParameter("BEMC:EcalBarrelSciGlassProtoClusters:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("BEMC:EcalBarrelSciGlassProtoClusters:geoServiceName", m_geoSvcName); app->SetDefaultParameter("BEMC:EcalBarrelSciGlassProtoClusters:readoutClass", m_readout); app->SetDefaultParameter("BEMC:EcalBarrelSciGlassProtoClusters:sectorDist", m_sectorDist); @@ -93,7 +93,7 @@ class ProtoCluster_factory_EcalBarrelSciGlassProtoClusters : public eicrecon::JF // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - hits = event->Get(m_input_tag); + hits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/BEMC/ProtoCluster_factory_EcalBarrelSciGlassTruthProtoClusters.h b/src/detectors/BEMC/ProtoCluster_factory_EcalBarrelSciGlassTruthProtoClusters.h index e01f7cdcc0..d8a0af76a0 100644 --- a/src/detectors/BEMC/ProtoCluster_factory_EcalBarrelSciGlassTruthProtoClusters.h +++ b/src/detectors/BEMC/ProtoCluster_factory_EcalBarrelSciGlassTruthProtoClusters.h @@ -6,30 +6,26 @@ #include -#include +#include #include #include -class ProtoCluster_factory_EcalBarrelSciGlassTruthProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterTruthClustering { +class ProtoCluster_factory_EcalBarrelSciGlassTruthProtoClusters : public JChainFactoryT, CalorimeterTruthClustering { public: //------------------------------------------ // Constructor - ProtoCluster_factory_EcalBarrelSciGlassTruthProtoClusters(){ - SetTag("EcalBarrelSciGlassTruthProtoClusters"); + ProtoCluster_factory_EcalBarrelSciGlassTruthProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); - m_inputHit_tag="EcalBarrelSciGlassRecHits"; - m_inputMCHit_tag="EcalBarrelSciGlassHits"; - - app->SetDefaultParameter("BEMC:EcalBarrelSciGlassTruthProtoClusters:inputHit_tag", m_inputHit_tag, "Name of input collection to use"); + InitDataTags(GetPluginName() + ":" + GetTag()); AlgorithmInit(m_log); } @@ -44,8 +40,8 @@ class ProtoCluster_factory_EcalBarrelSciGlassTruthProtoClusters : public eicreco // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputHits = event->Get(m_inputHit_tag); - m_mcHits = event->Get(m_inputMCHit_tag); + m_inputHits = event->Get(GetInputTags()[0]); + m_mcHits = event->Get(GetInputTags()[1]); // Call Process for generic algorithm AlgorithmProcess(); @@ -54,9 +50,4 @@ class ProtoCluster_factory_EcalBarrelSciGlassTruthProtoClusters : public eicreco Set(m_outputProtoClusters); m_outputProtoClusters.clear(); // not really needed, but better to not leave dangling pointers around } - -private: - // Name of input data type (collection) - std::string m_inputHit_tag; - std::string m_inputMCHit_tag; }; diff --git a/src/detectors/BEMC/RawCalorimeterHit_factory_EcalBarrelImagingRawHits.h b/src/detectors/BEMC/RawCalorimeterHit_factory_EcalBarrelImagingRawHits.h index 3e0e9dc7a3..8a6b5d0499 100644 --- a/src/detectors/BEMC/RawCalorimeterHit_factory_EcalBarrelImagingRawHits.h +++ b/src/detectors/BEMC/RawCalorimeterHit_factory_EcalBarrelImagingRawHits.h @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include @@ -18,24 +18,25 @@ -class RawCalorimeterHit_factory_EcalBarrelImagingRawHits : public eicrecon::JFactoryPodioT, CalorimeterHitDigi { +class RawCalorimeterHit_factory_EcalBarrelImagingRawHits : public JChainFactoryT, CalorimeterHitDigi { public: //------------------------------------------ // Constructor - RawCalorimeterHit_factory_EcalBarrelImagingRawHits() { - SetTag("EcalBarrelImagingRawHits"); + RawCalorimeterHit_factory_EcalBarrelImagingRawHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override { + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); // Set default values for all config. parameters in CalorimeterHitDigi algorithm - m_input_tag = "EcalBarrelImagingHits"; u_eRes = {0.0 * sqrt(dd4hep::GeV), 0.02, 0.0 * dd4hep::GeV}; m_tRes = 0.0 * dd4hep::ns; m_capADC = 8192; @@ -49,7 +50,6 @@ class RawCalorimeterHit_factory_EcalBarrelImagingRawHits : public eicrecon::JFac m_geoSvc = app->GetService(); // TODO: implement named geometry service? // This is another option for exposing the data members as JANA configuration parameters. - app->SetDefaultParameter("BEMC:EcalBarrelImagingRawHits:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("BEMC:EcalBarrelImagingRawHits:energyResolutions",u_eRes); app->SetDefaultParameter("BEMC:EcalBarrelImagingRawHits:timeResolution", m_tRes); app->SetDefaultParameter("BEMC:EcalBarrelImagingRawHits:capacityADC", m_capADC); @@ -76,7 +76,7 @@ class RawCalorimeterHit_factory_EcalBarrelImagingRawHits : public eicrecon::JFac // Process void Process(const std::shared_ptr &event) override { // Prefill inputs - simhits = event->Get(m_input_tag); + simhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/BEMC/RawCalorimeterHit_factory_EcalBarrelScFiRawHits.h b/src/detectors/BEMC/RawCalorimeterHit_factory_EcalBarrelScFiRawHits.h index d0f07eef0c..6cae50bf47 100644 --- a/src/detectors/BEMC/RawCalorimeterHit_factory_EcalBarrelScFiRawHits.h +++ b/src/detectors/BEMC/RawCalorimeterHit_factory_EcalBarrelScFiRawHits.h @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include @@ -18,24 +18,25 @@ -class RawCalorimeterHit_factory_EcalBarrelScFiRawHits : public eicrecon::JFactoryPodioT, CalorimeterHitDigi { +class RawCalorimeterHit_factory_EcalBarrelScFiRawHits : public JChainFactoryT, CalorimeterHitDigi { public: //------------------------------------------ // Constructor - RawCalorimeterHit_factory_EcalBarrelScFiRawHits() { - SetTag("EcalBarrelScFiRawHits"); + RawCalorimeterHit_factory_EcalBarrelScFiRawHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override { + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); // Set default values for all config. parameters in CalorimeterHitDigi algorithm - m_input_tag = "EcalBarrelScFiHits"; u_eRes = {0.0 * sqrt(dd4hep::GeV), 0.0, 0.0 * dd4hep::GeV}; m_tRes = 0.0 * dd4hep::ns; m_capADC = 16384; @@ -50,8 +51,6 @@ class RawCalorimeterHit_factory_EcalBarrelScFiRawHits : public eicrecon::JFactor m_geoSvc = app->GetService(); // TODO: implement named geometry service? // This is another option for exposing the data members as JANA configuration parameters. -// app->SetDefaultParameter("BEMC:tag", m_input_tag); - app->SetDefaultParameter("BEMC:EcalBarrelScFiRawHits:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("BEMC:EcalBarrelScFiRawHits:energyResolutions",u_eRes); app->SetDefaultParameter("BEMC:EcalBarrelScFiRawHits:timeResolution", m_tRes); app->SetDefaultParameter("BEMC:EcalBarrelScFiRawHits:capacityADC", m_capADC); @@ -78,7 +77,7 @@ class RawCalorimeterHit_factory_EcalBarrelScFiRawHits : public eicrecon::JFactor // Process void Process(const std::shared_ptr &event) override { // Prefill inputs - simhits = event->Get(m_input_tag); + simhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/BEMC/RawCalorimeterHit_factory_EcalBarrelSciGlassRawHits.h b/src/detectors/BEMC/RawCalorimeterHit_factory_EcalBarrelSciGlassRawHits.h index dbba38039a..f270bb1ac6 100644 --- a/src/detectors/BEMC/RawCalorimeterHit_factory_EcalBarrelSciGlassRawHits.h +++ b/src/detectors/BEMC/RawCalorimeterHit_factory_EcalBarrelSciGlassRawHits.h @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include @@ -19,24 +19,25 @@ -class RawCalorimeterHit_factory_EcalBarrelSciGlassRawHits : public eicrecon::JFactoryPodioT, CalorimeterHitDigi { +class RawCalorimeterHit_factory_EcalBarrelSciGlassRawHits : public JChainFactoryT, CalorimeterHitDigi { public: //------------------------------------------ // Constructor - RawCalorimeterHit_factory_EcalBarrelSciGlassRawHits() { - SetTag("EcalBarrelSciGlassRawHits"); + RawCalorimeterHit_factory_EcalBarrelSciGlassRawHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override { + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); // Set default values for all config. parameters in CalorimeterHitDigi algorithm - m_input_tag = "EcalBarrelSciGlassHits"; u_eRes = {0.0 * sqrt(dd4hep::GeV), 0.0, 0.0 * dd4hep::GeV}; m_tRes = 0.0 * dd4hep::ns; m_capADC = 16384; @@ -53,8 +54,6 @@ class RawCalorimeterHit_factory_EcalBarrelSciGlassRawHits : public eicrecon::JFa // This is another option for exposing the data members as JANA configuration parameters. -// app->SetDefaultParameter("BEMC:tag", m_input_tag); - app->SetDefaultParameter("BEMC:EcalBarrelSciGlassRawHits:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("BEMC:EcalBarrelSciGlassRawHits:energyResolutions",u_eRes); app->SetDefaultParameter("BEMC:EcalBarrelSciGlassRawHits:timeResolution", m_tRes); app->SetDefaultParameter("BEMC:EcalBarrelSciGlassRawHits:capacityADC", m_capADC); @@ -81,7 +80,7 @@ class RawCalorimeterHit_factory_EcalBarrelSciGlassRawHits : public eicrecon::JFa // Process void Process(const std::shared_ptr &event) override { // Prefill inputs - simhits = event->Get(m_input_tag); + simhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/BHCAL/BHCAL.cc b/src/detectors/BHCAL/BHCAL.cc index cc47f216cf..403afacdbd 100644 --- a/src/detectors/BHCAL/BHCAL.cc +++ b/src/detectors/BHCAL/BHCAL.cc @@ -3,6 +3,7 @@ // // +#include #include #include @@ -25,10 +26,18 @@ extern "C" { InitJANAPlugin(app); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); + app->Add(new JChainFactoryGeneratorT( + {"HcalBarrelHits"}, "HcalBarrelRawHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"HcalBarrelRawHits"}, "HcalBarrelRecHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"HcalBarrelRecHits", "HcalBarrelHits"}, "HcalBarrelTruthProtoClusters" + )); + app->Add(new JChainFactoryGeneratorT( + {"HcalBarrelRecHits"}, "HcalBarrelIslandProtoClusters" + )); app->Add( new JChainMultifactoryGeneratorT( diff --git a/src/detectors/BHCAL/CalorimeterHit_factory_HcalBarrelRecHits.h b/src/detectors/BHCAL/CalorimeterHit_factory_HcalBarrelRecHits.h index b1ae8bcdbb..7aacfa071d 100644 --- a/src/detectors/BHCAL/CalorimeterHit_factory_HcalBarrelRecHits.h +++ b/src/detectors/BHCAL/CalorimeterHit_factory_HcalBarrelRecHits.h @@ -3,27 +3,27 @@ #include -#include +#include #include #include #include -class CalorimeterHit_factory_HcalBarrelRecHits : public eicrecon::JFactoryPodioT, CalorimeterHitReco { +class CalorimeterHit_factory_HcalBarrelRecHits : public JChainFactoryT, CalorimeterHitReco { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_HcalBarrelRecHits(){ - SetTag("HcalBarrelRecHits"); + CalorimeterHit_factory_HcalBarrelRecHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); + InitDataTags(GetPluginName() + ":" + GetTag()); - m_input_tag = "HcalBarrelRawHits"; + auto app = GetApplication(); // digitization settings, must be consistent with digi class m_capADC=65536; @@ -48,7 +48,6 @@ class CalorimeterHit_factory_HcalBarrelRecHits : public eicrecon::JFactoryPodioT m_localDetElement=""; u_localDetFields={}; -// app->SetDefaultParameter("BHCAL:tag", m_input_tag); app->SetDefaultParameter("BHCAL:HcalBarrelRecHits:capacityADC", m_capADC); app->SetDefaultParameter("BHCAL:HcalBarrelRecHits:dynamicRangeADC", m_dyRangeADC); app->SetDefaultParameter("BHCAL:HcalBarrelRecHits:pedestalMean", m_pedMeanADC); @@ -78,7 +77,7 @@ class CalorimeterHit_factory_HcalBarrelRecHits : public eicrecon::JFactoryPodioT // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - rawhits = event->Get(m_input_tag); + rawhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/BHCAL/ProtoCluster_factory_HcalBarrelIslandProtoClusters.h b/src/detectors/BHCAL/ProtoCluster_factory_HcalBarrelIslandProtoClusters.h index 58becdecf7..04ffc47abe 100644 --- a/src/detectors/BHCAL/ProtoCluster_factory_HcalBarrelIslandProtoClusters.h +++ b/src/detectors/BHCAL/ProtoCluster_factory_HcalBarrelIslandProtoClusters.h @@ -6,27 +6,28 @@ #include -#include +#include #include #include #include #include -class ProtoCluster_factory_HcalBarrelIslandProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterIslandCluster { +class ProtoCluster_factory_HcalBarrelIslandProtoClusters : public JChainFactoryT, CalorimeterIslandCluster { public: //------------------------------------------ // Constructor - ProtoCluster_factory_HcalBarrelIslandProtoClusters(){ - SetTag("HcalBarrelIslandProtoClusters"); + ProtoCluster_factory_HcalBarrelIslandProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); - m_input_tag = "HcalBarrelRecHits"; // adjacency matrix m_geoSvcName = "GeoSvc"; @@ -93,7 +94,7 @@ class ProtoCluster_factory_HcalBarrelIslandProtoClusters : public eicrecon::JFac // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - hits = event->Get(m_input_tag); + hits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/BHCAL/ProtoCluster_factory_HcalBarrelTruthProtoClusters.h b/src/detectors/BHCAL/ProtoCluster_factory_HcalBarrelTruthProtoClusters.h index a4e77e15fd..d1f462a15a 100644 --- a/src/detectors/BHCAL/ProtoCluster_factory_HcalBarrelTruthProtoClusters.h +++ b/src/detectors/BHCAL/ProtoCluster_factory_HcalBarrelTruthProtoClusters.h @@ -8,29 +8,27 @@ #include -#include +#include #include #include #include #include -class ProtoCluster_factory_HcalBarrelTruthProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterTruthClustering { +class ProtoCluster_factory_HcalBarrelTruthProtoClusters : public JChainFactoryT, CalorimeterTruthClustering { public: //------------------------------------------ // Constructor - ProtoCluster_factory_HcalBarrelTruthProtoClusters(){ - SetTag("HcalBarrelTruthProtoClusters"); + ProtoCluster_factory_HcalBarrelTruthProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); - m_inputHit_tag="HcalBarrelRecHits"; - m_inputMCHit_tag="HcalBarrelHits"; + InitDataTags(GetPluginName() + ":" + GetTag()); AlgorithmInit(m_log); } @@ -45,8 +43,8 @@ class ProtoCluster_factory_HcalBarrelTruthProtoClusters : public eicrecon::JFact // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputHits = event->Get(m_inputHit_tag); - m_mcHits = event->Get(m_inputMCHit_tag); + m_inputHits = event->Get(GetInputTags()[0]); + m_mcHits = event->Get(GetInputTags()[1]); // Call Process for generic algorithm AlgorithmProcess(); @@ -56,9 +54,5 @@ class ProtoCluster_factory_HcalBarrelTruthProtoClusters : public eicrecon::JFact m_outputProtoClusters.clear(); // not really needed, but better to not leave dangling pointers around } private: - // Name of input data type (collection) - std::string m_inputHit_tag; - std::string m_inputMCHit_tag; - std::shared_ptr m_log; }; diff --git a/src/detectors/BHCAL/RawCalorimeterHit_factory_HcalBarrelRawHits.h b/src/detectors/BHCAL/RawCalorimeterHit_factory_HcalBarrelRawHits.h index e764c20e91..71541810a4 100644 --- a/src/detectors/BHCAL/RawCalorimeterHit_factory_HcalBarrelRawHits.h +++ b/src/detectors/BHCAL/RawCalorimeterHit_factory_HcalBarrelRawHits.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include @@ -20,24 +20,25 @@ -class RawCalorimeterHit_factory_HcalBarrelRawHits : public eicrecon::JFactoryPodioT, CalorimeterHitDigi { +class RawCalorimeterHit_factory_HcalBarrelRawHits : public JChainFactoryT, CalorimeterHitDigi { public: //------------------------------------------ // Constructor - RawCalorimeterHit_factory_HcalBarrelRawHits() { - SetTag("HcalBarrelRawHits"); + RawCalorimeterHit_factory_HcalBarrelRawHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override { + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); // Set default values for all config. parameters in CalorimeterHitDigi algorithm - m_input_tag = "HcalBarrelHits"; u_eRes = {}; m_tRes = 0.0 * dd4hep::ns; m_capADC = 65536; @@ -53,7 +54,6 @@ class RawCalorimeterHit_factory_HcalBarrelRawHits : public eicrecon::JFactoryPod m_geoSvc = app->GetService(); // TODO: implement named geometry service? // This is another option for exposing the data members as JANA configuration parameters. -// app->SetDefaultParameter("BHCAL:tag", m_input_tag); app->SetDefaultParameter("BHCAL:HcalBarrelRawHits:energyResolutions",u_eRes); app->SetDefaultParameter("BHCAL:HcalBarrelRawHits:timeResolution", m_tRes); app->SetDefaultParameter("BHCAL:HcalBarrelRawHits:capacityADC", m_capADC); @@ -80,7 +80,7 @@ class RawCalorimeterHit_factory_HcalBarrelRawHits : public eicrecon::JFactoryPod // Process void Process(const std::shared_ptr &event) override { // Prefill inputs - simhits = event->Get(m_input_tag); + simhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/EEMC/CalorimeterHit_factory_EcalEndcapNRecHits.h b/src/detectors/EEMC/CalorimeterHit_factory_EcalEndcapNRecHits.h index 59f314988b..ab587e3377 100644 --- a/src/detectors/EEMC/CalorimeterHit_factory_EcalEndcapNRecHits.h +++ b/src/detectors/EEMC/CalorimeterHit_factory_EcalEndcapNRecHits.h @@ -3,27 +3,27 @@ #include -#include +#include #include #include #include -class CalorimeterHit_factory_EcalEndcapNRecHits : public eicrecon::JFactoryPodioT, CalorimeterHitReco { +class CalorimeterHit_factory_EcalEndcapNRecHits : public JChainFactoryT, CalorimeterHitReco { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_EcalEndcapNRecHits(){ - SetTag("EcalEndcapNRecHits"); + CalorimeterHit_factory_EcalEndcapNRecHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); + InitDataTags(GetPluginName() + ":" + GetTag()); - m_input_tag = "EcalEndcapNRawHits"; + auto app = GetApplication(); // digitization settings, must be consistent with digi class m_capADC=16384;//{this, "capacityADC", 8096}; @@ -48,8 +48,6 @@ class CalorimeterHit_factory_EcalEndcapNRecHits : public eicrecon::JFactoryPodio m_localDetElement=""; // from ATHENA's reconstruction.py (i.e. not defined there) u_localDetFields={}; // from ATHENA's reconstruction.py (i.e. not defined there) -// app->SetDefaultParameter("EEMC:tag", m_input_tag); - app->SetDefaultParameter("EEMC:EcalEndcapNRecHits:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("EEMC:EcalEndcapNRecHits:capacityADC", m_capADC); app->SetDefaultParameter("EEMC:EcalEndcapNRecHits:dynamicRangeADC", m_dyRangeADC); app->SetDefaultParameter("EEMC:EcalEndcapNRecHits:pedestalMean", m_pedMeanADC); @@ -79,7 +77,7 @@ class CalorimeterHit_factory_EcalEndcapNRecHits : public eicrecon::JFactoryPodio // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - rawhits = event->Get(m_input_tag); + rawhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/EEMC/EEMC.cc b/src/detectors/EEMC/EEMC.cc index 84825da4c1..3bd1faf853 100644 --- a/src/detectors/EEMC/EEMC.cc +++ b/src/detectors/EEMC/EEMC.cc @@ -3,6 +3,7 @@ // // +#include #include #include @@ -24,10 +25,18 @@ extern "C" { InitJANAPlugin(app); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); + app->Add(new JChainFactoryGeneratorT( + {"EcalEndcapNHits"}, "EcalEndcapNRawHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalEndcapNRawHits"}, "EcalEndcapNRecHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalEndcapNRecHits", "EcalEndcapNHits"}, "EcalEndcapNTruthProtoClusters" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalEndcapNRecHits"}, "EcalEndcapNIslandProtoClusters" + )); app->Add( new JChainMultifactoryGeneratorT( diff --git a/src/detectors/EEMC/ProtoCluster_factory_EcalEndcapNIslandProtoClusters.h b/src/detectors/EEMC/ProtoCluster_factory_EcalEndcapNIslandProtoClusters.h index f0ddfd92e9..8169d6b639 100644 --- a/src/detectors/EEMC/ProtoCluster_factory_EcalEndcapNIslandProtoClusters.h +++ b/src/detectors/EEMC/ProtoCluster_factory_EcalEndcapNIslandProtoClusters.h @@ -6,27 +6,28 @@ #include -#include +#include #include #include #include #include -class ProtoCluster_factory_EcalEndcapNIslandProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterIslandCluster { +class ProtoCluster_factory_EcalEndcapNIslandProtoClusters : public JChainFactoryT, CalorimeterIslandCluster { public: //------------------------------------------ // Constructor - ProtoCluster_factory_EcalEndcapNIslandProtoClusters(){ - SetTag("EcalEndcapNIslandProtoClusters"); + ProtoCluster_factory_EcalEndcapNIslandProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); - m_input_tag = "EcalEndcapNRecHits"; // adjacency matrix m_geoSvcName = "GeoSvc"; @@ -51,7 +52,6 @@ class ProtoCluster_factory_EcalEndcapNIslandProtoClusters : public eicrecon::JFa u_transverseEnergyProfileMetric = "globalDistEtaPhi"; u_transverseEnergyProfileScale = 0.08; - app->SetDefaultParameter("EEMC:EcalEndcapNIslandProtoClusters:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("EEMC:EcalEndcapNIslandProtoClusters:geoServiceName", m_geoSvcName); app->SetDefaultParameter("EEMC:EcalEndcapNIslandProtoClusters:readoutClass", m_readout); app->SetDefaultParameter("EEMC:EcalEndcapNIslandProtoClusters:sectorDist", m_sectorDist); @@ -82,7 +82,7 @@ class ProtoCluster_factory_EcalEndcapNIslandProtoClusters : public eicrecon::JFa // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - hits = event->Get(m_input_tag); + hits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/EEMC/ProtoCluster_factory_EcalEndcapNTruthProtoClusters.h b/src/detectors/EEMC/ProtoCluster_factory_EcalEndcapNTruthProtoClusters.h index 86f5f9f9c8..efe1f82e7b 100644 --- a/src/detectors/EEMC/ProtoCluster_factory_EcalEndcapNTruthProtoClusters.h +++ b/src/detectors/EEMC/ProtoCluster_factory_EcalEndcapNTruthProtoClusters.h @@ -8,30 +8,26 @@ #include -#include +#include #include #include -class ProtoCluster_factory_EcalEndcapNTruthProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterTruthClustering { +class ProtoCluster_factory_EcalEndcapNTruthProtoClusters : public JChainFactoryT, CalorimeterTruthClustering { public: //------------------------------------------ // Constructor - ProtoCluster_factory_EcalEndcapNTruthProtoClusters(){ - SetTag("EcalEndcapNTruthProtoClusters"); + ProtoCluster_factory_EcalEndcapNTruthProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); - m_inputHit_tag="EcalEndcapNRecHits"; - m_inputMCHit_tag="EcalEndcapNHits"; - - app->SetDefaultParameter("EEMC:EcalEndcapNTruthProtoClusters:inputHit_tag", m_inputHit_tag, "Name of input collection to use"); + InitDataTags(GetPluginName() + ":" + GetTag()); AlgorithmInit(m_log); } @@ -46,8 +42,8 @@ class ProtoCluster_factory_EcalEndcapNTruthProtoClusters : public eicrecon::JFac // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputHits = event->Get(m_inputHit_tag); - m_mcHits = event->Get(m_inputMCHit_tag); + m_inputHits = event->Get(GetInputTags()[0]); + m_mcHits = event->Get(GetInputTags()[1]); // Call Process for generic algorithm AlgorithmProcess(); @@ -56,9 +52,4 @@ class ProtoCluster_factory_EcalEndcapNTruthProtoClusters : public eicrecon::JFac Set(m_outputProtoClusters); m_outputProtoClusters.clear(); // not really needed, but better to not leave dangling pointers around } - -private: - // Name of input data type (collection) - std::string m_inputHit_tag; - std::string m_inputMCHit_tag; }; diff --git a/src/detectors/EEMC/RawCalorimeterHit_factory_EcalEndcapNRawHits.h b/src/detectors/EEMC/RawCalorimeterHit_factory_EcalEndcapNRawHits.h index 1d8cbd1d7c..cfd52ea722 100644 --- a/src/detectors/EEMC/RawCalorimeterHit_factory_EcalEndcapNRawHits.h +++ b/src/detectors/EEMC/RawCalorimeterHit_factory_EcalEndcapNRawHits.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include @@ -20,24 +20,25 @@ -class RawCalorimeterHit_factory_EcalEndcapNRawHits : public eicrecon::JFactoryPodioT, CalorimeterHitDigi { +class RawCalorimeterHit_factory_EcalEndcapNRawHits : public JChainFactoryT, CalorimeterHitDigi { public: //------------------------------------------ // Constructor - RawCalorimeterHit_factory_EcalEndcapNRawHits() { - SetTag("EcalEndcapNRawHits"); + RawCalorimeterHit_factory_EcalEndcapNRawHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override { + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); // Set default values for all config. parameters in CalorimeterHitDigi algorithm - m_input_tag = "EcalEndcapNHits"; u_eRes = {0.0 * sqrt(dd4hep::GeV), 0.02, 0.0 * dd4hep::GeV}; // flat 2% m_tRes = 0.0 * dd4hep::ns; m_capADC = 16384; @@ -54,8 +55,6 @@ class RawCalorimeterHit_factory_EcalEndcapNRawHits : public eicrecon::JFactoryPo // This is another option for exposing the data members as JANA configuration parameters. -// app->SetDefaultParameter("EEMC:tag", m_input_tag); - app->SetDefaultParameter("EEMC:EcalEndcapNRawHits:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("EEMC:EcalEndcapNRawHits:energyResolutions",u_eRes); app->SetDefaultParameter("EEMC:EcalEndcapNRawHits:timeResolution", m_tRes); app->SetDefaultParameter("EEMC:EcalEndcapNRawHits:capacityADC", m_capADC); @@ -81,7 +80,7 @@ class RawCalorimeterHit_factory_EcalEndcapNRawHits : public eicrecon::JFactoryPo // Process void Process(const std::shared_ptr &event) override { // Prefill inputs - simhits = event->Get(m_input_tag); + simhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/EHCAL/CalorimeterHit_factory_HcalEndcapNMergedHits.h b/src/detectors/EHCAL/CalorimeterHit_factory_HcalEndcapNMergedHits.h index f649526a41..18d6c5c2eb 100644 --- a/src/detectors/EHCAL/CalorimeterHit_factory_HcalEndcapNMergedHits.h +++ b/src/detectors/EHCAL/CalorimeterHit_factory_HcalEndcapNMergedHits.h @@ -1,42 +1,40 @@ #pragma once -#include +#include #include #include #include -class CalorimeterHit_factory_HcalEndcapNMergedHits : public eicrecon::JFactoryPodioT, CalorimeterHitsMerger { +class CalorimeterHit_factory_HcalEndcapNMergedHits : public JChainFactoryT, CalorimeterHitsMerger { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_HcalEndcapNMergedHits(){ - SetTag("HcalEndcapNMergedHits"); + CalorimeterHit_factory_HcalEndcapNMergedHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); m_log = app->GetService()->logger(GetTag()); - m_input_tag = "HcalEndcapNRecHits"; - m_readout="HcalEndcapNHits"; u_fields={"layer", "slice"}; // from ATHENA's reconstruction.py u_refs={1, 0}; // from ATHENA's reconstruction.py m_geoSvc= app->GetService(); - app->SetDefaultParameter("EHCAL:HcalEndcapNMergedHits:input_tag", m_input_tag); app->SetDefaultParameter("EHCAL:HcalEndcapNMergedHits:readout", m_readout); app->SetDefaultParameter("EHCAL:HcalEndcapNMergedHits:fields", u_fields); app->SetDefaultParameter("EHCAL:HcalEndcapNMergedHits:refs", u_refs); - initialize(); } @@ -48,7 +46,7 @@ class CalorimeterHit_factory_HcalEndcapNMergedHits : public eicrecon::JFactoryPo // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputs = event->Get(m_input_tag); + m_inputs = event->Get(GetInputTags()[0]); // Call Process for generic algorithm execute(); @@ -57,7 +55,4 @@ class CalorimeterHit_factory_HcalEndcapNMergedHits : public eicrecon::JFactoryPo Set(m_outputs); m_outputs.clear(); // not really needed, but better to not leave dangling pointers around } - -private: - std::string m_input_tag; }; diff --git a/src/detectors/EHCAL/CalorimeterHit_factory_HcalEndcapNRecHits.h b/src/detectors/EHCAL/CalorimeterHit_factory_HcalEndcapNRecHits.h index 57160f236a..64ee101d8f 100644 --- a/src/detectors/EHCAL/CalorimeterHit_factory_HcalEndcapNRecHits.h +++ b/src/detectors/EHCAL/CalorimeterHit_factory_HcalEndcapNRecHits.h @@ -3,27 +3,27 @@ #include -#include +#include #include #include #include -class CalorimeterHit_factory_HcalEndcapNRecHits : public eicrecon::JFactoryPodioT, CalorimeterHitReco { +class CalorimeterHit_factory_HcalEndcapNRecHits : public JChainFactoryT, CalorimeterHitReco { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_HcalEndcapNRecHits(){ - SetTag("HcalEndcapNRecHits"); + CalorimeterHit_factory_HcalEndcapNRecHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); + InitDataTags(GetPluginName() + ":" + GetTag()); - m_input_tag = "HcalEndcapNRawHits"; + auto app = GetApplication(); // digitization settings, must be consistent with digi class m_capADC=1024;//{this, "capacityADC", 8096}; @@ -48,7 +48,6 @@ class CalorimeterHit_factory_HcalEndcapNRecHits : public eicrecon::JFactoryPodio m_localDetElement=""; // from ATHENA's reconstruction.py (i.e. not defined there) u_localDetFields={}; // from ATHENA's reconstruction.py (i.e. not defined there) -// app->SetDefaultParameter("EHCAL:tag", m_input_tag); app->SetDefaultParameter("EHCAL:HcalEndcapNRecHits:capacityADC", m_capADC); app->SetDefaultParameter("EHCAL:HcalEndcapNRecHits:dynamicRangeADC", m_dyRangeADC); app->SetDefaultParameter("EHCAL:HcalEndcapNRecHits:pedestalMean", m_pedMeanADC); @@ -78,7 +77,7 @@ class CalorimeterHit_factory_HcalEndcapNRecHits : public eicrecon::JFactoryPodio // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - rawhits = event->Get(m_input_tag); + rawhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/EHCAL/EHCAL.cc b/src/detectors/EHCAL/EHCAL.cc index da025d06cd..2c5e458294 100644 --- a/src/detectors/EHCAL/EHCAL.cc +++ b/src/detectors/EHCAL/EHCAL.cc @@ -3,6 +3,7 @@ // // +#include #include #include @@ -26,11 +27,21 @@ extern "C" { InitJANAPlugin(app); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); + app->Add(new JChainFactoryGeneratorT( + {"HcalEndcapNHits"}, "HcalEndcapNRawHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"HcalEndcapNRawHits"}, "HcalEndcapNRecHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"HcalEndcapNRecHits"}, "HcalEndcapNMergedHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"HcalEndcapNRecHits", "HcalEndcapNHits"}, "HcalEndcapNTruthProtoClusters" + )); + app->Add(new JChainFactoryGeneratorT( + {"HcalEndcapNRecHits"}, "HcalEndcapNIslandProtoClusters" + )); app->Add( new JChainMultifactoryGeneratorT( "HcalEndcapNTruthClusters", diff --git a/src/detectors/EHCAL/ProtoCluster_factory_HcalEndcapNIslandProtoClusters.h b/src/detectors/EHCAL/ProtoCluster_factory_HcalEndcapNIslandProtoClusters.h index 8e9140c152..b5682f4b53 100644 --- a/src/detectors/EHCAL/ProtoCluster_factory_HcalEndcapNIslandProtoClusters.h +++ b/src/detectors/EHCAL/ProtoCluster_factory_HcalEndcapNIslandProtoClusters.h @@ -6,27 +6,28 @@ #include -#include +#include #include #include #include #include -class ProtoCluster_factory_HcalEndcapNIslandProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterIslandCluster { +class ProtoCluster_factory_HcalEndcapNIslandProtoClusters : public JChainFactoryT, CalorimeterIslandCluster { public: //------------------------------------------ // Constructor - ProtoCluster_factory_HcalEndcapNIslandProtoClusters(){ - SetTag("HcalEndcapNIslandProtoClusters"); + ProtoCluster_factory_HcalEndcapNIslandProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); - m_input_tag = "HcalEndcapNMergedHits"; // adjacency matrix m_geoSvcName = "GeoSvc"; @@ -81,7 +82,7 @@ class ProtoCluster_factory_HcalEndcapNIslandProtoClusters : public eicrecon::JFa // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - hits = event->Get(m_input_tag); + hits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/EHCAL/ProtoCluster_factory_HcalEndcapNTruthProtoClusters.h b/src/detectors/EHCAL/ProtoCluster_factory_HcalEndcapNTruthProtoClusters.h index 258671067a..867743ed03 100644 --- a/src/detectors/EHCAL/ProtoCluster_factory_HcalEndcapNTruthProtoClusters.h +++ b/src/detectors/EHCAL/ProtoCluster_factory_HcalEndcapNTruthProtoClusters.h @@ -8,28 +8,26 @@ #include -#include +#include #include #include -class ProtoCluster_factory_HcalEndcapNTruthProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterTruthClustering { +class ProtoCluster_factory_HcalEndcapNTruthProtoClusters : public JChainFactoryT, CalorimeterTruthClustering { public: //------------------------------------------ // Constructor - ProtoCluster_factory_HcalEndcapNTruthProtoClusters(){ - SetTag("HcalEndcapNTruthProtoClusters"); + ProtoCluster_factory_HcalEndcapNTruthProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); - m_inputHit_tag="HcalEndcapNRecHits"; - m_inputMCHit_tag="HcalEndcapNHits"; + InitDataTags(GetPluginName() + ":" + GetTag()); AlgorithmInit(m_log); } @@ -44,8 +42,8 @@ class ProtoCluster_factory_HcalEndcapNTruthProtoClusters : public eicrecon::JFac // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputHits = event->Get(m_inputHit_tag); - m_mcHits = event->Get(m_inputMCHit_tag); + m_inputHits = event->Get(GetInputTags()[0]); + m_mcHits = event->Get(GetInputTags()[1]); // Call Process for generic algorithm AlgorithmProcess(); @@ -54,8 +52,4 @@ class ProtoCluster_factory_HcalEndcapNTruthProtoClusters : public eicrecon::JFac Set(m_outputProtoClusters); m_outputProtoClusters.clear(); // not really needed, but better to not leave dangling pointers around } -private: - // Name of input data type (collection) - std::string m_inputHit_tag; - std::string m_inputMCHit_tag; }; diff --git a/src/detectors/EHCAL/RawCalorimeterHit_factory_HcalEndcapNRawHits.h b/src/detectors/EHCAL/RawCalorimeterHit_factory_HcalEndcapNRawHits.h index d0b4dd15e3..30ab50cd9d 100644 --- a/src/detectors/EHCAL/RawCalorimeterHit_factory_HcalEndcapNRawHits.h +++ b/src/detectors/EHCAL/RawCalorimeterHit_factory_HcalEndcapNRawHits.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include @@ -20,24 +20,25 @@ -class RawCalorimeterHit_factory_HcalEndcapNRawHits : public eicrecon::JFactoryPodioT, CalorimeterHitDigi { +class RawCalorimeterHit_factory_HcalEndcapNRawHits : public JChainFactoryT, CalorimeterHitDigi { public: //------------------------------------------ // Constructor - RawCalorimeterHit_factory_HcalEndcapNRawHits() { - SetTag("HcalEndcapNRawHits"); + RawCalorimeterHit_factory_HcalEndcapNRawHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override { + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); // Set default values for all config. parameters in CalorimeterHitDigi algorithm - m_input_tag = "HcalEndcapNHits"; u_eRes = {}; m_tRes = 0.0 * dd4hep::ns; m_capADC = 1024; @@ -52,7 +53,6 @@ class RawCalorimeterHit_factory_HcalEndcapNRawHits : public eicrecon::JFactoryPo m_geoSvc = app->GetService(); // TODO: implement named geometry service? // This is another option for exposing the data members as JANA configuration parameters. -// app->SetDefaultParameter("EHCAL:tag", m_input_tag); app->SetDefaultParameter("EHCAL:HcalEndcapNRawHits:energyResolutions",u_eRes); app->SetDefaultParameter("EHCAL:HcalEndcapNRawHits:timeResolution", m_tRes); app->SetDefaultParameter("EHCAL:HcalEndcapNRawHits:capacityADC", m_capADC); @@ -79,7 +79,7 @@ class RawCalorimeterHit_factory_HcalEndcapNRawHits : public eicrecon::JFactoryPo // Process void Process(const std::shared_ptr &event) override { // Prefill inputs - simhits = event->Get(m_input_tag); + simhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/FEMC/CalorimeterHit_factory_EcalEndcapPInsertRecHits.h b/src/detectors/FEMC/CalorimeterHit_factory_EcalEndcapPInsertRecHits.h index 8127145f08..2ff949fb8c 100644 --- a/src/detectors/FEMC/CalorimeterHit_factory_EcalEndcapPInsertRecHits.h +++ b/src/detectors/FEMC/CalorimeterHit_factory_EcalEndcapPInsertRecHits.h @@ -1,28 +1,28 @@ #pragma once -#include +#include #include #include #include -class CalorimeterHit_factory_EcalEndcapPInsertRecHits : public eicrecon::JFactoryPodioT, CalorimeterHitReco { +class CalorimeterHit_factory_EcalEndcapPInsertRecHits : public JChainFactoryT, CalorimeterHitReco { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_EcalEndcapPInsertRecHits(){ - SetTag("EcalEndcapPInsertRecHits"); + CalorimeterHit_factory_EcalEndcapPInsertRecHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); + InitDataTags(GetPluginName() + ":" + GetTag()); - m_input_tag = "EcalEndcapPInsertRawHits"; + auto app = GetApplication(); // digitization settings, must be consistent with digi class m_capADC=16384;//{this, "capacityADC", 8096}; @@ -47,8 +47,6 @@ class CalorimeterHit_factory_EcalEndcapPInsertRecHits : public eicrecon::JFactor m_localDetElement=""; // from ATHENA's reconstruction.py (i.e. not defined there) u_localDetFields={}; // from ATHENA's reconstruction.py (i.e. not defined there) -// app->SetDefaultParameter("FEMC:tag", m_input_tag); - app->SetDefaultParameter("FEMC:EcalEndcapPInsertRecHits:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("FEMC:EcalEndcapPInsertRecHits:capacityADC", m_capADC); app->SetDefaultParameter("FEMC:EcalEndcapPInsertRecHits:dynamicRangeADC", m_dyRangeADC); app->SetDefaultParameter("FEMC:EcalEndcapPInsertRecHits:pedestalMean", m_pedMeanADC); @@ -78,7 +76,7 @@ class CalorimeterHit_factory_EcalEndcapPInsertRecHits : public eicrecon::JFactor // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - rawhits = event->Get(m_input_tag); + rawhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/FEMC/CalorimeterHit_factory_EcalEndcapPRecHits.h b/src/detectors/FEMC/CalorimeterHit_factory_EcalEndcapPRecHits.h index 2ff0f3b9a2..a85436aa4d 100644 --- a/src/detectors/FEMC/CalorimeterHit_factory_EcalEndcapPRecHits.h +++ b/src/detectors/FEMC/CalorimeterHit_factory_EcalEndcapPRecHits.h @@ -3,27 +3,27 @@ #include -#include +#include #include #include #include -class CalorimeterHit_factory_EcalEndcapPRecHits : public eicrecon::JFactoryPodioT, CalorimeterHitReco { +class CalorimeterHit_factory_EcalEndcapPRecHits : public JChainFactoryT, CalorimeterHitReco { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_EcalEndcapPRecHits(){ - SetTag("EcalEndcapPRecHits"); + CalorimeterHit_factory_EcalEndcapPRecHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); + InitDataTags(GetPluginName() + ":" + GetTag()); - m_input_tag = "EcalEndcapPRawHits"; + auto app = GetApplication(); // digitization settings, must be consistent with digi class m_capADC=65536;//2^16 old: 16384 @@ -48,8 +48,6 @@ class CalorimeterHit_factory_EcalEndcapPRecHits : public eicrecon::JFactoryPodio m_localDetElement=""; // from ATHENA's reconstruction.py (i.e. not defined there) u_localDetFields={}; // from ATHENA's reconstruction.py (i.e. not defined there) -// app->SetDefaultParameter("FEMC:tag", m_input_tag); - app->SetDefaultParameter("FEMC:EcalEndcapPRecHits:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("FEMC:EcalEndcapPRecHits:capacityADC", m_capADC); app->SetDefaultParameter("FEMC:EcalEndcapPRecHits:dynamicRangeADC", m_dyRangeADC); app->SetDefaultParameter("FEMC:EcalEndcapPRecHits:pedestalMean", m_pedMeanADC); @@ -79,7 +77,7 @@ class CalorimeterHit_factory_EcalEndcapPRecHits : public eicrecon::JFactoryPodio // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - rawhits = event->Get(m_input_tag); + rawhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/FEMC/FEMC.cc b/src/detectors/FEMC/FEMC.cc index 0edb750258..00ffc5c555 100644 --- a/src/detectors/FEMC/FEMC.cc +++ b/src/detectors/FEMC/FEMC.cc @@ -3,6 +3,7 @@ // // +#include #include #include @@ -31,10 +32,18 @@ extern "C" { InitJANAPlugin(app); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); + app->Add(new JChainFactoryGeneratorT( + {"EcalEndcapPHits"}, "EcalEndcapPRawHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalEndcapPRawHits"}, "EcalEndcapPRecHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalEndcapPRecHits", "EcalEndcapPHits"}, "EcalEndcapPTruthProtoClusters" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalEndcapPRecHits"}, "EcalEndcapPIslandProtoClusters" + )); app->Add( new JChainMultifactoryGeneratorT( @@ -74,10 +83,18 @@ extern "C" { ) ); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); + app->Add(new JChainFactoryGeneratorT( + {"EcalEndcapPInsertHits"}, "EcalEndcapPInsertRawHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalEndcapPInsertRawHits"}, "EcalEndcapPInsertRecHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalEndcapPInsertRecHits", "EcalEndcapPInsertHits"}, "EcalEndcapPInsertTruthProtoClusters" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalEndcapPInsertRecHits"}, "EcalEndcapPInsertIslandProtoClusters" + )); app->Add( new JChainMultifactoryGeneratorT( diff --git a/src/detectors/FEMC/ProtoCluster_factory_EcalEndcapPInsertIslandProtoClusters.h b/src/detectors/FEMC/ProtoCluster_factory_EcalEndcapPInsertIslandProtoClusters.h index ea55f6e425..3dbfd8920e 100644 --- a/src/detectors/FEMC/ProtoCluster_factory_EcalEndcapPInsertIslandProtoClusters.h +++ b/src/detectors/FEMC/ProtoCluster_factory_EcalEndcapPInsertIslandProtoClusters.h @@ -6,27 +6,28 @@ #include -#include +#include #include #include #include #include -class ProtoCluster_factory_EcalEndcapPInsertIslandProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterIslandCluster { +class ProtoCluster_factory_EcalEndcapPInsertIslandProtoClusters : public JChainFactoryT, CalorimeterIslandCluster { public: //------------------------------------------ // Constructor - ProtoCluster_factory_EcalEndcapPInsertIslandProtoClusters(){ - SetTag("EcalEndcapPInsertIslandProtoClusters"); + ProtoCluster_factory_EcalEndcapPInsertIslandProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); - m_input_tag = "EcalEndcapPInsertRecHits"; // adjacency matrix m_geoSvcName = "GeoSvc"; @@ -51,7 +52,6 @@ class ProtoCluster_factory_EcalEndcapPInsertIslandProtoClusters : public eicreco u_transverseEnergyProfileMetric = "globalDistEtaPhi"; u_transverseEnergyProfileScale = 1.; - app->SetDefaultParameter("FEMC:EcalEndcapPInsertIslandProtoClusters:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("FEMC:EcalEndcapPInsertIslandProtoClusters:geoServiceName", m_geoSvcName); app->SetDefaultParameter("FEMC:EcalEndcapPInsertIslandProtoClusters:readoutClass", m_readout); app->SetDefaultParameter("FEMC:EcalEndcapPInsertIslandProtoClusters:sectorDist", m_sectorDist); @@ -82,7 +82,7 @@ class ProtoCluster_factory_EcalEndcapPInsertIslandProtoClusters : public eicreco // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - hits = event->Get(m_input_tag); + hits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/FEMC/ProtoCluster_factory_EcalEndcapPInsertTruthProtoClusters.h b/src/detectors/FEMC/ProtoCluster_factory_EcalEndcapPInsertTruthProtoClusters.h index 26dcf39ea2..4c54ae5d46 100644 --- a/src/detectors/FEMC/ProtoCluster_factory_EcalEndcapPInsertTruthProtoClusters.h +++ b/src/detectors/FEMC/ProtoCluster_factory_EcalEndcapPInsertTruthProtoClusters.h @@ -6,30 +6,26 @@ #include -#include +#include #include #include -class ProtoCluster_factory_EcalEndcapPInsertTruthProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterTruthClustering { +class ProtoCluster_factory_EcalEndcapPInsertTruthProtoClusters : public JChainFactoryT, CalorimeterTruthClustering { public: //------------------------------------------ // Constructor - ProtoCluster_factory_EcalEndcapPInsertTruthProtoClusters(){ - SetTag("EcalEndcapPInsertTruthProtoClusters"); + ProtoCluster_factory_EcalEndcapPInsertTruthProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); - m_inputHit_tag="EcalEndcapPInsertRecHits"; - m_inputMCHit_tag="EcalEndcapPInsertHits"; - - app->SetDefaultParameter("FEMC:EcalEndcapPInsertTruthProtoClusters:inputHit_tag", m_inputHit_tag, "Name of input collection to use"); + InitDataTags(GetPluginName() + ":" + GetTag()); AlgorithmInit(m_log); } @@ -44,8 +40,8 @@ class ProtoCluster_factory_EcalEndcapPInsertTruthProtoClusters : public eicrecon // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputHits = event->Get(m_inputHit_tag); - m_mcHits = event->Get(m_inputMCHit_tag); + m_inputHits = event->Get(GetInputTags()[0]); + m_mcHits = event->Get(GetInputTags()[1]); // Call Process for generic algorithm AlgorithmProcess(); @@ -54,8 +50,4 @@ class ProtoCluster_factory_EcalEndcapPInsertTruthProtoClusters : public eicrecon Set(m_outputProtoClusters); m_outputProtoClusters.clear(); // not really needed, but better to not leave dangling pointers around } -private: - // Name of input data type (collection) - std::string m_inputHit_tag; - std::string m_inputMCHit_tag; }; diff --git a/src/detectors/FEMC/ProtoCluster_factory_EcalEndcapPIslandProtoClusters.h b/src/detectors/FEMC/ProtoCluster_factory_EcalEndcapPIslandProtoClusters.h index 2e172b6646..13c377ce30 100644 --- a/src/detectors/FEMC/ProtoCluster_factory_EcalEndcapPIslandProtoClusters.h +++ b/src/detectors/FEMC/ProtoCluster_factory_EcalEndcapPIslandProtoClusters.h @@ -6,27 +6,28 @@ #include -#include +#include #include #include #include #include -class ProtoCluster_factory_EcalEndcapPIslandProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterIslandCluster { +class ProtoCluster_factory_EcalEndcapPIslandProtoClusters : public JChainFactoryT, CalorimeterIslandCluster { public: //------------------------------------------ // Constructor - ProtoCluster_factory_EcalEndcapPIslandProtoClusters(){ - SetTag("EcalEndcapPIslandProtoClusters"); + ProtoCluster_factory_EcalEndcapPIslandProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); - m_input_tag = "EcalEndcapPRecHits"; // adjacency matrix m_geoSvcName = "GeoSvc"; @@ -51,7 +52,6 @@ class ProtoCluster_factory_EcalEndcapPIslandProtoClusters : public eicrecon::JFa u_transverseEnergyProfileMetric = "globalDistEtaPhi"; u_transverseEnergyProfileScale = 0.04; - app->SetDefaultParameter("FEMC:EcalEndcapPIslandProtoClusters:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("FEMC:EcalEndcapPIslandProtoClusters:geoServiceName", m_geoSvcName); app->SetDefaultParameter("FEMC:EcalEndcapPIslandProtoClusters:readoutClass", m_readout); app->SetDefaultParameter("FEMC:EcalEndcapPIslandProtoClusters:sectorDist", m_sectorDist); @@ -82,7 +82,7 @@ class ProtoCluster_factory_EcalEndcapPIslandProtoClusters : public eicrecon::JFa // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - hits = event->Get(m_input_tag); + hits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/FEMC/ProtoCluster_factory_EcalEndcapPTruthProtoClusters.h b/src/detectors/FEMC/ProtoCluster_factory_EcalEndcapPTruthProtoClusters.h index 88b237ae41..050ebf973b 100644 --- a/src/detectors/FEMC/ProtoCluster_factory_EcalEndcapPTruthProtoClusters.h +++ b/src/detectors/FEMC/ProtoCluster_factory_EcalEndcapPTruthProtoClusters.h @@ -8,30 +8,26 @@ #include -#include +#include #include #include -class ProtoCluster_factory_EcalEndcapPTruthProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterTruthClustering { +class ProtoCluster_factory_EcalEndcapPTruthProtoClusters : public JChainFactoryT, CalorimeterTruthClustering { public: //------------------------------------------ // Constructor - ProtoCluster_factory_EcalEndcapPTruthProtoClusters(){ - SetTag("EcalEndcapPTruthProtoClusters"); + ProtoCluster_factory_EcalEndcapPTruthProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); - m_inputHit_tag="EcalEndcapPRecHits"; - m_inputMCHit_tag="EcalEndcapPHits"; - - app->SetDefaultParameter("FEMC:EcalEndcapPTruthProtoClusters:inputHit_tag", m_inputHit_tag, "Name of input collection to use"); + InitDataTags(GetPluginName() + ":" + GetTag()); AlgorithmInit(m_log); } @@ -46,8 +42,8 @@ class ProtoCluster_factory_EcalEndcapPTruthProtoClusters : public eicrecon::JFac // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputHits = event->Get(m_inputHit_tag); - m_mcHits = event->Get(m_inputMCHit_tag); + m_inputHits = event->Get(GetInputTags()[0]); + m_mcHits = event->Get(GetInputTags()[1]); // Call Process for generic algorithm AlgorithmProcess(); @@ -56,8 +52,4 @@ class ProtoCluster_factory_EcalEndcapPTruthProtoClusters : public eicrecon::JFac Set(m_outputProtoClusters); m_outputProtoClusters.clear(); // not really needed, but better to not leave dangling pointers around } -private: - // Name of input data type (collection) - std::string m_inputHit_tag; - std::string m_inputMCHit_tag; }; diff --git a/src/detectors/FEMC/RawCalorimeterHit_factory_EcalEndcapPInsertRawHits.h b/src/detectors/FEMC/RawCalorimeterHit_factory_EcalEndcapPInsertRawHits.h index 4dd7b4a8ab..da439b46af 100644 --- a/src/detectors/FEMC/RawCalorimeterHit_factory_EcalEndcapPInsertRawHits.h +++ b/src/detectors/FEMC/RawCalorimeterHit_factory_EcalEndcapPInsertRawHits.h @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include @@ -18,24 +18,25 @@ -class RawCalorimeterHit_factory_EcalEndcapPInsertRawHits : public eicrecon::JFactoryPodioT, CalorimeterHitDigi { +class RawCalorimeterHit_factory_EcalEndcapPInsertRawHits : public JChainFactoryT, CalorimeterHitDigi { public: //------------------------------------------ // Constructor - RawCalorimeterHit_factory_EcalEndcapPInsertRawHits() { - SetTag("EcalEndcapPInsertRawHits"); + RawCalorimeterHit_factory_EcalEndcapPInsertRawHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override { + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); // Set default values for all config. parameters in CalorimeterHitDigi algorithm - m_input_tag = "EcalEndcapPInsertHits"; u_eRes = {0.00340 * sqrt(dd4hep::GeV), 0.0009, 0.0 * dd4hep::GeV}; // (0.340% / sqrt(E)) \oplus 0.09% m_tRes = 0.0 * dd4hep::ns; m_capADC = 16384; @@ -50,8 +51,6 @@ class RawCalorimeterHit_factory_EcalEndcapPInsertRawHits : public eicrecon::JFac m_geoSvc = app->GetService(); // TODO: implement named geometry service? // This is another option for exposing the data members as JANA configuration parameters. -// app->SetDefaultParameter("FEMC:tag", m_input_tag); - app->SetDefaultParameter("FEMC:EcalEndcapPInsertRawHits:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("FEMC:EcalEndcapPInsertRawHits:energyResolutions",u_eRes); app->SetDefaultParameter("FEMC:EcalEndcapPInsertRawHits:timeResolution", m_tRes); app->SetDefaultParameter("FEMC:EcalEndcapPInsertRawHits:capacityADC", m_capADC); @@ -78,7 +77,7 @@ class RawCalorimeterHit_factory_EcalEndcapPInsertRawHits : public eicrecon::JFac // Process void Process(const std::shared_ptr &event) override { // Prefill inputs - simhits = event->Get(m_input_tag); + simhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/FEMC/RawCalorimeterHit_factory_EcalEndcapPRawHits.h b/src/detectors/FEMC/RawCalorimeterHit_factory_EcalEndcapPRawHits.h index 6c3d854f2a..a38b34a8f5 100644 --- a/src/detectors/FEMC/RawCalorimeterHit_factory_EcalEndcapPRawHits.h +++ b/src/detectors/FEMC/RawCalorimeterHit_factory_EcalEndcapPRawHits.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include @@ -20,24 +20,25 @@ -class RawCalorimeterHit_factory_EcalEndcapPRawHits : public eicrecon::JFactoryPodioT, CalorimeterHitDigi { +class RawCalorimeterHit_factory_EcalEndcapPRawHits : public JChainFactoryT, CalorimeterHitDigi { public: //------------------------------------------ // Constructor - RawCalorimeterHit_factory_EcalEndcapPRawHits() { - SetTag("EcalEndcapPRawHits"); + RawCalorimeterHit_factory_EcalEndcapPRawHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override { + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); // Set default values for all config. parameters in CalorimeterHitDigi algorithm - m_input_tag = "EcalEndcapPHits"; u_eRes = {0.00340 * sqrt(dd4hep::GeV), 0.0009, 0.0 * dd4hep::GeV}; // (0.340% / sqrt(E)) \oplus 0.09% m_tRes = 0.0 ; m_capTime = 100 ; // given in ns, 4 samples in HGCROC @@ -55,8 +56,6 @@ class RawCalorimeterHit_factory_EcalEndcapPRawHits : public eicrecon::JFactoryPo // This is another option for exposing the data members as JANA configuration parameters. -// app->SetDefaultParameter("FEMC:tag", m_input_tag); - app->SetDefaultParameter("FEMC:EcalEndcapPRawHits:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("FEMC:EcalEndcapPRawHits:energyResolutions",u_eRes); app->SetDefaultParameter("FEMC:EcalEndcapPRawHits:timeResolution", m_tRes); app->SetDefaultParameter("FEMC:EcalEndcapPRawHits:capacityADC", m_capADC); @@ -83,7 +82,7 @@ class RawCalorimeterHit_factory_EcalEndcapPRawHits : public eicrecon::JFactoryPo // Process void Process(const std::shared_ptr &event) override { // Prefill inputs - simhits = event->Get(m_input_tag); + simhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/FHCAL/CalorimeterHit_factory_HcalEndcapPInsertMergedHits.h b/src/detectors/FHCAL/CalorimeterHit_factory_HcalEndcapPInsertMergedHits.h index 62ae377268..885ffc0373 100644 --- a/src/detectors/FHCAL/CalorimeterHit_factory_HcalEndcapPInsertMergedHits.h +++ b/src/detectors/FHCAL/CalorimeterHit_factory_HcalEndcapPInsertMergedHits.h @@ -1,37 +1,36 @@ #pragma once -#include +#include #include #include #include -class CalorimeterHit_factory_HcalEndcapPInsertMergedHits : public eicrecon::JFactoryPodioT, CalorimeterHitsMerger { +class CalorimeterHit_factory_HcalEndcapPInsertMergedHits : public JChainFactoryT, CalorimeterHitsMerger { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_HcalEndcapPInsertMergedHits(){ - SetTag("HcalEndcapPInsertMergedHits"); + CalorimeterHit_factory_HcalEndcapPInsertMergedHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); m_log = app->GetService()->logger(GetTag()); - m_input_tag = "HcalEndcapPInsertRecHits"; - m_readout="HcalEndcapPInsertHits"; u_fields={"layer", "slice"}; // from ATHENA's reconstruction.py u_refs={1, 0}; // from ATHENA's reconstruction.py m_geoSvc= app->GetService(); - app->SetDefaultParameter("FHCAL:HcalEndcapPInsertMergedHits:input_tag", m_input_tag); app->SetDefaultParameter("FHCAL:HcalEndcapPInsertMergedHits:fields", u_fields); app->SetDefaultParameter("FHCAL:HcalEndcapPInsertMergedHits:refs", u_refs); @@ -46,7 +45,7 @@ class CalorimeterHit_factory_HcalEndcapPInsertMergedHits : public eicrecon::JFac // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputs = event->Get(m_input_tag); + m_inputs = event->Get(GetInputTags()[0]); // Call Process for generic algorithm execute(); @@ -55,7 +54,4 @@ class CalorimeterHit_factory_HcalEndcapPInsertMergedHits : public eicrecon::JFac Set(m_outputs); m_outputs.clear(); // not really needed, but better to not leave dangling pointers around } - -private: - std::string m_input_tag; }; diff --git a/src/detectors/FHCAL/CalorimeterHit_factory_HcalEndcapPInsertRecHits.h b/src/detectors/FHCAL/CalorimeterHit_factory_HcalEndcapPInsertRecHits.h index 46767bd26d..403c20e965 100644 --- a/src/detectors/FHCAL/CalorimeterHit_factory_HcalEndcapPInsertRecHits.h +++ b/src/detectors/FHCAL/CalorimeterHit_factory_HcalEndcapPInsertRecHits.h @@ -1,28 +1,28 @@ #pragma once -#include +#include #include #include #include -class CalorimeterHit_factory_HcalEndcapPInsertRecHits : public eicrecon::JFactoryPodioT, CalorimeterHitReco { +class CalorimeterHit_factory_HcalEndcapPInsertRecHits : public JChainFactoryT, CalorimeterHitReco { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_HcalEndcapPInsertRecHits(){ - SetTag("HcalEndcapPInsertRecHits"); + CalorimeterHit_factory_HcalEndcapPInsertRecHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); + InitDataTags(GetPluginName() + ":" + GetTag()); - m_input_tag = "HcalEndcapPInsertRawHits"; + auto app = GetApplication(); // digitization settings, must be consistent with digi class m_capADC=32768;//{this, "capacityADC", 8096}; @@ -47,7 +47,6 @@ class CalorimeterHit_factory_HcalEndcapPInsertRecHits : public eicrecon::JFactor m_localDetElement=""; // from ATHENA's reconstruction.py (i.e. not defined there) u_localDetFields={}; // from ATHENA's reconstruction.py (i.e. not defined there) -// app->SetDefaultParameter("FHCAL:tag", m_input_tag); app->SetDefaultParameter("FHCAL:HcalEndcapPInsertRecHits:capacityADC", m_capADC); app->SetDefaultParameter("FHCAL:HcalEndcapPInsertRecHits:dynamicRangeADC", m_dyRangeADC); app->SetDefaultParameter("FHCAL:HcalEndcapPInsertRecHits:pedestalMean", m_pedMeanADC); @@ -77,7 +76,7 @@ class CalorimeterHit_factory_HcalEndcapPInsertRecHits : public eicrecon::JFactor // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - rawhits = event->Get(m_input_tag); + rawhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/FHCAL/CalorimeterHit_factory_HcalEndcapPMergedHits.h b/src/detectors/FHCAL/CalorimeterHit_factory_HcalEndcapPMergedHits.h index 5367e926d5..0912fa2488 100644 --- a/src/detectors/FHCAL/CalorimeterHit_factory_HcalEndcapPMergedHits.h +++ b/src/detectors/FHCAL/CalorimeterHit_factory_HcalEndcapPMergedHits.h @@ -1,37 +1,36 @@ #pragma once -#include +#include #include #include #include -class CalorimeterHit_factory_HcalEndcapPMergedHits : public eicrecon::JFactoryPodioT, CalorimeterHitsMerger { +class CalorimeterHit_factory_HcalEndcapPMergedHits : public JChainFactoryT, CalorimeterHitsMerger { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_HcalEndcapPMergedHits(){ - SetTag("HcalEndcapPMergedHits"); + CalorimeterHit_factory_HcalEndcapPMergedHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); m_log = app->GetService()->logger(GetTag()); - m_input_tag = "HcalEndcapPRecHits"; - m_readout="HcalEndcapPHits"; u_fields={"layer", "slice"}; // from ATHENA's reconstruction.py u_refs={1, 0}; // from ATHENA's reconstruction.py m_geoSvc= app->GetService(); - app->SetDefaultParameter("FHCAL:HcalEndcapPMergedHits:input_tag", m_input_tag); app->SetDefaultParameter("FHCAL:HcalEndcapPMergedHits:readout", m_readout); app->SetDefaultParameter("FHCAL:HcalEndcapPMergedHits:fields", u_fields); app->SetDefaultParameter("FHCAL:HcalEndcapPMergedHits:refs", u_refs); @@ -47,7 +46,7 @@ class CalorimeterHit_factory_HcalEndcapPMergedHits : public eicrecon::JFactoryPo // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputs = event->Get(m_input_tag); + m_inputs = event->Get(GetInputTags()[0]); // Call Process for generic algorithm execute(); @@ -56,7 +55,4 @@ class CalorimeterHit_factory_HcalEndcapPMergedHits : public eicrecon::JFactoryPo Set(m_outputs); m_outputs.clear(); // not really needed, but better to not leave dangling pointers around } - -private: - std::string m_input_tag; }; diff --git a/src/detectors/FHCAL/CalorimeterHit_factory_HcalEndcapPRecHits.h b/src/detectors/FHCAL/CalorimeterHit_factory_HcalEndcapPRecHits.h index adc7ae2112..d34b9323d9 100644 --- a/src/detectors/FHCAL/CalorimeterHit_factory_HcalEndcapPRecHits.h +++ b/src/detectors/FHCAL/CalorimeterHit_factory_HcalEndcapPRecHits.h @@ -3,27 +3,27 @@ #include -#include +#include #include #include #include -class CalorimeterHit_factory_HcalEndcapPRecHits : public eicrecon::JFactoryPodioT, CalorimeterHitReco { +class CalorimeterHit_factory_HcalEndcapPRecHits : public JChainFactoryT, CalorimeterHitReco { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_HcalEndcapPRecHits(){ - SetTag("HcalEndcapPRecHits"); + CalorimeterHit_factory_HcalEndcapPRecHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); + InitDataTags(GetPluginName() + ":" + GetTag()); - m_input_tag = "HcalEndcapPRawHits"; + auto app = GetApplication(); // digitization settings, must be consistent with digi class m_capADC=65536; @@ -48,7 +48,6 @@ class CalorimeterHit_factory_HcalEndcapPRecHits : public eicrecon::JFactoryPodio m_localDetElement=""; // from ATHENA's reconstruction.py (i.e. not defined there) u_localDetFields={}; // from ATHENA's reconstruction.py (i.e. not defined there) -// app->SetDefaultParameter("FHCAL:tag", m_input_tag); app->SetDefaultParameter("FHCAL:HcalEndcapPRecHits:capacityADC", m_capADC); app->SetDefaultParameter("FHCAL:HcalEndcapPRecHits:dynamicRangeADC", m_dyRangeADC); app->SetDefaultParameter("FHCAL:HcalEndcapPRecHits:pedestalMean", m_pedMeanADC); @@ -78,7 +77,7 @@ class CalorimeterHit_factory_HcalEndcapPRecHits : public eicrecon::JFactoryPodio // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - rawhits = event->Get(m_input_tag); + rawhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/FHCAL/CalorimeterHit_factory_LFHCALRecHits.h b/src/detectors/FHCAL/CalorimeterHit_factory_LFHCALRecHits.h index 6932e9ade3..0e05524c48 100644 --- a/src/detectors/FHCAL/CalorimeterHit_factory_LFHCALRecHits.h +++ b/src/detectors/FHCAL/CalorimeterHit_factory_LFHCALRecHits.h @@ -6,27 +6,27 @@ #include -#include +#include #include #include #include -class CalorimeterHit_factory_LFHCALRecHits : public eicrecon::JFactoryPodioT, CalorimeterHitReco { +class CalorimeterHit_factory_LFHCALRecHits : public JChainFactoryT, CalorimeterHitReco { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_LFHCALRecHits(){ - SetTag("LFHCALRecHits"); + CalorimeterHit_factory_LFHCALRecHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); + InitDataTags(GetPluginName() + ":" + GetTag()); - m_input_tag = "LFHCALRawHits"; + auto app = GetApplication(); // digitization settings, must be consistent with digi class m_capADC=65536;//2^16 @@ -52,7 +52,6 @@ class CalorimeterHit_factory_LFHCALRecHits : public eicrecon::JFactoryPodioTSetDefaultParameter("FHCAL:tag", m_input_tag); app->SetDefaultParameter("FHCAL:LFHCALRecHits:capacityADC", m_capADC); app->SetDefaultParameter("FHCAL:LFHCALRecHits:dynamicRangeADC", m_dyRangeADC); app->SetDefaultParameter("FHCAL:LFHCALRecHits:pedestalMean", m_pedMeanADC); @@ -82,7 +81,7 @@ class CalorimeterHit_factory_LFHCALRecHits : public eicrecon::JFactoryPodioT &event) override{ // Prefill inputs - rawhits = event->Get(m_input_tag); + rawhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/FHCAL/FHCAL.cc b/src/detectors/FHCAL/FHCAL.cc index e76309b7e9..d4521a2c89 100644 --- a/src/detectors/FHCAL/FHCAL.cc +++ b/src/detectors/FHCAL/FHCAL.cc @@ -3,6 +3,7 @@ // // +#include #include #include @@ -40,11 +41,21 @@ extern "C" { InitJANAPlugin(app); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); + app->Add(new JChainFactoryGeneratorT( + {"HcalEndcapPHits"}, "HcalEndcapPRawHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"HcalEndcapPRawHits"}, "HcalEndcapPRecHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"HcalEndcapPRecHits"}, "HcalEndcapPMergedHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"HcalEndcapPRecHits", "HcalEndcapPHits"}, "HcalEndcapPTruthProtoClusters" + )); + app->Add(new JChainFactoryGeneratorT( + {"HcalEndcapPRecHits"}, "HcalEndcapPIslandProtoClusters" + )); app->Add( new JChainMultifactoryGeneratorT( @@ -84,11 +95,21 @@ extern "C" { ) ); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); + app->Add(new JChainFactoryGeneratorT( + {"HcalEndcapPInsertHits"}, "HcalEndcapPInsertRawHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"HcalEndcapPInsertRawHits"}, "HcalEndcapPInsertRecHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"HcalEndcapPInsertRecHits"}, "HcalEndcapPInsertMergedHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"HcalEndcapPInsertMergedHits", "HcalEndcapPInsertHits"}, "HcalEndcapPInsertTruthProtoClusters" + )); + app->Add(new JChainFactoryGeneratorT( + {"HcalEndcapPInsertMergedHits"}, "HcalEndcapPInsertIslandProtoClusters" + )); app->Add( new JChainMultifactoryGeneratorT( @@ -128,10 +149,18 @@ extern "C" { ) ); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); + app->Add(new JChainFactoryGeneratorT( + {"LFHCALHits"}, "LFHCALRawHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"LFHCALRawHits"}, "LFHCALRecHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"LFHCALRecHits", "LFHCALHits"}, "LFHCALTruthProtoClusters" + )); + app->Add(new JChainFactoryGeneratorT( + {"LFHCALRecHits"}, "LFHCALIslandProtoClusters" + )); app->Add( new JChainMultifactoryGeneratorT( diff --git a/src/detectors/FHCAL/ProtoCluster_factory_HcalEndcapPInsertIslandProtoClusters.h b/src/detectors/FHCAL/ProtoCluster_factory_HcalEndcapPInsertIslandProtoClusters.h index 0cfa44151e..47c009c25d 100644 --- a/src/detectors/FHCAL/ProtoCluster_factory_HcalEndcapPInsertIslandProtoClusters.h +++ b/src/detectors/FHCAL/ProtoCluster_factory_HcalEndcapPInsertIslandProtoClusters.h @@ -6,27 +6,28 @@ #include -#include +#include #include #include #include #include -class ProtoCluster_factory_HcalEndcapPInsertIslandProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterIslandCluster { +class ProtoCluster_factory_HcalEndcapPInsertIslandProtoClusters : public JChainFactoryT, CalorimeterIslandCluster { public: //------------------------------------------ // Constructor - ProtoCluster_factory_HcalEndcapPInsertIslandProtoClusters(){ - SetTag("HcalEndcapPInsertIslandProtoClusters"); + ProtoCluster_factory_HcalEndcapPInsertIslandProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); - m_input_tag = "HcalEndcapPInsertMergedHits"; // adjacency matrix m_geoSvcName = "GeoSvc"; @@ -81,7 +82,7 @@ class ProtoCluster_factory_HcalEndcapPInsertIslandProtoClusters : public eicreco // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - hits = event->Get(m_input_tag); + hits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/FHCAL/ProtoCluster_factory_HcalEndcapPInsertTruthProtoClusters.h b/src/detectors/FHCAL/ProtoCluster_factory_HcalEndcapPInsertTruthProtoClusters.h index ed24989598..e657d8c520 100644 --- a/src/detectors/FHCAL/ProtoCluster_factory_HcalEndcapPInsertTruthProtoClusters.h +++ b/src/detectors/FHCAL/ProtoCluster_factory_HcalEndcapPInsertTruthProtoClusters.h @@ -6,28 +6,26 @@ #include -#include +#include #include #include -class ProtoCluster_factory_HcalEndcapPInsertTruthProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterTruthClustering { +class ProtoCluster_factory_HcalEndcapPInsertTruthProtoClusters : public JChainFactoryT, CalorimeterTruthClustering { public: //------------------------------------------ // Constructor - ProtoCluster_factory_HcalEndcapPInsertTruthProtoClusters(){ - SetTag("HcalEndcapPInsertTruthProtoClusters"); + ProtoCluster_factory_HcalEndcapPInsertTruthProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); - m_inputHit_tag="HcalEndcapPInsertRecHits"; - m_inputMCHit_tag="HcalEndcapPInsertHits"; + InitDataTags(GetPluginName() + ":" + GetTag()); AlgorithmInit(m_log); } @@ -42,8 +40,8 @@ class ProtoCluster_factory_HcalEndcapPInsertTruthProtoClusters : public eicrecon // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputHits = event->Get(m_inputHit_tag); - m_mcHits = event->Get(m_inputMCHit_tag); + m_inputHits = event->Get(GetInputTags()[0]); + m_mcHits = event->Get(GetInputTags()[1]); // Call Process for generic algorithm AlgorithmProcess(); @@ -52,8 +50,4 @@ class ProtoCluster_factory_HcalEndcapPInsertTruthProtoClusters : public eicrecon Set(m_outputProtoClusters); m_outputProtoClusters.clear(); // not really needed, but better to not leave dangling pointers around } -private: - // Name of input data type (collection) - std::string m_inputHit_tag; - std::string m_inputMCHit_tag; }; diff --git a/src/detectors/FHCAL/ProtoCluster_factory_HcalEndcapPIslandProtoClusters.h b/src/detectors/FHCAL/ProtoCluster_factory_HcalEndcapPIslandProtoClusters.h index dd1a3d4b9d..bd93246c00 100644 --- a/src/detectors/FHCAL/ProtoCluster_factory_HcalEndcapPIslandProtoClusters.h +++ b/src/detectors/FHCAL/ProtoCluster_factory_HcalEndcapPIslandProtoClusters.h @@ -6,27 +6,28 @@ #include -#include +#include #include #include #include #include -class ProtoCluster_factory_HcalEndcapPIslandProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterIslandCluster { +class ProtoCluster_factory_HcalEndcapPIslandProtoClusters : public JChainFactoryT, CalorimeterIslandCluster { public: //------------------------------------------ // Constructor - ProtoCluster_factory_HcalEndcapPIslandProtoClusters(){ - SetTag("HcalEndcapPIslandProtoClusters"); + ProtoCluster_factory_HcalEndcapPIslandProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); - m_input_tag = "HcalEndcapPMergedHits"; // adjacency matrix m_geoSvcName = "GeoSvc"; @@ -81,7 +82,7 @@ class ProtoCluster_factory_HcalEndcapPIslandProtoClusters : public eicrecon::JFa // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - hits = event->Get(m_input_tag); + hits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/FHCAL/ProtoCluster_factory_HcalEndcapPTruthProtoClusters.h b/src/detectors/FHCAL/ProtoCluster_factory_HcalEndcapPTruthProtoClusters.h index 284a49ea3d..81a548d509 100644 --- a/src/detectors/FHCAL/ProtoCluster_factory_HcalEndcapPTruthProtoClusters.h +++ b/src/detectors/FHCAL/ProtoCluster_factory_HcalEndcapPTruthProtoClusters.h @@ -8,28 +8,26 @@ #include -#include +#include #include #include -class ProtoCluster_factory_HcalEndcapPTruthProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterTruthClustering { +class ProtoCluster_factory_HcalEndcapPTruthProtoClusters : public JChainFactoryT, CalorimeterTruthClustering { public: //------------------------------------------ // Constructor - ProtoCluster_factory_HcalEndcapPTruthProtoClusters(){ - SetTag("HcalEndcapPTruthProtoClusters"); + ProtoCluster_factory_HcalEndcapPTruthProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); - m_inputHit_tag="HcalEndcapPRecHits"; - m_inputMCHit_tag="HcalEndcapPHits"; + InitDataTags(GetPluginName() + ":" + GetTag()); AlgorithmInit(m_log); } @@ -44,8 +42,8 @@ class ProtoCluster_factory_HcalEndcapPTruthProtoClusters : public eicrecon::JFac // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputHits = event->Get(m_inputHit_tag); - m_mcHits = event->Get(m_inputMCHit_tag); + m_inputHits = event->Get(GetInputTags()[0]); + m_mcHits = event->Get(GetInputTags()[1]); // Call Process for generic algorithm AlgorithmProcess(); @@ -54,8 +52,4 @@ class ProtoCluster_factory_HcalEndcapPTruthProtoClusters : public eicrecon::JFac Set(m_outputProtoClusters); m_outputProtoClusters.clear(); // not really needed, but better to not leave dangling pointers around } -private: - // Name of input data type (collection) - std::string m_inputHit_tag; - std::string m_inputMCHit_tag; }; diff --git a/src/detectors/FHCAL/ProtoCluster_factory_LFHCALIslandProtoClusters.h b/src/detectors/FHCAL/ProtoCluster_factory_LFHCALIslandProtoClusters.h index 95280c1970..3aec07ee96 100644 --- a/src/detectors/FHCAL/ProtoCluster_factory_LFHCALIslandProtoClusters.h +++ b/src/detectors/FHCAL/ProtoCluster_factory_LFHCALIslandProtoClusters.h @@ -7,27 +7,28 @@ #include -#include +#include #include #include #include #include -class ProtoCluster_factory_LFHCALIslandProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterIslandCluster { +class ProtoCluster_factory_LFHCALIslandProtoClusters : public JChainFactoryT, CalorimeterIslandCluster { public: //------------------------------------------ // Constructor - ProtoCluster_factory_LFHCALIslandProtoClusters(){ - SetTag("LFHCALIslandProtoClusters"); + ProtoCluster_factory_LFHCALIslandProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); - m_input_tag = "LFHCALRecHits"; // neighbour checking distances m_sectorDist=0 * dd4hep::cm; @@ -106,7 +107,7 @@ class ProtoCluster_factory_LFHCALIslandProtoClusters : public eicrecon::JFactory // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - hits = event->Get(m_input_tag); + hits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/FHCAL/ProtoCluster_factory_LFHCALTruthProtoClusters.h b/src/detectors/FHCAL/ProtoCluster_factory_LFHCALTruthProtoClusters.h index c79d3646c3..c90972a374 100644 --- a/src/detectors/FHCAL/ProtoCluster_factory_LFHCALTruthProtoClusters.h +++ b/src/detectors/FHCAL/ProtoCluster_factory_LFHCALTruthProtoClusters.h @@ -7,28 +7,26 @@ #include -#include +#include #include #include -class ProtoCluster_factory_LFHCALTruthProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterTruthClustering { +class ProtoCluster_factory_LFHCALTruthProtoClusters : public JChainFactoryT, CalorimeterTruthClustering { public: //------------------------------------------ // Constructor - ProtoCluster_factory_LFHCALTruthProtoClusters(){ - SetTag("LFHCALTruthProtoClusters"); + ProtoCluster_factory_LFHCALTruthProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); - m_inputHit_tag="LFHCALRecHits"; - m_inputMCHit_tag="LFHCALHits"; + InitDataTags(GetPluginName() + ":" + GetTag()); AlgorithmInit(m_log); } @@ -43,8 +41,8 @@ class ProtoCluster_factory_LFHCALTruthProtoClusters : public eicrecon::JFactoryP // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputHits = event->Get(m_inputHit_tag); - m_mcHits = event->Get(m_inputMCHit_tag); + m_inputHits = event->Get(GetInputTags()[0]); + m_mcHits = event->Get(GetInputTags()[1]); // Call Process for generic algorithm AlgorithmProcess(); @@ -53,10 +51,6 @@ class ProtoCluster_factory_LFHCALTruthProtoClusters : public eicrecon::JFactoryP Set(m_outputProtoClusters); m_outputProtoClusters.clear(); // not really needed, but better to not leave dangling pointers around } -private: - // Name of input data type (collection) - std::string m_inputHit_tag; - std::string m_inputMCHit_tag; }; #endif // _ProtoCLuster_factory_IslandProtoClusters_h_ diff --git a/src/detectors/FHCAL/RawCalorimeterHit_factory_HcalEndcapPInsertRawHits.h b/src/detectors/FHCAL/RawCalorimeterHit_factory_HcalEndcapPInsertRawHits.h index cfcf5e060d..581a9eabc7 100644 --- a/src/detectors/FHCAL/RawCalorimeterHit_factory_HcalEndcapPInsertRawHits.h +++ b/src/detectors/FHCAL/RawCalorimeterHit_factory_HcalEndcapPInsertRawHits.h @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include @@ -18,24 +18,25 @@ -class RawCalorimeterHit_factory_HcalEndcapPInsertRawHits : public eicrecon::JFactoryPodioT, CalorimeterHitDigi { +class RawCalorimeterHit_factory_HcalEndcapPInsertRawHits : public JChainFactoryT, CalorimeterHitDigi { public: //------------------------------------------ // Constructor - RawCalorimeterHit_factory_HcalEndcapPInsertRawHits() { - SetTag("HcalEndcapPInsertRawHits"); + RawCalorimeterHit_factory_HcalEndcapPInsertRawHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override { + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); // Set default values for all config. parameters in CalorimeterHitDigi algorithm - m_input_tag = "HcalEndcapPInsertHits"; u_eRes = {}; m_tRes = 0.0 * dd4hep::ns; m_capADC = 32768; @@ -50,7 +51,6 @@ class RawCalorimeterHit_factory_HcalEndcapPInsertRawHits : public eicrecon::JFac m_geoSvc = app->GetService(); // TODO: implement named geometry service? // This is another option for exposing the data members as JANA configuration parameters. -// app->SetDefaultParameter("FHCAL:tag", m_input_tag); app->SetDefaultParameter("FHCAL:HcalEndcapPInsertRawHits:energyResolutions",u_eRes); app->SetDefaultParameter("FHCAL:HcalEndcapPInsertRawHits:timeResolution", m_tRes); app->SetDefaultParameter("FHCAL:HcalEndcapPInsertRawHits:capacityADC", m_capADC); @@ -77,7 +77,7 @@ class RawCalorimeterHit_factory_HcalEndcapPInsertRawHits : public eicrecon::JFac // Process void Process(const std::shared_ptr &event) override { // Prefill inputs - simhits = event->Get(m_input_tag); + simhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/FHCAL/RawCalorimeterHit_factory_HcalEndcapPRawHits.h b/src/detectors/FHCAL/RawCalorimeterHit_factory_HcalEndcapPRawHits.h index add04e45e0..a5f64c4f1a 100644 --- a/src/detectors/FHCAL/RawCalorimeterHit_factory_HcalEndcapPRawHits.h +++ b/src/detectors/FHCAL/RawCalorimeterHit_factory_HcalEndcapPRawHits.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include @@ -20,24 +20,25 @@ -class RawCalorimeterHit_factory_HcalEndcapPRawHits : public eicrecon::JFactoryPodioT, CalorimeterHitDigi { +class RawCalorimeterHit_factory_HcalEndcapPRawHits : public JChainFactoryT, CalorimeterHitDigi { public: //------------------------------------------ // Constructor - RawCalorimeterHit_factory_HcalEndcapPRawHits() { - SetTag("HcalEndcapPRawHits"); + RawCalorimeterHit_factory_HcalEndcapPRawHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override { + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); // Set default values for all config. parameters in CalorimeterHitDigi algorithm - m_input_tag = "HcalEndcapPHits"; u_eRes = {}; m_tRes = 0.001 * dd4hep::ns; m_capADC = 65536; @@ -52,7 +53,6 @@ class RawCalorimeterHit_factory_HcalEndcapPRawHits : public eicrecon::JFactoryPo m_geoSvc = app->GetService(); // TODO: implement named geometry service? // This is another option for exposing the data members as JANA configuration parameters. -// app->SetDefaultParameter("FHCAL:tag", m_input_tag); app->SetDefaultParameter("FHCAL:HcalEndcapPRawHits:energyResolutions",u_eRes); app->SetDefaultParameter("FHCAL:HcalEndcapPRawHits:timeResolution", m_tRes); app->SetDefaultParameter("FHCAL:HcalEndcapPRawHits:capacityADC", m_capADC); @@ -79,7 +79,7 @@ class RawCalorimeterHit_factory_HcalEndcapPRawHits : public eicrecon::JFactoryPo // Process void Process(const std::shared_ptr &event) override { // Prefill inputs - simhits = event->Get(m_input_tag); + simhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/FHCAL/RawCalorimeterHit_factory_LFHCALRawHits.h b/src/detectors/FHCAL/RawCalorimeterHit_factory_LFHCALRawHits.h index 1f1ffddb62..944ea9d374 100644 --- a/src/detectors/FHCAL/RawCalorimeterHit_factory_LFHCALRawHits.h +++ b/src/detectors/FHCAL/RawCalorimeterHit_factory_LFHCALRawHits.h @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include #include @@ -19,24 +19,25 @@ -class RawCalorimeterHit_factory_LFHCALRawHits : public eicrecon::JFactoryPodioT, CalorimeterHitDigi { +class RawCalorimeterHit_factory_LFHCALRawHits : public JChainFactoryT, CalorimeterHitDigi { public: //------------------------------------------ // Constructor - RawCalorimeterHit_factory_LFHCALRawHits() { - SetTag("LFHCALRawHits"); + RawCalorimeterHit_factory_LFHCALRawHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override { + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); // Set default values for all config. parameters in CalorimeterHitDigi algorithm - m_input_tag = "LFHCALHits"; u_eRes = {}; m_tRes = 0.0; // in ns m_capTime = 100 ; // given in ns, 4 samples in HGCROC @@ -52,7 +53,6 @@ class RawCalorimeterHit_factory_LFHCALRawHits : public eicrecon::JFactoryPodioT< m_geoSvc = app->GetService(); // TODO: implement named geometry service? // This is another option for exposing the data members as JANA configuration parameters. -// app->SetDefaultParameter("FHCAL:tag", m_input_tag); app->SetDefaultParameter("FHCAL:LFHCALRawHits:energyResolutions",u_eRes); app->SetDefaultParameter("FHCAL:LFHCALRawHits:maxTimeInt", m_capTime); app->SetDefaultParameter("FHCAL:LFHCALRawHits:timeResolution", m_tRes); @@ -80,7 +80,7 @@ class RawCalorimeterHit_factory_LFHCALRawHits : public eicrecon::JFactoryPodioT< // Process void Process(const std::shared_ptr &event) override { // Prefill inputs - simhits = event->Get(m_input_tag); + simhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/LUMISPECCAL/CalorimeterHit_factory_EcalLumiSpecRecHits.h b/src/detectors/LUMISPECCAL/CalorimeterHit_factory_EcalLumiSpecRecHits.h index 4a413a825e..57c6c27af1 100644 --- a/src/detectors/LUMISPECCAL/CalorimeterHit_factory_EcalLumiSpecRecHits.h +++ b/src/detectors/LUMISPECCAL/CalorimeterHit_factory_EcalLumiSpecRecHits.h @@ -4,27 +4,27 @@ #include #include -#include +#include #include #include #include -class CalorimeterHit_factory_EcalLumiSpecRecHits : public eicrecon::JFactoryPodioT, CalorimeterHitReco { +class CalorimeterHit_factory_EcalLumiSpecRecHits : public JChainFactoryT, CalorimeterHitReco { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_EcalLumiSpecRecHits(){ - SetTag("EcalLumiSpecRecHits"); + CalorimeterHit_factory_EcalLumiSpecRecHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); + InitDataTags(GetPluginName() + ":" + GetTag()); - m_input_tag = "EcalLumiSpecRawHits"; + auto app = GetApplication(); // digitization settings, must be consistent with digi class m_capADC=16384;//{this, "capacityADC", 8096}; @@ -49,7 +49,6 @@ class CalorimeterHit_factory_EcalLumiSpecRecHits : public eicrecon::JFactoryPodi m_localDetElement=""; // from ATHENA's reconstruction.py (i.e. not defined there) u_localDetFields={}; // from ATHENA's reconstruction.py (i.e. not defined there) - app->SetDefaultParameter("LUMISPECCAL:EcalLumiSpecRecHits:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("LUMISPECCAL:EcalLumiSpecRecHits:capacityADC", m_capADC); app->SetDefaultParameter("LUMISPECCAL:EcalLumiSpecRecHits:dynamicRangeADC", m_dyRangeADC); app->SetDefaultParameter("LUMISPECCAL:EcalLumiSpecRecHits:pedestalMean", m_pedMeanADC); @@ -79,7 +78,7 @@ class CalorimeterHit_factory_EcalLumiSpecRecHits : public eicrecon::JFactoryPodi // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - rawhits = event->Get(m_input_tag); + rawhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/LUMISPECCAL/LUMISPECCAL.cc b/src/detectors/LUMISPECCAL/LUMISPECCAL.cc index 13b7168eb5..f439b2ac53 100644 --- a/src/detectors/LUMISPECCAL/LUMISPECCAL.cc +++ b/src/detectors/LUMISPECCAL/LUMISPECCAL.cc @@ -3,6 +3,7 @@ // // +#include #include #include @@ -24,10 +25,18 @@ extern "C" { InitJANAPlugin(app); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); + app->Add(new JChainFactoryGeneratorT( + {"LumiSpecCALHits"}, "EcalLumiSpecRawHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalLumiSpecRawHits"}, "EcalLumiSpecRecHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalLumiSpecRecHits", "LumiSpecCALHits"}, "EcalLumiSpecTruthProtoClusters" + )); + app->Add(new JChainFactoryGeneratorT( + {"EcalLumiSpecRecHits"}, "EcalLumiSpecIslandProtoClusters" + )); app->Add( new JChainMultifactoryGeneratorT( diff --git a/src/detectors/LUMISPECCAL/ProtoCluster_factory_EcalLumiSpecIslandProtoClusters.h b/src/detectors/LUMISPECCAL/ProtoCluster_factory_EcalLumiSpecIslandProtoClusters.h index 5efdda4833..a7a504af9c 100644 --- a/src/detectors/LUMISPECCAL/ProtoCluster_factory_EcalLumiSpecIslandProtoClusters.h +++ b/src/detectors/LUMISPECCAL/ProtoCluster_factory_EcalLumiSpecIslandProtoClusters.h @@ -6,27 +6,28 @@ #include -#include +#include #include #include #include #include -class ProtoCluster_factory_EcalLumiSpecIslandProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterIslandCluster { +class ProtoCluster_factory_EcalLumiSpecIslandProtoClusters : public JChainFactoryT, CalorimeterIslandCluster { public: //------------------------------------------ // Constructor - ProtoCluster_factory_EcalLumiSpecIslandProtoClusters(){ - SetTag("EcalLumiSpecIslandProtoClusters"); + ProtoCluster_factory_EcalLumiSpecIslandProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); - m_input_tag = "EcalLumiSpecRecHits"; // adjacency matrix m_geoSvcName = "GeoSvc"; @@ -51,7 +52,6 @@ class ProtoCluster_factory_EcalLumiSpecIslandProtoClusters : public eicrecon::JF u_transverseEnergyProfileMetric = "localDistXY"; u_transverseEnergyProfileScale = 10. * dd4hep::mm; - app->SetDefaultParameter("LUMISPECCAL:EcalLumiSpecIslandProtoClusters:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("LUMISPECCAL:EcalLumiSpecIslandProtoClusters:geoServiceName", m_geoSvcName); app->SetDefaultParameter("LUMISPECCAL:EcalLumiSpecIslandProtoClusters:readoutClass", m_readout); app->SetDefaultParameter("LUMISPECCAL:EcalLumiSpecIslandProtoClusters:sectorDist", m_sectorDist); @@ -82,7 +82,7 @@ class ProtoCluster_factory_EcalLumiSpecIslandProtoClusters : public eicrecon::JF // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - hits = event->Get(m_input_tag); + hits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/LUMISPECCAL/ProtoCluster_factory_EcalLumiSpecTruthProtoClusters.h b/src/detectors/LUMISPECCAL/ProtoCluster_factory_EcalLumiSpecTruthProtoClusters.h index 84e602b073..329820424f 100644 --- a/src/detectors/LUMISPECCAL/ProtoCluster_factory_EcalLumiSpecTruthProtoClusters.h +++ b/src/detectors/LUMISPECCAL/ProtoCluster_factory_EcalLumiSpecTruthProtoClusters.h @@ -8,30 +8,26 @@ #include -#include +#include #include #include -class ProtoCluster_factory_EcalLumiSpecTruthProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterTruthClustering { +class ProtoCluster_factory_EcalLumiSpecTruthProtoClusters : public JChainFactoryT, CalorimeterTruthClustering { public: //------------------------------------------ // Constructor - ProtoCluster_factory_EcalLumiSpecTruthProtoClusters(){ - SetTag("EcalLumiSpecTruthProtoClusters"); + ProtoCluster_factory_EcalLumiSpecTruthProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); - m_inputHit_tag="EcalLumiSpecRecHits"; - m_inputMCHit_tag="LumiSpecCALHits"; - - app->SetDefaultParameter("LUMISPECCAL:EcalLumiSpecTruthProtoClusters:inputHit_tag", m_inputHit_tag, "Name of input collection to use"); + InitDataTags(GetPluginName() + ":" + GetTag()); AlgorithmInit(m_log); } @@ -46,8 +42,8 @@ class ProtoCluster_factory_EcalLumiSpecTruthProtoClusters : public eicrecon::JFa // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputHits = event->Get(m_inputHit_tag); - m_mcHits = event->Get(m_inputMCHit_tag); + m_inputHits = event->Get(GetInputTags()[0]); + m_mcHits = event->Get(GetInputTags()[1]); // Call Process for generic algorithm AlgorithmProcess(); @@ -56,9 +52,4 @@ class ProtoCluster_factory_EcalLumiSpecTruthProtoClusters : public eicrecon::JFa Set(m_outputProtoClusters); m_outputProtoClusters.clear(); // not really needed, but better to not leave dangling pointers around } - -private: - // Name of input data type (collection) - std::string m_inputHit_tag; - std::string m_inputMCHit_tag; }; diff --git a/src/detectors/LUMISPECCAL/RawCalorimeterHit_factory_EcalLumiSpecRawHits.h b/src/detectors/LUMISPECCAL/RawCalorimeterHit_factory_EcalLumiSpecRawHits.h index ade1afa3b6..e81a66f0f5 100644 --- a/src/detectors/LUMISPECCAL/RawCalorimeterHit_factory_EcalLumiSpecRawHits.h +++ b/src/detectors/LUMISPECCAL/RawCalorimeterHit_factory_EcalLumiSpecRawHits.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include @@ -20,24 +20,25 @@ -class RawCalorimeterHit_factory_EcalLumiSpecRawHits : public eicrecon::JFactoryPodioT, CalorimeterHitDigi { +class RawCalorimeterHit_factory_EcalLumiSpecRawHits : public JChainFactoryT, CalorimeterHitDigi { public: //------------------------------------------ // Constructor - RawCalorimeterHit_factory_EcalLumiSpecRawHits() { - SetTag("EcalLumiSpecRawHits"); + RawCalorimeterHit_factory_EcalLumiSpecRawHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override { + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); // Set default values for all config. parameters in CalorimeterHitDigi algorithm - m_input_tag = "LumiSpecCALHits"; u_eRes = {0.0 * sqrt(dd4hep::GeV), 0.02, 0.0 * dd4hep::GeV}; // flat 2% m_tRes = 0.0 * dd4hep::ns; m_capADC = 16384; @@ -54,7 +55,6 @@ class RawCalorimeterHit_factory_EcalLumiSpecRawHits : public eicrecon::JFactoryP // This is another option for exposing the data members as JANA configuration parameters. - app->SetDefaultParameter("LUMISPECCAL:EcalLumiSpecRawHits:input_tag", m_input_tag, "Name of input collection to use"); app->SetDefaultParameter("LUMISPECCAL:EcalLumiSpecRawHits:energyResolutions",u_eRes); app->SetDefaultParameter("LUMISPECCAL:EcalLumiSpecRawHits:timeResolution", m_tRes); app->SetDefaultParameter("LUMISPECCAL:EcalLumiSpecRawHits:capacityADC", m_capADC); @@ -80,7 +80,7 @@ class RawCalorimeterHit_factory_EcalLumiSpecRawHits : public eicrecon::JFactoryP // Process void Process(const std::shared_ptr &event) override { // Prefill inputs - simhits = event->Get(m_input_tag); + simhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/ZDC/CalorimeterHit_factory_ZDCEcalRecHits.h b/src/detectors/ZDC/CalorimeterHit_factory_ZDCEcalRecHits.h index 814fc194fa..fd11ef5500 100644 --- a/src/detectors/ZDC/CalorimeterHit_factory_ZDCEcalRecHits.h +++ b/src/detectors/ZDC/CalorimeterHit_factory_ZDCEcalRecHits.h @@ -3,27 +3,27 @@ #include -#include +#include #include #include #include -class CalorimeterHit_factory_ZDCEcalRecHits : public eicrecon::JFactoryPodioT, CalorimeterHitReco { +class CalorimeterHit_factory_ZDCEcalRecHits : public JChainFactoryT, CalorimeterHitReco { public: //------------------------------------------ // Constructor - CalorimeterHit_factory_ZDCEcalRecHits(){ - SetTag("ZDCEcalRecHits"); + CalorimeterHit_factory_ZDCEcalRecHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); + InitDataTags(GetPluginName() + ":" + GetTag()); - m_input_tag = "ZDCEcalRawHits"; + auto app = GetApplication(); // digitization settings, must be consistent with digi class m_capADC=8096;//{this, "capacityADC", 8096}; @@ -48,7 +48,6 @@ class CalorimeterHit_factory_ZDCEcalRecHits : public eicrecon::JFactoryPodioTSetDefaultParameter("ZDC:tag", m_input_tag); app->SetDefaultParameter("ZDC:ZDCEcalRecHits:capacityADC", m_capADC); app->SetDefaultParameter("ZDC:ZDCEcalRecHits:dynamicRangeADC", m_dyRangeADC); app->SetDefaultParameter("ZDC:ZDCEcalRecHits:pedestalMean", m_pedMeanADC); @@ -78,7 +77,7 @@ class CalorimeterHit_factory_ZDCEcalRecHits : public eicrecon::JFactoryPodioT &event) override{ // Prefill inputs - rawhits = event->Get(m_input_tag); + rawhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/ZDC/ProtoCluster_factory_ZDCEcalIslandProtoClusters.h b/src/detectors/ZDC/ProtoCluster_factory_ZDCEcalIslandProtoClusters.h index 7df67147ff..0cdb6dcdd2 100644 --- a/src/detectors/ZDC/ProtoCluster_factory_ZDCEcalIslandProtoClusters.h +++ b/src/detectors/ZDC/ProtoCluster_factory_ZDCEcalIslandProtoClusters.h @@ -6,27 +6,28 @@ #include -#include +#include #include #include #include #include -class ProtoCluster_factory_ZDCEcalIslandProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterIslandCluster { +class ProtoCluster_factory_ZDCEcalIslandProtoClusters : public JChainFactoryT, CalorimeterIslandCluster { public: //------------------------------------------ // Constructor - ProtoCluster_factory_ZDCEcalIslandProtoClusters(){ - SetTag("ZDCEcalIslandProtoClusters"); + ProtoCluster_factory_ZDCEcalIslandProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); - m_input_tag = "ZDCEcalRecHits"; // adjacency matrix m_geoSvcName = "GeoSvc"; @@ -83,7 +84,7 @@ class ProtoCluster_factory_ZDCEcalIslandProtoClusters : public eicrecon::JFactor // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - hits = event->Get(m_input_tag); + hits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/ZDC/ProtoCluster_factory_ZDCEcalTruthProtoClusters.h b/src/detectors/ZDC/ProtoCluster_factory_ZDCEcalTruthProtoClusters.h index 5cde3eb765..8619551ae3 100644 --- a/src/detectors/ZDC/ProtoCluster_factory_ZDCEcalTruthProtoClusters.h +++ b/src/detectors/ZDC/ProtoCluster_factory_ZDCEcalTruthProtoClusters.h @@ -8,28 +8,26 @@ #include -#include +#include #include #include -class ProtoCluster_factory_ZDCEcalTruthProtoClusters : public eicrecon::JFactoryPodioT, CalorimeterTruthClustering { +class ProtoCluster_factory_ZDCEcalTruthProtoClusters : public JChainFactoryT, CalorimeterTruthClustering { public: //------------------------------------------ // Constructor - ProtoCluster_factory_ZDCEcalTruthProtoClusters(){ - SetTag("ZDCEcalTruthProtoClusters"); + ProtoCluster_factory_ZDCEcalTruthProtoClusters(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override{ - auto app = GetApplication(); - m_inputHit_tag="ZDCEcalRecHits"; - m_inputMCHit_tag="ZDCEcalHits"; + InitDataTags(GetPluginName() + ":" + GetTag()); AlgorithmInit(m_log); } @@ -44,8 +42,8 @@ class ProtoCluster_factory_ZDCEcalTruthProtoClusters : public eicrecon::JFactory // Process void Process(const std::shared_ptr &event) override{ // Prefill inputs - m_inputHits = event->Get(m_inputHit_tag); - m_mcHits = event->Get(m_inputMCHit_tag); + m_inputHits = event->Get(GetInputTags()[0]); + m_mcHits = event->Get(GetInputTags()[1]); // Call Process for generic algorithm AlgorithmProcess(); @@ -54,9 +52,4 @@ class ProtoCluster_factory_ZDCEcalTruthProtoClusters : public eicrecon::JFactory Set(m_outputProtoClusters); m_outputProtoClusters.clear(); // not really needed, but better to not leave dangling pointers around } - -private: - // Name of input data type (collection) - std::string m_inputHit_tag; - std::string m_inputMCHit_tag; }; diff --git a/src/detectors/ZDC/RawCalorimeterHit_factory_ZDCEcalRawHits.h b/src/detectors/ZDC/RawCalorimeterHit_factory_ZDCEcalRawHits.h index 7ca9e42ba8..e3e568da7a 100644 --- a/src/detectors/ZDC/RawCalorimeterHit_factory_ZDCEcalRawHits.h +++ b/src/detectors/ZDC/RawCalorimeterHit_factory_ZDCEcalRawHits.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include @@ -20,24 +20,25 @@ -class RawCalorimeterHit_factory_ZDCEcalRawHits : public eicrecon::JFactoryPodioT, CalorimeterHitDigi { +class RawCalorimeterHit_factory_ZDCEcalRawHits : public JChainFactoryT, CalorimeterHitDigi { public: //------------------------------------------ // Constructor - RawCalorimeterHit_factory_ZDCEcalRawHits() { - SetTag("ZDCEcalRawHits"); + RawCalorimeterHit_factory_ZDCEcalRawHits(std::vector default_input_tags) + : JChainFactoryT(std::move(default_input_tags)) { m_log = japp->GetService()->logger(GetTag()); } //------------------------------------------ // Init void Init() override { + InitDataTags(GetPluginName() + ":" + GetTag()); + auto app = GetApplication(); // Set default values for all config. parameters in CalorimeterHitDigi algorithm - m_input_tag = "ZDCEcalHits"; u_eRes = {}; m_tRes = 0.0 * dd4hep::ns; m_capADC = 8096; @@ -52,7 +53,6 @@ class RawCalorimeterHit_factory_ZDCEcalRawHits : public eicrecon::JFactoryPodioT m_geoSvc = app->GetService(); // TODO: implement named geometry service? // This is another option for exposing the data members as JANA configuration parameters. -// app->SetDefaultParameter("ZDC:tag", m_input_tag); app->SetDefaultParameter("ZDC:ZDCEcalRawHits:energyResolutions",u_eRes); app->SetDefaultParameter("ZDC:ZDCEcalRawHits:timeResolution", m_tRes); app->SetDefaultParameter("ZDC:ZDCEcalRawHits:capacityADC", m_capADC); @@ -79,7 +79,7 @@ class RawCalorimeterHit_factory_ZDCEcalRawHits : public eicrecon::JFactoryPodioT // Process void Process(const std::shared_ptr &event) override { // Prefill inputs - simhits = event->Get(m_input_tag); + simhits = event->Get(GetInputTags()[0]); // Call Process for generic algorithm AlgorithmProcess(); diff --git a/src/detectors/ZDC/ZDC.cc b/src/detectors/ZDC/ZDC.cc index ee08d2993b..40445c9b0d 100644 --- a/src/detectors/ZDC/ZDC.cc +++ b/src/detectors/ZDC/ZDC.cc @@ -3,6 +3,7 @@ // // +#include #include #include @@ -25,10 +26,18 @@ extern "C" { InitJANAPlugin(app); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); - app->Add(new JFactoryGeneratorT()); + app->Add(new JChainFactoryGeneratorT( + {"ZDCEcalHits"}, "ZDCEcalRawHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"ZDCEcalRawHits"}, "ZDCEcalRecHits" + )); + app->Add(new JChainFactoryGeneratorT( + {"ZDCEcalRecHits", "ZDCEcalHits"}, "ZDCEcalTruthProtoClusters" + )); + app->Add(new JChainFactoryGeneratorT( + {"ZDCEcalRecHits"}, "ZDCEcalIslandProtoClusters" + )); app->Add( new JChainMultifactoryGeneratorT(