12#ifndef ALICEO2_BASE_TRACKREFERENCE_H_
13#define ALICEO2_BASE_TRACKREFERENCE_H_
15#include <TVirtualMC.h>
40 if (vmc.IsTrackEntering()) {
43 if (vmc.IsTrackExiting()) {
46 if (vmc.IsTrackInside()) {
49 if (vmc.IsTrackOut()) {
52 if (vmc.IsTrackStop()) {
55 if (vmc.IsNewTrack()) {
58 if (vmc.IsTrackAlive()) {
74 unsigned char mStatus = 0;
110 float R()
const {
return TMath::Sqrt(mX * mX + mY * mY); }
112 float Pt()
const {
return TMath::Sqrt(mPX * mPX + mPY * mPY); }
113 float PhiPos()
const {
return TMath::ATan2(mY, mX); }
114 float Phi()
const {
return TMath::ATan2(mPY, mPX); }
115 float Theta()
const {
return TMath::ACos(mPZ /
P()); }
116 float X()
const {
return mX; }
117 float Y()
const {
return mY; }
118 float Z()
const {
return mZ; }
119 float Px()
const {
return mPX; }
120 float Py()
const {
return mPY; }
121 float Pz()
const {
return mPZ; }
122 float P()
const {
return TMath::Sqrt(mPX * mPX + mPY * mPY + mPZ * mPZ); }
145 float phiPosition()
const {
return TMath::Pi() + TMath::ATan2(-mY, -mX); }
147 float Alpha()
const {
return TMath::Pi() * (20 * ((((Int_t)(
phiPosition() * 180 / TMath::Pi())) / 20)) + 10) / 180.; }
152 return mX * TMath::Cos(-
alpha) - mY * TMath::Sin(-
alpha);
158 return mX * TMath::Sin(-
alpha) + mY * TMath::Cos(-
alpha);
164 Int_t mTrackNumber = 0;
171 float mTrackLength = 0;
174 Int_t mDetectorId = 0;
185 int trackID,
int detlabel)
186 : mTrackNumber(trackID),
195 mDetectorId(detlabel)
207 vmc.TrackPosition(
x,
y,
z);
208 vmc.TrackMomentum(px, py, pz, e);
215 mTrackLength = vmc.TrackLength();
216 mTof = vmc.TrackTime();
217 mDetectorId = detlabel;
218 mTrackNumber = vmc.GetStack()->GetCurrentTrackNumber();
223 os <<
"TrackRef (" <<
a.mTrackNumber <<
"): X[" <<
a.mX <<
" , " <<
a.mY <<
" , " <<
a.mZ <<
"]"
224 <<
"; P[ " <<
a.mPX <<
" , " <<
a.mPY <<
" , " <<
a.mPZ <<
" ] "
225 <<
"; Length = " <<
a.mTrackLength <<
" ; TOF = " <<
a.mTof <<
" ; DetID = " <<
a.mDetectorId
226 <<
"; Status = " <<
a.mStatus;
232 os << status.mStatus;
const SimTrackStatus & getTrackStatus() const
float phiPosition() const
void setUserId(Int_t userId)
void setDetectorId(Int_t id)
~TrackReference()=default
Default Destructor.
Int_t getDetectorId() const
TrackReference()=default
Default Constructor.
friend std::ostream & operator<<(std::ostream &, const TrackReference &)
void setPosition(float x, float y, float z)
void setMomentum(float px, float py, float pz)
void setTrackID(Int_t track)
void setLength(float length)
GLfloat GLfloat GLfloat alpha
GLuint GLsizei GLsizei * length
GLboolean GLboolean GLboolean GLboolean a
GLdouble GLdouble GLdouble z
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::ostream & operator<<(std::ostream &stream, o2::InteractionRecord const &ir)
SimTrackStatus(const TVirtualMC &vmc)
unsigned char getStatusWord() const
friend std::ostream & operator<<(std::ostream &, const SimTrackStatus &)