File indexing completed on 2024-09-27 07:03:04
0001
0002
0003
0004
0005
0006 #include <edm4eic/EDM4eicVersion.h>
0007 #include <Evaluator/DD4hepUnits.h>
0008 #include <JANA/JApplication.h>
0009 #include <math.h>
0010 #include <string>
0011
0012 #include "algorithms/calorimetry/CalorimeterHitDigiConfig.h"
0013 #include "extensions/jana/JOmniFactoryGeneratorT.h"
0014 #include "factories/calorimetry/CalorimeterClusterRecoCoG_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/TrackClusterMergeSplitter_factory.h"
0020
0021 extern "C" {
0022 void InitPlugin(JApplication *app) {
0023
0024 using namespace eicrecon;
0025
0026 InitJANAPlugin(app);
0027
0028
0029 decltype(CalorimeterHitDigiConfig::capADC) EcalEndcapN_capADC = 16384;
0030 decltype(CalorimeterHitDigiConfig::dyRangeADC) EcalEndcapN_dyRangeADC = 20.0 * dd4hep::GeV;
0031 decltype(CalorimeterHitDigiConfig::pedMeanADC) EcalEndcapN_pedMeanADC = 20;
0032 decltype(CalorimeterHitDigiConfig::pedSigmaADC) EcalEndcapN_pedSigmaADC = 1;
0033 decltype(CalorimeterHitDigiConfig::resolutionTDC) EcalEndcapN_resolutionTDC = 10 * dd4hep::picosecond;
0034 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitDigi_factory>(
0035 "EcalEndcapNRawHits",
0036 {"EcalEndcapNHits"},
0037 #if EDM4EIC_VERSION_MAJOR >= 7
0038 {"EcalEndcapNRawHits", "EcalEndcapNRawHitAssociations"},
0039 #else
0040 {"EcalEndcapNRawHits"},
0041 #endif
0042 {
0043 .eRes = {0.0 * sqrt(dd4hep::GeV), 0.02, 0.0 * dd4hep::GeV},
0044 .tRes = 0.0 * dd4hep::ns,
0045 .threshold = 0.0 * dd4hep::MeV,
0046 .capADC = EcalEndcapN_capADC,
0047 .dyRangeADC = EcalEndcapN_dyRangeADC,
0048 .pedMeanADC = EcalEndcapN_pedMeanADC,
0049 .pedSigmaADC = EcalEndcapN_pedSigmaADC,
0050 .resolutionTDC = EcalEndcapN_resolutionTDC,
0051 .corrMeanScale = "1.0",
0052 .readout = "EcalEndcapNHits",
0053 },
0054 app
0055 ));
0056 app->Add(new JOmniFactoryGeneratorT<CalorimeterHitReco_factory>(
0057 "EcalEndcapNRecHits", {"EcalEndcapNRawHits"}, {"EcalEndcapNRecHits"},
0058 {
0059 .capADC = EcalEndcapN_capADC,
0060 .dyRangeADC = EcalEndcapN_dyRangeADC,
0061 .pedMeanADC = EcalEndcapN_pedMeanADC,
0062 .pedSigmaADC = EcalEndcapN_pedSigmaADC,
0063 .resolutionTDC = EcalEndcapN_resolutionTDC,
0064 .thresholdFactor = 0.0,
0065 .thresholdValue = 4.0,
0066 .sampFrac = "0.998",
0067 .readout = "EcalEndcapNHits",
0068 .sectorField = "sector",
0069 },
0070 app
0071 ));
0072 app->Add(new JOmniFactoryGeneratorT<CalorimeterTruthClustering_factory>(
0073 "EcalEndcapNTruthProtoClusters", {"EcalEndcapNRecHits", "EcalEndcapNHits"}, {"EcalEndcapNTruthProtoClusters"},
0074 app
0075 ));
0076 app->Add(new JOmniFactoryGeneratorT<CalorimeterIslandCluster_factory>(
0077 "EcalEndcapNIslandProtoClusters", {"EcalEndcapNRecHits"}, {"EcalEndcapNIslandProtoClusters"},
0078 {
0079 .adjacencyMatrix = "(abs(row_1 - row_2) + abs(column_1 - column_2)) == 1",
0080 .peakNeighbourhoodMatrix = "max(abs(row_1 - row_2), abs(column_1 - column_2)) == 1",
0081 .readout = "EcalEndcapNHits",
0082 .sectorDist = 5.0 * dd4hep::cm,
0083 .splitCluster = true,
0084 .minClusterHitEdep = 1.0 * dd4hep::MeV,
0085 .minClusterCenterEdep = 30.0 * dd4hep::MeV,
0086 .transverseEnergyProfileMetric = "globalDistEtaPhi",
0087 .transverseEnergyProfileScale = 0.08,
0088 },
0089 app
0090 ));
0091
0092 app->Add(
0093 new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0094 "EcalEndcapNTruthClusters",
0095 {"EcalEndcapNTruthProtoClusters",
0096 #if EDM4EIC_VERSION_MAJOR >= 7
0097 "EcalEndcapNRawHitAssociations"},
0098 #else
0099 "EcalEndcapNHits"},
0100 #endif
0101 {"EcalEndcapNTruthClusters",
0102 "EcalEndcapNTruthClusterAssociations"},
0103 {
0104 .energyWeight = "log",
0105 .sampFrac = 1.0,
0106 .logWeightBase = 4.6,
0107 .enableEtaBounds = false
0108 },
0109 app
0110 )
0111 );
0112
0113 app->Add(
0114 new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0115 "EcalEndcapNClusters",
0116 {"EcalEndcapNIslandProtoClusters",
0117 #if EDM4EIC_VERSION_MAJOR >= 7
0118 "EcalEndcapNRawHitAssociations"},
0119 #else
0120 "EcalEndcapNHits"},
0121 #endif
0122 {"EcalEndcapNClusters",
0123 "EcalEndcapNClusterAssociations"},
0124 {
0125 .energyWeight = "log",
0126 .sampFrac = 1.0,
0127 .logWeightBase = 3.6,
0128 .enableEtaBounds = false,
0129 },
0130 app
0131 )
0132 );
0133
0134 app->Add(
0135 new JOmniFactoryGeneratorT<TrackClusterMergeSplitter_factory>(
0136 "EcalEndcapNSplitMergeProtoClusters",
0137 {"EcalEndcapNIslandProtoClusters",
0138 "CalorimeterTrackProjections"},
0139 {"EcalEndcapNSplitMergeProtoClusters"},
0140 {
0141 .idCalo = "EcalEndcapN_ID",
0142 .minSigCut = -1.0,
0143 .avgEP = 1.0,
0144 .sigEP = 0.10,
0145 .drAdd = 0.08,
0146 .sampFrac = 1.0,
0147 .transverseEnergyProfileScale = 1.0
0148 },
0149 app
0150 )
0151 );
0152
0153 app->Add(
0154 new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0155 "EcalEndcapNSplitMergeClusters",
0156 {"EcalEndcapNSplitMergeProtoClusters",
0157 "EcalEndcapNHits"},
0158 {"EcalEndcapNSplitMergeClusters",
0159 "EcalEndcapNSplitMergeClusterAssociations"},
0160 {
0161 .energyWeight = "log",
0162 .sampFrac = 1.0,
0163 .logWeightBase = 3.6,
0164 .enableEtaBounds = false
0165 },
0166 app
0167 )
0168 );
0169 }
0170 }