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 <math.h>
0008 #include <string>
0009
0010 #include "algorithms/calorimetry/CalorimeterHitDigiConfig.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 void InitPlugin(JApplication *app) {
0021
0022 using namespace eicrecon;
0023
0024 InitJANAPlugin(app);
0025
0026 decltype(CalorimeterHitDigiConfig::capADC) EcalEndcapP_capADC = 16384;
0027 decltype(CalorimeterHitDigiConfig::dyRangeADC) EcalEndcapP_dyRangeADC = 3 * dd4hep::GeV;
0028 decltype(CalorimeterHitDigiConfig::pedMeanADC) EcalEndcapP_pedMeanADC = 200;
0029 decltype(CalorimeterHitDigiConfig::pedSigmaADC) EcalEndcapP_pedSigmaADC = 2.4576;
0030 decltype(CalorimeterHitDigiConfig::resolutionTDC) EcalEndcapP_resolutionTDC = 10 * dd4hep::picosecond;
0031 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitDigi_factory>(
0032 "EcalEndcapPRawHits",
0033 {"EcalEndcapPHits"},
0034 #if EDM4EIC_VERSION_MAJOR >= 7
0035 {"EcalEndcapPRawHits", "EcalEndcapPRawHitAssociations"},
0036 #else
0037 {"EcalEndcapPRawHits"},
0038 #endif
0039 {
0040 .eRes = {0.11333 * sqrt(dd4hep::GeV), 0.03, 0.0 * dd4hep::GeV},
0041 .tRes = 0.0,
0042 .threshold = 0.0,
0043
0044 .capADC = EcalEndcapP_capADC,
0045 .capTime = 100,
0046 .dyRangeADC = EcalEndcapP_dyRangeADC,
0047 .pedMeanADC = EcalEndcapP_pedMeanADC,
0048 .pedSigmaADC = EcalEndcapP_pedSigmaADC,
0049 .resolutionTDC = EcalEndcapP_resolutionTDC,
0050 .corrMeanScale = "0.03",
0051 .readout = "EcalEndcapPHits",
0052 },
0053 app
0054 ));
0055 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitReco_factory>(
0056 "EcalEndcapPRecHits", {"EcalEndcapPRawHits"}, {"EcalEndcapPRecHits"},
0057 {
0058 .capADC = EcalEndcapP_capADC,
0059 .dyRangeADC = EcalEndcapP_dyRangeADC,
0060 .pedMeanADC = EcalEndcapP_pedMeanADC,
0061 .pedSigmaADC = EcalEndcapP_pedSigmaADC,
0062 .resolutionTDC = EcalEndcapP_resolutionTDC,
0063 .thresholdFactor = 0.0,
0064 .thresholdValue = 2,
0065 .sampFrac = "0.03",
0066 .readout = "EcalEndcapPHits",
0067 },
0068 app
0069 ));
0070 app->Add(new JOmniFactoryGeneratorT<CalorimeterTruthClustering_factory>(
0071 "EcalEndcapPTruthProtoClusters", {"EcalEndcapPRecHits", "EcalEndcapPHits"}, {"EcalEndcapPTruthProtoClusters"},
0072 app
0073 ));
0074 app->Add(new JOmniFactoryGeneratorT<CalorimeterIslandCluster_factory>(
0075 "EcalEndcapPIslandProtoClusters", {"EcalEndcapPRecHits"}, {"EcalEndcapPIslandProtoClusters"},
0076 {
0077 .sectorDist = 5.0 * dd4hep::cm,
0078 .dimScaledLocalDistXY = {1.5,1.5},
0079 .splitCluster = false,
0080 .minClusterHitEdep = 0.0 * dd4hep::MeV,
0081 .minClusterCenterEdep = 60.0 * dd4hep::MeV,
0082 .transverseEnergyProfileMetric = "dimScaledLocalDistXY",
0083 .transverseEnergyProfileScale = 1.,
0084 },
0085 app
0086 ));
0087
0088 app->Add(
0089 new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0090 "EcalEndcapPTruthClusters",
0091 {"EcalEndcapPTruthProtoClusters",
0092 #if EDM4EIC_VERSION_MAJOR >= 7
0093 "EcalEndcapPRawHitAssociations"},
0094 #else
0095 "EcalEndcapPHits"},
0096 #endif
0097 {"EcalEndcapPTruthClusters",
0098 "EcalEndcapPTruthClusterAssociations"},
0099 {
0100 .energyWeight = "log",
0101 .sampFrac = 1.0,
0102 .logWeightBase = 6.2,
0103 .enableEtaBounds = true
0104 },
0105 app
0106 )
0107 );
0108
0109 app->Add(
0110 new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0111 "EcalEndcapPClusters",
0112 {"EcalEndcapPIslandProtoClusters",
0113 #if EDM4EIC_VERSION_MAJOR >= 7
0114 "EcalEndcapPRawHitAssociations"},
0115 #else
0116 "EcalEndcapPHits"},
0117 #endif
0118 {"EcalEndcapPClusters",
0119 "EcalEndcapPClusterAssociations"},
0120 {
0121 .energyWeight = "log",
0122 .sampFrac = 1.0,
0123 .logWeightBase = 3.6,
0124 .enableEtaBounds = false,
0125 },
0126 app
0127 )
0128 );
0129
0130 app->Add(
0131 new JOmniFactoryGeneratorT<TrackClusterMergeSplitter_factory>(
0132 "EcalEndcapPSplitMergeProtoClusters",
0133 {"EcalEndcapPIslandProtoClusters",
0134 "CalorimeterTrackProjections"},
0135 {"EcalEndcapPSplitMergeProtoClusters"},
0136 {
0137 .idCalo = "EcalEndcapP_ID",
0138 .minSigCut = -2.0,
0139 .avgEP = 1.0,
0140 .sigEP = 0.10,
0141 .drAdd = 0.30,
0142 .sampFrac = 1.0,
0143 .transverseEnergyProfileScale = 1.0
0144 },
0145 app
0146 )
0147 );
0148
0149 app->Add(
0150 new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0151 "EcalEndcapPSplitMergeClusters",
0152 {"EcalEndcapPSplitMergeProtoClusters",
0153 "EcalEndcapPHits"},
0154 {"EcalEndcapPSplitMergeClusters",
0155 "EcalEndcapPSplitMergeClusterAssociations"},
0156 {
0157 .energyWeight = "log",
0158 .sampFrac = 1.0,
0159 .logWeightBase = 3.6,
0160 .enableEtaBounds = false
0161 },
0162 app
0163 )
0164 );
0165
0166
0167 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitDigi_factory>(
0168 "EcalEndcapPInsertRawHits",
0169 {"EcalEndcapPInsertHits"},
0170 #if EDM4EIC_VERSION_MAJOR >= 7
0171 {"EcalEndcapPInsertRawHits", "EcalEndcapPInsertRawHitAssociations"},
0172 #else
0173 {"EcalEndcapPInsertRawHits"},
0174 #endif
0175 {
0176 .eRes = {0.11333 * sqrt(dd4hep::GeV), 0.03, 0.0 * dd4hep::GeV},
0177 .tRes = 0.0,
0178 .threshold = 0.0,
0179
0180 .capADC = EcalEndcapP_capADC,
0181 .capTime = 100,
0182 .dyRangeADC = EcalEndcapP_dyRangeADC,
0183 .pedMeanADC = EcalEndcapP_pedMeanADC,
0184 .pedSigmaADC = EcalEndcapP_pedSigmaADC,
0185 .resolutionTDC = EcalEndcapP_resolutionTDC,
0186 .corrMeanScale = "0.03",
0187 .readout = "EcalEndcapPInsertHits",
0188 },
0189 app
0190 ));
0191 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitReco_factory>(
0192 "EcalEndcapPInsertRecHits", {"EcalEndcapPInsertRawHits"}, {"EcalEndcapPInsertRecHits"},
0193 {
0194 .capADC = EcalEndcapP_capADC,
0195 .dyRangeADC = EcalEndcapP_dyRangeADC,
0196 .pedMeanADC = EcalEndcapP_pedMeanADC,
0197 .pedSigmaADC = EcalEndcapP_pedSigmaADC,
0198 .resolutionTDC = EcalEndcapP_resolutionTDC,
0199 .thresholdFactor = 0.0,
0200 .thresholdValue = 2,
0201 .sampFrac = "0.03",
0202 .readout = "EcalEndcapPInsertHits",
0203 },
0204 app
0205 ));
0206 app->Add(new JOmniFactoryGeneratorT<CalorimeterTruthClustering_factory>(
0207 "EcalEndcapPInsertTruthProtoClusters", {"EcalEndcapPInsertRecHits", "EcalEndcapPInsertHits"}, {"EcalEndcapPInsertTruthProtoClusters"},
0208 app
0209 ));
0210 app->Add(new JOmniFactoryGeneratorT<CalorimeterIslandCluster_factory>(
0211 "EcalEndcapPInsertIslandProtoClusters", {"EcalEndcapPInsertRecHits"}, {"EcalEndcapPInsertIslandProtoClusters"},
0212 {
0213 .sectorDist = 5.0 * dd4hep::cm,
0214 .dimScaledLocalDistXY = {1.5,1.5},
0215 .splitCluster = false,
0216 .minClusterHitEdep = 0.0 * dd4hep::MeV,
0217 .minClusterCenterEdep = 60.0 * dd4hep::MeV,
0218 .transverseEnergyProfileMetric = "dimScaledLocalDistXY",
0219 .transverseEnergyProfileScale = 1.,
0220 },
0221 app
0222 ));
0223
0224 app->Add(
0225 new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0226 "EcalEndcapPInsertTruthClusters",
0227 {"EcalEndcapPInsertTruthProtoClusters",
0228 #if EDM4EIC_VERSION_MAJOR >= 7
0229 "EcalEndcapPInsertRawHitAssociations"},
0230 #else
0231 "EcalEndcapPInsertHits"},
0232 #endif
0233 {"EcalEndcapPInsertTruthClusters",
0234 "EcalEndcapPInsertTruthClusterAssociations"},
0235 {
0236 .energyWeight = "log",
0237 .sampFrac = 1.0,
0238 .logWeightBase = 6.2,
0239 .enableEtaBounds = true
0240 },
0241 app
0242 )
0243 );
0244
0245 app->Add(
0246 new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0247 "EcalEndcapPInsertClusters",
0248 {"EcalEndcapPInsertIslandProtoClusters",
0249 #if EDM4EIC_VERSION_MAJOR >= 7
0250 "EcalEndcapPInsertRawHitAssociations"},
0251 #else
0252 "EcalEndcapPInsertHits"},
0253 #endif
0254 {"EcalEndcapPInsertClusters",
0255 "EcalEndcapPInsertClusterAssociations"},
0256 {
0257 .energyWeight = "log",
0258 .sampFrac = 1.0,
0259 .logWeightBase = 3.6,
0260 .enableEtaBounds = false,
0261 },
0262 app
0263 )
0264 );
0265
0266 }
0267 }