Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-23 09:10:35

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2024, 2025, 2026, Alexander Kiselev
0003 
0004 #if IRT2_VERSION_MAJOR > 2 || (IRT2_VERSION_MAJOR == 2 && IRT2_VERSION_MINOR >= 2)
0005 
0006 #pragma once
0007 
0008 #include <CherenkovDetector.h>
0009 #include <CherenkovDetectorCollection.h>
0010 #include <IRT2/CherenkovEvent.h>
0011 #include <IRT2/ReconstructionFactory.h>
0012 #include <algorithms/algorithm.h>
0013 #include <algorithms/geo.h>
0014 #include <edm4eic/IrtParticleCollection.h>
0015 #include <edm4eic/IrtRadiatorInfoCollection.h>
0016 #include <edm4eic/MCRecoTrackParticleLinkCollection.h>
0017 #include <edm4eic/TrackCollection.h>
0018 #include <edm4eic/TrackSegmentCollection.h>
0019 #include <edm4hep/EventHeaderCollection.h>
0020 #include <edm4hep/MCParticleCollection.h>
0021 #include <edm4hep/SimTrackerHitCollection.h>
0022 #include <spdlog/logger.h>
0023 #include <memory>
0024 #include <mutex>
0025 #include <string>
0026 #include <string_view>
0027 
0028 #include "IrtInterfaceConfig.h"
0029 #include "algorithms/interfaces/UniqueIDGenSvc.h"
0030 #include "algorithms/interfaces/WithPodConfig.h"
0031 
0032 namespace eicrecon {
0033 using IrtInterfaceAlgorithm = algorithms::Algorithm<
0034     algorithms::Input<edm4hep::EventHeaderCollection, edm4hep::MCParticleCollection,
0035                       edm4eic::TrackCollection, edm4eic::MCRecoTrackParticleLinkCollection,
0036                       edm4eic::TrackSegmentCollection, edm4hep::SimTrackerHitCollection>,
0037     algorithms::Output<edm4eic::IrtRadiatorInfoCollection, edm4eic::IrtParticleCollection>>;
0038 
0039 class IrtInterface : public IrtInterfaceAlgorithm, public WithPodConfig<IrtConfig> {
0040 
0041 public:
0042   IrtInterface(std::string_view name)
0043       : IrtInterfaceAlgorithm{name,
0044                               {"eventHeaderCollection", "inputMCParticles", "inputTracks",
0045                                "inputTrackAssotiations", "inputTrackSegments", "inputSimHits"},
0046                               {"outputIrtRadiatorInfo", "outputIrtParticles"},
0047                               "Performs PID evaluation based on IRT2 algorithm"} {};
0048 
0049   void init() final;
0050 
0051   void process(const Input&, const Output&) const final;
0052 
0053   ~IrtInterface();
0054 
0055 private:
0056   std::shared_ptr<spdlog::logger> m_log;
0057 
0058   IRT2::CherenkovDetectorCollection* m_irt_geometry{nullptr};
0059   IRT2::CherenkovDetector* m_irt_detector{nullptr};
0060 
0061   std::unique_ptr<IRT2::CherenkovEvent> m_Event;
0062 
0063   const algorithms::UniqueIDGenSvc& m_uid = algorithms::UniqueIDGenSvc::instance();
0064 
0065   std::unique_ptr<IRT2::ReconstructionFactory> m_ReconstructionFactory;
0066 
0067   const algorithms::GeoSvc& m_geo = algorithms::GeoSvc::instance();
0068 
0069   static std::mutex m_irt_geom_mutex;
0070 };
0071 } // namespace eicrecon
0072 
0073 #endif