File indexing completed on 2026-11-27 09:45:35
0001
0002
0003
0004 #include <Evaluator/DD4hepUnits.h>
0005 #include <JANA/JApplicationFwd.h>
0006 #include <JANA/Utils/JTypeInfo.h>
0007 #include <string>
0008 #include <variant>
0009 #include <vector>
0010
0011 #include "algorithms/calorimetry/CalorimeterHitDigiConfig.h"
0012 #include "algorithms/calorimetry/CalorimeterIslandClusterConfig.h"
0013 #include "extensions/jana/JOmniFactoryGeneratorT.h"
0014 #include "factories/calorimetry/CalorimeterClusterRecoCoG_factory.h"
0015 #include "factories/calorimetry/CalorimeterClusterShape_factory.h"
0016 #include "factories/calorimetry/CalorimeterHitDigi_factory.h"
0017 #include "factories/calorimetry/CalorimeterHitReco_factory.h"
0018 #include "factories/calorimetry/CalorimeterHitsMerger_factory.h"
0019 #include "factories/calorimetry/CalorimeterIslandCluster_factory.h"
0020 #include "factories/calorimetry/CalorimeterTruthClustering_factory.h"
0021
0022 extern "C" {
0023
0024 void InitPlugin(JApplication* app) {
0025
0026 using namespace eicrecon;
0027
0028 InitJANAPlugin(app);
0029
0030
0031 decltype(CalorimeterHitDigiConfig::capADC) HcalBarrel_capADC = 65536;
0032 decltype(CalorimeterHitDigiConfig::dyRangeADC) HcalBarrel_dyRangeADC = 1.0 * dd4hep::GeV;
0033 decltype(CalorimeterHitDigiConfig::pedMeanADC) HcalBarrel_pedMeanADC = 300;
0034 decltype(CalorimeterHitDigiConfig::pedSigmaADC) HcalBarrel_pedSigmaADC = 2;
0035 decltype(CalorimeterHitDigiConfig::resolutionTDC) HcalBarrel_resolutionTDC =
0036 1 * dd4hep::picosecond;
0037
0038
0039
0040 decltype(CalorimeterIslandClusterConfig::adjacencyMatrix) HcalBarrel_adjacencyMatrix =
0041 "("
0042
0043 " ( (abs(eta_1 - eta_2) == 1) && (abs(phi_1 - phi_2) == 0) ) ||"
0044
0045 " ( (abs(eta_1 - eta_2) == 0) && (abs(phi_1 - phi_2) == 1) ) ||"
0046
0047 " ( (abs(eta_1 - eta_2) == 0) && (abs(phi_1 - phi_2) == (320 - 1)) )"
0048 ") == 1";
0049
0050 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitDigi_factory>(
0051 "HcalBarrelRawHits", {"EventHeader", "HcalBarrelHits"},
0052 {"HcalBarrelRawHits", "HcalBarrelRawHitLinks", "HcalBarrelRawHitAssociations"},
0053 {
0054 .eRes = {},
0055 .tRes = 0.0 * dd4hep::ns,
0056 .threshold = 0.0,
0057 .capADC = HcalBarrel_capADC,
0058 .capTime = 100,
0059 .dyRangeADC = HcalBarrel_dyRangeADC,
0060 .pedMeanADC = HcalBarrel_pedMeanADC,
0061 .pedSigmaADC = HcalBarrel_pedSigmaADC,
0062 .resolutionTDC = HcalBarrel_resolutionTDC,
0063 .corrMeanScale = "1.0",
0064 .readout = "HcalBarrelHits",
0065 },
0066 app
0067 ));
0068
0069 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitReco_factory>(
0070 "HcalBarrelRecHits", {"HcalBarrelRawHits"}, {"HcalBarrelRecHits"},
0071 {
0072 .capADC = HcalBarrel_capADC,
0073 .dyRangeADC = HcalBarrel_dyRangeADC,
0074 .pedMeanADC = HcalBarrel_pedMeanADC,
0075 .pedSigmaADC = HcalBarrel_pedSigmaADC,
0076 .resolutionTDC = HcalBarrel_resolutionTDC,
0077 .thresholdFactor = 0.0,
0078 .thresholdValue = 33,
0079 .sampFrac = "0.033",
0080 .readout = "HcalBarrelHits",
0081 .layerField = "",
0082 .sectorField = "",
0083 },
0084 app
0085 ));
0086
0087
0088
0089
0090
0091 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitsMerger_factory>(
0092 "HcalBarrelMergedHits", {"HcalBarrelRecHits"}, {"HcalBarrelMergedHits"},
0093 {.readout = "HcalBarrelHits", .fieldTransformations = {"phi:phi"}},
0094 app
0095 ));
0096
0097 app->Add(new JOmniFactoryGeneratorT<CalorimeterTruthClustering_factory>(
0098 "HcalBarrelTruthProtoClusters", {"HcalBarrelRecHits", "HcalBarrelRawHitLinks"},
0099 {"HcalBarrelTruthProtoClusters"},
0100 app
0101 ));
0102
0103 app->Add(new JOmniFactoryGeneratorT<CalorimeterIslandCluster_factory>(
0104 "HcalBarrelIslandProtoClusters", {"HcalBarrelRecHits"}, {"HcalBarrelIslandProtoClusters"},
0105 {.adjacencyMatrix = HcalBarrel_adjacencyMatrix,
0106 .peakNeighbourhoodMatrix{},
0107 .readout = "HcalBarrelHits",
0108 .sectorDist = 5.0 * dd4hep::cm,
0109 .localDistXY{},
0110 .localDistXZ{},
0111 .localDistYZ{},
0112 .globalDistRPhi{},
0113 .globalDistEtaPhi{},
0114 .dimScaledLocalDistXY{},
0115 .splitCluster = false,
0116 .minClusterHitEdep = 5.0 * dd4hep::MeV,
0117 .minClusterCenterEdep = 30.0 * dd4hep::MeV,
0118 .transverseEnergyProfileMetric = "globalDistEtaPhi",
0119 .transverseEnergyProfileScale = 1.,
0120 .transverseEnergyProfileScaleUnits{}},
0121 app
0122 ));
0123
0124 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0125 "HcalBarrelClustersWithoutShapes",
0126 {
0127 "HcalBarrelIslandProtoClusters",
0128 "HcalBarrelRawHitLinks",
0129 "HcalBarrelRawHitAssociations"
0130 },
0131 {"HcalBarrelClustersWithoutShapes", "HcalBarrelClusterLinksWithoutShapes",
0132 "HcalBarrelClusterAssociationsWithoutShapes"},
0133 {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false},
0134 app
0135 ));
0136
0137 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0138 "HcalBarrelClusters",
0139 {"HcalBarrelClustersWithoutShapes", "HcalBarrelClusterLinksWithoutShapes"},
0140 {"HcalBarrelClusters", "HcalBarrelClusterLinks", "HcalBarrelClusterAssociations"},
0141 {.energyWeight = "log", .logWeightBase = 6.2}, app));
0142
0143 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0144 "HcalBarrelTruthClustersWithoutShapes",
0145 {
0146 "HcalBarrelTruthProtoClusters",
0147 "HcalBarrelRawHitLinks",
0148 "HcalBarrelRawHitAssociations"
0149 },
0150 {"HcalBarrelTruthClustersWithoutShapes", "HcalBarrelTruthClusterLinksWithoutShapes",
0151 "HcalBarrelTruthClusterAssociationsWithoutShapes"},
0152 {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false},
0153 app
0154 ));
0155
0156 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0157 "HcalBarrelTruthClusters",
0158 {"HcalBarrelTruthClustersWithoutShapes", "HcalBarrelTruthClusterLinksWithoutShapes"},
0159 {"HcalBarrelTruthClusters", "HcalBarrelTruthClusterLinks",
0160 "HcalBarrelTruthClusterAssociations"},
0161 {.energyWeight = "log", .logWeightBase = 6.2}, app));
0162 }
0163 }