Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-21 08:26:35

0001 
0002 // SPDX-License-Identifier: LGPL-3.0-or-later
0003 // Copyright (C) 2026 Sylvester Joosten, Whitney Armstrong, Wouter Deconinck, Derek Anderson
0004 
0005 #pragma once
0006 
0007 #include <algorithms/algorithm.h>
0008 #include <edm4eic/CalorimeterHitCollection.h>
0009 #include <edm4eic/MCRecoCalorimeterHitLinkCollection.h>
0010 #include <edm4eic/ProtoClusterCollection.h>
0011 #include <edm4hep/CaloHitContribution.h>
0012 #include <edm4hep/MCParticleCollection.h>
0013 #include <string>
0014 #include <string_view>
0015 
0016 #include "algorithms/interfaces/WithPodConfig.h"
0017 
0018 namespace eicrecon {
0019 
0020 using CalorimeterTruthClusteringAlgorithm =
0021     algorithms::Algorithm<algorithms::Input<edm4eic::CalorimeterHitCollection,
0022                                             edm4eic::MCRecoCalorimeterHitLinkCollection>,
0023                           algorithms::Output<edm4eic::ProtoClusterCollection>>;
0024 
0025 class CalorimeterTruthClustering : public CalorimeterTruthClusteringAlgorithm,
0026                                    public WithPodConfig<NoConfig> {
0027 
0028 public:
0029   CalorimeterTruthClustering(std::string_view name)
0030       : CalorimeterTruthClusteringAlgorithm{name,
0031                                             {"inputHitCollection", "inputHitLinks"},
0032                                             {"outputProtoClusterCollection"},
0033                                             "Use truth information for clustering."} {}
0034 
0035 public:
0036   void init() final;
0037   void process(const Input&, const Output&) const final;
0038 
0039 private:
0040   static edm4hep::MCParticle get_primary(const edm4hep::CaloHitContribution& contrib);
0041 };
0042 
0043 } // namespace eicrecon