Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:02

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 // TODO: update to C++17 style
0012 
0013 #include "Acts/EventData/Seed.hpp"
0014 #include "Acts/EventData/SpacePointData.hpp"
0015 #include "Acts/Seeding/SeedFinderConfig.hpp"
0016 #include "Acts/Seeding/SeedFinderGbtsConfig.hpp"
0017 #include "Acts/TrackFinding/RoiDescriptor.hpp"
0018 #include "Acts/Utilities/Logger.hpp"
0019 
0020 #include <array>
0021 #include <iostream>
0022 #include <list>
0023 #include <map>
0024 #include <memory>
0025 #include <set>
0026 #include <string>
0027 #include <utility>
0028 #include <vector>
0029 
0030 namespace Acts {
0031 
0032 template <typename external_spacepoint_t>
0033 struct GbtsTrigTracklet {
0034  public:
0035   GbtsTrigTracklet(std::vector<const GbtsSP<external_spacepoint_t> *> &vSP,
0036                    std::vector<TrigInDetTriplet<external_spacepoint_t>> &tbuf)
0037       : m_track(vSP), m_seeds(tbuf) {}
0038 
0039   std::vector<const GbtsSP<external_spacepoint_t> *> m_track;
0040   std::vector<TrigInDetTriplet<external_spacepoint_t>> m_seeds;
0041 };
0042 
0043 template <typename external_spacepoint_t>
0044 class SeedFinderGbts {
0045  public:
0046   static constexpr std::size_t NDims = 3;
0047 
0048   using seed_t = Seed<external_spacepoint_t>;
0049 
0050   // constructors
0051   SeedFinderGbts(const SeedFinderGbtsConfig<external_spacepoint_t> &config,
0052                  const GbtsGeometry<external_spacepoint_t> &gbtsgeo,
0053                  std::unique_ptr<const Acts::Logger> logger =
0054                      Acts::getDefaultLogger("Finder",
0055                                             Acts::Logging::Level::INFO));
0056 
0057   ~SeedFinderGbts() = default;
0058   SeedFinderGbts() = default;
0059   SeedFinderGbts(const SeedFinderGbts<external_spacepoint_t> &) = delete;
0060   SeedFinderGbts<external_spacepoint_t> &operator=(
0061       const SeedFinderGbts<external_spacepoint_t> &) = delete;
0062 
0063   void loadSpacePoints(
0064       const std::vector<GbtsSP<external_spacepoint_t>> &gbtsSPvect);
0065 
0066   // inner
0067   template <typename output_container_t>
0068   void createSeeds(
0069       const Acts::RoiDescriptor & /*roi*/,
0070       const Acts::GbtsGeometry<external_spacepoint_t> & /*gbtsgeo*/,
0071       output_container_t & /*out_cont*/);
0072   // outer
0073   std::vector<seed_t> createSeeds(
0074       const Acts::RoiDescriptor & /*roi*/,
0075       const Acts::GbtsGeometry<external_spacepoint_t> & /*gbtsgeo*/);
0076 
0077  private:
0078   enum Dim { DimPhi = 0, DimR = 1, DimZ = 2 };
0079 
0080   // config object
0081   SeedFinderGbtsConfig<external_spacepoint_t> m_config;
0082 
0083   void runGbts_TrackFinder(
0084       std::vector<GbtsTrigTracklet<external_spacepoint_t>> &vTracks,
0085       const Acts::RoiDescriptor &roi,
0086       const Acts::GbtsGeometry<external_spacepoint_t> &gbtsgeo);
0087 
0088   // needs to be member of class so can accessed by all member functions
0089   std::unique_ptr<GbtsDataStorage<external_spacepoint_t>> m_storage{nullptr};
0090 
0091   // for create seeds:
0092   std::vector<TrigInDetTriplet<external_spacepoint_t>> m_triplets;
0093 
0094   const Acts::Logger &logger() const { return *m_logger; }
0095   std::unique_ptr<const Acts::Logger> m_logger =
0096       Acts::getDefaultLogger("Finder", Acts::Logging::Level::INFO);
0097 };
0098 
0099 }  // namespace Acts
0100 
0101 #include "Acts/Seeding/SeedFinderGbts.ipp"