EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
IterativeVertexFinder_factory.h
Go to the documentation of this file.
1// Created by Joe Osborn
2// Subject to the terms in the LICENSE file found in the top-level directory.
3//
4
5#pragma once
6
7#include <ActsExamples/EventData/Track.hpp>
8#include <JANA/JEvent.h>
9#include <cassert>
10#include <edm4eic/VertexCollection.h>
11#include <edm4eic/ReconstructedParticle.h>
12#include <memory>
13#include <string>
14#include <utility>
15#include <vector>
16
20
21namespace eicrecon {
22
24 : public JOmniFactory<IterativeVertexFinder_factory, IterativeVertexFinderConfig> {
25
26private:
28 std::unique_ptr<AlgoT> m_algo;
29
30 Input<Acts::ConstVectorMultiTrajectory> m_acts_track_states_input{this};
31 Input<Acts::ConstVectorTrackContainer> m_acts_tracks_input{this};
32 PodioInput<edm4eic::ReconstructedParticle> m_edm4eic_reconParticles_input{this};
33 PodioOutput<edm4eic::Vertex> m_vertices_output{this};
34
35 ParameterRef<int> m_maxVertices{this, "maxVertices", config().maxVertices,
36 "Maximum num vertices that can be found"};
37 ParameterRef<bool> m_reassignTracksAfterFirstFit{
38 this, "reassignTracksAfterFirstFit", config().reassignTracksAfterFirstFit,
39 "Whether or not to reassign tracks after first fit"};
40 ParameterRef<unsigned int> m_minTrackHits{
41 this, "minTrackHits", config().minTrackHits,
42 "Minimum number of hits to require for the tracks used"};
43
44 Service<ACTSGeo_service> m_ACTSGeoSvc{this};
45
46public:
47 void Configure() {
48 m_algo = std::make_unique<AlgoT>(this->GetPrefix());
49 m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
50 m_algo->applyConfig(config());
51 m_algo->init();
52 }
53
54 void Process(int32_t /* run_number */, uint64_t /* event_number */) {
55 auto track_states_vec = m_acts_track_states_input();
56 auto tracks_vec = m_acts_tracks_input();
57 assert(!track_states_vec.empty() && "ConstVectorMultiTrajectory vector should not be empty");
58 assert(track_states_vec.front() != nullptr &&
59 "ConstVectorMultiTrajectory pointer should not be null");
60 assert(!tracks_vec.empty() && "ConstVectorTrackContainer vector should not be empty");
61 assert(tracks_vec.front() != nullptr && "ConstVectorTrackContainer pointer should not be null");
62
63 m_algo->process(AlgoT::Input{track_states_vec.front(), tracks_vec.front(),
64 m_edm4eic_reconParticles_input()},
65 AlgoT::Output{m_vertices_output().get()});
66 }
67};
68
69} // namespace eicrecon
Definition JOmniFactory.h:30
IterativeVertexFinderConfig & 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
Definition IterativeVertexFinder_factory.h:24
void Process(int32_t, uint64_t)
Definition IterativeVertexFinder_factory.h:54
void Configure()
Definition IterativeVertexFinder_factory.h:47
Definition IterativeVertexFinder.h:30
-client
Definition CalorimeterClusterRecoCoG.cc:37