LDMX Software
SeedFinderProcessor.h
1#pragma once
2
3//---< Framework >---//
4#include "Framework/Configure/Parameters.h"
5#include "Framework/Event.h"
7
8//---< Tracking >---//
9#include "Tracking/Event/Track.h"
10#include "Tracking/Sim/SeedToTrackParamMaker.h"
11
12//---< SimCore >---//
13
14//---< STD C++ >---//
15
16//---< ACTS >---//
17#include "Acts/Definitions/Algebra.hpp"
18
19//--- LDMX ---//
20#include "Tracking/Event/Measurement.h"
21#include "Tracking/Reco/TrackingGeometryUser.h"
22#include "Tracking/Reco/TruthMatchingTool.h"
23
24namespace tracking {
25namespace reco {
26
28 public:
35 SeedFinderProcessor(const std::string& name, framework::Process& process);
36
38 virtual ~SeedFinderProcessor() = default;
39
43 void onProcessStart() override;
44
48 void onProcessEnd() override;
49
55 void configure(framework::config::Parameters& parameters) override;
56
63 void produce(framework::Event& event) override;
64
65 bool groupStrips(const std::vector<ldmx::Measurement>& measurements,
66 const std::vector<int> strategy);
67
68 void findSeedsFromMap(std::vector<ldmx::Track>& seeds,
69 const ldmx::Measurements& pmeas,
70 const ldmx::Measurements& fit_constraints);
71
72 private:
74 ldmx::Track seedTracker(const ldmx::Measurements& vmeas, double xOrigin,
75 const Acts::Vector3& perigee_location,
76 const ldmx::Measurement* constraint);
77
78 void lineParabolaToHelix(const Acts::Vector<5> parameters,
79 Acts::Vector<5>& helix_parameters,
80 Acts::Vector3 ref);
81
82 Acts::Vector3 b_field_;
83
84 /* This is a temporary (working) solution to estimate the track parameters out
85 * of the seeds Eventually we should move to what is in ACTS (I'm not happy
86 * with what they did regarding this part atm)
87 */
88
89 std::shared_ptr<tracking::sim::SeedToTrackParamMaker> seed_to_track_maker_;
90
91 double processing_time_{0.};
92 long nevents_{0};
93 unsigned int ntracks_{0};
94
95 std::vector<double> inflate_factors_{1., 1., 1., 1., 1.};
96
98 std::string out_seed_collection_{"SeedTracks"};
100 std::string input_hits_collection_{"TaggerSimHits"};
102 std::string tagger_trks_collection_{"TaggerTracks"};
103 std::string input_pass_name_{""};
104
105 std::string sim_particles_coll_name_;
106 std::string sim_particles_passname_;
107 std::string tagger_trks_event_collection_passname_;
108 std::string sim_particles_event_passname_;
110 std::vector<double> perigee_location_{-700., 0., 0};
112 double pmin_{0.05};
113
115 double pmax_{8};
116
118 double d0max_{20.};
119
121 double d0min_{20.};
122
124 double z0max_{60.};
125
126 double piover2_{1.5708};
127
129 double phicut_{0.1};
130
132 double thetacut_{0.2};
133
135 double loc0cut_{0.1};
136 double loc1cut_{0.3};
137
139 std::vector<std::string> strategies_{};
141 std::vector<std::vector<int>> strategy_layers_{};
147 std::vector<double> beamspot_sigma_{5.77, 23.1};
149 std::shared_ptr<Acts::Surface> target_surface_;
152 double bfield_{1.5};
153
154 std::vector<float> xhit_;
155 std::vector<float> yhit_;
156 std::vector<float> zhit_;
157
158 std::vector<float> b0_;
159 std::vector<float> b1_;
160 std::vector<float> b2_;
161 std::vector<float> b3_;
162 std::vector<float> b4_;
163
164 // Check failures
165 long ndoubles_{0};
166 long nmissing_{0};
167 long nfailpmin_{0};
168 long nfailpmax_{0};
169 long nfaild0min_{0};
170 long nfaild0max_{0};
171 long nfailz0max_{0};
172 long nfailphi_{0};
173 long nfailtheta_{0};
174
175 // The measurements groups
176 std::map<int, std::vector<const ldmx::Measurement*>> groups_map_;
177
178 // Truth Matching tool
179 std::shared_ptr<tracking::sim::TruthMatchingTool> truth_matching_tool_ =
180 nullptr;
181
183 double u_error_;
185 double v_error_;
186
187}; // SeedFinderProcessor
188
189} // namespace reco
190} // namespace tracking
Base classes for all user event processing components to extend.
Class implementing an event buffer system for storing event data.
Implements an event buffer system for storing event data.
Definition Event.h:40
Class which represents the process under execution.
Definition Process.h:34
virtual void process(Event &event) final
Processing an event for a Producer is calling produce.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:26
Implementation of a track object.
Definition Track.h:54
virtual ~SeedFinderProcessor()=default
Destructor.
std::vector< std::vector< int > > strategy_layers_
Layer lists parsed from strategies_, one per strategy.
bool use_beamspot_constraint_
Put the beam spot into the seed fit when no tagger track exists.
SeedFinderProcessor(const std::string &name, framework::Process &process)
Constructor.
std::string out_seed_collection_
The name of the output collection of seeds to be stored.
double pmax_
Maximum cut on the momentum of the seeds.
std::vector< std::string > strategies_
List of stragies for seed finding.
bool use_target_constraint_
Put tagger track positions at the target into the seed fit.
std::string input_hits_collection_
The name of the input hits collection to use in finding seeds..
ldmx::Track seedTracker(const ldmx::Measurements &vmeas, double xOrigin, const Acts::Vector3 &perigee_location, const ldmx::Measurement *constraint)
Fit the strips plus an optional target constraint (nullptr = none)
void onProcessEnd() override
Callback for the EventProcessor to take any necessary action when the processing of events finishes,...
std::shared_ptr< Acts::Surface > target_surface_
Target surface the constraints live on.
void produce(framework::Event &event) override
Run the processor and create a collection of results which indicate if a charge particle can be found...
std::vector< double > beamspot_sigma_
Beam spot sigma at the target in local (u, v) [mm].
void onProcessStart() override
Callback for the EventProcessor to take any necessary action when the processing of events starts,...
double pmin_
Minimum cut on the momentum of the seeds.
std::string tagger_trks_collection_
The name of the tagger Tracks (only for Recoil Seeding)
bool warned_ambiguous_tagger_
Warn only once about several tagger track collections.
std::vector< double > perigee_location_
Location of the perigee for the helix track parameters.
double d0max_
Max d0 allowed for the seeds.
void configure(framework::config::Parameters &parameters) override
Configure the processor using the given user specified parameters.
double d0min_
Min d0 allowed for the seeds.
double z0max_
Max z0 allowed for the seeds.
a helper base class providing some methods to shorten access to common conditions used within the tra...
The measurement calibrator can be a function or a class/struct able to retrieve the sim hits containe...