BmnRoot
Loading...
Searching...
No Matches
BmnGlobalTrack.cxx
Go to the documentation of this file.
1// -------------------------------------------------------------------------
2// ----- BmnGlobalTrack source file -----
3// ----- Created S. Merts -----
4// -------------------------------------------------------------------------
5#include "BmnGlobalTrack.h"
6
7#include <iostream>
8
9using std::cout;
10using std::endl;
11
12// ----- Default constructor -------------------------------------------
14 : fGemTrack(-1)
15 , fSsdTrack(-1)
16 , fSilTrack(-1)
17 , fTof1Hit(-1)
18 , fTof2Hit(-1)
19 , fDch1Track(-1)
20 , fDch2Track(-1)
21 , fDchTrack(-1)
22 , fScWallCellId(-1)
23 , fScWallSignal(-1000.0)
24 , fBeta400(-1000.0)
25 , fBeta700(-1000.0)
26 , fdQdNUpper(0.0)
27 , fdQdNLower(0.0)
28 , fA(-1)
29 , fZ(0)
30 , fPDG(0)
31 , fIsPrimary(kTRUE)
32{
33 fCscHit.resize(5);
34 for (auto& idx : fCscHit)
35 idx = -1;
36}
37// -------------------------------------------------------------------------
38
39// ----- Destructor ----------------------------------------------------
41// -------------------------------------------------------------------------
42
43// ----- Public method Print -------------------------------------------
44// void BmnGlobalTrack::Print() const {
45
46// cout << endl << "MwpcTrack " << fMwpc1Track << ", SilHit " << fSilTrack << ", GemTrack " << fGemTrack << ", Tof1Hit "
47// << fTof1Hit << ", Tof2Hit " << fTof2Hit << ", DchTrack " << fDchTrack << endl;
48//}
49// -------------------------------------------------------------------------
50
51void BmnGlobalTrack::SetBeta(Double_t b, Int_t tofID)
52{
53 if (tofID == 1)
54 fBeta400 = b;
55 else if (tofID == 2)
56 fBeta700 = b;
57 ;
58}
59
60Double_t BmnGlobalTrack::GetMass2(Int_t tofID)
61{
62 // p^2/gamma^2/beta^2
63 Double_t beta = this->GetBeta(tofID);
64 if (beta < -999.0)
65 return -1000.0;
66 return TMath::Sq(this->GetP()) * (1 / beta / beta - 1);
67}
68
70{
71 FairTrackParam* par = this->GetParamFirst();
72 return par->GetTx() * this->GetPz();
73}
74
76{
77 FairTrackParam* par = this->GetParamFirst();
78 return par->GetTy() * this->GetPz();
79}
80
82{
83 FairTrackParam* par = this->GetParamFirst();
84 Double_t tx2 = TMath::Sq(par->GetTx());
85 Double_t ty2 = TMath::Sq(par->GetTy());
86 return this->GetP() / TMath::Sqrt(tx2 + ty2 + 1);
87}
88
90{
91 return TMath::ATan2(this->GetPt(), this->GetPz());
92}
93
95{
96 return TMath::ATan2(this->GetPy(), this->GetPx());
97}
98
100{
101 return TMath::Sqrt(this->GetPx() * this->GetPx() + this->GetPy() * this->GetPy());
102}
103
105{
106 return 0.5 * TMath::Log((this->GetP() + this->GetPz()) / (this->GetP() - this->GetPz()));
107}
108
110{
111 if (this->GetTof1HitIndex() != -1) {
112 Int_t maxInd = std::max_element(fPidTof400.begin(), fPidTof400.end()) - fPidTof400.begin();
113 return static_cast<PidParticles>(maxInd);
114 } else
115 return EndPidEnum;
116}
117
119{
120 if (this->GetTof2HitIndex() != -1) {
121 Int_t maxInd = std::max_element(fPidTof700.begin(), fPidTof700.end()) - fPidTof700.begin();
122 return static_cast<PidParticles>(maxInd);
123 } else
124 return EndPidEnum;
125}
126
128{
130 return GetParticleTof400();
131
132 Double_t maxTof400 = 0;
133 Double_t maxTof700 = 0;
134 if (this->GetTof1HitIndex() != -1)
135 maxTof400 = *std::max_element(fPidTof400.begin(), fPidTof400.end());
136 if (this->GetTof2HitIndex() != -1)
137 maxTof700 = *std::max_element(fPidTof700.begin(), fPidTof700.end());
138
139 if (maxTof400 < maxTof700)
140 return GetParticleTof700();
141 else
142 return GetParticleTof400();
143}
Double_t GetMass2(Int_t tofID)
Int_t GetTof2HitIndex() const
virtual ~BmnGlobalTrack()
PidParticles GetParticleTof400()
Double_t GetBeta(Int_t tofID) const
PidParticles GetParticle()
void SetBeta(Double_t b, Int_t tofID)
PidParticles GetParticleTof700()
Int_t GetTof1HitIndex() const
Double_t GetTheta()
FairTrackParam * GetParamFirst()
Definition BmnTrack.h:72
Double_t GetP()
Definition BmnTrack.h:80
PidParticles
@ EndPidEnum