Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-11 07:53:40

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2022 - 2025 Sylvester Joosten, Chao, Chao Peng, Whitney Armstrong, David Lawrence, Dhevan Gangadharan, Nathan Brei,, Wouter Deconinck, Dmitry Kalinkin, Derek Anderson
0003 
0004 #include <Evaluator/DD4hepUnits.h>
0005 #include <JANA/JApplicationFwd.h>
0006 #include <cmath>
0007 #include <string>
0008 #include <variant>
0009 
0010 #include "algorithms/interfaces/WithPodConfig.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       "EcalLumiSpecRawHits", {"EcalLumiSpecHits"},
0028       {"EcalLumiSpecRawHits", "EcalLumiSpecRawHitAssociations"},
0029       {
0030           .eRes          = {0.0 * sqrt(dd4hep::GeV), 0.02, 0.0 * dd4hep::GeV}, // flat 2%
0031           .tRes          = 0.0 * dd4hep::ns,
0032           .capADC        = 16384,
0033           .dyRangeADC    = 20 * dd4hep::GeV,
0034           .pedMeanADC    = 100,
0035           .pedSigmaADC   = 1,
0036           .resolutionTDC = 10 * dd4hep::picosecond,
0037           .corrMeanScale = "1.0",
0038           .readout       = "EcalLumiSpecHits",
0039       },
0040       app // TODO: Remove me once fixed
0041       ));
0042   app->Add(new JOmniFactoryGeneratorT<CalorimeterHitReco_factory>(
0043       "EcalLumiSpecRecHits", {"EcalLumiSpecRawHits"}, {"EcalLumiSpecRecHits"},
0044       {
0045           .capADC          = 16384,
0046           .dyRangeADC      = 20. * dd4hep::GeV,
0047           .pedMeanADC      = 100,
0048           .pedSigmaADC     = 1,
0049           .resolutionTDC   = 10 * dd4hep::picosecond,
0050           .thresholdFactor = 0.0,
0051           .thresholdValue  = 2.0,
0052           .sampFrac        = "1.0",
0053           .readout         = "EcalLumiSpecHits",
0054       },
0055       app // TODO: Remove me once fixed
0056       ));
0057   app->Add(new JOmniFactoryGeneratorT<CalorimeterTruthClustering_factory>(
0058       "EcalLumiSpecTruthProtoClusters", {"EcalLumiSpecRecHits", "EcalLumiSpecHits"},
0059       {"EcalLumiSpecTruthProtoClusters"},
0060       app // TODO: Remove me once fixed
0061       ));
0062   app->Add(new JOmniFactoryGeneratorT<CalorimeterIslandCluster_factory>(
0063       "EcalLumiSpecIslandProtoClusters", {"EcalLumiSpecRecHits"},
0064       {"EcalLumiSpecIslandProtoClusters"},
0065       {
0066           .adjacencyMatrix =
0067               "(sector_1 == sector_2) && ((abs(floor(module_1 / 10) - floor(module_2 / 10)) + "
0068               "abs(fmod(module_1, 10) - fmod(module_2, 10))) == 1)",
0069           .peakNeighbourhoodMatrix{},
0070           .readout    = "EcalLumiSpecHits",
0071           .sectorDist = 0.0 * dd4hep::cm,
0072           .localDistXY{},
0073           .localDistXZ{},
0074           .localDistYZ{},
0075           .globalDistRPhi{},
0076           .globalDistEtaPhi{},
0077           .dimScaledLocalDistXY{},
0078           .splitCluster                  = true,
0079           .minClusterHitEdep             = 1.0 * dd4hep::MeV,
0080           .minClusterCenterEdep          = 30.0 * dd4hep::MeV,
0081           .transverseEnergyProfileMetric = "localDistXY",
0082           .transverseEnergyProfileScale  = 10. * dd4hep::mm,
0083           .transverseEnergyProfileScaleUnits{},
0084       },
0085       app // TODO: Remove me once fixed
0086       ));
0087 
0088   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0089       "EcalLumiSpecClustersWithoutShapes",
0090       {
0091           "EcalLumiSpecIslandProtoClusters", // edm4eic::ProtoClusterCollection
0092           "EcalLumiSpecRawHitAssociations"   // edm4eic::MCRecoCalorimeterHitAssociationCollection
0093       },
0094       {"EcalLumiSpecClustersWithoutShapes",             // edm4eic::Cluster
0095        "EcalLumiSpecClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation
0096       {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false},
0097       app // TODO: Remove me once fixed
0098       ));
0099   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0100       "EcalLumiSpecClusters",
0101       {"EcalLumiSpecClustersWithoutShapes", "EcalLumiSpecClusterAssociationsWithoutShapes"},
0102       {"EcalLumiSpecClusters", "EcalLumiSpecClusterAssociations"},
0103       {.energyWeight = "log", .logWeightBase = 3.6}, app));
0104 
0105   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0106       "EcalLumiSpecTruthClustersWithoutShapes",
0107       {
0108           "EcalLumiSpecTruthProtoClusters", // edm4eic::ProtoClusterCollection
0109           "EcalLumiSpecRawHitAssociations"  // edm4eic::MCRecoCalorimeterHitAssociationCollection
0110       },
0111       {"EcalLumiSpecTruthClustersWithoutShapes",             // edm4eic::Cluster
0112        "EcalLumiSpecTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation
0113       {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 4.6, .enableEtaBounds = false},
0114       app // TODO: Remove me once fixed
0115       ));
0116   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0117       "EcalLumiSpecTruthClusters",
0118       {"EcalLumiSpecTruthClustersWithoutShapes",
0119        "EcalLumiSpecTruthClusterAssociationsWithoutShapes"},
0120       {"EcalLumiSpecTruthClusters", "EcalLumiSpecTruthClusterAssociations"},
0121       {.energyWeight = "log", .logWeightBase = 4.6}, app));
0122 }
0123 }