EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
TrackProjector_factory.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright 2022 - 2025 Dmitry Romanov, Dmitry Kalinkin
3
4#pragma once
5
6#include <ActsExamples/EventData/Track.hpp>
7#include <JANA/JEvent.h>
8#include <cassert>
9#include <edm4eic/TrackSegmentCollection.h>
10#include <memory>
11#include <string>
12#include <utility>
13#include <vector>
14
17
18namespace eicrecon {
19
20class TrackProjector_factory : public JOmniFactory<TrackProjector_factory, NoConfig> {
21
22private:
24
25 std::unique_ptr<AlgoT> m_algo;
26
27 Input<Acts::ConstVectorMultiTrajectory> m_acts_track_states_input{this};
28 Input<Acts::ConstVectorTrackContainer> m_acts_tracks_input{this};
29 PodioInput<edm4eic::Track> m_tracks_input{this};
30 PodioOutput<edm4eic::TrackSegment> m_segments_output{this};
31
32 Service<AlgorithmsInit_service> m_algorithmsInit{this};
33
34public:
35 void Configure() {
36 m_algo = std::make_unique<AlgoT>(this->GetPrefix());
37 m_algo->level((algorithms::LogLevel)logger()->level());
38 m_algo->applyConfig(config());
39 m_algo->init();
40 }
41
42 void Process(int32_t /* run_number */, uint64_t /* event_number */) {
43 auto track_states_vec = m_acts_track_states_input();
44 auto tracks_vec = m_acts_tracks_input();
45 assert(!track_states_vec.empty() && "ConstVectorMultiTrajectory vector should not be empty");
46 assert(track_states_vec.front() != nullptr &&
47 "ConstVectorMultiTrajectory pointer should not be null");
48 assert(!tracks_vec.empty() && "ConstVectorTrackContainer vector should not be empty");
49 assert(tracks_vec.front() != nullptr && "ConstVectorTrackContainer pointer should not be null");
50
51 m_algo->process(
52 {
53 track_states_vec.front(),
54 tracks_vec.front(),
55 m_tracks_input(),
56 },
57 {
58 m_segments_output().get(),
59 });
60 }
61};
62
63} // 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 TrackProjector_factory.h:20
void Configure()
Definition TrackProjector_factory.h:35
void Process(int32_t, uint64_t)
Definition TrackProjector_factory.h:42
Definition TrackProjector.h:25
-client
Definition CalorimeterClusterRecoCoG.cc:37