Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-11 08:30:19

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2023, Christopher Dilks
0003 
0004 // General algorithm to merge together particle ID datatypes
0005 
0006 #pragma once
0007 
0008 // data model
0009 #include <algorithms/algorithm.h>
0010 #include <edm4eic/CherenkovParticleIDCollection.h>
0011 #include <string>
0012 #include <string_view>
0013 #include <vector>
0014 
0015 // EICrecon
0016 #include "algorithms/interfaces/WithPodConfig.h"
0017 #include "algorithms/pid/MergeParticleIDConfig.h"
0018 
0019 namespace eicrecon {
0020 
0021 using MergeParticleIDAlgorithm = algorithms::Algorithm<
0022     algorithms::Input<std::vector<const edm4eic::CherenkovParticleIDCollection>>,
0023     algorithms::Output<edm4eic::CherenkovParticleIDCollection>>;
0024 
0025 class MergeParticleID : public MergeParticleIDAlgorithm,
0026                         public WithPodConfig<MergeParticleIDConfig> {
0027 
0028 public:
0029   MergeParticleID(std::string_view name)
0030       : MergeParticleIDAlgorithm{name,
0031                                  {"inputTrackSegments"},
0032                                  {"outputTrackSegments"},
0033                                  "Effectively 'zip' the input particle IDs"} {}
0034 
0035   void init();
0036 
0037   // - input: a list of particle ID collections, which we want to merge together
0038   // - output: the merged particle ID collection
0039   // - overload this function to support different collections from other PID subsystems, or to support
0040   //   merging PID results from overlapping subsystems
0041   void process(const Input&, const Output&) const final;
0042 };
0043 
0044 } // namespace eicrecon