Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-04-03 08:49:42

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 
0025 
0026     class TrackClusterMatch : public TrackClusterMatchAlgorithm, public WithPodConfig<TrackClusterMatchConfig> {
0027     private:
0028         const algorithms::GeoSvc& m_geo = algorithms::GeoSvc::instance();
0029         double distance(const edm4hep::Vector3f& v1, const edm4hep::Vector3f& v2) const;
0030         static double Phi_mpi_pi(double phi) {return std::remainder(phi, 2 * M_PI);}
0031 
0032 
0033     public:
0034         TrackClusterMatch(std::string_view name) :
0035                 TrackClusterMatchAlgorithm{name, {"inputTracks", "inputClusters"}, {"outputParticles"}, ""} {}
0036 
0037         void init() final {};
0038         void process(const Input&, const Output&) const final;
0039     };
0040 }