Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-14 08:14:40

0001 // Created by Dmitry Romanov
0002 // Subject to the terms in the LICENSE file found in the top-level directory.
0003 //
0004 
0005 #pragma once
0006 
0007 #if Acts_VERSION_MAJOR >= 37
0008 #include <Acts/EventData/SpacePointContainer.hpp>
0009 #endif
0010 #include <Acts/MagneticField/MagneticFieldContext.hpp>
0011 #include <Acts/Seeding/SeedFilterConfig.hpp>
0012 #include <Acts/Seeding/SeedFinderConfig.hpp>
0013 #include <Acts/Seeding/SeedFinderOrthogonalConfig.hpp>
0014 #if Acts_VERSION_MAJOR >= 37
0015 #include <ActsExamples/EventData/SpacePointContainer.hpp>
0016 #endif
0017 #include <edm4eic/TrackParametersCollection.h>
0018 #include <edm4eic/TrackerHitCollection.h>
0019 #include <spdlog/logger.h>
0020 #include <memory>
0021 #include <tuple>
0022 #include <utility>
0023 #include <vector>
0024 
0025 #include "ActsGeometryProvider.h"
0026 #include "DD4hepBField.h"
0027 #include "OrthogonalTrackSeedingConfig.h"
0028 #include "SpacePoint.h"
0029 #include "algorithms/interfaces/WithPodConfig.h"
0030 
0031 namespace eicrecon {
0032 class TrackSeeding : public eicrecon::WithPodConfig<eicrecon::OrthogonalTrackSeedingConfig> {
0033 public:
0034 #if Acts_VERSION_MAJOR >= 37
0035   using proxy_type = typename Acts::SpacePointContainer<
0036       ActsExamples::SpacePointContainer<std::vector<const SpacePoint*>>,
0037       Acts::detail::RefHolder>::SpacePointProxyType;
0038 #endif
0039 
0040   void init(std::shared_ptr<const ActsGeometryProvider> geo_svc,
0041             std::shared_ptr<spdlog::logger> log);
0042   std::unique_ptr<edm4eic::TrackParametersCollection>
0043   produce(const edm4eic::TrackerHitCollection& trk_hits);
0044 
0045 private:
0046   void configure();
0047 
0048   std::shared_ptr<spdlog::logger> m_log;
0049   std::shared_ptr<const ActsGeometryProvider> m_geoSvc;
0050 
0051   std::shared_ptr<const eicrecon::BField::DD4hepBField> m_BField = nullptr;
0052   Acts::MagneticFieldContext m_fieldctx;
0053 
0054   Acts::SeedFilterConfig m_seedFilterConfig;
0055   Acts::SeedFinderOptions m_seedFinderOptions;
0056 #if Acts_VERSION_MAJOR >= 37
0057   Acts::SeedFinderOrthogonalConfig<proxy_type> m_seedFinderConfig;
0058 #else
0059   Acts::SeedFinderOrthogonalConfig<SpacePoint> m_seedFinderConfig;
0060 #endif
0061 
0062   static int determineCharge(std::vector<std::pair<float, float>>& positions,
0063                              const std::pair<float, float>& PCA,
0064                              std::tuple<float, float, float>& RX0Y0);
0065   static std::pair<float, float> findPCA(std::tuple<float, float, float>& circleParams);
0066   static std::vector<const eicrecon::SpacePoint*>
0067   getSpacePoints(const edm4eic::TrackerHitCollection& trk_hits);
0068   std::unique_ptr<edm4eic::TrackParametersCollection> makeTrackParams(SeedContainer& seeds);
0069 
0070   static std::tuple<float, float, float> circleFit(std::vector<std::pair<float, float>>& positions);
0071   static std::tuple<float, float> lineFit(std::vector<std::pair<float, float>>& positions);
0072 };
0073 } // namespace eicrecon