Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /EICrecon/src/detectors/LUMISPECCAL/LUMISPECCAL.cc was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 <edm4eic/EDM4eicVersion.h>
0007 #include <JANA/Utils/JTypeInfo.h>
0008 #include <cmath>
0009 #include <string>
0010 #include <variant>
0011 #include <vector>
0012 
0013 #include "extensions/jana/JOmniFactoryGeneratorT.h"
0014 #include "factories/calorimetry/CalorimeterClusterRecoCoG_factory.h"
0015 #include "factories/calorimetry/CalorimeterClusterShape_factory.h"
0016 #include "factories/calorimetry/CalorimeterHitDigi_factory.h"
0017 #include "factories/calorimetry/CalorimeterHitReco_factory.h"
0018 #include "factories/calorimetry/CalorimeterIslandCluster_factory.h"
0019 #include "factories/calorimetry/CalorimeterTruthClustering_factory.h"
0020 
0021 extern "C" {
0022 void InitPlugin(JApplication* app) {
0023 
0024   using namespace eicrecon;
0025 
0026   InitJANAPlugin(app);
0027 
0028   app->Add(new JOmniFactoryGeneratorT<CalorimeterHitDigi_factory>(
0029       "EcalLumiSpecRawHits", {"EventHeader", "EcalLumiSpecHits"},
0030       {"EcalLumiSpecRawHits",
0031 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0032        "EcalLumiSpecRawHitLinks",
0033 #endif
0034        "EcalLumiSpecRawHitAssociations"},
0035       {
0036           .eRes          = {0.0 * sqrt(dd4hep::GeV), 0.02, 0.0 * dd4hep::GeV}, // flat 2%
0037           .tRes          = 0.0 * dd4hep::ns,
0038           .capADC        = 16384,
0039           .dyRangeADC    = 20 * dd4hep::GeV,
0040           .pedMeanADC    = 100,
0041           .pedSigmaADC   = 1,
0042           .resolutionTDC = 10 * dd4hep::picosecond,
0043           .corrMeanScale = "1.0",
0044           .readout       = "EcalLumiSpecHits",
0045       },
0046       app // TODO: Remove me once fixed
0047       ));
0048   app->Add(new JOmniFactoryGeneratorT<CalorimeterHitReco_factory>(
0049       "EcalLumiSpecRecHits", {"EcalLumiSpecRawHits"}, {"EcalLumiSpecRecHits"},
0050       {
0051           .capADC          = 16384,
0052           .dyRangeADC      = 20. * dd4hep::GeV,
0053           .pedMeanADC      = 100,
0054           .pedSigmaADC     = 1,
0055           .resolutionTDC   = 10 * dd4hep::picosecond,
0056           .thresholdFactor = 0.0,
0057           .thresholdValue  = 2.0,
0058           .sampFrac        = "1.0",
0059           .readout         = "EcalLumiSpecHits",
0060       },
0061       app // TODO: Remove me once fixed
0062       ));
0063   app->Add(new JOmniFactoryGeneratorT<CalorimeterTruthClustering_factory>(
0064       "EcalLumiSpecTruthProtoClusters", {"EcalLumiSpecRecHits", "EcalLumiSpecHits"},
0065       {"EcalLumiSpecTruthProtoClusters"},
0066       app // TODO: Remove me once fixed
0067       ));
0068   app->Add(new JOmniFactoryGeneratorT<CalorimeterIslandCluster_factory>(
0069       "EcalLumiSpecIslandProtoClusters", {"EcalLumiSpecRecHits"},
0070       {"EcalLumiSpecIslandProtoClusters"},
0071       {
0072           .adjacencyMatrix =
0073               "(sector_1 == sector_2) && ((abs(floor(module_1 / 10) - floor(module_2 / 10)) + "
0074               "abs(fmod(module_1, 10) - fmod(module_2, 10))) == 1)",
0075           .peakNeighbourhoodMatrix{},
0076           .readout    = "EcalLumiSpecHits",
0077           .sectorDist = 0.0 * dd4hep::cm,
0078           .localDistXY{},
0079           .localDistXZ{},
0080           .localDistYZ{},
0081           .globalDistRPhi{},
0082           .globalDistEtaPhi{},
0083           .dimScaledLocalDistXY{},
0084           .splitCluster                  = true,
0085           .minClusterHitEdep             = 1.0 * dd4hep::MeV,
0086           .minClusterCenterEdep          = 30.0 * dd4hep::MeV,
0087           .transverseEnergyProfileMetric = "localDistXY",
0088           .transverseEnergyProfileScale  = 10. * dd4hep::mm,
0089           .transverseEnergyProfileScaleUnits{},
0090       },
0091       app // TODO: Remove me once fixed
0092       ));
0093 
0094   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0095       "EcalLumiSpecClustersWithoutShapes",
0096       {
0097           "EcalLumiSpecIslandProtoClusters", // edm4eic::ProtoClusterCollection
0098 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0099           "EcalLumiSpecRawHitLinks", // edm4eic::MCRecoCalorimeterHitLink
0100 #endif
0101           "EcalLumiSpecRawHitAssociations" // edm4eic::MCRecoCalorimeterHitAssociationCollection
0102       },
0103       {"EcalLumiSpecClustersWithoutShapes",
0104 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0105        "EcalLumiSpecClusterLinksWithoutShapes",
0106 #endif
0107        "EcalLumiSpecClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation
0108       {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 3.6, .enableEtaBounds = false},
0109       app // TODO: Remove me once fixed
0110       ));
0111   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0112       "EcalLumiSpecClusters",
0113       {"EcalLumiSpecClustersWithoutShapes", "EcalLumiSpecClusterAssociationsWithoutShapes"},
0114       {"EcalLumiSpecClusters",
0115 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0116        "EcalLumiSpecClusterLinks",
0117 #endif
0118        "EcalLumiSpecClusterAssociations"},
0119       {.energyWeight = "log", .logWeightBase = 3.6}, app));
0120 
0121   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0122       "EcalLumiSpecTruthClustersWithoutShapes",
0123       {
0124           "EcalLumiSpecTruthProtoClusters", // edm4eic::ProtoClusterCollection
0125 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0126           "EcalLumiSpecRawHitLinks", // edm4eic::MCRecoCalorimeterHitLink
0127 #endif
0128           "EcalLumiSpecRawHitAssociations" // edm4eic::MCRecoCalorimeterHitAssociationCollection
0129       },
0130       {"EcalLumiSpecTruthClustersWithoutShapes",
0131 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0132        "EcalLumiSpecTruthClusterLinksWithoutShapes",
0133 #endif
0134        "EcalLumiSpecTruthClusterAssociationsWithoutShapes"}, // edm4eic::MCRecoClusterParticleAssociation
0135       {.energyWeight = "log", .sampFrac = 1.0, .logWeightBase = 4.6, .enableEtaBounds = false},
0136       app // TODO: Remove me once fixed
0137       ));
0138   app->Add(new JOmniFactoryGeneratorT<CalorimeterClusterShape_factory>(
0139       "EcalLumiSpecTruthClusters",
0140       {"EcalLumiSpecTruthClustersWithoutShapes",
0141        "EcalLumiSpecTruthClusterAssociationsWithoutShapes"},
0142       {"EcalLumiSpecTruthClusters",
0143 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0144        "EcalLumiSpecTruthClusterLinks",
0145 #endif
0146        "EcalLumiSpecTruthClusterAssociations"},
0147       {.energyWeight = "log", .logWeightBase = 4.6}, app));
0148 }
0149 }