Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
ExpTrack.cxx
1/*
2 * DetectedTrack.cxx
3 *
4 * Created on: 7 kwi 2017
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "ExpTrack.h"
10#include "DataFormat.h"
11#include "ExpEvent.h"
12#include "ToFTrack.h"
13#include "TpcTrack.h"
14namespace Hal {
15 ExpTrack::ExpTrack() : Track(), fNHits(0), fChi2(0), fTrackLenght(0) {}
16
17 void ExpTrack::SetGlobal(Bool_t global) {
18 if (global) {
19 CLRBIT(fType, kGlobal);
20 } else {
21 SETBIT(fType, kGlobal);
22 }
23 }
24
25 ExpTrack::~ExpTrack() {}
26
27 void ExpTrack::CopyData(Track* other) {
28 Track::CopyData(other);
29 ExpTrack* track = (ExpTrack*) other;
30 fNHits = track->fNHits;
31 fChi2 = track->fChi2;
32 fTrackLenght = track->fTrackLenght;
33 fDCA = track->fDCA;
34 }
35
36 void ExpTrackHelix::UpdateHelix() {
37 TVector3 pos = GetDCA() + GetEvent()->GetVertex()->Vect();
38 fHelix.SetParams(pos, GetMomentum().Vect(), GetCharge());
39 }
40
41 ExpTrackHelix::ExpTrackHelix() {}
42
43 ExpTrackHelix::~ExpTrackHelix() {}
44
45 void ExpTrackHelix::CopyData(Track* other) {
46 ExpTrack::CopyData(other);
47 ExpTrackHelix* track = (ExpTrackHelix*) other;
48 fHelix = track->fHelix;
49 }
50
51 Float_t ExpTrack::GetFieldVal(Int_t fieldID) const {
52 TpcTrack* tpc = static_cast<TpcTrack*>(GetDetTrack(DetectorID::kTPC));
53 ToFTrack* tof = static_cast<ToFTrack*>(GetDetTrack(DetectorID::kTOF));
54 switch (fieldID) {
55 case DataFieldID::Track::EExp::kChi2: return GetChi2(); break;
56 case DataFieldID::Track::EExp::kNHits: return GetNHits(); break;
57 case DataFieldID::Track::EExp::kTrackLenght: return GetTrackLenght(); break;
58 case DataFieldID::Track::EExp::kDcaX: return GetDCA().X(); break;
59 case DataFieldID::Track::EExp::kDcaY: return GetDCA().Y(); break;
60 case DataFieldID::Track::EExp::kDcaZ: return GetDCA().Z(); break;
61 case DataFieldID::Track::EExp::kDcaXY: return GetDCA().Pt(); break;
62 case DataFieldID::Track::EExp::kDca: return GetDCA().Mag(); break;
63 // only for detectors
64 case DataFieldID::Track::EExp::kTofM2: return tof->GetMass2(); break;
65 case DataFieldID::Track::EExp::kToFBeta: return tof->GetBeta(); break;
66 case DataFieldID::Track::EExp::kToFFlag: return tof->GetFlag(); break;
67 case DataFieldID::Track::EExp::kToFTime: return tof->GetTime(); break;
68 case DataFieldID::Track::EExp::kToFEnergy: return tof->GetEnergy(); break;
69
70 case DataFieldID::Track::EExp::kTpcDedx: return tpc->GetDeDx(); break;
71 case DataFieldID::Track::EExp::kTpcNHits: return tpc->GetNHits(); break;
72 case DataFieldID::Track::EExp::kTpcNsigmaPi: return tpc->GetSigmaPion(); break;
73 case DataFieldID::Track::EExp::kTpcNsigmaKa: return tpc->GetSigmaKaon(); break;
74 case DataFieldID::Track::EExp::kTpcNsigmaPr: return tpc->GetSigmaProton(); break;
75 case DataFieldID::Track::EExp::kTpcNsigmaEl: return tpc->GetSigmaElectron(); break;
76 }
77 return Track::GetFieldVal(fieldID);
78 }
79
80 TString ExpTrack::GetFieldName(Int_t fieldID) const {
81 switch (fieldID) {
82 case DataFieldID::Track::EExp::kChi2: return "#chi^{2} [AU]"; break;
83 case DataFieldID::Track::EExp::kNHits: return "Nhits [N]"; break;
84 case DataFieldID::Track::EExp::kTrackLenght: return "L_{track} [cm]"; break;
85 case DataFieldID::Track::EExp::kDcaX: return "DCA_{x} [cm]"; break;
86 case DataFieldID::Track::EExp::kDcaY: return "DCA_{Y} [cm]"; break;
87 case DataFieldID::Track::EExp::kDcaZ: return "DCA_{Z} [cm]"; break;
88 case DataFieldID::Track::EExp::kDcaXY: return "DCA_{XY} [cm]"; break;
89 case DataFieldID::Track::EExp::kDca: return "DCA [cm]"; break;
90 // only for detectors
91 case DataFieldID::Track::EExp::kTofM2: return "m^{2}_{ToF} [GeV^{2}/c^{4}]"; break;
92 case DataFieldID::Track::EExp::kToFBeta: return "#beta_{ToF} [c]"; break;
93 case DataFieldID::Track::EExp::kToFFlag: return "#Flag_{ToF} [AU]"; break;
94 case DataFieldID::Track::EExp::kToFTime: return "#T_{ToF} [AU]"; break;
95 case DataFieldID::Track::EExp::kToFEnergy: return "#E_{ToF} [GeV/c^{2}]"; break;
96
97 case DataFieldID::Track::EExp::kTpcDedx: return "dEdX_{TPC} [AU]"; break;
98 case DataFieldID::Track::EExp::kTpcNHits: return "#NHits_{TPC} [AU]"; break;
99 case DataFieldID::Track::EExp::kTpcNsigmaPi: return "n#sigma#pi_{TPC} [AU]"; break;
100 case DataFieldID::Track::EExp::kTpcNsigmaKa: return "n#sigma K_{TPC} [AU]"; break;
101 case DataFieldID::Track::EExp::kTpcNsigmaPr: return "n#sigma p_{TPC} [AU]"; break;
102 case DataFieldID::Track::EExp::kTpcNsigmaEl: return "n#sigma e_{TPC} [AU]"; break;
103 }
104 return Track::GetFieldName(fieldID);
105 }
106} // namespace Hal
Int_t GetFlag() const
Float_t GetEnergy() const
Definition ToFTrack.h:70
Float_t GetBeta() const
Definition ToFTrack.h:65
Float_t GetMass2() const
Definition ToFTrack.h:60
Float_t GetTime() const
Definition ToFTrack.h:54
Float_t GetSigmaPion() const
Definition TpcTrack.h:54
Float_t GetDeDx() const
Definition TpcTrack.h:94
Int_t GetNHits() const
Definition TpcTrack.h:49
Float_t GetSigmaProton() const
Definition TpcTrack.h:64
Float_t GetSigmaKaon() const
Definition TpcTrack.h:59
Float_t GetSigmaElectron() const
Definition TpcTrack.h:69