PandaRoot
PndFtsHit.h
Go to the documentation of this file.
1 
10 #ifndef PNDFTSHIT_H
11 #define PNDFTSHIT_H 1
12 
13 #include "TVector3.h"
14 #include "FairHit.h"
15 
16 class PndFtsHit : public FairHit {
17 
18  public:
20  PndFtsHit();
21 
36  // THIS ONE!
37  PndFtsHit(Int_t detID, Int_t tubeID, Int_t chamberID, Int_t layerID, Int_t skew, Int_t mcindex, TVector3 &pos, TVector3 &dpos, Double_t p, Double_t isochrone,
38  Double_t isochroneError, Double_t chDep);
39 
41  virtual ~PndFtsHit();
42 
44  virtual void Print(const Option_t *opt = nullptr) const
45  {
46  std::cout << " opt = " << opt << std::endl;
47  return;
48  }
49 
53  void Clear();
54 
56  Double_t GetIsochrone() const { return fIsochrone; };
57  Double_t GetIsochroneError() const { return fIsochroneError; };
58  Double_t GetPulse() const { return fPulse; };
59  Double_t GetDepCharge() const { return fDepCharge; };
60  Double_t GetEnergyLoss() const { return fDepCharge / 1e6; };
61 
63  void SetIsochrone(Double_t isochrone) { fIsochrone = isochrone; };
64  void SetIsochroneError(Double_t isochroneError) { fIsochroneError = isochroneError; };
65  void SetDepCharge(Double_t depcharge) { fDepCharge = depcharge; }
66 
67  // tube ID // CHECK added
68  void SetTubeID(Int_t tubeid) { fTubeID = tubeid; }
69  Int_t GetTubeID() const { return fTubeID; }
70  void SetChamberID(Int_t chamberid) { fChamberID = chamberid; }
71  Int_t GetChamberID() const { return fChamberID; }
72  void SetLayerID(Int_t layerid) { fLayerID = layerid; }
73  Int_t GetLayerID() const { return fLayerID; }
74  Int_t GetSkewed() const { return fSkewed; }
75 
76  virtual bool equal(FairTimeStamp *data) const
77  {
78  PndFtsHit *myDigi = dynamic_cast<PndFtsHit *>(data);
79  if (myDigi != nullptr) {
80  if (fTubeID == myDigi->GetTubeID())
81  return true;
82  }
83  return false;
84  }
85 
86  virtual bool operator<(const PndFtsHit &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, PndFtsHit &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  Double_t fIsochrone;
105  Double_t fIsochroneError;
106 
108  Double_t fPulse;
109 
111  Double_t fDepCharge;
112 
114  Int_t fTubeID; // CHECK added
115  Int_t fChamberID;
116  Int_t fLayerID;
117  Int_t fSkewed;
118 
119  ClassDef(PndFtsHit, 2);
120 };
121 
122 #endif
void SetIsochrone(Double_t isochrone)
Definition: PndFtsHit.h:63
Int_t GetTubeID() const
Definition: PndFtsHit.h:69
void SetChamberID(Int_t chamberid)
Definition: PndFtsHit.h:70
Int_t fLayerID
Definition: PndFtsHit.h:116
Int_t GetLayerID() const
Definition: PndFtsHit.h:73
void SetTubeID(Int_t tubeid)
Definition: PndFtsHit.h:68
Double_t fDepCharge
Definition: PndFtsHit.h:111
Int_t GetChamberID() const
Definition: PndFtsHit.h:71
virtual ~PndFtsHit()
Int_t fSkewed
Definition: PndFtsHit.h:117
Int_t GetSkewed() const
Definition: PndFtsHit.h:74
virtual bool operator<(const PndFtsHit &myDigi) const
Definition: PndFtsHit.h:86
Double_t GetDepCharge() const
Definition: PndFtsHit.h:59
Double_t fIsochroneError
Definition: PndFtsHit.h:105
Double_t GetPulse() const
Definition: PndFtsHit.h:58
Double_t fPulse
Definition: PndFtsHit.h:108
void SetDepCharge(Double_t depcharge)
Definition: PndFtsHit.h:65
Double_t GetIsochrone() const
Definition: PndFtsHit.h:56
Int_t fChamberID
Definition: PndFtsHit.h:115
Double_t GetEnergyLoss() const
Definition: PndFtsHit.h:60
virtual bool equal(FairTimeStamp *data) const
Definition: PndFtsHit.h:76
Double_t fIsochrone
Definition: PndFtsHit.h:103
Int_t fTubeID
Definition: PndFtsHit.h:114
Double_t GetIsochroneError() const
Definition: PndFtsHit.h:57
void SetLayerID(Int_t layerid)
Definition: PndFtsHit.h:72
virtual void Print(const Option_t *opt=nullptr) const
Definition: PndFtsHit.h:44
void Clear()
friend std::ostream & operator<<(std::ostream &out, PndFtsHit &digi)
Definition: PndFtsHit.h:94
void SetIsochroneError(Double_t isochroneError)
Definition: PndFtsHit.h:64
ClassDef(PndFtsHit, 2)