12#include "CompressionMap.h"
14#include "DataFormat.h"
24 TObject(), fEvent(nullptr), fID(0), fStatus(0), fHiddenInfo(0), fMotherID(-1), fThisID(-1), fType(0), fCharge(0) {}
26 void Track::Print(Option_t* )
const {
27 Cout::Database({
"Px",
"Py",
"Pz"});
28 Cout::Database({Form(
"%4.5f", GetPx()), Form(
"%4.5f", GetPy()), Form(
"%4.5f", GetPz())});
33 void Track::Boost(Double_t vx, Double_t vy, Double_t vz) { fP.Boost(vx, vy, vz); }
35 void Track::SetPrimary() {
36 SETBIT(fType, kPrimary);
37 CLRBIT(fType, kMother);
40 void Track::CopyData(
Track* other) {
43 fStatus = other->fStatus;
44 fMotherID = other->fMotherID;
45 fCharge = other->fCharge;
49 fHiddenInfo = GetEvent()->fTotalV0s++;
50 V0Track* v0 = (
V0Track*) GetEvent()->fV0sHiddenInfo->ConstructedAt(fHiddenInfo);
54 fHiddenInfo = GetEvent()->fTotalXis++;
55 XiTrack* xi = (
XiTrack*) GetEvent()->fXisHiddenInfo->ConstructedAt(fHiddenInfo);
60 void Track::CopyAllData(
Track* other) {
62 fThisID = other->fThisID;
66 Track::Track(
const Track& track) : TObject(track) {
70 fStatus = track.fStatus;
71 fMotherID = track.fMotherID;
72 fThisID = track.fThisID;
74 fCharge = track.fCharge;
75 fHiddenInfo = track.fHiddenInfo;
79 std::vector<int> links;
96 vec[size++] = xi->GetV0Id();
97 vec[size++] = xi->GetChId();
98 int v0id = xi->GetV0Id();
100 if (v0track->IsGoodV0()) {
101 V0Track* v0 = v0track->GetV0Info();
116 vec.push_back(xi->GetV0Id());
117 vec.push_back(xi->GetChId());
119 if (v0track->IsGoodV0()) {
120 V0Track* v0 = v0track->GetV0Info();
125 return (
int) vec.size();
152 v0Info->SetPosId(vec[2]);
153 v0Info->SetNegId(vec[3]);
158 xiInfo->SetV0Id(vec[2]);
159 xiInfo->SetChId(vec[3]);
165 v0Info->SetPosId(vec[1]);
166 v0Info->SetNegId(vec[2]);
171 v0Info->SetV0Id(vec[1]);
172 v0Info->SetChId(vec[2]);
179 Double_t e = TMath::Sqrt(p * p + mass * mass);
184 CLRBIT(fType, kPrimary);
186 SETBIT(fType, kMother);
188 CLRBIT(fType, kMother);
196 SETBIT(fType, kV0Daughters);
198 CLRBIT(fType, kV0Daughters);
199 fHiddenInfo =
fEvent->fTotalV0s;
200 fEvent->fV0sHiddenInfo->ConstructedAt(
fEvent->fTotalV0s++);
208 case DataFieldID::Track::EBasic::kPx:
return fP.Px();
break;
209 case DataFieldID::Track::EBasic::kPy:
return fP.Py();
break;
210 case DataFieldID::Track::EBasic::kPz:
return fP.Pz();
break;
211 case DataFieldID::Track::EBasic::kE:
return fP.E();
break;
212 case DataFieldID::Track::EBasic::kPhi:
return fP.Phi();
break;
214 case DataFieldID::Track::EBasic::kPt:
return fP.Pt();
break;
215 case DataFieldID::Track::EBasic::kTheta:
return fP.Theta();
break;
216 case DataFieldID::Track::EBasic::kP:
return fP.P();
break;
217 case DataFieldID::Track::EBasic::kEta:
return fP.Eta();
break;
218 case DataFieldID::Track::EBasic::kRapidity:
return fP.Rapidity();
break;
220 case DataFieldID::Track::EBasic::kCharge:
return GetCharge();
break;
221 case DataFieldID::Track::EBasic::kStatus:
return GetStatus();
break;
222 case DataFieldID::Track::EBasic::kPq:
return GetCharge() *
fP.P();
break;
223 case DataFieldID::Track::EBasic::kTrackZero:
return 0;
break;
225 case DataFieldID::Track::EV0::kAssumedPdg:
return GetV0IfPossible(fieldID);
break;
226 case DataFieldID::Track::EV0::kAssumedPdgPos:
return GetV0IfPossible(fieldID);
break;
227 case DataFieldID::Track::EV0::kAssumedPdgNeg:
return GetV0IfPossible(fieldID);
break;
228 case DataFieldID::Track::EV0::kS1:
return GetV0IfPossible(fieldID);
break;
229 case DataFieldID::Track::EV0::kS2:
return GetV0IfPossible(fieldID);
break;
230 case DataFieldID::Track::EV0::kAlphaArm:
return GetV0IfPossible(fieldID);
break;
231 case DataFieldID::Track::EV0::kPtArm:
return GetV0IfPossible(fieldID);
break;
232 case DataFieldID::Track::EV0::kDauDist:
return GetV0IfPossible(fieldID);
break;
233 case DataFieldID::Track::EV0::kDecLenght:
return GetV0IfPossible(fieldID);
break;
234 case DataFieldID::Track::EV0::kCosAngle:
return GetV0IfPossible(fieldID);
break;
235 case DataFieldID::Track::EV0::kLambdaMass:
return GetV0IfPossible(fieldID);
break;
236 case DataFieldID::Track::EV0::kAntiLambdaMass:
return GetV0IfPossible(fieldID);
break;
237 case DataFieldID::Track::EV0::kK0Mass:
return GetV0IfPossible(fieldID);
break;
239 if (fieldID > DataFieldID::Internal::EventStart) {
return GetEvent()->
GetFieldVal(fieldID); }
246 case DataFieldID::Track::EBasic::kPx:
return "p_{x} [GeV/c]";
break;
247 case DataFieldID::Track::EBasic::kPy:
return "p_{y} [GeV/c]";
break;
248 case DataFieldID::Track::EBasic::kPz:
return "p_{z} [GeV/c]";
break;
249 case DataFieldID::Track::EBasic::kE:
return "E [GeV/c^{2}]";
break;
250 case DataFieldID::Track::EBasic::kPhi:
return "#phi [rad]";
break;
252 case DataFieldID::Track::EBasic::kPt:
return "p_{T} [GeV/c]";
break;
253 case DataFieldID::Track::EBasic::kTheta:
return "#theta [rad]";
break;
254 case DataFieldID::Track::EBasic::kP:
return "p [GeV/c]";
break;
255 case DataFieldID::Track::EBasic::kEta:
return "#eta [AU]";
break;
256 case DataFieldID::Track::EBasic::kRapidity:
return "y [AU]";
break;
258 case DataFieldID::Track::EBasic::kCharge:
return "q [e]";
break;
259 case DataFieldID::Track::EBasic::kStatus:
return "stat [AU]";
break;
260 case DataFieldID::Track::EBasic::kPq:
return "pq [GeV/c*e]";
break;
262 case DataFieldID::Track::EV0::kAssumedPdg:
return "V0_{pidHypo} [PDG]";
break;
263 case DataFieldID::Track::EV0::kAssumedPdgPos:
return "V0_{dau pos Hypo} [PDG]";
break;
264 case DataFieldID::Track::EV0::kAssumedPdgNeg:
return "V0_{dau neg Hypo} [PDG]";
break;
265 case DataFieldID::Track::EV0::kS1:
return "V0_{s1} [cm]";
break;
266 case DataFieldID::Track::EV0::kS2:
return "V0_{s2} [cm]";
break;
267 case DataFieldID::Track::EV0::kAlphaArm:
return "V0_{#alpha} [AU]";
break;
268 case DataFieldID::Track::EV0::kPtArm:
return "V0_{pT} [AU]";
break;
269 case DataFieldID::Track::EV0::kDauDist:
return "V0_{dau-dist} [cm]";
break;
270 case DataFieldID::Track::EV0::kDecLenght:
return "V0_{L} [cm]";
break;
271 case DataFieldID::Track::EV0::kCosAngle:
return "V0_{angle cos} [AU]";
break;
272 case DataFieldID::Track::EV0::kLambdaMass:
return "V0_{m#Lambda} [GeV/c^{2}]";
break;
273 case DataFieldID::Track::EV0::kAntiLambdaMass:
return "V0_{m#bar{#Lambda}} [GeV/c^{2}]";
break;
274 case DataFieldID::Track::EV0::kK0Mass:
return "V0_{K_{0}^{2}} [GeV/c^{2}]";
break;
277 Cout::PrintInfo(Form(
"Track::GetFieldName cannot find field with fieldID %i", fieldID), EInfo::kLowWarning);
291 if (!TESTBIT(fType, kV0))
return nullptr;
292 return (
V0Track*)
fEvent->fV0sHiddenInfo->UncheckedAt(fHiddenInfo);
306 if (tr ==
nullptr)
return Hal::Const::DummyVal();
308 case DataFieldID::Track::EV0::kAssumedPdg:
return tr->
GetPdg();
break;
309 case DataFieldID::Track::EV0::kAssumedPdgPos:
return tr->
GetPdgPosDau();
break;
310 case DataFieldID::Track::EV0::kAssumedPdgNeg:
return tr->
GetPdgNegDau();
break;
311 case DataFieldID::Track::EV0::kS1:
return tr->
GetS().first;
break;
312 case DataFieldID::Track::EV0::kS2:
return tr->
GetS().second;
break;
313 case DataFieldID::Track::EV0::kAlphaArm:
return tr->
GetAlphaArm();
break;
314 case DataFieldID::Track::EV0::kPtArm:
return tr->
GetPtArm();
break;
315 case DataFieldID::Track::EV0::kDauDist:
return tr->
GetDauDist();
break;
316 case DataFieldID::Track::EV0::kDecLenght:
return tr->
GetDecLength();
break;
317 case DataFieldID::Track::EV0::kCosAngle:
return tr->
GetCosAngle();
break;
318 case DataFieldID::Track::EV0::kLambdaMass:
return tr->
GetLambdaMass();
break;
319 case DataFieldID::Track::EV0::kAntiLambdaMass:
return tr->
GetAntiLambdaMass();
break;
320 case DataFieldID::Track::EV0::kK0Mass:
return tr->
GetK0Mass();
break;
331 SETBIT(fType, kXiDaughters);
333 CLRBIT(fType, kXiDaughters);
334 fHiddenInfo =
fEvent->fTotalXis;
335 fEvent->fXisHiddenInfo->ConstructedAt(
fEvent->fTotalXis++);
342 if (!TESTBIT(fType, kXi))
return nullptr;
343 return (
XiTrack*)
fEvent->fXisHiddenInfo->UncheckedAt(fHiddenInfo);
Int_t GetNewIndex(Int_t old_index) const
static void PrintInfo(TString text, Hal::EInfo status)
virtual Float_t GetFieldVal(Int_t fieldID) const
virtual TString GetFieldName(Int_t fieldID) const
Track * GetTrack(Int_t i) const
virtual void ResetTrack(Int_t thisID=-1, Event *event=nullptr)
void EnableV0(Bool_t v0, Bool_t daughters=kTRUE)
virtual void SetLinks(std::vector< int > &vec)
Float_t GetV0IfPossible(Int_t fieldId) const
void EnableXi(Bool_t xi, Bool_t daughters=kTRUE)
V0Track * GetV0Info() const
void SetMass(Double_t mass)
const TLorentzVector & GetMomentum() const
virtual void RotateZ(Double_t angle)
void TranslateLinks(const CompressionMap &map)
void SetSecondary(Bool_t parent)
TLorentzVector fP
don't stream it will be build on the fly
virtual Float_t GetFieldVal(Int_t fieldID) const
virtual TString GetFieldName(Int_t fieldID) const
Bool_t IsGoodSecondary() const
void SetMotherIndex(Int_t index)
virtual void Clear(Option_t *opt="")
Int_t GetMotherIndex() const
XiTrack * GetXiInfo() const
std::vector< int > GetLinks() const
Double_t GetCharge() const
virtual Int_t GetLinksFast(std::vector< int > &vec, Bool_t fast=kTRUE) const
Double_t GetK0Mass() const
Double_t GetDecLength() const
Double_t GetPtArm() const
virtual void CopyData(V0Track *v)
Double_t GetAntiLambdaMass() const
Double_t GetAlphaArm() const
Double_t GetDauDist() const
Int_t GetPdgNegDau() const
std::pair< Double_t, Double_t > GetS() const
Int_t GetPdgPosDau() const
Double_t GetLambdaMass() const
Double_t GetCosAngle() const