EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
PIDLookup_factory.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) 2024, Nathan Brei
3
4#pragma once
5
6#include <edm4eic/MCRecoParticleAssociationCollection.h>
7#include <edm4eic/EDM4eicVersion.h>
8#include <edm4eic/ReconstructedParticleCollection.h>
9#include <edm4hep/MCParticleCollection.h>
10#include <edm4hep/ParticleIDCollection.h>
11
15
16namespace eicrecon {
17
18class PIDLookup_factory : public JOmniFactory<PIDLookup_factory, PIDLookupConfig> {
19public:
21
22private:
23 std::unique_ptr<AlgoT> m_algo;
24
25 PodioInput<edm4hep::EventHeader> m_event_headers_input{this};
26 PodioInput<edm4eic::ReconstructedParticle> m_recoparticles_input{this};
27 PodioInput<edm4eic::MCRecoParticleAssociation> m_recoparticle_assocs_input{this};
28 PodioOutput<edm4eic::ReconstructedParticle> m_recoparticles_output{this};
29#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
30 PodioOutput<edm4eic::MCRecoParticleLink> m_recoparticle_links_output{this};
31#endif
32 PodioOutput<edm4eic::MCRecoParticleAssociation> m_recoparticle_assocs_output{this};
33 PodioOutput<edm4hep::ParticleID> m_particleids_output{this};
34
35 ParameterRef<std::string> m_filename{this, "filename", config().filename,
36 "Relative to current working directory"};
37 ParameterRef<std::string> m_system{this, "system", config().system, "For the ParticleID record"};
38
39 Service<AlgorithmsInit_service> m_algorithmsInit{this};
40
41public:
42 void Configure() {
43 m_algo = std::make_unique<AlgoT>(this->GetPrefix());
44 m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
45 m_algo->applyConfig(config());
46 m_algo->init();
47 }
48
49 void Process(int32_t /* run_number */, uint64_t /* event_number */) {
50 m_algo->process(
51 {m_event_headers_input(), m_recoparticles_input(), m_recoparticle_assocs_input()},
52 {m_recoparticles_output().get(),
53#if EDM4EIC_BUILD_VERSION >= EDM4EIC_VERSION(8, 7, 0)
54 m_recoparticle_links_output().get(),
55#endif
56 m_recoparticle_assocs_output().get(), m_particleids_output().get()});
57 }
58};
59
60} // namespace eicrecon
Definition JOmniFactory.h:30
PIDLookupConfig & 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 PIDLookup_factory.h:18
void Process(int32_t, uint64_t)
Definition PIDLookup_factory.h:49
void Configure()
Definition PIDLookup_factory.h:42
Definition PIDLookup.h:41
-client
Definition CalorimeterClusterRecoCoG.cc:37