Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-11-26 09:30:06

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2026 Tom Bleher
0003 
0004 #pragma once
0005 
0006 #include <Acts/MagneticField/MagneticFieldContext.hpp>
0007 #include <Acts/MagneticField/MagneticFieldProvider.hpp>
0008 #include <algorithms/algorithm.h>
0009 #include <edm4eic/TrackParametersCollection.h>
0010 #include <edm4eic/TrackSeedCollection.h>
0011 #include <edm4eic/TrackerHitCollection.h>
0012 #include <memory>
0013 #include <string>
0014 #include <string_view>
0015 
0016 #include "algorithms/interfaces/ActsSvc.h"
0017 #include "algorithms/interfaces/WithPodConfig.h"
0018 #include "algorithms/tracking/ActsGeometryProvider.h"
0019 #include "algorithms/tracking/B0TrackSeedingConfig.h"
0020 
0021 namespace eicrecon {
0022 
0023 using B0TrackSeedingAlgorithm = algorithms::Algorithm<
0024     algorithms::Input<edm4eic::TrackerHitCollection>,
0025     algorithms::Output<edm4eic::TrackSeedCollection, edm4eic::TrackParametersCollection>>;
0026 
0027 /// B0 track seeds from the Acts triplet seeder.
0028 ///
0029 /// The Acts finders assume a uniform field along z. The field of the B0 dipole changes direction
0030 /// off its midplane, so each middle hit gets its own frame, a rotation that takes the field at
0031 /// that hit to z. Rotating further about z does not change what the finders compute, so no other
0032 /// axis, such as the beam, is needed.
0033 class B0TrackSeeding : public B0TrackSeedingAlgorithm, public WithPodConfig<B0TrackSeedingConfig> {
0034 public:
0035   B0TrackSeeding(std::string_view name)
0036       : B0TrackSeedingAlgorithm{name,
0037                                 {"inputTrackerHits"},
0038                                 {"outputTrackSeeds", "outputTrackParameters"},
0039                                 "create B0 track seeds with the Acts triplet seeder"} {}
0040 
0041   void init() final;
0042   void process(const Input& input, const Output& output) const final;
0043 
0044   /// The seeds of the hits in a field
0045   void findSeeds(const edm4eic::TrackerHitCollection& hits,
0046                  const Acts::MagneticFieldProvider& fieldProvider,
0047                  const Acts::MagneticFieldContext& fieldContext,
0048                  edm4eic::TrackSeedCollection& seeds,
0049                  edm4eic::TrackParametersCollection& parameters) const;
0050 
0051 private:
0052   const std::shared_ptr<const ActsGeometryProvider> m_geoSvc{
0053       algorithms::ActsSvc::instance().acts_geometry_provider()};
0054 };
0055 
0056 } // namespace eicrecon