RooParticle
Particle scattering simulator with ROOT
Loading...
Searching...
No Matches
path.hpp
Go to the documentation of this file.
1
3
4#ifndef H_PATH
5#define H_PATH 1;
6
7#include "TROOT.h"
8#include "RPConfig.hpp"
9#include "TVector3.h"
10#include "iostream"
11
12#include "list"
13
14using namespace std;
15
37class path{
38public:
40 path();
42 path(const path& path_);
44 ~path();
51 void AddRecord(TVector3 x_, TVector3 v_, Double_t time_);
52
54 Int_t GetRecordSize(){return pos.size();}
55
60 TVector3 GetRecordX(Int_t i);
62 TVector3 GetRecordV(Int_t i);
66 Double_t GetRecordT(Int_t i);
73 void GetRecord(Int_t i, TVector3 & x_, TVector3 & v_, Double_t & t_);
74
76 TVector3 GetInitX();
78 TVector3 GetInitV();
80 Double_t GetInitT();
85 void GetInit(TVector3 & x_, TVector3 & v_, Double_t & t_);
86
89 TVector3 GetLastX();
91 TVector3 GetLastV();
93 Double_t GetLastT();
98 void GetLast(TVector3 & x_, TVector3 & v_, Double_t & t_);
99
127 void GetDCA(const TVector3 pos_, Double_t & DCA, Double_t & outtime, Bool_t verbose=false, Bool_t interpolate=true);
150 void GetDCA(path* timepath, Double_t & DCA, Double_t & outtime, Bool_t verbose=false, Bool_t interpolate=true);
152 Long64_t GetMaxNumber(){return t.size();}
153 // Double_t GetDCA(const TVector3 pos);
154 // Double_t GetDCA(path* timepath);
155protected:
157 Bool_t lengthChk(path* target);
159 Bool_t timeChk(path* target);
160
161private:
162 // Int_t writingCursor = 0;
163 std::vector<TVector3> pos;
164 std::vector<TVector3> vel;
165 std::vector<Double_t> t;
166};
167
168#endif
Compile-time limits and default tolerances (macros).
Time-ordered list of (position, velocity, time) samples of one particle.
Definition path.hpp:37
Bool_t lengthChk(path *target)
True if target has the same number of records; otherwise prints a message on std::cerr and returns fa...
Definition path.cpp:246
void GetInit(TVector3 &x_, TVector3 &v_, Double_t &t_)
First record as position (fm), velocity (c) and time (fm/c).
Definition path.cpp:106
Double_t GetLastT()
Time of the last stored record (fm/c); 0 plus message if empty.
Definition path.cpp:130
TVector3 GetRecordV(Int_t i)
Velocity of record i (c); same failure behaviour as GetRecordX().
Definition path.cpp:57
std::vector< TVector3 > pos
positions (fm)
Definition path.hpp:163
TVector3 GetRecordX(Int_t i)
Position of record i (fm).
Definition path.cpp:48
path()
Create an empty path.
Definition path.cpp:12
std::vector< TVector3 > vel
velocities (c)
Definition path.hpp:164
std::vector< Double_t > t
times (fm/c)
Definition path.hpp:165
Bool_t timeChk(path *target)
True if target has the same length and exactly equal times in every record; prints a message on std::...
Definition path.cpp:256
Int_t GetRecordSize()
Number of stored records (size of the position vector).
Definition path.hpp:54
void GetDCA(const TVector3 pos_, Double_t &DCA, Double_t &outtime, Bool_t verbose=false, Bool_t interpolate=true)
Distance of closest approach of this path to a fixed point.
Definition path.cpp:181
TVector3 GetLastV()
Velocity of the last stored record (c); null vector plus message if empty.
Definition path.cpp:122
void GetRecord(Int_t i, TVector3 &x_, TVector3 &v_, Double_t &t_)
Position, velocity and time of record i in one call.
Definition path.cpp:73
TVector3 GetLastX()
Position of the last stored record (fm); null vector plus message if empty.
Definition path.cpp:114
void GetLast(TVector3 &x_, TVector3 &v_, Double_t &t_)
Last stored record as position (fm), velocity (c) and time (fm/c).
Definition path.cpp:138
Long64_t GetMaxNumber()
Number of stored time stamps (as a 64-bit integer); equals GetRecordSize().
Definition path.hpp:152
TVector3 GetInitX()
Position of the first record (fm); null vector plus message if the path is empty.
Definition path.cpp:82
void AddRecord(TVector3 x_, TVector3 v_, Double_t time_)
Append one record at the end.
Definition path.cpp:42
~path()
Destructor: clears the records.
Definition path.cpp:32
Double_t GetRecordT(Int_t i)
Time of record i (fm/c).
Definition path.cpp:65
TVector3 GetInitV()
Velocity of the first record (c); null vector plus message if the path is empty.
Definition path.cpp:90
Double_t GetInitT()
Time of the first record (fm/c); 0 plus message if the path is empty.
Definition path.cpp:98