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