Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
Track.h
1/*
2 * Track.h
3 *
4 * Created on: 04-05-2022
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#ifndef HALTRACK_H_
11#define HALTRACK_H_
12
13#include "V0Track.h"
14#include "XiTrack.h"
15
16#include "Link.h"
17
18#include <TLorentzVector.h>
19
20#include <vector>
21
22namespace Hal {
23 class Event;
24 class CompressionMap;
25
29 class Track : public TObject {
30 friend class Event;
31
32 protected:
37 TLorentzVector fP;
38 Int_t fID;
39 Int_t fStatus;
40 Int_t fHiddenInfo;
41 Int_t fMotherID;
42 Int_t fThisID;
43 UInt_t fType;
44 Float_t fCharge;
45 enum ETrackBits {
46 kPrimary = 0,
47 kV0 = 1,
48 kXi = 2,
49 kGlobal = 3,
50 kMother = 4, // set if mother is known (and its secondary)
51 kV0Daughters = 5, // set if v0 and daughters are known
52 kXiDaughters = 6 // set if xi and daughters are known
53 };
59 Float_t GetV0IfPossible(Int_t fieldId) const;
60
61 public:
62 Track();
67 Track(const Track& track);
73 Track& operator=(const Track& track) = default;
78 inline void SetThisID(Int_t id) { fThisID = id; };
83 inline Int_t GetThisID() const { return fThisID; };
89 inline void SetIDs(Int_t id) { fThisID = fID = id; }
94 inline Int_t GetHiddenInfoIndex() const { return fHiddenInfo; };
99 inline Double_t GetPx() const { return fP.Px(); };
104 inline Double_t GetPy() const { return fP.Py(); };
109 inline Double_t GetPz() const { return fP.Pz(); };
114 inline Double_t GetE() const { return fP.E(); };
118 inline const TLorentzVector& GetMomentum() const { return fP; };
125 virtual void Boost(Double_t vx, Double_t vy, Double_t vz);
129 virtual void Print(Option_t* option = "") const;
134 inline void SetCharge(Double_t charge) { fCharge = charge; };
139 inline void SetID(Int_t id) { fID = id; };
144 inline void SetStatus(Int_t status) { fStatus = status; };
152 inline void SetMomentum(Double_t px, Double_t py, Double_t pz, Double_t e) { fP.SetPxPyPzE(px, py, pz, e); }
158 void EnableV0(Bool_t v0, Bool_t daughters = kTRUE);
159
165 void EnableXi(Bool_t xi, Bool_t daughters = kTRUE);
170 inline void SetMotherIndex(Int_t index) {
171 CLRBIT(fType, kPrimary);
172 if (index >= 0) SETBIT(fType, kMother);
173 fMotherID = index;
174 };
179 inline Double_t GetMass() const { return fP.M(); };
184 inline Double_t GetCharge() const { return fCharge; };
189 inline Int_t GetHiddenInfoId() const { return fHiddenInfo; };
194 virtual Int_t GetID() const { return fID; };
199 inline Int_t GetStatus() const { return fStatus; };
204 inline Int_t GetMotherIndex() const { return fMotherID; };
209 inline Bool_t IsPrimary() const { return TESTBIT(fType, kPrimary); };
214 inline Bool_t IsGoodSecondary() const { return TESTBIT(fType, kMother); };
219 inline Bool_t IsGoodV0() const { return TESTBIT(fType, kV0Daughters); };
225 inline Bool_t IsGoodXi() const { return TESTBIT(fType, kXiDaughters); }
230 inline Bool_t IsGlobal() const { return TESTBIT(fType, kGlobal); };
235 V0Track* GetV0Info() const;
240 XiTrack* GetXiInfo() const;
245 inline void SetGlobal(Bool_t global = kTRUE) {
246 if (global)
247 SETBIT(fType, kGlobal);
248 else
249 CLRBIT(fType, kGlobal);
250 };
254 inline void ClearType() { fType = 0; };
259 void SetMass(Double_t mass);
263 void SetPrimary();
268 void SetSecondary(Bool_t parent);
273 void TranslateLinks(const CompressionMap& map);
278 inline Bool_t IsV0() const { return TESTBIT(fType, kV0); };
283 inline Bool_t IsXi() const { return TESTBIT(fType, kXi); };
289 virtual void CopyData(Track* other);
294 virtual void CopyAllData(Track* other);
299 virtual void Clear(Option_t* opt = "");
305 virtual void ResetTrack(Int_t thisID = -1, Event* event = nullptr);
310 virtual void RotateZ(Double_t angle);
315 Event* GetEvent() const { return fEvent; };
320 std::vector<int> GetLinks() const;
327 virtual Int_t GetLinksFast(std::vector<int>& vec, Bool_t fast = kTRUE) const;
332 virtual void SetLinks(std::vector<int>& vec);
337 void SetEvent(Event* event) { fEvent = event; };
343 virtual Float_t GetFieldVal(Int_t fieldID) const;
349 virtual TString GetFieldName(Int_t fieldID) const;
350 virtual ~Track();
351 ClassDef(Track, 1)
352 };
353} // namespace Hal
354
355#endif /* HALTRACK_H_ */
void SetCharge(Double_t charge)
Definition Track.h:134
virtual Int_t GetID() const
Definition Track.h:194
Int_t GetHiddenInfoIndex() const
Definition Track.h:94
Double_t GetPz() const
Definition Track.h:109
virtual void Print(Option_t *option="") const
Definition Track.cxx:26
Bool_t IsGlobal() const
Definition Track.h:230
virtual void ResetTrack(Int_t thisID=-1, Event *event=nullptr)
Definition Track.cxx:295
Track & operator=(const Track &track)=default
Bool_t IsPrimary() const
Definition Track.h:209
void EnableV0(Bool_t v0, Bool_t daughters=kTRUE)
Definition Track.cxx:192
Int_t GetThisID() const
Definition Track.h:83
virtual void SetLinks(std::vector< int > &vec)
Definition Track.cxx:145
Float_t GetV0IfPossible(Int_t fieldId) const
Definition Track.cxx:304
void SetThisID(Int_t id)
Definition Track.h:78
Int_t GetStatus() const
Definition Track.h:199
void EnableXi(Bool_t xi, Bool_t daughters=kTRUE)
Definition Track.cxx:327
Event * GetEvent() const
Definition Track.h:315
void SetGlobal(Bool_t global=kTRUE)
Definition Track.h:245
Double_t GetPx() const
Definition Track.h:99
V0Track * GetV0Info() const
Definition Track.cxx:290
void ClearType()
Definition Track.h:254
Double_t GetMass() const
Definition Track.h:179
Int_t GetHiddenInfoId() const
Definition Track.h:189
Bool_t IsXi() const
Definition Track.h:283
void SetMass(Double_t mass)
Definition Track.cxx:177
const TLorentzVector & GetMomentum() const
Definition Track.h:118
void SetID(Int_t id)
Definition Track.h:139
Bool_t IsV0() const
Definition Track.h:278
virtual void RotateZ(Double_t angle)
Definition Track.cxx:325
Bool_t IsGoodV0() const
Definition Track.h:219
void TranslateLinks(const CompressionMap &map)
Definition Track.cxx:129
void SetSecondary(Bool_t parent)
Definition Track.cxx:183
TLorentzVector fP
don't stream it will be build on the fly
Definition Track.h:37
virtual void Boost(Double_t vx, Double_t vy, Double_t vz)
Definition Track.cxx:33
virtual void CopyData(Track *other)
Definition Track.cxx:40
Event * fEvent
Definition Track.h:36
void SetStatus(Int_t status)
Definition Track.h:144
void SetEvent(Event *event)
Definition Track.h:337
virtual Float_t GetFieldVal(Int_t fieldID) const
Definition Track.cxx:206
virtual TString GetFieldName(Int_t fieldID) const
Definition Track.cxx:244
void SetIDs(Int_t id)
Definition Track.h:89
Bool_t IsGoodXi() const
Definition Track.h:225
Bool_t IsGoodSecondary() const
Definition Track.h:214
virtual void CopyAllData(Track *other)
Definition Track.cxx:60
Double_t GetPy() const
Definition Track.h:104
void SetMotherIndex(Int_t index)
Definition Track.h:170
virtual void Clear(Option_t *opt="")
Definition Track.cxx:281
Int_t GetMotherIndex() const
Definition Track.h:204
XiTrack * GetXiInfo() const
Definition Track.cxx:341
std::vector< int > GetLinks() const
Definition Track.cxx:78
void SetMomentum(Double_t px, Double_t py, Double_t pz, Double_t e)
Definition Track.h:152
Double_t GetE() const
Definition Track.h:114
Double_t GetCharge() const
Definition Track.h:184
void SetPrimary()
Definition Track.cxx:35
virtual Int_t GetLinksFast(std::vector< int > &vec, Bool_t fast=kTRUE) const
Definition Track.cxx:84