File indexing completed on 2025-07-11 07:53:40
0001
0002
0003
0004
0005
0006 #include <Evaluator/DD4hepUnits.h>
0007 #include <JANA/JApplication.h>
0008 #include <JANA/JException.h>
0009 #include <stdexcept>
0010 #include <string>
0011
0012 #include "algorithms/interfaces/WithPodConfig.h"
0013 #include "extensions/jana/JOmniFactoryGeneratorT.h"
0014 #include "factories/digi/MPGDTrackerDigi_factory.h"
0015 #include "factories/digi/SiliconTrackerDigi_factory.h"
0016 #include "factories/tracking/TrackerHitReconstruction_factory.h"
0017
0018
0019
0020
0021
0022
0023
0024 extern "C" {
0025 void InitPlugin(JApplication* app) {
0026 InitJANAPlugin(app);
0027
0028 using namespace eicrecon;
0029
0030
0031
0032
0033 unsigned int SiFactoryPattern = 0x3;
0034 std::string SiFactoryPattern_str;
0035 app->SetDefaultParameter("MPGD:SiFactoryPattern", SiFactoryPattern_str,
0036 "Hexadecimal Pattern of MPGDs digitized via \"SiliconTrackerDigi\"");
0037 if (!SiFactoryPattern_str.empty()) {
0038 try {
0039 SiFactoryPattern = std::stoul(SiFactoryPattern_str, nullptr, 16);
0040 } catch (const std::invalid_argument& e) {
0041 throw JException(
0042 R"(Option "MPGD:SiFactoryPattern": Error ("%s") parsing input
0043 string: '%s')",
0044 e.what(), SiFactoryPattern_str.c_str());
0045 }
0046 }
0047
0048
0049
0050 if ((SiFactoryPattern & 0x1) != 0U) {
0051 app->Add(new JOmniFactoryGeneratorT<SiliconTrackerDigi_factory>(
0052 "MPGDBarrelRawHits", {"MPGDBarrelHits"},
0053 {"MPGDBarrelRawHits", "MPGDBarrelRawHitAssociations"},
0054 {
0055 .threshold = 100 * dd4hep::eV,
0056 .timeResolution = 10,
0057 },
0058 app));
0059 } else {
0060 app->Add(new JOmniFactoryGeneratorT<MPGDTrackerDigi_factory>(
0061 "MPGDBarrelRawHits", {"MPGDBarrelHits"},
0062 {"MPGDBarrelRawHits", "MPGDBarrelRawHitAssociations"},
0063 {
0064 .readout = "MPGDBarrelHits",
0065 .threshold = 100 * dd4hep::eV,
0066 .timeResolution = 10,
0067 },
0068 app));
0069 }
0070
0071
0072 app->Add(new JOmniFactoryGeneratorT<TrackerHitReconstruction_factory>(
0073 "MPGDBarrelRecHits", {"MPGDBarrelRawHits"},
0074 {"MPGDBarrelRecHits"},
0075 {
0076 .timeResolution = 10,
0077 },
0078 app));
0079
0080
0081
0082 if ((SiFactoryPattern & 0x2) != 0U) {
0083 app->Add(new JOmniFactoryGeneratorT<SiliconTrackerDigi_factory>(
0084 "OuterMPGDBarrelRawHits", {"OuterMPGDBarrelHits"},
0085 {"OuterMPGDBarrelRawHits", "OuterMPGDBarrelRawHitAssociations"},
0086 {
0087 .threshold = 100 * dd4hep::eV,
0088 .timeResolution = 10,
0089 },
0090 app));
0091 } else {
0092 app->Add(new JOmniFactoryGeneratorT<MPGDTrackerDigi_factory>(
0093 "OuterMPGDBarrelRawHits", {"OuterMPGDBarrelHits"},
0094 {"OuterMPGDBarrelRawHits", "OuterMPGDBarrelRawHitAssociations"},
0095 {
0096 .readout = "OuterMPGDBarrelHits",
0097 .threshold = 100 * dd4hep::eV,
0098 .timeResolution = 10,
0099 },
0100 app));
0101 }
0102
0103
0104 app->Add(new JOmniFactoryGeneratorT<TrackerHitReconstruction_factory>(
0105 "OuterMPGDBarrelRecHits", {"OuterMPGDBarrelRawHits"},
0106 {"OuterMPGDBarrelRecHits"},
0107 {
0108 .timeResolution = 10,
0109 },
0110 app));
0111
0112
0113
0114 app->Add(new JOmniFactoryGeneratorT<SiliconTrackerDigi_factory>(
0115 "BackwardMPGDEndcapRawHits", {"BackwardMPGDEndcapHits"},
0116 {"BackwardMPGDEndcapRawHits", "BackwardMPGDEndcapRawHitAssociations"},
0117 {
0118 .threshold = 100 * dd4hep::eV,
0119 .timeResolution = 10,
0120 },
0121 app));
0122
0123
0124 app->Add(new JOmniFactoryGeneratorT<TrackerHitReconstruction_factory>(
0125 "BackwardMPGDEndcapRecHits", {"BackwardMPGDEndcapRawHits"},
0126 {"BackwardMPGDEndcapRecHits"},
0127 {
0128 .timeResolution = 10,
0129 },
0130 app));
0131
0132
0133
0134 app->Add(new JOmniFactoryGeneratorT<SiliconTrackerDigi_factory>(
0135 "ForwardMPGDEndcapRawHits", {"ForwardMPGDEndcapHits"},
0136 {"ForwardMPGDEndcapRawHits", "ForwardMPGDEndcapRawHitAssociations"},
0137 {
0138 .threshold = 100 * dd4hep::eV,
0139 .timeResolution = 10,
0140 },
0141 app));
0142
0143
0144 app->Add(new JOmniFactoryGeneratorT<TrackerHitReconstruction_factory>(
0145 "ForwardMPGDEndcapRecHits", {"ForwardMPGDEndcapRawHits"},
0146 {"ForwardMPGDEndcapRecHits"},
0147 {
0148 .timeResolution = 10,
0149 },
0150 app));
0151 }
0152 }