File indexing completed on 2025-11-29 09:22:08
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/ImagingTopoClusterConfig.h"
0012 #include "extensions/jana/JOmniFactoryGeneratorT.h"
0013 #include "factories/calorimetry/CalorimeterClusterRecoCoG_factory.h"
0014 #include "factories/calorimetry/CalorimeterClusterShape_factory.h"
0015 #include "factories/calorimetry/CalorimeterHitDigi_factory.h"
0016 #include "factories/calorimetry/CalorimeterHitReco_factory.h"
0017 #include "factories/calorimetry/CalorimeterIslandCluster_factory.h"
0018 #include "factories/calorimetry/CalorimeterTruthClustering_factory.h"
0019 #include "factories/calorimetry/HEXPLIT_factory.h"
0020 #include "factories/calorimetry/ImagingTopoCluster_factory.h"
0021
0022 extern "C" {
0023 void InitPlugin(JApplication* app) {
0024
0025 using namespace eicrecon;
0026
0027 InitJANAPlugin(app);
0028
0029
0030 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitDigi_factory>(
0031 "EcalFarForwardZDCRawHits", {"EventHeader", "EcalFarForwardZDCHits"},
0032 {"EcalFarForwardZDCRawHits", "EcalFarForwardZDCRawHitAssociations"},
0033 {
0034 .eRes{},
0035 .tRes = 0.0 * dd4hep::ns,
0036 .capADC = 32768,
0037 .dyRangeADC = 2000 * dd4hep::MeV,
0038 .pedMeanADC = 400,
0039 .pedSigmaADC = 3.2,
0040 .resolutionTDC = 10 * dd4hep::picosecond,
0041 .corrMeanScale = "1.0",
0042 .readout = "EcalFarForwardZDCHits",
0043 },
0044 app
0045 ));
0046 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitReco_factory>(
0047 "EcalFarForwardZDCRecHits", {"EcalFarForwardZDCRawHits"}, {"EcalFarForwardZDCRecHits"},
0048 {
0049 .capADC = 32768,
0050 .dyRangeADC = 2000. * dd4hep::MeV,
0051 .pedMeanADC = 400,
0052 .pedSigmaADC = 3.2,
0053 .resolutionTDC = 10 * dd4hep::picosecond,
0054 .thresholdFactor = 4.0,
0055 .thresholdValue = 0.0,
0056 .sampFrac = "1.0",
0057 .readout = "EcalFarForwardZDCHits",
0058 },
0059 app
0060 ));
0061 app->Add(new JOmniFactoryGeneratorT<CalorimeterTruthClustering_factory>(
0062 "EcalFarForwardZDCTruthProtoClusters", {"EcalFarForwardZDCRecHits", "EcalFarForwardZDCHits"},
0063 {"EcalFarForwardZDCTruthProtoClusters"},
0064 app
0065 ));
0066 app->Add(new JOmniFactoryGeneratorT<CalorimeterIslandCluster_factory>(
0067 "EcalFarForwardZDCIslandProtoClusters", {"EcalFarForwardZDCRecHits"},
0068 {"EcalFarForwardZDCIslandProtoClusters"},
0069 {
0070 .adjacencyMatrix{},
0071 .peakNeighbourhoodMatrix{},
0072 .readout{},
0073 .sectorDist = 5.0 * dd4hep::cm,
0074 .localDistXY = {50 * dd4hep::cm, 50 * dd4hep::cm},
0075 .localDistXZ{},
0076 .localDistYZ{},
0077 .globalDistRPhi{},
0078 .globalDistEtaPhi{},
0079 .dimScaledLocalDistXY{},
0080 .splitCluster = true,
0081 .minClusterHitEdep = 0.1 * dd4hep::MeV,
0082 .minClusterCenterEdep = 3.0 * dd4hep::MeV,
0083 .transverseEnergyProfileMetric = "globalDistEtaPhi",
0084 .transverseEnergyProfileScale = 1.,
0085 .transverseEnergyProfileScaleUnits{},
0086 },
0087 app
0088 ));
0089
0090 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0091 "EcalFarForwardZDCTruthClustersWithoutShapes",
0092 {
0093 "EcalFarForwardZDCTruthProtoClusters",
0094 "EcalFarForwardZDCRawHitAssociations"
0095 },
0096 {"EcalFarForwardZDCTruthClustersWithoutShapes",
0097 "EcalFarForwardZDCTruthClusterAssociationsWithoutShapes"},
0098 {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false},
0099 app
0100 ));
0101
0102 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0103 "EcalFarForwardZDCTruthClusters",
0104 {"EcalFarForwardZDCTruthClustersWithoutShapes",
0105 "EcalFarForwardZDCTruthClusterAssociationsWithoutShapes"},
0106 {"EcalFarForwardZDCTruthClusters", "EcalFarForwardZDCTruthClusterAssociations"},
0107 {.longitudinalShowerInfoAvailable = true, .energyWeight = "log", .logWeightBase = 3.6}, app));
0108
0109 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0110 "EcalFarForwardZDCClustersWithoutShapes",
0111 {
0112 "EcalFarForwardZDCIslandProtoClusters",
0113 "EcalFarForwardZDCRawHitAssociations"
0114 },
0115 {"EcalFarForwardZDCClustersWithoutShapes",
0116 "EcalFarForwardZDCClusterAssociationsWithoutShapes"},
0117 {
0118 .energyWeight = "log",
0119 .sampFrac = 1.0,
0120 .logWeightBase = 6.2,
0121 .enableEtaBounds = false,
0122 },
0123 app
0124 ));
0125
0126 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0127 "EcalFarForwardZDCClusters",
0128 {"EcalFarForwardZDCClustersWithoutShapes",
0129 "EcalFarForwardZDCClusterAssociationsWithoutShapes"},
0130 {"EcalFarForwardZDCClusters", "EcalFarForwardZDCClusterAssociations"},
0131 {.longitudinalShowerInfoAvailable = true, .energyWeight = "log", .logWeightBase = 6.2}, app));
0132
0133 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitDigi_factory>(
0134 "HcalFarForwardZDCRawHits", {"EventHeader", "HcalFarForwardZDCHits"},
0135 {"HcalFarForwardZDCRawHits", "HcalFarForwardZDCRawHitAssociations"},
0136 {
0137 .eRes{},
0138 .tRes = 0.0 * dd4hep::ns,
0139 .capADC = 65536,
0140 .dyRangeADC = 1000. * dd4hep::MeV,
0141 .pedMeanADC = 400,
0142 .pedSigmaADC = 2,
0143 .resolutionTDC = 10 * dd4hep::picosecond,
0144 .corrMeanScale = "1.0",
0145 .readout = "HcalFarForwardZDCHits",
0146 },
0147 app
0148 ));
0149
0150 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitReco_factory>(
0151 "HcalFarForwardZDCRecHits", {"HcalFarForwardZDCRawHits"}, {"HcalFarForwardZDCRecHits"},
0152 {
0153 .capADC = 65536,
0154 .dyRangeADC = 1000. * dd4hep::MeV,
0155 .pedMeanADC = 400,
0156 .pedSigmaADC = 2,
0157 .resolutionTDC = 10 * dd4hep::picosecond,
0158 .thresholdFactor = 3.0,
0159 .thresholdValue = 0.0,
0160 .sampFrac = "1.0",
0161 .readout = "HcalFarForwardZDCHits",
0162 .layerField = "layer",
0163 .sectorField = "system",
0164 },
0165 app
0166 ));
0167
0168 app->Add(new JOmniFactoryGeneratorT<HEXPLIT_factory>("HcalFarForwardZDCSubcellHits",
0169 {"HcalFarForwardZDCRecHits"},
0170 {"HcalFarForwardZDCSubcellHits"},
0171 {
0172 .MIP = 472. * dd4hep::keV,
0173 .Emin_in_MIPs = 0.5,
0174 .delta_in_MIPs = 0.01,
0175 .tmax = 269 * dd4hep::ns,
0176 },
0177 app
0178 ));
0179
0180 app->Add(new JOmniFactoryGeneratorT<ImagingTopoCluster_factory>(
0181 "HcalFarForwardZDCImagingProtoClusters", {"HcalFarForwardZDCSubcellHits"},
0182 {"HcalFarForwardZDCImagingProtoClusters"},
0183 {
0184 .neighbourLayersRange = 1,
0185 .sameLayerDistXY = {"0.5 * HcalFarForwardZDC_SiPMonTile_HexSideLength",
0186 "0.5 * HcalFarForwardZDC_SiPMonTile_HexSideLength * sin(pi / 3)"},
0187 .diffLayerDistXY = {"0.5 * HcalFarForwardZDC_SiPMonTile_HexSideLength",
0188 "0.5 * HcalFarForwardZDC_SiPMonTile_HexSideLength * sin(pi / 3)"},
0189 .sameLayerMode = eicrecon::ImagingTopoClusterConfig::ELayerMode::xy,
0190 .sectorDist = 10.0 * dd4hep::cm,
0191 .minClusterHitEdep = 50.0 * dd4hep::keV,
0192 .minClusterCenterEdep = 3.0 * dd4hep::MeV,
0193 .minClusterEdep = 11.0 * dd4hep::MeV,
0194 .minClusterNhits = 30,
0195 },
0196 app
0197 ));
0198
0199 app->Add(new JOmniFactoryGeneratorT<CalorimeterIslandCluster_factory>(
0200 "HcalFarForwardZDCIslandProtoClusters", {"HcalFarForwardZDCSubcellHits"},
0201 {"HcalFarForwardZDCIslandProtoClusters"},
0202 {.adjacencyMatrix{},
0203 .peakNeighbourhoodMatrix{},
0204 .readout{},
0205 .sectorDist = 1.5 * dd4hep::cm,
0206 .localDistXY = {"0.9 * HcalFarForwardZDC_SiPMonTile_HexSideLength",
0207 "0.76 * HcalFarForwardZDC_SiPMonTile_HexSideLength * sin(pi / 3)"},
0208 .localDistXZ{},
0209 .localDistYZ{},
0210 .globalDistRPhi{},
0211 .globalDistEtaPhi{},
0212 .dimScaledLocalDistXY{},
0213 .splitCluster = false,
0214 .minClusterHitEdep = 100.0 * dd4hep::keV,
0215 .minClusterCenterEdep = 1.0 * dd4hep::MeV,
0216 .transverseEnergyProfileMetric{},
0217 .transverseEnergyProfileScale{},
0218 .transverseEnergyProfileScaleUnits{}},
0219 app));
0220
0221 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0222 "HcalFarForwardZDCClustersWithoutShapes",
0223 {
0224 "HcalFarForwardZDCImagingProtoClusters",
0225 "HcalFarForwardZDCRawHitAssociations"
0226 },
0227 {"HcalFarForwardZDCClustersWithoutShapes",
0228 "HcalFarForwardZDCClusterAssociationsWithoutShapes"},
0229 {.energyWeight = "log",
0230 .sampFrac = 0.0203,
0231 .logWeightBaseCoeffs = {5.8, 0.65, 0.31},
0232 .logWeightBase_Eref = 50 * dd4hep::GeV},
0233 app
0234 ));
0235
0236 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0237 "HcalFarForwardZDCClusters",
0238 {"HcalFarForwardZDCClustersWithoutShapes",
0239 "HcalFarForwardZDCClusterAssociationsWithoutShapes"},
0240 {"HcalFarForwardZDCClusters", "HcalFarForwardZDCClusterAssociations"},
0241 {.longitudinalShowerInfoAvailable = true,
0242 .energyWeight = "log",
0243 .sampFrac = 0.0203,
0244 .logWeightBaseCoeffs = {5.8, 0.65, 0.31},
0245 .logWeightBase_Eref = 50 * dd4hep::GeV},
0246 app));
0247
0248 app->Add(new JOmniFactoryGeneratorT<CalorimeterTruthClustering_factory>(
0249 "HcalFarForwardZDCTruthProtoClusters", {"HcalFarForwardZDCRecHits", "HcalFarForwardZDCHits"},
0250 {"HcalFarForwardZDCTruthProtoClusters"},
0251 app
0252 ));
0253
0254
0255 app->Add(new JOmniFactoryGeneratorT<CalorimeterIslandCluster_factory>(
0256 "HcalFarForwardZDCIslandProtoClustersBaseline", {"HcalFarForwardZDCRecHits"},
0257 {"HcalFarForwardZDCIslandProtoClustersBaseline"},
0258 {.adjacencyMatrix{},
0259 .peakNeighbourhoodMatrix{},
0260 .readout{},
0261 .sectorDist = 5.0 * dd4hep::cm,
0262 .localDistXY = {50 * dd4hep::cm, 50 * dd4hep::cm},
0263 .localDistXZ{},
0264 .localDistYZ{},
0265 .globalDistRPhi{},
0266 .globalDistEtaPhi{},
0267 .dimScaledLocalDistXY{},
0268 .splitCluster = true,
0269 .minClusterHitEdep = 0.1 * dd4hep::MeV,
0270 .minClusterCenterEdep = 3.0 * dd4hep::MeV,
0271 .transverseEnergyProfileMetric = "globalDistEtaPhi",
0272 .transverseEnergyProfileScale = 1.,
0273 .transverseEnergyProfileScaleUnits{}},
0274 app
0275 ));
0276
0277 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0278 "HcalFarForwardZDCTruthClustersWithoutShapes",
0279 {
0280 "HcalFarForwardZDCTruthProtoClusters",
0281 "HcalFarForwardZDCRawHitAssociations"
0282 },
0283 {"HcalFarForwardZDCTruthClustersWithoutShapes",
0284 "HcalFarForwardZDCTruthClusterAssociationsWithoutShapes"},
0285 {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false},
0286 app
0287 ));
0288
0289 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0290 "HcalFarForwardZDCTruthClusters",
0291 {"HcalFarForwardZDCTruthClustersWithoutShapes",
0292 "HcalFarForwardZDCTruthClusterAssociationsWithoutShapes"},
0293 {"HcalFarForwardZDCTruthClusters", "HcalFarForwardZDCTruthClusterAssociations"},
0294 {.longitudinalShowerInfoAvailable = true, .energyWeight = "log", .logWeightBase = 3.6}, app));
0295
0296 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0297 "HcalFarForwardZDCClustersBaselineWithoutShapes",
0298 {
0299 "HcalFarForwardZDCIslandProtoClustersBaseline",
0300 "HcalFarForwardZDCRawHitAssociations"
0301 },
0302 {"HcalFarForwardZDCClustersBaselineWithoutShapes",
0303 "HcalFarForwardZDCClusterAssociationsBaselineWithoutShapes"},
0304 {
0305 .energyWeight = "log",
0306 .sampFrac = 0.0203,
0307 .logWeightBase = 6.2,
0308 .enableEtaBounds = false,
0309 },
0310 app
0311 ));
0312
0313 app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0314 "HcalFarForwardZDCClustersBaseline",
0315 {"HcalFarForwardZDCClustersBaselineWithoutShapes",
0316 "HcalFarForwardZDCClusterAssociationsBaselineWithoutShapes"},
0317 {"HcalFarForwardZDCClustersBaseline", "HcalFarForwardZDCClusterAssociationsBaseline"},
0318 {.longitudinalShowerInfoAvailable = true,
0319 .energyWeight = "log",
0320 .sampFrac = 0.0203,
0321 .logWeightBase = 6.2},
0322 app));
0323 }
0324 }