Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-29 07:57:55

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2025 Alex Jentsch
0003 //
0004 
0005 #pragma once
0006 
0007 #include <DD4hep/Detector.h>
0008 #include <DDRec/CellIDPositionConverter.h>
0009 #include <algorithms/algorithm.h>
0010 #include <algorithms/geo.h>
0011 #include <edm4eic/ReconstructedParticleCollection.h>
0012 #include <edm4eic/TrackerHitCollection.h>
0013 #include <edm4hep/MCParticleCollection.h>
0014 #include <gsl/pointers>
0015 #include <string>
0016 #include <string_view>
0017 
0018 #include "PolynomialMatrixReconstructionConfig.h"
0019 #include "algorithms/interfaces/WithPodConfig.h"
0020 
0021 namespace eicrecon {
0022 
0023 using PolynomialMatrixReconstructionAlgorithm = algorithms::Algorithm<
0024     algorithms::Input<edm4hep::MCParticleCollection, edm4eic::TrackerHitCollection>,
0025     algorithms::Output<edm4eic::ReconstructedParticleCollection>>;
0026 
0027 class PolynomialMatrixReconstruction : public PolynomialMatrixReconstructionAlgorithm,
0028                                        public WithPodConfig<PolynomialMatrixReconstructionConfig> {
0029 
0030 public:
0031   PolynomialMatrixReconstruction(std::string_view name)
0032       : PolynomialMatrixReconstructionAlgorithm{
0033             name,
0034             {"mcParticles", "inputHitCollection"},
0035             {"outputParticleCollection"},
0036             "Apply polynomial matrix method reconstruction to hits."} {}
0037 
0038   void init() final;
0039   void process(const Input&, const Output&) const final;
0040 
0041 private:
0042   const dd4hep::Detector* m_detector{algorithms::GeoSvc::instance().detector()};
0043   const dd4hep::rec::CellIDPositionConverter* m_converter{
0044       algorithms::GeoSvc::instance().cellIDPositionConverter()};
0045   double calculateOffsetFromXL(int whichOffset, double x_L, double beamEnergy) const;
0046   double calculateMatrixValueFromXL(int whichElement, double x_L, double beamEnergy) const;
0047 };
0048 } // namespace eicrecon