EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
TrackPropagation_factory.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) 2023 Tyler Kutz, Wouter Deconinck
3
4#pragma once
5
6#include <Acts/Surfaces/Surface.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
21
22namespace eicrecon {
23
25 : public JOmniFactory<TrackPropagation_factory, TrackPropagationConfig> {
26
27private:
29 std::unique_ptr<AlgoT> m_algo;
30
31 PodioInput<edm4eic::Track> m_tracks_input{this};
32 Input<Acts::ConstVectorMultiTrajectory> m_acts_track_states_input{this};
33 Input<Acts::ConstVectorTrackContainer> m_acts_tracks_input{this};
34 PodioOutput<edm4eic::TrackSegment> m_track_segments_output{this};
35
36 Service<DD4hep_service> m_GeoSvc{this};
37 Service<ACTSGeo_service> m_ACTSGeoSvc{this};
38
39public:
40 void Configure() {
41 m_algo = std::make_unique<AlgoT>(this->GetPrefix());
42 m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
43 m_algo->applyConfig(config());
44 m_algo->init();
45 }
46
47 void Process(int32_t /* run_number */, uint64_t /* event_number */) {
48 auto track_states_vec = m_acts_track_states_input();
49 auto tracks_vec = m_acts_tracks_input();
50 assert(!track_states_vec.empty() && "ConstVectorMultiTrajectory vector should not be empty");
51 assert(track_states_vec.front() != nullptr &&
52 "ConstVectorMultiTrajectory pointer should not be null");
53 assert(!tracks_vec.empty() && "ConstVectorTrackContainer vector should not be empty");
54 assert(tracks_vec.front() != nullptr && "ConstVectorTrackContainer pointer should not be null");
55
56 m_algo->process(AlgoT::Input{m_tracks_input(), track_states_vec.front(), tracks_vec.front()},
57 AlgoT::Output{m_track_segments_output().get()});
58 }
59};
60
61} // namespace eicrecon
Definition JOmniFactory.h:30
TrackPropagationConfig & 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 TrackPropagation_factory.h:25
void Process(int32_t, uint64_t)
Definition TrackPropagation_factory.h:47
void Configure()
Definition TrackPropagation_factory.h:40
Definition TrackPropagation.h:51
-client
Definition CalorimeterClusterRecoCoG.cc:37