EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
SecondaryVertexFinder_factory.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) 2025 Dongwi H. Dongwi (Bishoy)
3
4#pragma once
5
6#include <ActsExamples/EventData/Track.hpp>
7#include <JANA/JEvent.h>
8#include <cassert>
9#include <edm4eic/Vertex.h>
10#include <edm4eic/TrackParameters.h>
11#include <memory>
12#include <string>
13#include <utility>
14#include <vector>
15
19
20namespace eicrecon {
21
23 : public JOmniFactory<SecondaryVertexFinder_factory, SecondaryVertexFinderConfig> {
24
25private:
27 std::unique_ptr<AlgoT> m_algo;
28
29 PodioInput<edm4eic::ReconstructedParticle> m_reco_input{this};
30 Input<Acts::ConstVectorMultiTrajectory> m_acts_track_states_input{this};
31 Input<Acts::ConstVectorTrackContainer> m_acts_tracks_input{this};
32 PodioOutput<edm4eic::Vertex> m_vertices_output{this};
33
34 ParameterRef<unsigned int> m_maxVertices{this, "maxVertices", config().maxVertices,
35 "Maximum num vertices that can be found"};
36 ParameterRef<bool> m_reassignTracksAfterFirstFit{
37 this, "reassignTracksAfterFirstFit", config().reassignTracksAfterFirstFit,
38 "Whether or not to reassign tracks after first fit"};
39 ParameterRef<float> m_tracksMaxZinterval{this, "tracksMaxZinterval", config().tracksMaxZinterval,
40 "Max z interval for Acts::AdaptiveMultiVertexFinder."};
41 ParameterRef<unsigned int> m_maxIterations{this, "maxIterations", config().maxIterations,
42 "Max iterations for Acts::AdaptiveMultivertexFinder"};
43 ParameterRef<float> m_maxDistToLinPoint{
44 this, "maxDistToLinPoint", config().maxDistToLinPoint,
45 "Max disttance to line point (pca) for Acts::AdaptiveMultivertexFinder"};
46
47 Service<ACTSGeo_service> m_ACTSGeoSvc{this};
48
49public:
50 void Configure() {
51 m_algo = std::make_unique<AlgoT>(this->GetPrefix());
52 m_algo->level(static_cast<algorithms::LogLevel>(logger()->level()));
53 m_algo->applyConfig(config());
54 m_algo->init();
55 }
56
57 void Process(int32_t, uint64_t) {
58 auto track_states_vec = m_acts_track_states_input();
59 auto tracks_vec = m_acts_tracks_input();
60 assert(!track_states_vec.empty() && "ConstVectorMultiTrajectory vector should not be empty");
61 assert(track_states_vec.front() != nullptr &&
62 "ConstVectorMultiTrajectory pointer should not be null");
63 assert(!tracks_vec.empty() && "ConstVectorTrackContainer vector should not be empty");
64 assert(tracks_vec.front() != nullptr && "ConstVectorTrackContainer pointer should not be null");
65
66 m_algo->process(
67 {
68 m_reco_input(),
69 track_states_vec.front(),
70 tracks_vec.front(),
71 },
72 {
73 m_vertices_output().get(),
74 });
75 }
76};
77
78} // namespace eicrecon
Definition JOmniFactory.h:30
SecondaryVertexFinderConfig & 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 SecondaryVertexFinder_factory.h:23
void Configure()
Definition SecondaryVertexFinder_factory.h:50
void Process(int32_t, uint64_t)
Definition SecondaryVertexFinder_factory.h:57
Definition SecondaryVertexFinder.h:31
-client
Definition CalorimeterClusterRecoCoG.cc:37