-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCRPropaROOTOutput.h
More file actions
118 lines (98 loc) · 2.98 KB
/
CRPropaROOTOutput.h
File metadata and controls
118 lines (98 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/// ROOT Output Plugin for crpropa
/// Originally by Tobias Winchen
// Updated by Cosmin Deaconu <cozzyd@kicp.uchicago.edu> 2020
#include <crpropa/Module.h>
#include <TFile.h>
#include <TTree.h>
#include <TThread.h>
#include <omp.h>
/**
@class ROOTTrajectoryOutput1D
@brief Saves 1D trajectory information to a ROOT file.
*/
class ROOTTrajectoryOutput1D: public crpropa::Module {
mutable TFile *ROOTFile;
mutable TTree *Tree;
mutable int Particle_Type;
mutable float Energy_EeV;
mutable float Position_Mpc;
public:
ROOTTrajectoryOutput1D(std::string filename);
~ROOTTrajectoryOutput1D();
void process(crpropa::Candidate *candidate) const;
mutable omp_lock_t lock;
void close();
};
/**
@class ROOTTrajectoryOutput3D
@brief Saves 3D trajectory information to a ROOT file.
*/
class ROOTTrajectoryOutput3D: public crpropa::Module {
mutable TFile *ROOTFile;
mutable TTree *Tree;
mutable int Particle_Type;
mutable float Energy_EeV;
mutable float TrajectoryLength_Mpc;
mutable float Position_X_Mpc, Position_Y_Mpc, Position_Z_Mpc;
mutable float Direction_X_Mpc, Direction_Y_Mpc, Direction_Z_Mpc;
public:
ROOTTrajectoryOutput3D(std::string filename);
~ROOTTrajectoryOutput3D();
void process(crpropa::Candidate *candidate) const;
mutable omp_lock_t lock;
void close();
};
/**
@class ROOTEventOutput1D
@brief Saves 1D event information to a ROOT file.
*/
class ROOTEventOutput1D: public crpropa::Module {
mutable TFile *ROOTFile;
mutable TTree *Tree;
mutable int Particle_Type, Initial_Type;
mutable float Energy_EeV, Initial_Energy_EeV;
mutable float TrajectoryLength_Mpc;
public:
ROOTEventOutput1D(std::string filename);
~ROOTEventOutput1D();
void process(crpropa::Candidate *candidate) const;
mutable omp_lock_t lock;
void close();
};
/**
@class ROOTEventOutput3D
@brief Saves 3D event information to a ROOT file.
*/
class ROOTEventOutput3D: public crpropa::Module {
mutable TFile *ROOTFile;
mutable TTree *Tree;
mutable int Particle_Type, Initial_Type;
mutable float Momentum_E_EeV, Initial_Momentum_E_EeV;
mutable float TrajectoryLength_Mpc;
mutable float Position_X_Mpc, Position_Y_Mpc, Position_Z_Mpc;
mutable float Initial_Position_X_Mpc, Initial_Position_Y_Mpc, Initial_Position_Z_Mpc;
mutable float Direction_X_Mpc, Direction_Y_Mpc, Direction_Z_Mpc;
public:
ROOTEventOutput3D(std::string filename);
~ROOTEventOutput3D();
void process(crpropa::Candidate *candidate) const;
mutable omp_lock_t lock;
void close();
};
/**
@class ROOTPhotonOutput1D
@brief Records EM-particles to a ROOT file.
*/
class ROOTPhotonOutput1D: public crpropa::Module {
mutable TFile *ROOTFile;
mutable TTree *Tree;
mutable int Particle_Type, Initial_Type, Parent_Type;
mutable float Energy_EeV, Initial_Energy_EeV, Parent_Energy_EeV;
mutable float ComovingDistance_Mpc;
public:
ROOTPhotonOutput1D(std::string filename);
~ROOTPhotonOutput1D();
void process(crpropa::Candidate *candidate) const;
mutable omp_lock_t lock;
void close();
};