PandaRoot
PndSttHit.h
Go to the documentation of this file.
1 
15 #ifndef PNDSTTHIT_H
16 #define PNDSTTHIT_H 1
17 
18 #include "TVector3.h"
19 #include "FairHit.h"
20 #include "PndTrack.h"
21 
22 class PndSttHit : public FairHit {
23 
24  public:
26  PndSttHit();
27 
39  // THIS ONE!
40  PndSttHit(Int_t detID, Int_t tubeID, Int_t mcindex, TVector3 &pos, TVector3 &dpos, Double_t p, Double_t isochrone, Double_t isochroneError, Double_t chDep);
41 
43  virtual ~PndSttHit();
44 
46  virtual void Print(const Option_t *opt = nullptr) const
47  {
48  std::cout << " opt = " << opt << std::endl;
49  return;
50  }
51 
55  void Clear();
56 
58  Double_t GetIsochrone() const { return fIsochrone; };
59  Double_t GetIsochroneError() const { return fIsochroneError; };
60  Double_t GetPulse() const { return fPulse; };
61  Double_t GetDepCharge() const { return fDepCharge; };
62  Double_t GetEnergyLoss() const { return fDepCharge / 1e6; };
63 
65  void SetIsochrone(Double_t isochrone) { fIsochrone = isochrone; };
66  void SetIsochroneError(Double_t isochroneError) { fIsochroneError = isochroneError; };
67  void SetDepCharge(Double_t depcharge) { fDepCharge = depcharge; }
68 
69  // tube ID // CHECK added
70  void SetTubeID(Int_t tubeid) { fTubeID = tubeid; }
71  Int_t GetTubeID() const { return fTubeID; }
72 
73  // computation of dE/dx
74  Double_t ComputedEdx(PndTrack *track, Double_t tuberadius);
75 
76  virtual bool equal(FairTimeStamp *data)
77  {
78  PndSttHit *myDigi = dynamic_cast<PndSttHit *>(data);
79  if (myDigi != nullptr) {
80  if (fTubeID == myDigi->GetTubeID())
81  return true;
82  }
83  return false;
84  }
85 
86  virtual bool operator<(const PndSttHit &myDigi) const
87  {
88  if (fTubeID < myDigi.GetTubeID())
89  return true;
90  else
91  return false;
92  }
93 
94  friend std::ostream &operator<<(std::ostream &out, PndSttHit &digi)
95  {
96  out << "PndSttHit in Tube: " << digi.GetTubeID() << " Isochrone: " << digi.GetIsochrone() << " +/- " << digi.GetIsochroneError() << " Charge: " << digi.GetDepCharge()
97  << " Pulse: " << digi.GetPulse() << std::endl;
98  return out;
99  }
100 
101  protected:
103  Int_t fTubeID; // CHECK added
105  Double_t fPulse;
107  Double_t fIsochrone;
109  Double_t fIsochroneError;
111  Double_t fDepCharge;
112 
113  ClassDef(PndSttHit, 1);
114 };
115 
116 #endif
Double_t GetEnergyLoss() const
Definition: PndSttHit.h:62
Int_t GetTubeID() const
Definition: PndSttHit.h:71
Double_t GetPulse() const
Definition: PndSttHit.h:60
void Clear()
void SetIsochrone(Double_t isochrone)
Definition: PndSttHit.h:65
virtual bool operator<(const PndSttHit &myDigi) const
Definition: PndSttHit.h:86
virtual bool equal(FairTimeStamp *data)
Definition: PndSttHit.h:76
Double_t fIsochrone
Definition: PndSttHit.h:107
void SetTubeID(Int_t tubeid)
Definition: PndSttHit.h:70
Double_t fIsochroneError
Definition: PndSttHit.h:109
void SetDepCharge(Double_t depcharge)
Definition: PndSttHit.h:67
void SetIsochroneError(Double_t isochroneError)
Definition: PndSttHit.h:66
Int_t fTubeID
Definition: PndSttHit.h:103
Double_t fDepCharge
Definition: PndSttHit.h:111
virtual void Print(const Option_t *opt=nullptr) const
Definition: PndSttHit.h:46
Double_t ComputedEdx(PndTrack *track, Double_t tuberadius)
virtual ~PndSttHit()
ClassDef(PndSttHit, 1)
Double_t fPulse
Definition: PndSttHit.h:105
Double_t GetIsochrone() const
Definition: PndSttHit.h:58
Double_t GetIsochroneError() const
Definition: PndSttHit.h:59
friend std::ostream & operator<<(std::ostream &out, PndSttHit &digi)
Definition: PndSttHit.h:94
Double_t GetDepCharge() const
Definition: PndSttHit.h:61