Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
McTrack.cxx
1/*
2 * TrackMC.cxx
3 *
4 * Created on: 1 kwi 2017
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "McTrack.h"
10#include "DataFormat.h"
11namespace Hal {
12 McTrack::McTrack() : Track(), fPDG(0) {}
13
14 McTrack::~McTrack() {}
15
16 void McTrack::Boost(Double_t x, Double_t y, Double_t z) {
17 Track::Boost(x, y, z);
18 fFreez.Boost(x, y, z);
19 }
20
21 void McTrack::CopyData(Track* other) {
22 Track::CopyData(other);
23 fFreez = ((McTrack*) other)->fFreez;
24 fStart = ((McTrack*) other)->fStart;
25 fPDG = ((McTrack*) other)->fPDG;
26 }
27
28 Float_t McTrack::GetFieldVal(Int_t fieldID) const {
29 switch (fieldID) {
30 case DataFieldID::Track::EMc::kXfr: return fFreez.X(); break;
31 case DataFieldID::Track::EMc::kYfr: return fFreez.Y(); break;
32 case DataFieldID::Track::EMc::kZfr: return fFreez.Z(); break;
33 case DataFieldID::Track::EMc::kTfr: return fFreez.T(); break;
34 case DataFieldID::Track::EMc::kXstar: return fStart.X(); break;
35
36 case DataFieldID::Track::EMc::kYstart: return fStart.Y(); break;
37 case DataFieldID::Track::EMc::kZstart: return fStart.Z(); break;
38 case DataFieldID::Track::EMc::kTstart: return fStart.T(); break;
39 case DataFieldID::Track::EMc::kPdg: return GetPdg(); break;
40 case DataFieldID::Track::EMc::kXYstart: return fStart.Pt(); break;
41
42 case DataFieldID::Track::EMc::kXYfr: return fFreez.Pt(); break;
43 }
44 return Track::GetFieldVal(fieldID);
45 }
46
47 TString McTrack::GetFieldName(Int_t fieldID) const {
48 switch (fieldID) {
49 case DataFieldID::Track::EMc::kXfr: return "X_{fr} [fm]"; break;
50 case DataFieldID::Track::EMc::kYfr: return "Y_{fr} [fm]"; break;
51 case DataFieldID::Track::EMc::kZfr: return "Z_{fr} [fm]"; break;
52 case DataFieldID::Track::EMc::kTfr: return "T_{fr} [fm/c]"; break;
53 case DataFieldID::Track::EMc::kXstar: return "X_{start} [cm]"; break;
54
55 case DataFieldID::Track::EMc::kYstart: return "T_{start} [cm]"; break;
56 case DataFieldID::Track::EMc::kZstart: return "Z_{start} [cm]"; break;
57 case DataFieldID::Track::EMc::kTstart: return "T_{start} [ns]"; break;
58 case DataFieldID::Track::EMc::kPdg: return "Pdg [AU]"; break;
59 case DataFieldID::Track::EMc::kXYstart: return "XY_{start} [cm]"; break;
60
61 case DataFieldID::Track::EMc::kXYfr: return "XY_{fr} [fm]"; break;
62 }
63 return Track::GetFieldName(fieldID);
64 }
65
66 void McTrack::RotateZ(Double_t phi) {
67 Track::RotateZ(phi);
68 fFreez.RotateZ(phi);
69 fStart.RotateZ(phi);
70 }
71
72} // namespace Hal