Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
OTFData.h
1/*
2 * OTFData.h
3 *
4 * Created on: 28 maj 2022
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#ifndef HAL_EXAMPLES_ONTHEFLY_OTFDATA_H_
10#define HAL_EXAMPLES_ONTHEFLY_OTFDATA_H_
11
12#include <Rtypes.h>
13#include <RtypesCore.h>
14#include <TClonesArray.h>
15#include <TLorentzVector.h>
16#include <TNamed.h>
17#include <TObjArray.h>
18#include <TVector3.h>
19
20namespace OTF {
21 class RecoTrack : public TObject {
22 TLorentzVector fMomentum;
23 Int_t fIndexMc;
24 Int_t fNHits;
25 Int_t fCharge;
26 Int_t fDaugthers[2] = {-1, -1};
27
28 public:
29 RecoTrack() : fIndexMc(-1), fNHits(0), fCharge(0) {};
30 Int_t GetMcIndex() const { return fIndexMc; }
31 Int_t GetNHits() const { return fNHits; }
32 Int_t GetCharge() const { return fCharge; }
33 void SetDaughers(Int_t a, Int_t b) {
34 fDaugthers[0] = a;
35 fDaugthers[1] = b;
36 }
37 void GetDaughters(Int_t& a, Int_t& b) {
38 a = fDaugthers[0];
39 b = fDaugthers[1];
40 }
41 void SetCharge(Int_t ch) { fCharge = ch; }
42 void SetMom(TLorentzVector mom) { fMomentum = mom; }
43 void SetNHits(Int_t nHits) { fNHits = nHits; }
44 void SetMcIndex(Int_t index) { fIndexMc = index; }
45 void SetMom(Double_t px, Double_t py, Double_t pz, Double_t e) { fMomentum.SetXYZT(px, py, pz, e); }
46 void Clear(Option_t* /*opt*/ = "") { fDaugthers[0] = fDaugthers[1] = -1; }
47 const TLorentzVector& GetMom() const { return fMomentum; }
48 virtual ~RecoTrack() {};
49 ClassDef(RecoTrack, 1)
50 };
51
52 class McTrack : public TObject {
53 TLorentzVector fMomentum;
54 TLorentzVector fFreezout;
55 Int_t fPdgCode;
56 Int_t fMotherIdx;
57
58 public:
59 McTrack() : fPdgCode(0), fMotherIdx(-1) {};
60 void SetMotherId(Int_t momId) { fMotherIdx = momId; }
61 void SetPdgCode(Int_t pdgCode) { fPdgCode = pdgCode; }
62 void SetFreezout(const TLorentzVector& freezout) { fFreezout = freezout; }
63 void SetMomentum(const TLorentzVector& momentum) { fMomentum = momentum; }
64 Int_t GetMotherId() const { return fMotherIdx; }
65 Int_t GetPdgCode() const { return fPdgCode; }
66 const TLorentzVector& GetFreezout() const { return fFreezout; }
67 const TLorentzVector& GetMomentum() const { return fMomentum; }
68 virtual ~McTrack() {};
69 ClassDef(McTrack, 1)
70 };
71
72 class RecoEvent : public TNamed {
73 TClonesArray* fTracks;
74 TVector3 fVertex;
75 Double_t fPhi = {0};
76
77 public:
78 RecoEvent() : fTracks(new TClonesArray("OTF::RecoTrack")) {};
79 RecoTrack* GetTrack(Int_t index) const { return (RecoTrack*) fTracks->UncheckedAt(index); };
80 const TVector3& GetVertex() const { return fVertex; }
81 void SetPhi(Double_t psi) { fPhi = psi; }
82 void SetVertex(const TVector3& vertex) { fVertex = vertex; }
83 void AddTrack(const RecoTrack& track);
84 void Clear(Option_t* /*option*/ = "") { fTracks->Clear(); };
85 Double_t GetPhi() const { return fPhi; }
86 Int_t GetNTracks() const { return fTracks->GetEntriesFast(); };
87 virtual ~RecoEvent() { delete fTracks; };
88 ClassDef(RecoEvent, 1)
89 };
90
91 class McEvent : public TNamed {
92 TClonesArray* fTracks;
93 Double_t fB;
94 Double_t fPhi = {0};
95
96 public:
97 McEvent() : fTracks(new TClonesArray("OTF::McTrack")), fB(0) {};
98 void SetPhi(Double_t psi) { fPhi = psi; }
99 void SetB(Double_t b) { fB = b; }
100 void Clear(Option_t* /*option*/ = "") { fTracks->Clear(); };
101 void AddTrack(const McTrack& track);
102 TClonesArray* GetArray() const { return fTracks; }
103 Int_t GetNTracks() const { return fTracks->GetEntriesFast(); };
104 Double_t GetB() const { return fB; };
105 Double_t GetPhi() const { return fPhi; }
106 McTrack* GetTrack(Int_t idx) const { return (McTrack*) fTracks->UncheckedAt(idx); };
107 virtual ~McEvent() { delete fTracks; };
108 ClassDef(McEvent, 1)
109 };
110
111
112} // namespace OTF
113
114#endif /* HAL_EXAMPLES_ONTHEFLY_OTFDATA_H_ */