LDMX Software
PropagatorStepWriter.h
1#ifndef TRACKING_SIM_PROPAGATORSTEPWRITER_H
2#define TRACKING_SIM_PROPAGATORSTEPWRITER_H
3
4/* This class is a strip down version of the ActsExample::PropagatorStepWriter
5 * It's used to dump in a root file all the steps information of the
6 * Acts::Propagator for a complete validation of a tracking geometry.
7 */
8
9#include <mutex>
10
11//--- Framework ---//
12#include "Framework/Event.h"
13
14//--- ACTS ---//
15#include "Acts/Propagator/detail/SteppingLogger.hpp"
16
17//--- Tracking ---//
18#include "Tracking/Event/Measurement.h"
19
20//--- ROOT ---//
21#include "TFile.h"
22#include "TTree.h"
23
24using PropagationSteps = std::vector<Acts::detail::Step>;
25
26namespace tracking {
27namespace sim {
28
30 public:
31 struct Config {
32 // std::string collection =
33 // "propagation_steps"; ///< particle collection to write
34
35 std::string file_path_ = "";
36 std::string file_mode_ = "RECREATE";
37 std::string tree_name_ = "propagation_steps";
38 TFile* root_file_ = nullptr;
39 };
40
44 PropagatorStepWriter(const Config& cfg);
45
47
48 bool writeSteps(framework::Event& event,
49 const std::vector<PropagationSteps>& stepCollection,
50 const std::vector<ldmx::Measurement>& measurements,
51 const Acts::Vector3& start_pos,
52 const Acts::Vector3& start_mom);
53
54 protected:
56 std::mutex m_write_mutex_;
60
61 // std::vector<int> m_volumeID; ///< volume identifier
62 std::vector<int> m_boundary_id_;
63 std::vector<int> m_layer_id_;
64 std::vector<int> m_approach_id_;
65 std::vector<int> m_sensitive_id_;
66 std::vector<float> m_x_;
67 std::vector<float> m_y_;
68 std::vector<float> m_z_;
69 std::vector<float> m_dx_;
70 std::vector<float> m_dy_;
71 std::vector<float> m_dz_;
72 std::vector<int> m_step_type_;
73 std::vector<float> m_step_acc_;
74 std::vector<float> m_step_act_;
75 std::vector<float> m_step_abt_;
76 std::vector<float> m_step_usr_;
77 std::vector<float> m_hit_x_;
78 std::vector<float> m_hit_y_;
79 std::vector<float> m_hit_z_;
80 std::vector<float>
82 std::vector<float>
84};
85} // namespace sim
86} // namespace tracking
87
88#endif
Class implementing an event buffer system for storing event data.
Implements an event buffer system for storing event data.
Definition Event.h:42
std::vector< float > m_dx_
global direction x_
PropagatorStepWriter(const Config &cfg)
Constructor with.
std::vector< float > m_x_
global x_
std::vector< float > m_start_mom_
start momentum of the particle propagated
std::vector< float > m_start_pos_
start position of the particle propagated
TFile * m_output_file_
the output file name
std::vector< float > m_hit_x_
hit location X
std::vector< float > m_z_
global z_
std::vector< float > m_y_
global y_
std::mutex m_write_mutex_
protect multi-threaded writes
std::vector< float > m_step_abt_
aborter
std::vector< float > m_hit_y_
hit location Y
std::vector< float > m_hit_z_
hit location Z
std::vector< int > m_approach_id_
surface identifier
Config m_cfg_
the configuration object
std::vector< int > m_sensitive_id_
surface identifier
std::vector< float > m_dz_
global direction z_
std::vector< float > m_dy_
global direction y_
std::vector< float > m_step_act_
actor check
std::vector< int > m_boundary_id_
boundary identifier
std::vector< int > m_layer_id_
layer identifier if
std::vector< float > m_step_acc_
accuracy
std::vector< int > m_step_type_
step type
The measurement calibrator can be a function or a class/struct able to retrieve the sim hits containe...
std::string tree_name_
name of the output tree
std::string file_path_
path of the output file