EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
MatchClusters_factory.h
Go to the documentation of this file.
1// Created by Dmitry Romanov
2// Subject to the terms in the LICENSE file found in the top-level directory.
3//
4
5#pragma once
6
7#include <algorithms/logger.h>
8#include <edm4eic/ClusterCollection.h>
9#include <edm4eic/EDM4eicVersion.h>
10#include <edm4eic/MCRecoClusterParticleAssociationCollection.h>
11#include <edm4eic/MCRecoParticleAssociationCollection.h>
12#include <edm4eic/ReconstructedParticleCollection.h>
13#include <edm4hep/MCParticleCollection.h>
14#include <spdlog/logger.h>
15#include <stdint.h>
16#include <memory>
17
21
22namespace eicrecon {
23
24class MatchClusters_factory : public JOmniFactory<MatchClusters_factory, NoConfig> {
25private:
26 // Underlying algorithm
27 std::unique_ptr<eicrecon::MatchClusters> m_algo;
28
29 // Declare inputs
30 PodioInput<edm4hep::MCParticle> m_mc_parts_input{this};
31 PodioInput<edm4eic::ReconstructedParticle> m_rec_parts_input{this};
32 PodioInput<edm4eic::MCRecoParticleAssociation> m_rec_assocs_input{this};
33 PodioInput<edm4eic::Cluster> m_clusters_input{this};
34 PodioInput<edm4eic::MCRecoClusterParticleAssociation> m_cluster_assocs_input{this};
35
36 // Declare outputs
37 PodioOutput<edm4eic::ReconstructedParticle> m_rec_parts_output{this};
38#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
39 PodioOutput<edm4eic::MCRecoParticleLink> m_rec_links_output{this};
40#endif
41 PodioOutput<edm4eic::MCRecoParticleAssociation> m_rec_assocs_output{this};
42
43 Service<AlgorithmsInit_service> m_algorithmsInit{this};
44
45public:
46 void Configure() {
47 m_algo = std::make_unique<MatchClusters>(GetPrefix());
48 m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
49 m_algo->applyConfig(config());
50 m_algo->init();
51 }
52
53 void Process(int32_t /* run_number */, uint64_t /* event_number */) {
54 m_algo->process(
55 {
56 m_mc_parts_input(),
57 m_rec_parts_input(),
58 m_rec_assocs_input(),
59 m_clusters_input(),
60 m_cluster_assocs_input(),
61 },
62 {
63 m_rec_parts_output().get(),
64#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
65 m_rec_links_output().get(),
66#endif
67 m_rec_assocs_output().get(),
68 });
69 }
70};
71
72} // namespace eicrecon
Definition JOmniFactory.h:30
NoConfig & config()
Retrieve reference to embedded config object.
Definition JOmniFactory.h:576
std::shared_ptr< spdlog::logger > & logger()
Retrieve reference to already-configured logger.
Definition JOmniFactory.h:573
std::string GetPrefix()
Definition JOmniFactory.h:570
Definition MatchClusters_factory.h:24
void Process(int32_t, uint64_t)
Definition MatchClusters_factory.h:53
void Configure()
Definition MatchClusters_factory.h:46
-client
Definition CalorimeterClusterRecoCoG.cc:37