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 filePath = "";
36 std::string fileMode = "RECREATE";
37 std::string treeName = "propagation_steps";
38 TFile* rootFile = 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_writeMutex;
57 TFile* m_outputFile;
58 TTree* m_outputTree;
60
61 // std::vector<int> m_volumeID; ///< volume identifier
62 std::vector<int> m_boundaryID;
63 std::vector<int> m_layerID;
64 std::vector<int> m_approachID;
65 std::vector<int> m_sensitiveID;
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:41
std::vector< int > m_boundaryID
boundary identifier
std::vector< int > m_step_type
step type
std::vector< float > m_step_act
actor check
std::vector< float > m_hit_x
hit location X
TFile * m_outputFile
the output file name
std::vector< int > m_sensitiveID
surface identifier
std::vector< float > m_dz
global direction z
std::vector< float > m_hit_z
hit location Z
std::vector< int > m_approachID
surface identifier
std::vector< float > m_dx
global direction x
std::vector< float > m_start_pos
start position of the particle propagated
std::vector< float > m_dy
global direction y
std::vector< int > m_layerID
layer identifier if
std::vector< float > m_start_mom
start momentum of the particle propagated
std::vector< float > m_step_acc
accuracy
std::vector< float > m_step_abt
aborter
std::mutex m_writeMutex
protect multi-threaded writes
std::vector< float > m_hit_y
hit location Y
Config m_cfg
the configuration object
The measurement calibrator can be a function or a class/struct able to retrieve the sim hits containe...
std::string filePath
path of the output file
std::string treeName
name of the output tree