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/Sim/LdmxSpacePoint.h"
10#include "Tracking/Sim/SeedToTrackParamMaker.h"
11#include "Tracking/Sim/TrackingUtils.h"
12
13//---< SimCore >---//
15
16//---< STD C++ >---//
17
18#include <iostream>
19
20//---< ACTS >---//
21#include "Acts/Definitions/Algebra.hpp"
22#include "Acts/MagneticField/MagneticFieldContext.hpp"
23#include "Acts/Seeding/EstimateTrackParamsFromSeed.hpp"
24#include "Acts/Seeding/Seed.hpp"
25#include "Acts/Seeding/SeedFilter.hpp"
26#include "Acts/Seeding/SpacePointGrid.hpp"
27#include "Acts/Utilities/CalibrationContext.hpp"
28#include "Acts/Utilities/Intersection.hpp"
29
30//--- LDMX ---//
31#include "TFile.h"
32#include "TTree.h"
33#include "Tracking/Event/Measurement.h"
34#include "Tracking/Reco/TrackingGeometryUser.h"
35#include "Tracking/Reco/TruthMatchingTool.h"
36
37namespace tracking {
38namespace reco {
39
41 public:
48 SeedFinderProcessor(const std::string& name, framework::Process& process);
49
51 virtual ~SeedFinderProcessor() = default;
52
56 void onProcessStart() override;
57
61 void onProcessEnd() override;
62
68 void configure(framework::config::Parameters& parameters) override;
69
76 void produce(framework::Event& event) override;
77
78 bool GroupStrips(const std::vector<ldmx::Measurement>& measurements,
79 const std::vector<int> strategy);
80
81 void FindSeedsFromMap(ldmx::Tracks& seeds, const ldmx::Measurements& pmeas);
82
83 private:
84 ldmx::Track SeedTracker(const ldmx::Measurements& vmeas, double xOrigin,
85 const Acts::Vector3& perigee_location,
86 const ldmx::Measurements& pmeas_tgt);
87
88 void LineParabolaToHelix(const Acts::ActsVector<5> parameters,
89 Acts::ActsVector<5>& helix_parameters,
90 Acts::Vector3 ref);
91
92 Acts::Vector3 bField_;
93
94 /* This is a temporary (working) solution to estimate the track parameters out
95 * of the seeds Eventually we should move to what is in ACTS (I'm not happy
96 * with what they did regarding this part atm)
97 */
98
99 std::shared_ptr<tracking::sim::SeedToTrackParamMaker> seed_to_track_maker_;
100
101 double processing_time_{0.};
102 long nevents_{0};
103 unsigned int ntracks_{0};
104
105 std::vector<double> inflate_factors_{1., 1., 1., 1., 1.};
106
108 std::string out_seed_collection_{"SeedTracks"};
110 std::string input_hits_collection_{"TaggerSimHits"};
112 std::string tagger_trks_collection_{"TaggerTracks"};
113 std::string input_pass_name_{""};
115 std::vector<double> perigee_location_{-700., 0., 0};
117 double pmin_{0.05};
118
120 double pmax_{8};
121
123 double d0max_{20.};
124
126 double d0min_{20.};
127
129 double z0max_{60.};
130
131 double piover2_{1.5708};
132
134 double phicut_{0.1};
135
137 double thetacut_{0.2};
138
140 double loc0cut_{0.1};
141 double loc1cut_{0.3};
142
144 std::vector<std::string> strategies_{};
145 double bfield_{1.5};
146
147 std::vector<float> xhit_;
148 std::vector<float> yhit_;
149 std::vector<float> zhit_;
150
151 std::vector<float> b0_;
152 std::vector<float> b1_;
153 std::vector<float> b2_;
154 std::vector<float> b3_;
155 std::vector<float> b4_;
156
157 // Check failures
158 long ndoubles_{0};
159 long nmissing_{0};
160 long nfailpmin_{0};
161 long nfailpmax_{0};
162 long nfaild0min_{0};
163 long nfaild0max_{0};
164 long nfailz0max_{0};
165 long nfailphi_{0};
166 long nfailtheta_{0};
167
168 // The measurements groups
169 std::map<int, std::vector<const ldmx::Measurement*>> groups_map;
170
171 // Truth Matching tool
172 std::shared_ptr<tracking::sim::TruthMatchingTool> truthMatchingTool_ =
173 nullptr;
174
175}; // SeedFinderProcessor
176
177} // namespace reco
178} // namespace tracking
Base classes for all user event processing components to extend.
Class implementing an event buffer system for storing event data.
Class which encapsulates information from a hit in a simulated tracking detector.
Implements an event buffer system for storing event data.
Definition Event.h:42
Class which represents the process under execution.
Definition Process.h:36
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
Implementation of a track object.
Definition Track.h:53
virtual ~SeedFinderProcessor()=default
Destructor.
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.
std::string input_hits_collection_
The name of the input hits collection to use in finding seeds..
void onProcessEnd() override
Callback for the EventProcessor to take any necessary action when the processing of events finishes,...
void produce(framework::Event &event) override
Run the processor and create a collection of results which indicate if a charge particle can be found...
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)
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...