File indexing completed on 2024-09-27 07:03:04
0001
0002
0003
0004 #include <edm4eic/EDM4eicVersion.h>
0005 #include <Evaluator/DD4hepUnits.h>
0006 #include <JANA/JApplication.h>
0007 #include <memory>
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/CalorimeterHitDigi_factory.h"
0014 #include "factories/calorimetry/CalorimeterHitReco_factory.h"
0015 #include "factories/calorimetry/CalorimeterIslandCluster_factory.h"
0016 #include "factories/calorimetry/CalorimeterTruthClustering_factory.h"
0017 #include "factories/calorimetry/TrackClusterMergeSplitter_factory.h"
0018
0019 extern "C" {
0020
0021 void InitPlugin(JApplication *app) {
0022
0023 using namespace eicrecon;
0024
0025 InitJANAPlugin(app);
0026
0027
0028 decltype(CalorimeterHitDigiConfig::capADC) HcalBarrel_capADC = 65536;
0029 decltype(CalorimeterHitDigiConfig::dyRangeADC) HcalBarrel_dyRangeADC = 1.0 * dd4hep::GeV;
0030 decltype(CalorimeterHitDigiConfig::pedMeanADC) HcalBarrel_pedMeanADC = 300;
0031 decltype(CalorimeterHitDigiConfig::pedSigmaADC) HcalBarrel_pedSigmaADC = 2;
0032 decltype(CalorimeterHitDigiConfig::resolutionTDC) HcalBarrel_resolutionTDC = 1 * dd4hep::picosecond;
0033
0034
0035
0036 decltype(CalorimeterIslandClusterConfig::adjacencyMatrix) HcalBarrel_adjacencyMatrix =
0037 "("
0038
0039 " ( (abs(eta_1 - eta_2) == 1) && (abs(phi_1 - phi_2) == 0) ) ||"
0040
0041 " ( (abs(eta_1 - eta_2) == 0) && (abs(phi_1 - phi_2) == 1) ) ||"
0042
0043 " ( (abs(eta_1 - eta_2) == 0) && (abs(phi_1 - phi_2) == (320 - 1)) )"
0044 ") == 1";
0045
0046 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitDigi_factory>(
0047 "HcalBarrelRawHits",
0048 {"HcalBarrelHits"},
0049 #if EDM4EIC_VERSION_MAJOR >= 7
0050 {"HcalBarrelRawHits", "HcalBarrelRawHitAssociations"},
0051 #else
0052 {"HcalBarrelRawHits"},
0053 #endif
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 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 app->Add(new JOmniFactoryGeneratorT<CalorimeterTruthClustering_factory>(
0087 "HcalBarrelTruthProtoClusters", {"HcalBarrelRecHits", "HcalBarrelHits"}, {"HcalBarrelTruthProtoClusters"},
0088 app
0089 ));
0090 app->Add(new JOmniFactoryGeneratorT<CalorimeterIslandCluster_factory>(
0091 "HcalBarrelIslandProtoClusters", {"HcalBarrelRecHits"}, {"HcalBarrelIslandProtoClusters"},
0092 {
0093 .adjacencyMatrix = HcalBarrel_adjacencyMatrix,
0094 .readout = "HcalBarrelHits",
0095 .sectorDist = 5.0 * dd4hep::cm,
0096 .splitCluster = false,
0097 .minClusterHitEdep = 5.0 * dd4hep::MeV,
0098 .minClusterCenterEdep = 30.0 * dd4hep::MeV,
0099 .transverseEnergyProfileMetric = "globalDistEtaPhi",
0100 .transverseEnergyProfileScale = 1.,
0101 },
0102 app
0103 ));
0104
0105 app->Add(
0106 new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0107 "HcalBarrelClusters",
0108 {"HcalBarrelIslandProtoClusters",
0109 #if EDM4EIC_VERSION_MAJOR >= 7
0110 "HcalBarrelRawHitAssociations"},
0111 #else
0112 "HcalBarrelHits"},
0113 #endif
0114 {"HcalBarrelClusters",
0115 "HcalBarrelClusterAssociations"},
0116 {
0117 .energyWeight = "log",
0118 .sampFrac = 1.0,
0119 .logWeightBase = 6.2,
0120 .enableEtaBounds = false
0121 },
0122 app
0123 )
0124 );
0125
0126 app->Add(
0127 new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0128 "HcalBarrelTruthClusters",
0129 {"HcalBarrelTruthProtoClusters",
0130 #if EDM4EIC_VERSION_MAJOR >= 7
0131 "HcalBarrelRawHitAssociations"},
0132 #else
0133 "HcalBarrelHits"},
0134 #endif
0135 {"HcalBarrelTruthClusters",
0136 "HcalBarrelTruthClusterAssociations"},
0137 {
0138 .energyWeight = "log",
0139 .sampFrac = 1.0,
0140 .logWeightBase = 6.2,
0141 .enableEtaBounds = false
0142 },
0143 app
0144 )
0145 );
0146
0147 app->Add(
0148 new JOmniFactoryGeneratorT<TrackClusterMergeSplitter_factory>(
0149 "HcalBarrelSplitMergeProtoClusters",
0150 {"HcalBarrelIslandProtoClusters",
0151 "CalorimeterTrackProjections"},
0152 {"HcalBarrelSplitMergeProtoClusters"},
0153 {
0154 .idCalo = "HcalBarrel_ID",
0155 .minSigCut = -2.0,
0156 .avgEP = 0.50,
0157 .sigEP = 0.25,
0158 .drAdd = 0.40,
0159 .sampFrac = 1.0,
0160 .transverseEnergyProfileScale = 1.0
0161 },
0162 app
0163 )
0164 );
0165
0166 app->Add(
0167 new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0168 "HcalBarrelSplitMergeClusters",
0169 {"HcalBarrelSplitMergeProtoClusters",
0170 "HcalBarrelHits"},
0171 {"HcalBarrelSplitMergeClusters",
0172 "HcalBarrelSplitMergeClusterAssociations"},
0173 {
0174 .energyWeight = "log",
0175 .sampFrac = 1.0,
0176 .logWeightBase = 6.2,
0177 .enableEtaBounds = false
0178 },
0179 app
0180 )
0181 );
0182 }
0183 }