LDMX Software
LinearTruthTracking.h
1#pragma once
2
3//---< Framework >---//
4#include "Framework/Configure/Parameters.h"
5#include "Framework/Event.h"
7
8//---< SimCore >---//
10
11//---< STD C++ >---//
12
13//--- LDMX ---//
14#include "Tracking/Event/StraightTrack.h"
15#include "Tracking/Reco/TrackingGeometryUser.h"
16
17namespace tracking {
18namespace reco {
19
21 public:
28 LinearTruthTracking(const std::string& name, framework::Process& process);
29
31 virtual ~LinearTruthTracking() = default;
35 void onProcessEnd() override;
41 void configure(framework::config::Parameters& parameters) override;
42
49 void produce(framework::Event& event) override;
50
51 protected:
52 // Function to find recoil e- based on 4 recoil points with trackID = 1
53 ldmx::StraightTrack truthTracker(
54 const std::vector<ldmx::SimTrackerHit>& points,
55 std::vector<std::array<double, 3>>& ecal_points);
56
57 // Helper function: calculate distance between 2 3D points
58 double calculateDistance(const std::array<double, 3>& point1,
59 const std::array<double, 3>& point2);
60
61 // Fitting function: fit a straight line in 3D using 4 points (2 degrees of
62 // freedom)
63 std::tuple<double, double, double, double> fit3DLine(
64 const std::vector<ldmx::SimTrackerHit>& points);
65
66 // Calculate chi2 of the fit
67 double globalChiSquare(const std::vector<ldmx::SimTrackerHit>& points,
68 double a_x, double a_y, double b_x, double b_y);
69
70 double processing_time_{0.};
71 long n_events_{0};
72 unsigned int n_truth_{0};
73 long n_missing_{0};
74 long n_empty_{0};
75
76 // Assuming rLDMX v1 geometry
77 double ecal_first_layer_z_threshold_{250.0};
78
80 std::string out_trk_collection_{"LinearRecoilTruthTracks"};
82 std::string input_hits_collection_{"RecoilSimHits"};
84 std::string input_rec_hits_collection_{"EcalRecHits"};
85 std::string input_pass_name_{""};
86
87}; // LinearTruthTracking
88
89} // namespace reco
90} // 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: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
std::string input_rec_hits_collection_
The name of the tagger Tracks (only for Recoil Seeding)
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::string input_hits_collection_
The name of the input hits collection to use in finding seeds..
LinearTruthTracking(const std::string &name, framework::Process &process)
Constructor.
std::string out_trk_collection_
The name of the output collection of seeds to be stored.
void onProcessEnd() override
Output event statistics.
virtual ~LinearTruthTracking()=default
Destructor.
void configure(framework::config::Parameters &parameters) override
Configure the processor using the given user specified parameters.
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...