EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
RichTrack_factory.h
Go to the documentation of this file.
1// Copyright (C) 2022, 2023 Christopher Dilks
2// Subject to the terms in the LICENSE file found in the top-level directory.
3
4#pragma once
5
6#include <Acts/Surfaces/Surface.hpp>
7#include <JANA/JEvent.h>
8#include <cassert>
9#include <edm4eic/TrackPoint.h>
10#include <edm4eic/TrackSegmentCollection.h>
11#include <functional>
12#include <map>
13#include <memory>
14#include <string>
15#include <utility>
16#include <vector>
17
18// algorithms
24
25namespace eicrecon {
26
27class RichTrack_factory : public JOmniFactory<RichTrack_factory, TrackPropagationConfig> {
28
29private:
31 std::unique_ptr<AlgoT> m_algo;
32
33 PodioInput<edm4eic::Track> m_tracks_input{this};
34 Input<Acts::ConstVectorMultiTrajectory> m_acts_track_states_input{this};
35 Input<Acts::ConstVectorTrackContainer> m_acts_tracks_input{this};
36 PodioOutput<edm4eic::TrackSegment> m_track_segments_output{this};
37
38 Service<DD4hep_service> m_GeoSvc{this};
39 Service<ACTSGeo_service> m_ACTSGeoSvc{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
47 if (config().filter_surfaces.empty())
48 throw JException("cannot find filter surface for RICH track propagation");
49
50 m_algo->init();
51 }
52
53 void Process(int32_t /* run_number */, uint64_t /* event_number */) {
54 auto track_states_vec = m_acts_track_states_input();
55 auto tracks_vec = m_acts_tracks_input();
56 assert(!track_states_vec.empty() && "ConstVectorMultiTrajectory vector should not be empty");
57 assert(track_states_vec.front() != nullptr &&
58 "ConstVectorMultiTrajectory pointer should not be null");
59 assert(!tracks_vec.empty() && "ConstVectorTrackContainer vector should not be empty");
60 assert(tracks_vec.front() != nullptr && "ConstVectorTrackContainer pointer should not be null");
61
62 m_algo->propagateToSurfaceList(
63 AlgoT::Input{m_tracks_input(), track_states_vec.front(), tracks_vec.front()},
64 AlgoT::Output{m_track_segments_output().get()});
65 }
66};
67
68} // 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 RichTrack_factory.h:27
void Process(int32_t, uint64_t)
Definition RichTrack_factory.h:53
void Configure()
Definition RichTrack_factory.h:42
Definition TrackPropagation.h:51
-client
Definition CalorimeterClusterRecoCoG.cc:37