Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-09-27 07:03:04

0001 // Copyright 2022, David Lawrence
0002 // Subject to the terms in the LICENSE file found in the top-level directory.
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/interfaces/WithPodConfig.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 
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           "EcalLumiSpecRawHits",
0029           {"EcalLumiSpecHits"},
0030 #if EDM4EIC_VERSION_MAJOR >= 7
0031           {"EcalLumiSpecRawHits", "EcalLumiSpecRawHitAssociations"},
0032 #else
0033           {"EcalLumiSpecRawHits"},
0034 #endif
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"}, {"EcalLumiSpecTruthProtoClusters"},
0065           app   // TODO: Remove me once fixed
0066         ));
0067         app->Add(new JOmniFactoryGeneratorT<CalorimeterIslandCluster_factory>(
0068           "EcalLumiSpecIslandProtoClusters", {"EcalLumiSpecRecHits"}, {"EcalLumiSpecIslandProtoClusters"},
0069           {
0070             .adjacencyMatrix = "(sector_1 == sector_2) && ((abs(floor(module_1 / 10) - floor(module_2 / 10)) + abs(fmod(module_1, 10) - fmod(module_2, 10))) == 1)",
0071             .readout = "EcalLumiSpecHits",
0072             .sectorDist = 0.0 * dd4hep::cm,
0073             .splitCluster=true,
0074             .minClusterHitEdep = 1.0 * dd4hep::MeV,
0075             .minClusterCenterEdep = 30.0 * dd4hep::MeV,
0076             .transverseEnergyProfileMetric = "localDistXY",
0077             .transverseEnergyProfileScale = 10. * dd4hep::mm,
0078           },
0079           app   // TODO: Remove me once fixed
0080         ));
0081 
0082         app->Add(
0083           new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0084              "EcalLumiSpecClusters",
0085             {"EcalLumiSpecIslandProtoClusters",  // edm4eic::ProtoClusterCollection
0086 #if EDM4EIC_VERSION_MAJOR >= 7
0087              "EcalLumiSpecRawHitAssociations"},  // edm4eic::MCRecoCalorimeterHitAssociationCollection
0088 #else
0089              "EcalLumiSpecHits"},                // edm4hep::SimCalorimeterHitCollection
0090 #endif
0091             {"EcalLumiSpecClusters",             // edm4eic::Cluster
0092              "EcalLumiSpecClusterAssociations"}, // edm4eic::MCRecoClusterParticleAssociation
0093             {
0094               .energyWeight = "log",
0095               .sampFrac = 1.0,
0096               .logWeightBase = 3.6,
0097               .enableEtaBounds = false
0098             },
0099             app   // TODO: Remove me once fixed
0100           )
0101         );
0102 
0103         app->Add(
0104           new JOmniFactoryGeneratorT<CalorimeterClusterRecoCoG_factory>(
0105              "EcalLumiSpecTruthClusters",
0106             {"EcalLumiSpecTruthProtoClusters",        // edm4eic::ProtoClusterCollection
0107 #if EDM4EIC_VERSION_MAJOR >= 7
0108              "EcalLumiSpecRawHitAssociations"},       // edm4eic::MCRecoCalorimeterHitAssociationCollection
0109 #else
0110              "EcalLumiSpecHits"},                     // edm4hep::SimCalorimeterHitCollection
0111 #endif
0112             {"EcalLumiSpecTruthClusters",             // edm4eic::Cluster
0113              "EcalLumiSpecTruthClusterAssociations"}, // edm4eic::MCRecoClusterParticleAssociation
0114             {
0115               .energyWeight = "log",
0116               .sampFrac = 1.0,
0117               .logWeightBase = 4.6,
0118               .enableEtaBounds = false
0119             },
0120             app   // TODO: Remove me once fixed
0121           )
0122         );
0123     }
0124 }