Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-17 07:50:50

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2022 - 2026 Whitney Armstrong, Sylvester Joosten, Wouter Deconinck, Dmitry Romanov, Yann Bedfer
0003 
0004 #pragma once
0005 
0006 #include <DDRec/CellIDPositionConverter.h>
0007 #include <Parsers/Primitives.h>
0008 #include <algorithms/algorithm.h>
0009 #include <algorithms/geo.h>
0010 #include <edm4eic/RawTrackerHitCollection.h>
0011 #include <edm4eic/TrackerHitCollection.h>
0012 #include <gsl/pointers>
0013 #include <string>
0014 #include <string_view>
0015 
0016 #include "MPGDHitReconstructionConfig.h"
0017 #include "algorithms/interfaces/WithPodConfig.h"
0018 
0019 namespace eicrecon {
0020 
0021 using MPGDHitReconstructionAlgorithm =
0022     algorithms::Algorithm<algorithms::Input<edm4eic::RawTrackerHitCollection>,
0023                           algorithms::Output<edm4eic::TrackerHitCollection>>;
0024 
0025 /**
0026  * Produces edm4eic::TrackerHit with geometric info from edm4eic::RawTrackerHit
0027  Specific to MPGDs.
0028 */
0029 class MPGDHitReconstruction : public MPGDHitReconstructionAlgorithm,
0030                               public WithPodConfig<MPGDHitReconstructionConfig> {
0031 
0032 public:
0033   MPGDHitReconstruction(std::string_view name)
0034       : MPGDHitReconstructionAlgorithm{
0035             name, {"inputRawHits"}, {"outputHits"}, "reconstruct raw hits into tracker hits."} {}
0036 
0037   /// Once in a lifetime initialization
0038   void init() final;
0039 
0040   /// Processes RawTrackerHit and produces a TrackerHit
0041   void process(const Input&, const Output&) const final;
0042 
0043 private:
0044   /** Segmentation */
0045   const algorithms::GeoSvc& m_geo{algorithms::GeoSvc::instance()};
0046   const dd4hep::rec::CellIDPositionConverter* m_converter{m_geo.cellIDPositionConverter()};
0047   const dd4hep::BitFieldCoder* m_id_dec;
0048   // CellIDs specifying IDDescriptor fields.
0049   void parseIDDescriptor();
0050   int m_coordOffsets[2];          // Offsets of coordinate fields
0051   dd4hep::CellID m_subVolBits{0}; // SUBVOLUME = all but coordinates
0052   dd4hep::CellID m_pStripBit{0};  // 'p' strip
0053   dd4hep::CellID m_nStripBit{0};  // 'n' strip
0054 };
0055 
0056 } // namespace eicrecon