-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathTrackDetails.h
143 lines (121 loc) · 3.99 KB
/
TrackDetails.h
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#include "TFile.h"
#include "TTree.h"
#include "TMath.h"
#include "TF1.h"
#include "TVector3.h"
// - Bayeux
#include "bayeux/dpp/base_module.h"
#include "bayeux/mctools/simulated_data.h"
#include "bayeux/genbb_help/primary_particle.h"
#include "bayeux/genbb_help/primary_event.h"
#include "bayeux/datatools/service_manager.h"
#include "bayeux/geomtools/manager.h"
#include "bayeux/geomtools/geometry_service.h"
#include "bayeux/geomtools/line_3d.h"
#include "bayeux/geomtools/helix_3d.h"
#include "bayeux/geomtools/geomtools.h"
// - Falaise
#include "falaise/snemo/datamodels/calibrated_data.h"
#include "falaise/snemo/datamodels/tracker_clustering_data.h"
#include "falaise/snemo/datamodels/tracker_clustering_solution.h"
#include "falaise/snemo/datamodels/particle_track_data.h"
const double ELECTRON_MASS=0.5109989461; // From pdg, in MeV
const double LIGHT_SPEED=299792458 * 1e-9 * 1000; // Millimeters per nanosecond
const double FOIL_CELL_GAP=30.838; // From the foil to the first cell in mm
class TrackDetails{
TVector3 foilmostVertex_ ;
TVector3 direction_;
bool vertexOnFoil_=false;
bool vertexInTracker_=false;
TVector3 projectedVertex_;
enum Particle { ELECTRON, GAMMA, ALPHA, UNKNOWN };
Particle particleType_=UNKNOWN;
double mainwallFraction_=0;
double xwallFraction_=0;
double vetoFraction_=0;
int firstHitType_=-1;
double energy_=0;
double energySigma_=0;
double time_=0;
double timeSigma_=0;
int charge_=1;
bool makesTrack_=false;
snemo::datamodel::particle_track track_;
double delayTime_=0 ;
int trackerHitCount_= 0;
double trackLength_= 0;
double trackLengthSigma_=0;
double projectedLength_=0;
bool crossesFoil_=false;
const geomtools::manager* geometry_manager_;
bool hasTrack_=false;
bool SetFoilmostVertex();
bool SetDirection();
bool SetProjectedVertex();
bool PopulateCaloHits();
double GetTotalTimeVariance(double thisTrackLength);
public:
// SuperNEMO constants
int MAINWALL=1302;
int XWALL=1232;
int GVETO=1252;
double MAXY=2505.494; // This is the calo position but maybe it should be the end of the actual foils?
double MAXZ=1400; // This is not exact! Get the real value!
TrackDetails();
TrackDetails(const geomtools::manager* geometry_manager_, snemo::datamodel::particle_track track);
void Initialize(const geomtools::manager* geometry_manager_,snemo::datamodel::particle_track track);
bool Initialize();
bool IsGamma();
bool IsAlpha();
bool IsElectron();
bool IsNegativeElectron();
bool IsPositron();
bool MakesTrack();
// Charge
int GetCharge();
// Where did it hit?
bool HitMainwall();
bool HitXwall();
bool HitGammaVeto();
int GetFirstHitType();
// Energies
double GetEnergy();
double GetEnergySigma();
double GetTime();
double GetTimeSigma();
double GetMainwallFraction();
double GetXwallFraction();
double GetVetoFraction();
double GetBeta(); // Fraction of light speed
double GetProjectedTimeVariance();
double GetTotalTimeVariance();
// Foilmost vertex
double GetFoilmostVertexX();
double GetFoilmostVertexY();
double GetFoilmostVertexZ();
TVector3 GetFoilmostVertex();
bool HasFoilVertex();
bool HasTrackerVertex();
bool TrackCrossesFoil();
// Direction at foilmost end
double GetDirectionX();
double GetDirectionY();
double GetDirectionZ();
TVector3 GetDirection();
// Foil-projected vertex
double GetProjectedVertexX();
double GetProjectedVertexY();
double GetProjectedVertexZ();
TVector3 GetProjectedVertex();
// For charged particle tracks
double GetTrackLength();
double GetTrackLengthSigma();
double GetProjectedTrackLength();
int GetTrackerHitCount();
double GetDelayTime();
// For gammas, we need an electron track to calculate an assumed length
double GenerateGammaTrackLengths(TrackDetails *electronTrack);
TVector3 GenerateGammaTrackDirection(TrackDetails *electronTrack);
// And the same for alpha projections in a 1e1alpha topology
bool GenerateAlphaProjections(TrackDetails *electronTrack);
};