PandaRoot
PndMdtTrk.h
Go to the documentation of this file.
1 #ifndef PNDMDTTRK_HH
2 #define PNDMDTTRK_HH
3 
4 #include "FairHit.h"
5 #include "FairMultiLinkedData_Interface.h"
6 #include "PndTrackCand.h"
7 #include "PndDetectorList.h"
8 #include "TVector3.h"
9 
10 #include <iostream>
11 
12 using std::cout;
13 using std::endl;
14 
15 class PndMdtTrk : public FairMultiLinkedData_Interface {
16 
17  public:
18  PndMdtTrk();
19 
20  virtual ~PndMdtTrk();
21 
23  virtual void Print(const Option_t *opt = nullptr) const
24  {
25  std::cout << " opt = " << opt << std::endl;
26  return;
27  }
28 
32  void Clear();
33 
35  void GetHitList(Int_t *hit)
36  {
37  for (Int_t ii = 0; ii < 25; ii++)
38  hit[ii] = fHitList[ii];
39  };
40  void GetHitMult(Int_t *hit)
41  {
42  for (Int_t ii = 0; ii < 25; ii++)
43  hit[ii] = fHitMult[ii];
44  };
45  void GetHitDist(Float_t *hit)
46  {
47  for (Int_t ii = 0; ii < 25; ii++)
48  hit[ii] = fHitDist[ii];
49  };
50  void GetHitDeltaAngle(Float_t *hit)
51  {
52  for (Int_t ii = 0; ii < 25; ii++)
53  hit[ii] = fHitDeltaAngle[ii];
54  };
55  Int_t GetHitIndex(Int_t lay) const { return fHitList[lay]; };
56  Int_t GetHitMult(Int_t lay) const { return fHitMult[lay]; };
57  Float_t GetHitDist(Int_t lay) const { return fHitDist[lay]; };
58  Float_t GetHitDeltaAngle(Int_t lay) const { return fHitDeltaAngle[lay]; };
59  Float_t GetLayerDist(Int_t lay) const { return fLayDist[lay]; };
60  Float_t GetIronDist() const { return fIronDist; };
61  Int_t GetHitCount() const { return fHitCount; };
62  Int_t GetLayerCount() const { return fLayerCount; };
63  Int_t GetMaxLayer() const { return fMaxLayer; };
64  Int_t GetHitBit() const { return fHitBit; };
65  Int_t GetHitBit(Int_t lay) const { return (fHitBit & (1 << lay)); };
66  Int_t GetModule() const { return fModule; };
67  Float_t GetChi2() const { return fChi2; };
68 
69  PndTrackCand *AddTrackCand(const PndTrackCand *inTrackCand = new PndTrackCand());
70 
72  void SetHitIndex(Int_t lay, Int_t trackId);
73  void SetHitMult(Int_t lay, Int_t mult);
74  void SetHitDist(Int_t lay, Float_t dist);
75  void SetHitDeltaAngle(Int_t lay, Float_t angle);
76  void SetLayerDist(Int_t lay, Float_t dist);
77  void SetBit(Int_t lay) { fHitBit = fHitBit | (1 << lay); };
78 
79  void SetIronDist(Float_t dist) { fIronDist = dist; };
80  void SetHitCount(Int_t hit) { fHitCount = hit; };
81  void SetLayerCount(Int_t lay) { fLayerCount = lay; };
82  void SetMaxLayer(Int_t lay) { fMaxLayer = lay; };
83  void SetHitBit(Int_t bit) { fHitBit = bit; };
84  void SetModule(Int_t mod) { fModule = mod; };
85  void SetChi2(Float_t chi2) { fChi2 = chi2; };
86 
87  private:
88  Int_t fHitList[25]; // List of indexes of MdtHit
89  Int_t fHitMult[25]; // Number of MdtHits inside the correlation
90  Float_t fHitDist[25]; // Distance of the closest point to the previous layer hit
91  Float_t fHitDeltaAngle[25];
92  Float_t fLayDist[25]; // Distance of the actual layer from the previous one
93  Float_t fIronDist; // Amount of crossed iron [cm]
94  Int_t fHitCount; // Number of hits inside correlation
95  Int_t fLayerCount; // Number of fired layers
96  Int_t fMaxLayer; // Lat layer fired
97  Int_t fHitBit; // Layer Bit
98  Int_t fModule; // Module number of the first hit
99  Float_t fChi2; // global chi2 of the MDT correlation
100 
101  ClassDef(PndMdtTrk, 1);
102 };
103 
104 inline void PndMdtTrk::SetHitIndex(Int_t lay, Int_t trackId)
105 {
106  if (lay > 25) {
107  cout << " -E- PndMdtTrk::SetHitIndex: Layer > 25 !!!!!" << endl;
108  } else {
109  fHitList[lay] = trackId;
110  SetBit(lay);
111  AddLink(FairLink("MdtHit", trackId)); // 21.09.10 Stefano: fix for link
112  }
113 }
114 
115 inline void PndMdtTrk::SetHitMult(Int_t lay, Int_t mult)
116 {
117  if (lay > 25) {
118  cout << " -E- PndMdtTrk::SetHitMult: Layer > 25 !!!!!" << endl;
119  } else {
120  fHitMult[lay] = mult;
121  }
122 }
123 
124 inline void PndMdtTrk::SetHitDist(Int_t lay, Float_t dist)
125 {
126  if (lay > 25) {
127  cout << " -E- PndMdtTrk::SetHitDist: Layer > 25 !!!!!" << endl;
128  } else {
129  fHitDist[lay] = dist;
130  }
131 }
132 
133 inline void PndMdtTrk::SetHitDeltaAngle(Int_t lay, Float_t dist)
134 {
135  if (lay > 25) {
136  cout << " -E- PndMdtTrk::SetHitDeltaAngle: Layer > 25 !!!!!" << endl;
137  } else {
138  fHitDeltaAngle[lay] = dist;
139  }
140 }
141 
142 inline void PndMdtTrk::SetLayerDist(Int_t lay, Float_t dist)
143 {
144  if (lay > 25) {
145  cout << " -E- PndMdtTrk::SetLayerDist: Layer > 25 !!!!!" << endl;
146  } else {
147  fLayDist[lay] = dist;
148  }
149 }
150 
151 #endif
void SetHitDist(Int_t lay, Float_t dist)
Definition: PndMdtTrk.h:124
virtual ~PndMdtTrk()
void SetChi2(Float_t chi2)
Definition: PndMdtTrk.h:85
void GetHitMult(Int_t *hit)
Definition: PndMdtTrk.h:40
Float_t GetHitDist(Int_t lay) const
Definition: PndMdtTrk.h:57
Float_t GetLayerDist(Int_t lay) const
Definition: PndMdtTrk.h:59
virtual void Print(const Option_t *opt=nullptr) const
Definition: PndMdtTrk.h:23
Float_t GetHitDeltaAngle(Int_t lay) const
Definition: PndMdtTrk.h:58
void GetHitList(Int_t *hit)
Definition: PndMdtTrk.h:35
Int_t GetMaxLayer() const
Definition: PndMdtTrk.h:63
void SetLayerDist(Int_t lay, Float_t dist)
Definition: PndMdtTrk.h:142
void SetHitDeltaAngle(Int_t lay, Float_t angle)
Definition: PndMdtTrk.h:133
Int_t GetHitCount() const
Definition: PndMdtTrk.h:61
void SetMaxLayer(Int_t lay)
Definition: PndMdtTrk.h:82
Int_t GetHitIndex(Int_t lay) const
Definition: PndMdtTrk.h:55
Float_t GetChi2() const
Definition: PndMdtTrk.h:67
void SetHitIndex(Int_t lay, Int_t trackId)
Definition: PndMdtTrk.h:104
PndTrackCand * AddTrackCand(const PndTrackCand *inTrackCand=new PndTrackCand())
void GetHitDeltaAngle(Float_t *hit)
Definition: PndMdtTrk.h:50
Float_t GetIronDist() const
Definition: PndMdtTrk.h:60
Int_t GetModule() const
Definition: PndMdtTrk.h:66
void GetHitDist(Float_t *hit)
Definition: PndMdtTrk.h:45
void SetIronDist(Float_t dist)
Definition: PndMdtTrk.h:79
void SetModule(Int_t mod)
Definition: PndMdtTrk.h:84
void SetHitCount(Int_t hit)
Definition: PndMdtTrk.h:80
Int_t GetHitBit() const
Definition: PndMdtTrk.h:64
void SetHitBit(Int_t bit)
Definition: PndMdtTrk.h:83
void SetBit(Int_t lay)
Definition: PndMdtTrk.h:77
Int_t GetHitBit(Int_t lay) const
Definition: PndMdtTrk.h:65
void SetHitMult(Int_t lay, Int_t mult)
Definition: PndMdtTrk.h:115
void SetLayerCount(Int_t lay)
Definition: PndMdtTrk.h:81
void Clear()
Int_t GetHitMult(Int_t lay) const
Definition: PndMdtTrk.h:56
Int_t GetLayerCount() const
Definition: PndMdtTrk.h:62