File indexing completed on 2025-09-18 08:17:52
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 #include "factories/calorimetry/TrackClusterMergeSplitter_factory.h"
0022
0023 extern "C" {
0024
0025 void InitPlugin(JApplication* app) {
0026
0027 using namespace eicrecon;
0028
0029 InitJANAPlugin(app);
0030
0031
0032 decltype(CalorimeterHitDigiConfig::capADC) HcalBarrel_capADC = 65536;
0033 decltype(CalorimeterHitDigiConfig::dyRangeADC) HcalBarrel_dyRangeADC = 1.0 * dd4hep::GeV;
0034 decltype(CalorimeterHitDigiConfig::pedMeanADC) HcalBarrel_pedMeanADC = 300;
0035 decltype(CalorimeterHitDigiConfig::pedSigmaADC) HcalBarrel_pedSigmaADC = 2;
0036 decltype(CalorimeterHitDigiConfig::resolutionTDC) HcalBarrel_resolutionTDC =
0037 1 * dd4hep::picosecond;
0038
0039
0040
0041 decltype(CalorimeterIslandClusterConfig::adjacencyMatrix) HcalBarrel_adjacencyMatrix =
0042 "("
0043
0044 " ( (abs(eta_1 - eta_2) == 1) && (abs(phi_1 - phi_2) == 0) ) ||"
0045
0046 " ( (abs(eta_1 - eta_2) == 0) && (abs(phi_1 - phi_2) == 1) ) ||"
0047
0048 " ( (abs(eta_1 - eta_2) == 0) && (abs(phi_1 - phi_2) == (320 - 1)) )"
0049 ") == 1";
0050
0051 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitDigi_factory>(
0052 "HcalBarrelRawHits", {"EventHeader", "HcalBarrelHits"},
0053 {"HcalBarrelRawHits", "HcalBarrelRawHitAssociations"},
0054 {
0055 .eRes = {},
0056 .tRes = 0.0 * dd4hep::ns,
0057 .threshold = 0.0,
0058 .capADC = HcalBarrel_capADC,
0059 .capTime = 100,
0060 .dyRangeADC = HcalBarrel_dyRangeADC,
0061 .pedMeanADC = HcalBarrel_pedMeanADC,
0062 .pedSigmaADC = HcalBarrel_pedSigmaADC,
0063 .resolutionTDC = HcalBarrel_resolutionTDC,
0064 .corrMeanScale = "1.0",
0065 .readout = "HcalBarrelHits",
0066 },
0067 app
0068 ));
0069
0070 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitReco_factory>(
0071 "HcalBarrelRecHits", {"HcalBarrelRawHits"}, {"HcalBarrelRecHits"},
0072 {
0073 .capADC = HcalBarrel_capADC,
0074 .dyRangeADC = HcalBarrel_dyRangeADC,
0075 .pedMeanADC = HcalBarrel_pedMeanADC,
0076 .pedSigmaADC = HcalBarrel_pedSigmaADC,
0077 .resolutionTDC = HcalBarrel_resolutionTDC,
0078 .thresholdFactor = 0.0,
0079 .thresholdValue = 33,
0080 .sampFrac = "0.033",
0081 .readout = "HcalBarrelHits",
0082 .layerField = "",
0083 .sectorField = "",
0084 },
0085 app
0086 ));
0087
0088
0089
0090
0091
0092 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitsMerger_factory>(
0093 "HcalBarrelMergedHits", {"HcalBarrelRecHits"}, {"HcalBarrelMergedHits"},
0094 {.readout = "HcalBarrelHits", .fieldTransformations = {"phi:phi"}},
0095 app
0096 ));
0097
0098 app->Add(new JOmniFactoryGeneratorT<CalorimeterTruthClustering_factory>(
0099 "HcalBarrelTruthProtoClusters", {"HcalBarrelRecHits", "HcalBarrelHits"},
0100 {"HcalBarrelTruthProtoClusters"},
0101 app
0102 ));
0103
0104 app->Add(new JOmniFactoryGeneratorT<CalorimeterIslandCluster_factory>(
0105 "HcalBarrelIslandProtoClusters", {"HcalBarrelRecHits"}, {"HcalBarrelIslandProtoClusters"},
0106 {.adjacencyMatrix = HcalBarrel_adjacencyMatrix,
0107 .peakNeighbourhoodMatrix{},
0108 .readout = "HcalBarrelHits",
0109 .sectorDist = 5.0 * dd4hep::cm,
0110 .localDistXY{},
0111 .localDistXZ{},
0112 .localDistYZ{},
0113 .globalDistRPhi{},
0114 .globalDistEtaPhi{},
0115 .dimScaledLocalDistXY{},
0116 .splitCluster = false,
0117 .minClusterHitEdep = 5.0 * dd4hep::MeV,
0118 .minClusterCenterEdep = 30.0 * dd4hep::MeV,
0119 .transverseEnergyProfileMetric = "globalDistEtaPhi",
0120 .transverseEnergyProfileScale = 1.,
0121 .transverseEnergyProfileScaleUnits{}},
0122 app
0123 ));
0124
0125 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0126 "HcalBarrelClustersWithoutShapes",
0127 {
0128 "HcalBarrelIslandProtoClusters",
0129 "HcalBarrelRawHitAssociations"
0130 },
0131 {"HcalBarrelClustersWithoutShapes",
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", "HcalBarrelClusterAssociationsWithoutShapes"},
0140 {"HcalBarrelClusters", "HcalBarrelClusterAssociations"},
0141 {.energyWeight = "log", .logWeightBase = 6.2}, app));
0142
0143 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0144 "HcalBarrelTruthClustersWithoutShapes",
0145 {
0146 "HcalBarrelTruthProtoClusters",
0147 "HcalBarrelRawHitAssociations"
0148 },
0149 {"HcalBarrelTruthClustersWithoutShapes",
0150 "HcalBarrelTruthClusterAssociationsWithoutShapes"},
0151 {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false},
0152 app
0153 ));
0154
0155 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0156 "HcalBarrelTruthClusters",
0157 {"HcalBarrelTruthClustersWithoutShapes", "HcalBarrelTruthClusterAssociationsWithoutShapes"},
0158 {"HcalBarrelTruthClusters", "HcalBarrelTruthClusterAssociations"},
0159 {.energyWeight = "log", .logWeightBase = 6.2}, app));
0160
0161 app->Add(new JOmniFactoryGeneratorT<TrackClusterMergeSplitter_factory>(
0162 "HcalBarrelSplitMergeProtoClusters",
0163 {"HcalBarrelIslandProtoClusters", "CalorimeterTrackProjections"},
0164 {"HcalBarrelSplitMergeProtoClusters"},
0165 {.idCalo = "HcalBarrel_ID",
0166 .minSigCut = -2.0,
0167 .avgEP = 0.50,
0168 .sigEP = 0.25,
0169 .drAdd = 0.40,
0170 .sampFrac = 1.0,
0171 .transverseEnergyProfileScale = 1.0},
0172 app
0173 ));
0174
0175 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0176 "HcalBarrelSplitMergeClustersWithoutShapes",
0177 {
0178 "HcalBarrelSplitMergeProtoClusters",
0179 "HcalBarrelRawHitAssociations"
0180 },
0181 {"HcalBarrelSplitMergeClustersWithoutShapes",
0182 "HcalBarrelSplitMergeClusterAssociationsWithoutShapes"},
0183 {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false},
0184 app
0185 ));
0186
0187 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0188 "HcalBarrelSplitMergeClusters",
0189 {"HcalBarrelSplitMergeClustersWithoutShapes",
0190 "HcalBarrelSplitMergeClusterAssociationsWithoutShapes"},
0191 {"HcalBarrelSplitMergeClusters", "HcalBarrelSplitMergeClusterAssociations"}, {}, app));
0192 }
0193 }