Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-06 07:54:15

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2022 - 2025 Whitney Armstrong, Sylvester Joosten, Chao Peng, David Lawrence, Thomas Britton, Wouter Deconinck, Maria Zurek, Akshaya Vijay, Nathan Brei, Dmitry Kalinkin, Derek Anderson, Minho Kim
0003 
0004 #include <Evaluator/DD4hepUnits.h>
0005 #include <JANA/JApplication.h>
0006 #include <JANA/JApplicationFwd.h>
0007 #include <JANA/Utils/JTypeInfo.h>
0008 #include <edm4eic/EDM4eicVersion.h>
0009 #include <edm4eic/unit_system.h>
0010 #include <edm4hep/SimCalorimeterHit.h>
0011 #include <cmath>
0012 #include <map>
0013 #include <memory>
0014 #include <string>
0015 #include <variant>
0016 #include <vector>
0017 
0018 #include "algorithms/calorimetry/CalorimeterHitDigiConfig.h"
0019 #include "algorithms/calorimetry/ImagingTopoClusterConfig.h"
0020 #include "algorithms/calorimetry/SimCalorimeterHitProcessorConfig.h"
0021 #include "algorithms/digi/CALOROCDigitizationConfig.h"
0022 #include "algorithms/digi/PulseCombinerConfig.h"
0023 #include "algorithms/digi/PulseGenerationConfig.h"
0024 #include "algorithms/digi/PulseNoiseConfig.h"
0025 #include "extensions/jana/JOmniFactoryGeneratorT.h"
0026 #include "factories/calorimetry/CalorimeterClusterRecoCoG_factory.h"
0027 #include "factories/calorimetry/CalorimeterClusterShape_factory.h"
0028 #include "factories/calorimetry/CalorimeterHitDigi_factory.h"
0029 #include "factories/calorimetry/CalorimeterHitReco_factory.h"
0030 #include "factories/calorimetry/CalorimeterIslandCluster_factory.h"
0031 #include "factories/calorimetry/EnergyPositionClusterMerger_factory.h"
0032 #include "factories/calorimetry/ImagingClusterReco_factory.h"
0033 #include "factories/calorimetry/ImagingTopoCluster_factory.h"
0034 #include "factories/calorimetry/SimCalorimeterHitProcessor_factory.h"
0035 #include "factories/calorimetry/TruthEnergyPositionClusterMerger_factory.h"
0036 #include "factories/digi/PulseCombiner_factory.h"
0037 #include "factories/digi/PulseGeneration_factory.h"
0038 #include "factories/digi/PulseNoise_factory.h"
0039 
0040 #if EDM4EIC_VERSION_MAJOR > 8 || (EDM4EIC_VERSION_MAJOR == 8 && EDM4EIC_VERSION_MINOR >= 7)
0041 #include "factories/digi/CALOROCDigitization_factory.h"
0042 #endif
0043 
0044 extern "C" {
0045 void InitPlugin(JApplication* app) {
0046 
0047   using namespace eicrecon;
0048 
0049   InitJANAPlugin(app);
0050 
0051   // Make sure left and right use the same value
0052   decltype(SimCalorimeterHitProcessorConfig::attenuationParameters) EcalBarrelScFi_attPars = {
0053       0.416212, 747.39875 * edm4eic::unit::mm, 7521.88383 * edm4eic::unit::mm};
0054   decltype(SimCalorimeterHitProcessorConfig::hitMergeFields) EcalBarrelScFi_hitMergeFields = {
0055       "fiber", "z"};
0056   decltype(SimCalorimeterHitProcessorConfig::contributionMergeFields)
0057       EcalBarrelScFi_contributionMergeFields = {"fiber"};
0058   decltype(SimCalorimeterHitProcessorConfig::inversePropagationSpeed)
0059       EcalBarrelScFi_inversePropagationSpeed = {(1. / 160) * edm4eic::unit::ns / edm4eic::unit::mm};
0060   decltype(SimCalorimeterHitProcessorConfig::fixedTimeDelay) EcalBarrelScFi_fixedTimeDelay = {
0061       2 * edm4eic::unit::ns};
0062   decltype(SimCalorimeterHitProcessorConfig::timeWindow) EcalBarrelScFi_timeWindow = {
0063       100 * edm4eic::unit::ns};
0064 
0065   decltype(PulseGenerationConfig::pulse_shape_function) EcalBarrelScFi_pulse_shape_function = {
0066       "LandauPulse"};
0067   decltype(PulseGenerationConfig::pulse_shape_params) EcalBarrelScFi_pulse_shape_params = {
0068       5.0, 10 * edm4eic::unit::ns};
0069   decltype(PulseGenerationConfig::ignore_thres) EcalBarrelScFi_ignore_thres = {5.0e-5};
0070   decltype(PulseGenerationConfig::timestep) EcalBarrelScFi_timestep = {0.5 * edm4eic::unit::ns};
0071 
0072   decltype(PulseCombinerConfig::combine_field) EcalBarrelScFi_combine_field           = {"grid"};
0073   decltype(PulseCombinerConfig::minimum_separation) EcalBarrelScFi_minimum_separation = {
0074       100 * edm4eic::unit::ns};
0075   decltype(PulseNoiseConfig::poles) EcalBarrelScFi_poles                  = {2};
0076   decltype(PulseNoiseConfig::variance) EcalBarrelScFi_variance            = {0.5};
0077   decltype(PulseNoiseConfig::alpha) EcalBarrelScFi_alpha                  = {0};
0078   decltype(PulseNoiseConfig::scale) EcalBarrelScFi_scale                  = {5.4e-5};
0079   decltype(PulseNoiseConfig::pedestal) EcalBarrelScFi_pedestal            = {1.6e-4};
0080   decltype(CALOROCDigitizationConfig::adc_phase) EcalBarrelScFi_adc_phase = {10 *
0081                                                                              edm4eic::unit::ns};
0082   decltype(CALOROCDigitizationConfig::toa_thres) EcalBarrelScFi_toa_thres = {4.0e-4};
0083   decltype(CALOROCDigitizationConfig::tot_thres) EcalBarrelScFi_tot_thres = {8.0e-4};
0084   decltype(CALOROCDigitizationConfig::dyRangeSingleGainADC) EcalBarrelScFi_dyRangeSingleGainADC = {
0085       1.0e-3};
0086   decltype(CALOROCDigitizationConfig::dyRangeHighGainADC) EcalBarrelScFi_dyRangeHighGainADC = {
0087       1.0e-3};
0088   decltype(CALOROCDigitizationConfig::dyRangeLowGainADC) EcalBarrelScFi_dyRangeLowGainADC = {
0089       1.5e-2};
0090 
0091   // Make sure digi and reco use the same value
0092   decltype(CalorimeterHitDigiConfig::capADC) EcalBarrelScFi_capADC = 16384; //16384,  14bit ADC
0093   decltype(CalorimeterHitDigiConfig::dyRangeADC) EcalBarrelScFi_dyRangeADC   = 1500 * dd4hep::MeV;
0094   decltype(CalorimeterHitDigiConfig::pedMeanADC) EcalBarrelScFi_pedMeanADC   = 100;
0095   decltype(CalorimeterHitDigiConfig::pedSigmaADC) EcalBarrelScFi_pedSigmaADC = 1;
0096   decltype(CalorimeterHitDigiConfig::resolutionTDC) EcalBarrelScFi_resolutionTDC =
0097       10 * dd4hep::picosecond;
0098   app->Add(new JOmniFactoryGeneratorT<SimCalorimeterHitProcessor_factory>(
0099       "EcalBarrelScFiPAttenuatedHits", {"EcalBarrelScFiHits"},
0100       {"EcalBarrelScFiPAttenuatedHits", "EcalBarrelScFiPAttenuatedHitContributions"},
0101       {
0102           .attenuationParameters            = EcalBarrelScFi_attPars,
0103           .readout                          = "EcalBarrelScFiHits",
0104           .attenuationReferencePositionName = "EcalBarrel_LightGuide_PositivePosZ",
0105           .hitMergeFields                   = EcalBarrelScFi_hitMergeFields,
0106           .contributionMergeFields          = EcalBarrelScFi_contributionMergeFields,
0107           .inversePropagationSpeed          = EcalBarrelScFi_inversePropagationSpeed,
0108           .fixedTimeDelay                   = EcalBarrelScFi_fixedTimeDelay,
0109           .timeWindow                       = EcalBarrelScFi_timeWindow,
0110       },
0111       app // TODO: Remove me once fixed
0112       ));
0113   app->Add(new JOmniFactoryGeneratorT<SimCalorimeterHitProcessor_factory>(
0114       "EcalBarrelScFiNAttenuatedHits", {"EcalBarrelScFiHits"},
0115       {"EcalBarrelScFiNAttenuatedHits", "EcalBarrelScFiNAttenuatedHitContributions"},
0116       {
0117           .attenuationParameters            = EcalBarrelScFi_attPars,
0118           .readout                          = "EcalBarrelScFiHits",
0119           .attenuationReferencePositionName = "EcalBarrel_LightGuide_NegativePosZ",
0120           .hitMergeFields                   = EcalBarrelScFi_hitMergeFields,
0121           .contributionMergeFields          = EcalBarrelScFi_contributionMergeFields,
0122           .inversePropagationSpeed          = EcalBarrelScFi_inversePropagationSpeed,
0123           .fixedTimeDelay                   = EcalBarrelScFi_fixedTimeDelay,
0124           .timeWindow                       = EcalBarrelScFi_timeWindow,
0125       },
0126       app // TODO: Remove me once fixed
0127       ));
0128   app->Add(new JOmniFactoryGeneratorT<PulseGeneration_factory<edm4hep::SimCalorimeterHit>>(
0129       "EcalBarrelScFiPPulses", {"EcalBarrelScFiPAttenuatedHits"}, {"EcalBarrelScFiPPulses"},
0130       {
0131           .pulse_shape_function = EcalBarrelScFi_pulse_shape_function,
0132           .pulse_shape_params   = EcalBarrelScFi_pulse_shape_params,
0133           .ignore_thres         = EcalBarrelScFi_ignore_thres,
0134           .timestep             = EcalBarrelScFi_timestep,
0135       },
0136       app // TODO: Remove me once fixed
0137       ));
0138   app->Add(new JOmniFactoryGeneratorT<PulseGeneration_factory<edm4hep::SimCalorimeterHit>>(
0139       "EcalBarrelScFiNPulses", {"EcalBarrelScFiNAttenuatedHits"}, {"EcalBarrelScFiNPulses"},
0140       {
0141           .pulse_shape_function = EcalBarrelScFi_pulse_shape_function,
0142           .pulse_shape_params   = EcalBarrelScFi_pulse_shape_params,
0143           .ignore_thres         = EcalBarrelScFi_ignore_thres,
0144           .timestep             = EcalBarrelScFi_timestep,
0145       },
0146       app // TODO: Remove me once fixed
0147       ));
0148   app->Add(new JOmniFactoryGeneratorT<PulseCombiner_factory>(
0149       "EcalBarrelScFiPCombinedPulses", {"EcalBarrelScFiPPulses"}, {"EcalBarrelScFiPCombinedPulses"},
0150       {
0151           .minimum_separation = EcalBarrelScFi_minimum_separation,
0152           .readout            = "EcalBarrelScFiHits",
0153           .combine_field      = EcalBarrelScFi_combine_field,
0154       },
0155       app // TODO: Remove me once fixed
0156       ));
0157   app->Add(new JOmniFactoryGeneratorT<PulseCombiner_factory>(
0158       "EcalBarrelScFiNCombinedPulses", {"EcalBarrelScFiNPulses"}, {"EcalBarrelScFiNCombinedPulses"},
0159       {
0160           .minimum_separation = EcalBarrelScFi_minimum_separation,
0161           .readout            = "EcalBarrelScFiHits",
0162           .combine_field      = EcalBarrelScFi_combine_field,
0163       },
0164       app // TODO: Remove me once fixed
0165       ));
0166   app->Add(new JOmniFactoryGeneratorT<PulseNoise_factory>(
0167       "EcalBarrelScFiPCombinedPulsesWithNoise", {"EventHeader", "EcalBarrelScFiPCombinedPulses"},
0168       {"EcalBarrelScFiPCombinedPulsesWithNoise"},
0169       {
0170           .poles    = EcalBarrelScFi_poles,
0171           .variance = EcalBarrelScFi_variance,
0172           .alpha    = EcalBarrelScFi_alpha,
0173           .scale    = EcalBarrelScFi_scale,
0174           .pedestal = EcalBarrelScFi_pedestal,
0175       },
0176       app // TODO: Remove me once fixed
0177       ));
0178   app->Add(new JOmniFactoryGeneratorT<PulseNoise_factory>(
0179       "EcalBarrelScFiNCombinedPulsesWithNoise", {"EventHeader", "EcalBarrelScFiNCombinedPulses"},
0180       {"EcalBarrelScFiNCombinedPulsesWithNoise"},
0181       {
0182           .poles    = EcalBarrelScFi_poles,
0183           .variance = EcalBarrelScFi_variance,
0184           .alpha    = EcalBarrelScFi_alpha,
0185           .scale    = EcalBarrelScFi_scale,
0186           .pedestal = EcalBarrelScFi_pedestal,
0187       },
0188       app // TODO: Remove me once fixed
0189       ));
0190 #if EDM4EIC_VERSION_MAJOR > 8 || (EDM4EIC_VERSION_MAJOR == 8 && EDM4EIC_VERSION_MINOR >= 7)
0191   app->Add(new JOmniFactoryGeneratorT<CALOROCDigitization_factory>(
0192       "EcalBarrelScFiPCALOROCHits", {"EcalBarrelScFiPCombinedPulsesWithNoise"},
0193       {"EcalBarrelScFiPCALOROCHits"},
0194       {
0195           .adc_phase            = EcalBarrelScFi_adc_phase,
0196           .toa_thres            = EcalBarrelScFi_toa_thres,
0197           .tot_thres            = EcalBarrelScFi_tot_thres,
0198           .dyRangeSingleGainADC = EcalBarrelScFi_dyRangeSingleGainADC,
0199           .dyRangeHighGainADC   = EcalBarrelScFi_dyRangeHighGainADC,
0200           .dyRangeLowGainADC    = EcalBarrelScFi_dyRangeLowGainADC,
0201       },
0202       app // TODO: Remove me once fixed
0203       ));
0204   app->Add(new JOmniFactoryGeneratorT<CALOROCDigitization_factory>(
0205       "EcalBarrelScFiNCALOROCHits", {"EcalBarrelScFiNCombinedPulses"},
0206       {"EcalBarrelScFiNCALOROCHits"},
0207       {
0208           .adc_phase            = EcalBarrelScFi_adc_phase,
0209           .toa_thres            = EcalBarrelScFi_toa_thres,
0210           .tot_thres            = EcalBarrelScFi_tot_thres,
0211           .dyRangeSingleGainADC = EcalBarrelScFi_dyRangeSingleGainADC,
0212           .dyRangeHighGainADC   = EcalBarrelScFi_dyRangeHighGainADC,
0213           .dyRangeLowGainADC    = EcalBarrelScFi_dyRangeLowGainADC,
0214       },
0215       app // TODO: Remove me once fixed
0216       ));
0217 #endif
0218   app->Add(new JOmniFactoryGeneratorT<CalorimeterHitDigi_factory>(
0219       "EcalBarrelScFiRawHits", {"EventHeader", "EcalBarrelScFiHits"},
0220       {"EcalBarrelScFiRawHits",
0221 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0222        "EcalBarrelScFiRawHitLinks",
0223 #endif
0224        "EcalBarrelScFiRawHitAssociations"},
0225       {
0226           .eRes          = {0.0 * sqrt(dd4hep::GeV), 0.0, 0.0 * dd4hep::GeV},
0227           .tRes          = 0.0 * dd4hep::ns,
0228           .threshold     = 0.0 * dd4hep::keV, // threshold is set in ADC in reco
0229           .capADC        = EcalBarrelScFi_capADC,
0230           .dyRangeADC    = EcalBarrelScFi_dyRangeADC,
0231           .pedMeanADC    = EcalBarrelScFi_pedMeanADC,
0232           .pedSigmaADC   = EcalBarrelScFi_pedSigmaADC,
0233           .resolutionTDC = EcalBarrelScFi_resolutionTDC,
0234           .corrMeanScale = "1.0",
0235           .readout       = "EcalBarrelScFiHits",
0236           .fields        = {"fiber", "z"},
0237       },
0238       app // TODO: Remove me once fixed
0239       ));
0240   app->Add(new JOmniFactoryGeneratorT<CalorimeterHitReco_factory>(
0241       "EcalBarrelScFiRecHits", {"EcalBarrelScFiRawHits"}, {"EcalBarrelScFiRecHits"},
0242       {
0243           .capADC          = EcalBarrelScFi_capADC,
0244           .dyRangeADC      = EcalBarrelScFi_dyRangeADC,
0245           .pedMeanADC      = EcalBarrelScFi_pedMeanADC,
0246           .pedSigmaADC     = EcalBarrelScFi_pedSigmaADC, // not needed; use only thresholdValue
0247           .resolutionTDC   = EcalBarrelScFi_resolutionTDC,
0248           .thresholdFactor = 0.0, // use only thresholdValue
0249           .thresholdValue  = 5.0, // 16384 ADC counts/1500 MeV * 0.5 MeV (desired threshold) = 5.46
0250           .sampFrac        = "0.09285755",
0251           .readout         = "EcalBarrelScFiHits",
0252           .layerField      = "layer",
0253           .sectorField     = "sector",
0254           .localDetFields  = {"system", "sector"},
0255           // here we want to use grid center position (XY) but keeps the z information from fiber-segment
0256           // TODO: a more realistic way to get z is to reconstruct it from timing
0257           .maskPos       = "xy",
0258           .maskPosFields = {"fiber", "z"},
0259       },
0260       app // TODO: Remove me once fixed
0261       ));
0262   app->Add(new JOmniFactoryGeneratorT<CalorimeterIslandCluster_factory>(
0263       "EcalBarrelScFiProtoClusters", {"EcalBarrelScFiRecHits"}, {"EcalBarrelScFiProtoClusters"},
0264       {
0265           .adjacencyMatrix{},
0266           .peakNeighbourhoodMatrix{},
0267           .readout{},
0268           .sectorDist = 50. * dd4hep::mm,
0269           .localDistXY{},
0270           .localDistXZ = {80 * dd4hep::mm, 80 * dd4hep::mm},
0271           .localDistYZ{},
0272           .globalDistRPhi{},
0273           .globalDistEtaPhi{},
0274           .dimScaledLocalDistXY{},
0275           .splitCluster         = false,
0276           .minClusterHitEdep    = 5.0 * dd4hep::MeV,
0277           .minClusterCenterEdep = 100.0 * dd4hep::MeV,
0278           .transverseEnergyProfileMetric{},
0279           .transverseEnergyProfileScale{},
0280           .transverseEnergyProfileScaleUnits{},
0281       },
0282       app // TODO: Remove me once fixed
0283       ));
0284   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0285       "EcalBarrelScFiClustersWithoutShapes",
0286       {
0287           "EcalBarrelScFiProtoClusters", // edm4eic::ProtoClusterCollection
0288 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0289           "EcalBarrelScFiRawHitLinks", // edm4eic::MCRecoCalorimeterHitLink
0290 #endif
0291           "EcalBarrelScFiRawHitAssociations" // edm4eic::MCRecoCalorimeterHitAssociation
0292       },
0293       {"EcalBarrelScFiClustersWithoutShapes", // edm4eic::Cluster
0294 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0295        "EcalBarrelScFiClusterLinksWithoutShapes",
0296 #endif
0297        "EcalBarrelScFiClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation
0298       {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false},
0299       app // TODO: Remove me once fixed
0300       ));
0301   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0302       "EcalBarrelScFiClusters",
0303       {"EcalBarrelScFiClustersWithoutShapes", "EcalBarrelScFiClusterAssociationsWithoutShapes"},
0304       {"EcalBarrelScFiClusters",
0305 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0306        "EcalBarrelScFiClusterLinks",
0307 #endif
0308        "EcalBarrelScFiClusterAssociations"},
0309       {.longitudinalShowerInfoAvailable = true, .energyWeight = "log", .logWeightBase = 6.2}, app));
0310 
0311   // Make sure digi and reco use the same value
0312   decltype(SimCalorimeterHitProcessorConfig::timeWindow) EcalBarrelImaging_timeWindow = {
0313       100 * edm4eic::unit::ns};
0314 
0315   decltype(CalorimeterHitDigiConfig::capADC) EcalBarrelImaging_capADC = 8192; //8192,  13bit ADC
0316   decltype(CalorimeterHitDigiConfig::dyRangeADC) EcalBarrelImaging_dyRangeADC = 3 * dd4hep::MeV;
0317   decltype(CalorimeterHitDigiConfig::pedMeanADC) EcalBarrelImaging_pedMeanADC =
0318       14; // Noise floor at 5 keV: 8192 / 3 * 0.005
0319   decltype(CalorimeterHitDigiConfig::pedSigmaADC) EcalBarrelImaging_pedSigmaADC =
0320       5; // Upper limit for sigma for AstroPix
0321   decltype(CalorimeterHitDigiConfig::resolutionTDC) EcalBarrelImaging_resolutionTDC =
0322       3.25 * dd4hep::nanosecond;
0323   app->Add(new JOmniFactoryGeneratorT<SimCalorimeterHitProcessor_factory>(
0324       "EcalBarrelImagingProcessedHits", {"EcalBarrelImagingHits"},
0325       {"EcalBarrelImagingProcessedHits", "EcalBarrelImagingProcessedHitContributions"},
0326       {
0327           .readout    = "EcalBarrelImagingHits",
0328           .timeWindow = EcalBarrelImaging_timeWindow,
0329       },
0330       app // TODO: Remove me once fixed
0331       ));
0332   app->Add(new JOmniFactoryGeneratorT<CalorimeterHitDigi_factory>(
0333       "EcalBarrelImagingRawHits", {"EventHeader", "EcalBarrelImagingProcessedHits"},
0334       {"EcalBarrelImagingRawHits",
0335 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0336        "EcalBarrelImagingRawHitLinks",
0337 #endif
0338        "EcalBarrelImagingRawHitAssociations"},
0339       {
0340           .eRes          = {0.0 * sqrt(dd4hep::GeV), 0.02, 0.0 * dd4hep::GeV},
0341           .tRes          = 0.0 * dd4hep::ns,
0342           .capADC        = EcalBarrelImaging_capADC,
0343           .dyRangeADC    = EcalBarrelImaging_dyRangeADC,
0344           .pedMeanADC    = EcalBarrelImaging_pedMeanADC,
0345           .pedSigmaADC   = EcalBarrelImaging_pedSigmaADC,
0346           .resolutionTDC = EcalBarrelImaging_resolutionTDC,
0347           .corrMeanScale = "1.0",
0348           .readout       = "EcalBarrelImagingHits",
0349       },
0350       app // TODO: Remove me once fixed
0351       ));
0352   app->Add(new JOmniFactoryGeneratorT<CalorimeterHitReco_factory>(
0353       "EcalBarrelImagingRecHits", {"EcalBarrelImagingRawHits"}, {"EcalBarrelImagingRecHits"},
0354       {
0355           .capADC          = EcalBarrelImaging_capADC,
0356           .dyRangeADC      = EcalBarrelImaging_dyRangeADC,
0357           .pedMeanADC      = EcalBarrelImaging_pedMeanADC,
0358           .pedSigmaADC     = EcalBarrelImaging_pedSigmaADC, // not needed; use only thresholdValue
0359           .resolutionTDC   = EcalBarrelImaging_resolutionTDC,
0360           .thresholdFactor = 0.0, // use only thresholdValue
0361           .thresholdValue  = 41,  // 8192 ADC counts/3 MeV * 0.015 MeV (desired threshold) = 41
0362           .sampFrac        = "0.00429453",
0363           .readout         = "EcalBarrelImagingHits",
0364           .layerField      = "layer",
0365           .sectorField     = "sector",
0366       },
0367       app // TODO: Remove me once fixed
0368       ));
0369   app->Add(new JOmniFactoryGeneratorT<ImagingTopoCluster_factory>(
0370       "EcalBarrelImagingProtoClusters", {"EcalBarrelImagingRecHits"},
0371       {"EcalBarrelImagingProtoClusters"},
0372       {
0373           .neighbourLayersRange = 2, //  # id diff for adjacent layer
0374           .sameLayerDistTZ      = {2.0 * dd4hep::mm, 2 * dd4hep::mm},     //  # same layer
0375           .diffLayerDistEtaPhi  = {10 * dd4hep::mrad, 10 * dd4hep::mrad}, //  # adjacent layer
0376           .sameLayerMode        = eicrecon::ImagingTopoClusterConfig::ELayerMode::tz,
0377           .diffLayerMode        = eicrecon::ImagingTopoClusterConfig::ELayerMode::etaphi,
0378           .sectorDist           = 3.0 * dd4hep::cm,
0379           .minClusterHitEdep    = 0,
0380           .minClusterCenterEdep = 0,
0381           .minClusterEdep       = 100 * dd4hep::MeV,
0382           .minClusterNhits      = 10,
0383       },
0384       app // TODO: Remove me once fixed
0385       ));
0386 
0387   app->Add(new JOmniFactoryGeneratorT<ImagingClusterReco_factory>(
0388       "EcalBarrelImagingClustersWithoutShapes",
0389       {"EcalBarrelImagingProtoClusters",
0390 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0391        "EcalBarrelImagingRawHitLinks",
0392 #endif
0393        "EcalBarrelImagingRawHitAssociations"},
0394       {"EcalBarrelImagingClustersWithoutShapes",
0395 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0396        "EcalBarrelImagingClusterLinksWithoutShapes",
0397 #endif
0398        "EcalBarrelImagingClusterAssociationsWithoutShapes", "EcalBarrelImagingLayers"},
0399       {
0400           .trackStopLayer = 6,
0401       },
0402       app // TODO: Remove me once fixed
0403       ));
0404   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0405       "EcalBarrelImagingClusters",
0406       {"EcalBarrelImagingClustersWithoutShapes",
0407        "EcalBarrelImagingClusterAssociationsWithoutShapes"},
0408       {"EcalBarrelImagingClusters",
0409 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0410        "EcalBarrelImagingClusterLinks",
0411 #endif
0412        "EcalBarrelImagingClusterAssociations"},
0413       {.longitudinalShowerInfoAvailable = false, .energyWeight = "log", .logWeightBase = 6.2},
0414       app));
0415   app->Add(new JOmniFactoryGeneratorT<EnergyPositionClusterMerger_factory>(
0416       "EcalBarrelClusters",
0417       {"EcalBarrelScFiClusters", "EcalBarrelScFiClusterAssociations", "EcalBarrelImagingClusters",
0418        "EcalBarrelImagingClusterAssociations"},
0419       {"EcalBarrelClusters",
0420 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0421        "EcalBarrelClusterLinks",
0422 #endif
0423        "EcalBarrelClusterAssociations"},
0424       {
0425           .energyRelTolerance = 0.5,
0426           .phiTolerance       = 0.1,
0427           .etaTolerance       = 0.2,
0428       },
0429       app // TODO: Remove me once fixed
0430       ));
0431   app->Add(new JOmniFactoryGeneratorT<TruthEnergyPositionClusterMerger_factory>(
0432       "EcalBarrelTruthClusters",
0433       {"MCParticles", "EcalBarrelScFiClusters", "EcalBarrelScFiClusterAssociations",
0434        "EcalBarrelImagingClusters", "EcalBarrelImagingClusterAssociations"},
0435       {"EcalBarrelTruthClusters",
0436 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0437        "EcalBarrelTruthClusterLinks",
0438 #endif
0439        "EcalBarrelTruthClusterAssociations"},
0440       app // TODO: Remove me once fixed
0441       ));
0442 }
0443 }