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