Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-15 08:16:19

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 <cmath>
0007 #include <string>
0008 #include <variant>
0009 
0010 #include "algorithms/calorimetry/CalorimeterClusterRecoCoGConfig.h"
0011 #include "extensions/jana/JOmniFactoryGeneratorT.h"
0012 #include "factories/calorimetry/CalorimeterClusterRecoCoG_factory.h"
0013 #include "factories/calorimetry/CalorimeterClusterShape_factory.h"
0014 #include "factories/calorimetry/CalorimeterHitDigi_factory.h"
0015 #include "factories/calorimetry/CalorimeterHitReco_factory.h"
0016 #include "factories/calorimetry/CalorimeterIslandCluster_factory.h"
0017 #include "factories/calorimetry/CalorimeterTruthClustering_factory.h"
0018 
0019 extern "C" {
0020 void InitPlugin(JApplication* app) {
0021 
0022   using namespace eicrecon;
0023 
0024   InitJANAPlugin(app);
0025 
0026   app->Add(new JOmniFactoryGeneratorT<CalorimeterHitDigi_factory>(
0027       "B0ECalRawHits", {"B0ECalHits"}, {"B0ECalRawHits", "B0ECalRawHitAssociations"},
0028       {
0029           // 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))
0030           .eRes          = {0.0326 * sqrt(dd4hep::GeV), 0.00, 0.0 * dd4hep::GeV},
0031           .tRes          = 0.0 * dd4hep::ns,
0032           .threshold     = 5.0 * dd4hep::MeV,
0033           .capADC        = 16384,
0034           .dyRangeADC    = 170 * dd4hep::GeV,
0035           .pedMeanADC    = 100,
0036           .pedSigmaADC   = 1,
0037           .resolutionTDC = 1e-11,
0038           .corrMeanScale = "1.0",
0039           .readout       = "B0ECalHits",
0040       },
0041       app));
0042   app->Add(new JOmniFactoryGeneratorT<CalorimeterHitReco_factory>(
0043       "B0ECalRecHits", {"B0ECalRawHits"}, {"B0ECalRecHits"},
0044       {
0045           .capADC          = 16384,
0046           .dyRangeADC      = 170. * dd4hep::GeV,
0047           .pedMeanADC      = 100,
0048           .pedSigmaADC     = 1,
0049           .resolutionTDC   = 1e-11,
0050           .thresholdFactor = 0.0,
0051           .thresholdValue  = 1.0, // using threshold of 10 photons = 10 MeV = 1 ADC
0052           .sampFrac        = "0.998",
0053           .readout         = "B0ECalHits",
0054           .sectorField     = "sector",
0055       },
0056       app));
0057   app->Add(new JOmniFactoryGeneratorT<CalorimeterTruthClustering_factory>(
0058       "B0ECalTruthProtoClusters", {"B0ECalRecHits", "B0ECalHits"}, {"B0ECalTruthProtoClusters"},
0059       app));
0060   app->Add(new JOmniFactoryGeneratorT<CalorimeterIslandCluster_factory>(
0061       "B0ECalIslandProtoClusters", {"B0ECalRecHits"}, {"B0ECalIslandProtoClusters"},
0062       {
0063           .adjacencyMatrix{},
0064           .peakNeighbourhoodMatrix{},
0065           .readout{},
0066           .sectorDist = 5.0 * dd4hep::cm,
0067           .localDistXY{},
0068           .localDistXZ{},
0069           .localDistYZ{},
0070           .globalDistRPhi{},
0071           .globalDistEtaPhi{},
0072           .dimScaledLocalDistXY          = {1.8, 1.8},
0073           .splitCluster                  = false,
0074           .minClusterHitEdep             = 1.0 * dd4hep::MeV,
0075           .minClusterCenterEdep          = 30.0 * dd4hep::MeV,
0076           .transverseEnergyProfileMetric = "globalDistEtaPhi",
0077           .transverseEnergyProfileScale  = 1.,
0078           .transverseEnergyProfileScaleUnits{},
0079       },
0080       app));
0081 
0082   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0083       "B0ECalClustersWithoutShapes",
0084       {
0085           "B0ECalIslandProtoClusters", // edm4eic::ProtoClusterCollection
0086           "B0ECalRawHitAssociations"   // edm4eic::MCRecoCalorimeterHitAssociationCollection
0087       },
0088       {"B0ECalClustersWithoutShapes",             // edm4eic::Cluster
0089        "B0ECalClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation
0090       {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false},
0091       app));
0092 
0093   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0094       "B0ECalClusters", {"B0ECalClustersWithoutShapes", "B0ECalClusterAssociationsWithoutShapes"},
0095       {"B0ECalClusters", "B0ECalClusterAssociations"},
0096       {.energyWeight = "log", .logWeightBase = 3.6}, app));
0097 
0098   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0099       "B0ECalTruthClustersWithoutShapes",
0100       {
0101           "B0ECalTruthProtoClusters", // edm4eic::ProtoClusterCollection
0102           "B0ECalRawHitAssociations"  // edm4eic::MCRecoCalorimeterHitAssociationCollection
0103       },
0104       {"B0ECalTruthClustersWithoutShapes",             // edm4eic::Cluster
0105        "B0ECalTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation
0106       {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 6.2, .enableEtaBounds = false},
0107       app));
0108 
0109   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0110       "B0ECalTruthClusters",
0111       {"B0ECalTruthClustersWithoutShapes", "B0ECalTruthClusterAssociationsWithoutShapes"},
0112       {"B0ECalTruthClusters", "B0ECalTruthClusterAssociations"},
0113       {.energyWeight = "log", .logWeightBase = 6.2}, app));
0114 }
0115 }