Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-12 08:33:59

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2025 Tristan Protzman
0003 
0004 #pragma once
0005 
0006 #include <algorithms/algorithm.h>
0007 #include <algorithms/geo.h>
0008 #include <edm4eic/ClusterCollection.h>
0009 #include <edm4eic/TrackClusterMatchCollection.h>
0010 #include <edm4eic/TrackSegmentCollection.h>
0011 #include <edm4hep/Vector3f.h>
0012 #include <cmath>
0013 #include <string>
0014 #include <string_view>
0015 
0016 #include "algorithms/interfaces/WithPodConfig.h"
0017 #include "algorithms/reco/TrackClusterMatchConfig.h"
0018 
0019 namespace eicrecon {
0020 using TrackClusterMatchAlgorithm = algorithms::Algorithm<
0021     algorithms::Input<edm4eic::TrackSegmentCollection, edm4eic::ClusterCollection>,
0022     algorithms::Output<edm4eic::TrackClusterMatchCollection>>;
0023 
0024 class TrackClusterMatch : public TrackClusterMatchAlgorithm,
0025                           public WithPodConfig<TrackClusterMatchConfig> {
0026 private:
0027   const algorithms::GeoSvc& m_geo = algorithms::GeoSvc::instance();
0028   static double distance(const edm4hep::Vector3f& v1, const edm4hep::Vector3f& v2);
0029   static double Phi_mpi_pi(double phi) { return std::remainder(phi, 2 * M_PI); }
0030 
0031 public:
0032   TrackClusterMatch(std::string_view name)
0033       : TrackClusterMatchAlgorithm{
0034             name, {"inputTracks", "inputClusters"}, {"outputParticles"}, ""} {}
0035 
0036   void init() final{};
0037   void process(const Input&, const Output&) const final;
0038 };
0039 } // namespace eicrecon