PandaRoot
PndRichDigi.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndRichDigi header file -----
3 // ----- Created 05/04/17 by Konstantin Beloborodov -----
4 // ----- -----
5 // -------------------------------------------------------------------------
6 
7 #ifndef PNDRICHDIGI_H
8 #define PNDRICHDIGI_H
9 
10 #include "TVector3.h"
11 #include "FairHit.h"
12 #include "FairTimeStamp.h"
13 
14 class PndRichDigi : public FairTimeStamp {
15 
16  public:
17  friend std::ostream &operator<<(std::ostream &out, PndRichDigi &hit)
18  {
19  out << "PndRichDigi in: " << hit.GetSensorId() << ", from Point(s) ";
20  std::vector<Int_t> indices = hit.GetIndices();
21  for (unsigned int i = 0; i < indices.size(); i++) {
22  out << indices[i] << " ";
23  }
24  out << std::endl;
25 
26  return out;
27  }
28 
29  public:
31  PndRichDigi();
32 
33  PndRichDigi(Int_t index, Int_t detID, Int_t sensorId, TVector3 &pos, TVector3 &dpos, Double_t time, Double_t timeThreshold, Double_t timeStamp);
34 
35  PndRichDigi(std::vector<Int_t> index, Int_t detID, Int_t sensorId, TVector3 &pos, TVector3 &dpos, Double_t time, Double_t timeThreshold, Double_t timeStamp);
36 
38  /* PndRichDigi(const PndRichDigi& hit) : FairHit(hit),
39  fSensorId(hit.fSensorId),
40  fTime(hit.fTime),
41  fTimeThreshold(hit.fTimeThreshold)
42  { *this = hit; };
43  */
45  virtual ~PndRichDigi();
46 
48  virtual void Print(const Option_t *opt = "") const;
49 
53  virtual Double_t GetTime() { return fTime; }
54  virtual Double_t GetTimeThreshold() { return fTimeThreshold; }
55  virtual Int_t GetRefIndex() { return fRefIndex; }
56  TVector3 GetPosition() const { return TVector3(fX, fY, fZ); }
57  Int_t GetSensorId() const { return fSensorId; }
58  std::vector<Int_t> GetIndices() const { return fIndex; }
59 
60  void AddIndex(int index)
61  {
62  fIndex.push_back(index);
63  AddLink(FairLink("PndRichDigi", index));
64  }
65 
66  void AddIndex(std::vector<Int_t> index)
67  {
68  fIndex = index;
69  AddLinks(FairMultiLinkedData("PndRichDigi", index));
70  }
71 
72  virtual bool equal(FairTimeStamp *data)
73  {
74  PndRichDigi *hit = dynamic_cast<PndRichDigi *>(data);
75  if (hit != nullptr) {
76  if (fSensorId == hit->GetSensorId())
77  return true;
78  }
79  return false;
80  }
81 
82  virtual bool operator<(const PndRichDigi &hit) const
83  {
84  if (fSensorId < hit.GetSensorId())
85  return true;
86  return false;
87  }
88  virtual bool operator>(const PndRichDigi &hit) const
89  {
90  if (fSensorId > hit.GetSensorId())
91  return true;
92  return false;
93  }
94  virtual bool operator==(const PndRichDigi &hit) const
95  {
96  if (fSensorId == hit.GetSensorId())
97  return true;
98  return false;
99  }
100 
101  protected:
102  std::vector<Int_t> fIndex; // indice of mc points contributing to this digi
103  Int_t fSensorId;
104  Int_t fRefIndex;
105  Double_t fX, fY, fZ;
107 
108  ClassDef(PndRichDigi, 1)
109 };
110 
111 #endif // PNDRICHDIGI_H
virtual void Print(const Option_t *opt="") const
std::vector< Int_t > GetIndices() const
Definition: PndRichDigi.h:58
Double_t fTime
Definition: PndRichDigi.h:106
TVector3 GetPosition() const
Definition: PndRichDigi.h:56
virtual bool operator<(const PndRichDigi &hit) const
Definition: PndRichDigi.h:82
unsigned int i
Definition: P4_F32vec4.h:21
std::vector< Int_t > fIndex
Definition: PndRichDigi.h:102
Double_t fX
Definition: PndRichDigi.h:105
Double_t fY
Definition: PndRichDigi.h:105
void AddIndex(std::vector< Int_t > index)
Definition: PndRichDigi.h:66
virtual bool operator>(const PndRichDigi &hit) const
Definition: PndRichDigi.h:88
Int_t fRefIndex
Definition: PndRichDigi.h:104
virtual Double_t GetTimeThreshold()
Definition: PndRichDigi.h:54
virtual ~PndRichDigi()
virtual Int_t GetRefIndex()
Definition: PndRichDigi.h:55
Double_t fZ
Definition: PndRichDigi.h:105
virtual bool operator==(const PndRichDigi &hit) const
Definition: PndRichDigi.h:94
virtual bool equal(FairTimeStamp *data)
Definition: PndRichDigi.h:72
friend std::ostream & operator<<(std::ostream &out, PndRichDigi &hit)
Definition: PndRichDigi.h:17
Int_t GetSensorId() const
Definition: PndRichDigi.h:57
virtual Double_t GetTime()
Definition: PndRichDigi.h:53
void AddIndex(int index)
Definition: PndRichDigi.h:60
Double_t fTimeThreshold
Definition: PndRichDigi.h:106
Int_t fSensorId
Definition: PndRichDigi.h:103