Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-07 08:04:09

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2026 ePIC Collaboration
0003 
0004 #pragma once
0005 
0006 #include <algorithms/algorithm.h>
0007 #include <edm4eic/ClusterCollection.h>
0008 #include <edm4eic/EDM4eicVersion.h>
0009 #include <edm4eic/MCRecoClusterParticleAssociationCollection.h>
0010 #include <edm4eic/MCRecoParticleAssociationCollection.h>
0011 #include <edm4eic/ReconstructedParticleCollection.h>
0012 #include <string>
0013 #include <string_view>
0014 
0015 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0016 #include <edm4eic/MCRecoParticleLinkCollection.h>
0017 #endif
0018 
0019 #include "algorithms/interfaces/WithPodConfig.h"
0020 #include "algorithms/reco/ClustersToParticlesConfig.h"
0021 #include "services/particle/ParticleSvc.h"
0022 
0023 namespace eicrecon {
0024 
0025 using ClustersToParticlesAlgorithm =
0026     algorithms::Algorithm<algorithms::Input<edm4eic::ClusterCollection,
0027                                             edm4eic::MCRecoClusterParticleAssociationCollection>,
0028                           algorithms::Output<edm4eic::ReconstructedParticleCollection,
0029 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0030                                              edm4eic::MCRecoParticleLinkCollection,
0031 #endif
0032                                              edm4eic::MCRecoParticleAssociationCollection>>;
0033 
0034 class ClustersToParticles : public ClustersToParticlesAlgorithm,
0035                             public WithPodConfig<ClustersToParticlesConfig> {
0036 
0037 public:
0038   ClustersToParticles(std::string_view name)
0039       : ClustersToParticlesAlgorithm{name,
0040                                      {"inputClusters", "inputClusterAssociations"},
0041                                      {"outputReconstructedParticles",
0042 #if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
0043                                       "outputParticleLinks",
0044 #endif
0045                                       "outputParticleAssociations"},
0046                                      "Convert clusters to neutral reconstructed particles."} {
0047   }
0048 
0049   void init() final;
0050 
0051   void process(const Input& input, const Output& output) const final;
0052 
0053 private:
0054   const algorithms::ParticleSvc& m_particleSvc = algorithms::ParticleSvc::instance();
0055   double m_mass{0.0};
0056   int m_charge{0};
0057 };
0058 
0059 } // namespace eicrecon