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