Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 08:17:50

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2022 - 2025 Whitney Armstrong, Sylvester Joosten, Wouter Deconinck, Dmitry Romanov
0003 
0004 #pragma once
0005 
0006 #include <DDRec/CellIDPositionConverter.h>
0007 #include <algorithms/algorithm.h>
0008 #include <algorithms/geo.h>
0009 #include <edm4eic/RawTrackerHitCollection.h>
0010 #include <edm4eic/TrackerHitCollection.h>
0011 #include <gsl/pointers>
0012 #include <string>
0013 #include <string_view>
0014 
0015 #include "TrackerHitReconstructionConfig.h"
0016 #include "algorithms/interfaces/WithPodConfig.h"
0017 
0018 namespace eicrecon {
0019 
0020 using TrackerHitReconstructionAlgorithm =
0021     algorithms::Algorithm<algorithms::Input<edm4eic::RawTrackerHitCollection>,
0022                           algorithms::Output<edm4eic::TrackerHitCollection>>;
0023 
0024 /**
0025  * Produces edm4eic::TrackerHit with geometric info from edm4eic::RawTrackerHit
0026  */
0027 class TrackerHitReconstruction : public TrackerHitReconstructionAlgorithm,
0028                                  public WithPodConfig<TrackerHitReconstructionConfig> {
0029 
0030 public:
0031   TrackerHitReconstruction(std::string_view name)
0032       : TrackerHitReconstructionAlgorithm{
0033             name, {"inputRawHits"}, {"outputHits"}, "reconstruct raw hits into tracker hits."} {}
0034 
0035   /// Once in a lifetime initialization
0036   void init() final {};
0037 
0038   /// Processes RawTrackerHit and produces a TrackerHit
0039   void process(const Input&, const Output&) const final;
0040 
0041 private:
0042   const algorithms::GeoSvc& m_geo{algorithms::GeoSvc::instance()};
0043   const dd4hep::rec::CellIDPositionConverter* m_converter{m_geo.cellIDPositionConverter()};
0044 };
0045 
0046 } // namespace eicrecon