Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:07:27

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2022 - 2025 Whitney Armstrong, Sylvester Joosten, Chao Peng, David Lawrence, Wouter Deconinck, Kolja Kauder, Nathan Brei, Dmitry Kalinkin, Derek Anderson, Michael Pitt
0003 
0004 #include <Evaluator/DD4hepUnits.h>
0005 #include <JANA/JApplicationFwd.h>
0006 #include <JANA/Utils/JTypeInfo.h>
0007 #include <cmath>
0008 #include <string>
0009 #include <variant>
0010 #include <vector>
0011 
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 
0020 extern "C" {
0021 void InitPlugin(JApplication* app) {
0022 
0023   using namespace eicrecon;
0024 
0025   InitJANAPlugin(app);
0026 
0027   app->Add(new JOmniFactoryGeneratorT<CalorimeterHitDigi_factory>(
0028       "B0ECalRawHits", {"EventHeader", "B0ECalHits"}, {"B0ECalRawHits", "B0ECalRawHitAssociations"},
0029       {
0030           // The stochastic term is set using light yield in PbOW4 of N_photons = 145.75 / GeV / mm, for 6x6 mm2 sensors with PDE=0.18 (a=1/sqrt(145.75*36*0.18))
0031           .eRes          = {0.0326 * sqrt(dd4hep::GeV), 0.00, 0.0 * dd4hep::GeV},
0032           .tRes          = 0.0 * dd4hep::ns,
0033           .threshold     = 5.0 * dd4hep::MeV,
0034           .capADC        = 16384,
0035           .dyRangeADC    = 170 * dd4hep::GeV,
0036           .pedMeanADC    = 100,
0037           .pedSigmaADC   = 1,
0038           .resolutionTDC = 1e-11,
0039           .corrMeanScale = "1.0",
0040           .readout       = "B0ECalHits",
0041       },
0042       app));
0043   app->Add(new JOmniFactoryGeneratorT<CalorimeterHitReco_factory>(
0044       "B0ECalRecHits", {"B0ECalRawHits"}, {"B0ECalRecHits"},
0045       {
0046           .capADC          = 16384,
0047           .dyRangeADC      = 170. * dd4hep::GeV,
0048           .pedMeanADC      = 100,
0049           .pedSigmaADC     = 1,
0050           .resolutionTDC   = 1e-11,
0051           .thresholdFactor = 0.0,
0052           .thresholdValue  = 1.0, // using threshold of 10 photons = 10 MeV = 1 ADC
0053           .sampFrac        = "0.998",
0054           .readout         = "B0ECalHits",
0055           .sectorField     = "sector",
0056       },
0057       app));
0058   app->Add(new JOmniFactoryGeneratorT<CalorimeterTruthClustering_factory>(
0059       "B0ECalTruthProtoClusters", {"B0ECalRecHits", "B0ECalHits"}, {"B0ECalTruthProtoClusters"},
0060       app));
0061   app->Add(new JOmniFactoryGeneratorT<CalorimeterIslandCluster_factory>(
0062       "B0ECalIslandProtoClusters", {"B0ECalRecHits"}, {"B0ECalIslandProtoClusters"},
0063       {
0064           .adjacencyMatrix{},
0065           .peakNeighbourhoodMatrix{},
0066           .readout{},
0067           .sectorDist = 5.0 * dd4hep::cm,
0068           .localDistXY{},
0069           .localDistXZ{},
0070           .localDistYZ{},
0071           .globalDistRPhi{},
0072           .globalDistEtaPhi{},
0073           .dimScaledLocalDistXY          = {1.8, 1.8},
0074           .splitCluster                  = false,
0075           .minClusterHitEdep             = 1.0 * dd4hep::MeV,
0076           .minClusterCenterEdep          = 30.0 * dd4hep::MeV,
0077           .transverseEnergyProfileMetric = "globalDistEtaPhi",
0078           .transverseEnergyProfileScale  = 1.,
0079           .transverseEnergyProfileScaleUnits{},
0080       },
0081       app));
0082 
0083   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0084       "B0ECalClustersWithoutShapes",
0085       {
0086           "B0ECalIslandProtoClusters", // edm4eic::ProtoClusterCollection
0087           "B0ECalRawHitAssociations"   // edm4eic::MCRecoCalorimeterHitAssociationCollection
0088       },
0089       {"B0ECalClustersWithoutShapes",             // edm4eic::Cluster
0090        "B0ECalClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation
0091       {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false},
0092       app));
0093 
0094   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0095       "B0ECalClusters", {"B0ECalClustersWithoutShapes", "B0ECalClusterAssociationsWithoutShapes"},
0096       {"B0ECalClusters", "B0ECalClusterAssociations"},
0097       {.energyWeight = "log", .logWeightBase = 3.6}, app));
0098 
0099   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0100       "B0ECalTruthClustersWithoutShapes",
0101       {
0102           "B0ECalTruthProtoClusters", // edm4eic::ProtoClusterCollection
0103           "B0ECalRawHitAssociations"  // edm4eic::MCRecoCalorimeterHitAssociationCollection
0104       },
0105       {"B0ECalTruthClustersWithoutShapes",             // edm4eic::Cluster
0106        "B0ECalTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation
0107       {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false},
0108       app));
0109 
0110   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0111       "B0ECalTruthClusters",
0112       {"B0ECalTruthClustersWithoutShapes", "B0ECalTruthClusterAssociationsWithoutShapes"},
0113       {"B0ECalTruthClusters", "B0ECalTruthClusterAssociations"},
0114       {.energyWeight = "log", .logWeightBase = 6.2}, app));
0115 }
0116 }