File indexing completed on 2026-09-01 08:26:02
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/MCRecoTrackerHitLinkCollection.h>
0013 #include <edm4eic/RawTrackerHitCollection.h>
0014 #include <edm4eic/TrackSegmentCollection.h>
0015 #include <stdint.h>
0016 #include <map>
0017 #include <mutex>
0018 #include <string>
0019 #include <string_view>
0020 #include <unordered_map>
0021
0022
0023 #include "algorithms/interfaces/WithPodConfig.h"
0024 #include "services/particle/ParticleSvc.h"
0025 #include "algorithms/pid/IrtCherenkovParticleIDConfig.h"
0026
0027 namespace eicrecon {
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038 using IrtCherenkovParticleIDAlgorithm = algorithms::Algorithm<
0039 algorithms::Input<const edm4eic::TrackSegmentCollection, const edm4eic::TrackSegmentCollection,
0040 const edm4eic::TrackSegmentCollection, const edm4eic::RawTrackerHitCollection,
0041 const edm4eic::MCRecoTrackerHitLinkCollection,
0042 const edm4eic::MCRecoTrackerHitAssociationCollection>,
0043 algorithms::Output<edm4eic::CherenkovParticleIDCollection,
0044 edm4eic::CherenkovParticleIDCollection>>;
0045
0046 class IrtCherenkovParticleID : public IrtCherenkovParticleIDAlgorithm,
0047 public WithPodConfig<IrtCherenkovParticleIDConfig> {
0048
0049 public:
0050 IrtCherenkovParticleID(std::string_view name)
0051 : IrtCherenkovParticleIDAlgorithm{name,
0052 {"inputAerogelTrackSegments", "inputGasTrackSegments",
0053 "inputMergedTrackSegments", "inputRawHits",
0054 "inputRawHitLinks", "inputRawHitAssociations"},
0055 {"outputAerogelParticleIDs", "outputGasParticleIDs"},
0056 "Effectively 'zip' the input particle IDs"} {}
0057
0058
0059 #pragma GCC diagnostic push
0060 #pragma GCC diagnostic ignored "-Woverloaded-virtual"
0061 void init(CherenkovDetectorCollection* irt_det_coll);
0062 #pragma GCC diagnostic pop
0063
0064 void process(const Input&, const Output&) const;
0065
0066 private:
0067
0068 inline static std::mutex m_irt_det_mutex;
0069 CherenkovDetectorCollection* m_irt_det_coll;
0070 CherenkovDetector* m_irt_det;
0071 std::map<std::string, CherenkovRadiator*> m_pid_radiators;
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 };
0079
0080 }