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#include <iostream>
13
14//--- LDMX ---//
15#include "Ecal/Event/EcalHit.h"
16#include "TFile.h"
17#include "TTree.h"
18#include "Tracking/Event/Measurement.h"
19#include "Tracking/Event/StraightTrack.h"
20#include "Tracking/Reco/TrackingGeometryUser.h"
21#include "Tracking/Reco/TruthMatchingTool.h"
22
23namespace tracking {
24namespace reco {
25
27 public:
34 LinearTruthTracking(const std::string& name, framework::Process& process);
35
37 virtual ~LinearTruthTracking() = default;
41 void onProcessEnd() override;
47 void configure(framework::config::Parameters& parameters) override;
48
55 void produce(framework::Event& event) override;
56
57 protected:
58 // Function to find recoil e- based on 4 recoil points with trackID = 1
59 ldmx::StraightTrack truthTracker(
60 const std::vector<ldmx::SimTrackerHit>& points,
61 std::vector<std::array<double, 3>>& ecal_points);
62
63 // Helper function: calculate distance between 2 3D points
64 double calculateDistance(const std::array<double, 3>& point1,
65 const std::array<double, 3>& point2);
66
67 // Fitting function: fit a straight line in 3D using 4 points (2 degrees of
68 // freedom)
69 std::tuple<double, double, double, double> fit3DLine(
70 const std::vector<ldmx::SimTrackerHit>& points);
71
72 // Calculate chi2 of the fit
73 double globalChiSquare(const std::vector<ldmx::SimTrackerHit>& points,
74 double a_x, double a_y, double b_x, double b_y);
75
76 double processing_time_{0.};
77 long n_events_{0};
78 unsigned int n_truth_{0};
79 long n_missing_{0};
80 long n_empty_{0};
81
82 // Assuming rLDMX v1 geometry
83 double ecal_first_layer_z_threshold_{250.0};
84
86 std::string out_trk_collection_{"LinearRecoilTruthTracks"};
88 std::string input_hits_collection_{"RecoilSimHits"};
90 std::string input_rec_hits_collection_{"EcalRecHits"};
91 std::string input_pass_name_{""};
92
93}; // LinearTruthTracking
94
95} // namespace reco
96} // 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
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...