File indexing completed on 2025-01-18 09:55:42
0001
0002
0003
0004 #pragma once
0005
0006 #include <IRT/CherenkovDetector.h>
0007 #include <IRT/CherenkovDetectorCollection.h>
0008 #include <IRT/CherenkovRadiator.h>
0009 #include <algorithms/algorithm.h>
0010 #include <edm4eic/CherenkovParticleIDCollection.h>
0011 #include <edm4eic/MCRecoTrackerHitAssociationCollection.h>
0012 #include <edm4eic/RawTrackerHitCollection.h>
0013 #include <edm4eic/TrackSegmentCollection.h>
0014 #include <spdlog/logger.h>
0015 #include <stdint.h>
0016 #include <map>
0017 #include <memory>
0018 #include <string>
0019 #include <string_view>
0020 #include <unordered_map>
0021
0022
0023 #include "IrtCherenkovParticleIDConfig.h"
0024 #include "algorithms/interfaces/ParticleSvc.h"
0025 #include "algorithms/interfaces/WithPodConfig.h"
0026
0027 namespace eicrecon {
0028
0029
0030
0031
0032
0033
0034
0035 using IrtCherenkovParticleIDAlgorithm = algorithms::Algorithm<
0036 algorithms::Input<
0037 const edm4eic::TrackSegmentCollection,
0038 const edm4eic::TrackSegmentCollection,
0039 const edm4eic::TrackSegmentCollection,
0040 const edm4eic::RawTrackerHitCollection,
0041 const edm4eic::MCRecoTrackerHitAssociationCollection
0042 >,
0043 algorithms::Output<
0044 edm4eic::CherenkovParticleIDCollection,
0045 edm4eic::CherenkovParticleIDCollection
0046 >
0047 >;
0048
0049 class IrtCherenkovParticleID
0050 : public IrtCherenkovParticleIDAlgorithm,
0051 public WithPodConfig<IrtCherenkovParticleIDConfig> {
0052
0053 public:
0054 IrtCherenkovParticleID(std::string_view name)
0055 : IrtCherenkovParticleIDAlgorithm{name,
0056 {
0057 "inputAerogelTrackSegments", "inputGasTrackSegments", "inputMergedTrackSegments",
0058 "inputRawHits", "inputRawHitAssociations"
0059 },
0060 {"outputAerogelParticleIDs", "outputGasParticleIDs"},
0061 "Effectively 'zip' the input particle IDs"} {}
0062
0063 void init(CherenkovDetectorCollection* irt_det_coll, std::shared_ptr<spdlog::logger>& logger);
0064
0065 void process(const Input&, const Output&) const;
0066
0067 private:
0068
0069 std::shared_ptr<spdlog::logger> m_log;
0070 CherenkovDetectorCollection* m_irt_det_coll;
0071 CherenkovDetector* m_irt_det;
0072
0073 const algorithms::ParticleSvc& m_particleSvc = algorithms::ParticleSvc::instance();
0074
0075 uint64_t m_cell_mask;
0076 std::string m_det_name;
0077 std::unordered_map<int,double> m_pdg_mass;
0078 std::map<std::string,CherenkovRadiator*> m_pid_radiators;
0079
0080 };
0081 }