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