PandaRoot
PndGemHit.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndGemHit header file -----
3 // ----- Created by R.Kliemt -----
4 // -------------------------------------------------------------------------
5 
15 #ifndef PNDGEMHIT_H
16 #define PNDGEMHIT_H
17 
18 #include "TVector3.h"
19 #include "TString.h"
20 #include "FairHit.h"
21 
22 #include <stdio.h>
23 #include <iostream>
24 
25 class PndGemHit : public FairHit {
26  friend std::ostream &operator<<(std::ostream &out, const PndGemHit &hit)
27  {
28  out << "Gem hit" /*in detector " << hit.GetDetName()*/ << " at (" << hit.GetX() << ", " << hit.GetY() << ", " << hit.GetZ() << ") cm "
29  << " with " << hit.GetCharge() << " e"
30  << ", Cluster No. " << hit.GetRefIndex() << std::endl;
31 
32  return out;
33  }
34 
35  public:
37  PndGemHit();
38 
48  PndGemHit(Int_t detID, TVector3 &pos, TVector3 &dpos, Int_t index, Double_t charge, Int_t NDigiHits, TString fromStr = "GEMPoint");
49  PndGemHit(Int_t detID, TVector3 &pos, TVector3 &dpos, Int_t digi1, Int_t digi2, Double_t dr, Double_t dp, Int_t index, TString fromStr = "GEMCluster");
50  PndGemHit(Int_t detID, TVector3 &pos, TVector3 &dpos, Double_t charge, Double_t time, Int_t digi1, Int_t digi2, Double_t dr, Double_t dp, Int_t index,
51  TString fromStr = "GEMCluster");
52 
53  // PndGemHit(PndGemHit& c);
55  virtual ~PndGemHit();
56 
59  void SetCharge(Double_t charge) { fCharge = charge; }
60  void SetNDigiHits(Int_t pixel) { fNDigiHits = pixel; }
61  void SetBotIndex(Int_t id) { fBotIndex = id; }
62  void SetErrors(Double_t dr, Double_t dp)
63  {
64  fDr = dr;
65  fDp = dp;
66  };
67  void SetDigiNr(Int_t digi1, Int_t digi2)
68  {
69  fDigiNr[0] = digi1;
70  fDigiNr[1] = digi2;
71  };
72 
73  Double_t GetCharge() const { return fCharge; }
74  Int_t GetNDigiHits() const { return fNDigiHits; }
75  TVector3 GetPosition() const { return TVector3(fX, fY, fZ); }
76  Int_t GetBotIndex() const { return fBotIndex; }
77  Double_t GetEloss() const { return (fCharge * 3.61e-9); } // 3.6 eV/Electron in Silicon
78 
79  Double_t GetDr() const { return fDr; };
80  Double_t GetDp() const { return fDp; };
81  Int_t GetDigiNr(Int_t iside) const
82  {
83  if (iside * (iside - 1) == 0)
84  return fDigiNr[iside];
85  return -1;
86  };
87 
88  Int_t GetSystemId() const { return ((fDetectorID & (31 << 27)) >> 27); }
89  Int_t GetStationNr() const { return ((fDetectorID & (8191 << 8)) >> 8); }
90  Int_t GetSensorNr() const
91  { // sensor number within station
92  return ((fDetectorID & (3 << 6)) >> 6);
93  }
94 
95  // // CAUTION The errors in the GemHit are LOCAL, but the coordinates are in the LAB
96  //
97  // Double_t GetDxLocal() const { return fDx;};
98  // Double_t GetDyLocal() const { return fDy;};
99  // Double_t GetDzLocal() const { return fDz;};
100  // void PositionErrorLocal(TVector3& dpos) const;
101 
102  // /** overloaded accessors **/
103  // Double_t GetDx() {return GetD(0);};
104  // Double_t GetDy() {return GetD(1);};
105  // Double_t GetDz() {return GetD(2);};
106  // void PositionError(TVector3& dpos);
107 
109  virtual void Print(const Option_t *opt = nullptr) const;
110 
111  private:
112  Int_t fDigiNr[2];
113  Double_t fDr; // error in radius calculation
114  Double_t fDp; // error in angle calculation
115 
116  Double_t fCharge;
117  Int_t fNDigiHits;
118  // if more then in the cluster cand, look for the bottom cluster.
119  Int_t fBotIndex;
120  ClassDef(PndGemHit, 1);
121 };
122 
123 // inline void PndGemHit::PositionErrorLocal(TVector3& dpos) const {
124 // dpos.SetXYZ(fDx, fDy, fDz);
125 // }
126 //
127 // inline void PndGemHit::PositionError(TVector3& dpos) {
128 // dpos.SetXYZ(GetDx(), GetDy(), GetDz());
129 // }
130 
131 #endif
virtual ~PndGemHit()
Double_t GetDp() const
Definition: PndGemHit.h:80
Int_t GetStationNr() const
Definition: PndGemHit.h:89
void SetBotIndex(Int_t id)
Definition: PndGemHit.h:61
void SetDigiNr(Int_t digi1, Int_t digi2)
Definition: PndGemHit.h:67
Int_t GetSensorNr() const
Definition: PndGemHit.h:90
Int_t GetNDigiHits() const
Definition: PndGemHit.h:74
void SetErrors(Double_t dr, Double_t dp)
Definition: PndGemHit.h:62
Double_t GetDr() const
Definition: PndGemHit.h:79
Int_t GetSystemId() const
Definition: PndGemHit.h:88
TVector3 GetPosition() const
Definition: PndGemHit.h:75
Int_t GetBotIndex() const
Definition: PndGemHit.h:76
void SetNDigiHits(Int_t pixel)
Definition: PndGemHit.h:60
friend std::ostream & operator<<(std::ostream &out, const PndGemHit &hit)
Definition: PndGemHit.h:26
Double_t GetEloss() const
Definition: PndGemHit.h:77
Double_t GetCharge() const
Definition: PndGemHit.h:73
void SetCharge(Double_t charge)
Definition: PndGemHit.h:59
Int_t GetDigiNr(Int_t iside) const
Definition: PndGemHit.h:81
virtual void Print(const Option_t *opt=nullptr) const