FairRoot/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 
8 #ifndef PNDRICHDIGI_H
9 #define PNDRICHDIGI_H
10 
11 #include "TVector3.h"
12 #include "FairHit.h"
13 #include "FairTimeStamp.h"
14 
15 class PndRichDigi : public FairTimeStamp {
16 
17 public:
19  out << "PndRichDigi in: " << hit.GetSensorId()
20  << ", from Point(s) ";
21  std::vector<Int_t>indices = hit.GetIndices();
22  for (unsigned int i = 0; i < indices.size(); i++){
23  out << indices[i] << " ";
24  }
25  out << std::endl;
26 
27  return out;
28  }
29 
30 public:
31 
33  PndRichDigi();
34 
35  PndRichDigi(Int_t index,
36  Int_t detID,
37  Int_t sensorId,
38  TVector3& pos,
39  TVector3& dpos,
40  Double_t time,
41  Double_t timeThreshold,
42  Double_t timeStamp);
43 
44  PndRichDigi(std::vector<Int_t> index,
45  Int_t detID,
46  Int_t sensorId,
47  TVector3& pos,
48  TVector3& dpos,
49  Double_t time,
50  Double_t timeThreshold,
51  Double_t timeStamp);
52 
53 
55 /* PndRichDigi(const PndRichDigi& hit) : FairHit(hit),
56  fSensorId(hit.fSensorId),
57  fTime(hit.fTime),
58  fTimeThreshold(hit.fTimeThreshold)
59  { *this = hit; };
60 */
62  virtual ~PndRichDigi();
63 
65  virtual void Print(const Option_t* opt ="") const;
66 
71  virtual Double_t GetTime() {return fTime;}
73  virtual Int_t GetRefIndex() {return fRefIndex;}
74  TVector3 GetPosition() const { return TVector3(fX, fY, fZ); }
75  Int_t GetSensorId() const {return fSensorId;}
76  std::vector<Int_t> GetIndices() const { return fIndex;}
77 
78  void AddIndex(int index)
79  {
80  fIndex.push_back(index);
81  AddLink(FairLink("PndRichDigi", index));
82  }
83 
84  void AddIndex(std::vector<Int_t> index)
85  {
86  fIndex = index;
87  AddLinks(FairMultiLinkedData("PndRichDigi", index));
88  }
89 
90  virtual bool equal(FairTimeStamp* data){
91  PndRichDigi* hit = dynamic_cast <PndRichDigi*> (data);
92  if (hit != 0){
93  if (fSensorId == hit->GetSensorId()) return true;
94  }
95  return false;
96  }
97 
98  virtual bool operator<(const PndRichDigi& hit) const{
99  if (fSensorId < hit.GetSensorId()) return true;
100  return false;
101  }
102  virtual bool operator>(const PndRichDigi& hit) const{
103  if (fSensorId > hit.GetSensorId()) return true;
104  return false;
105  }
106  virtual bool operator==(const PndRichDigi& hit) const{
107  if (fSensorId == hit.GetSensorId()) return true;
108  return false;
109  }
110 
111  protected:
112 
113  std::vector<Int_t> fIndex; // indice of mc points contributing to this digi
114  Int_t fSensorId;
115  Int_t fRefIndex;
118 
119  ClassDef(PndRichDigi,1)
120 };
121 
122 #endif //PNDRICHDIGI_H
TVector3 pos
Int_t i
Definition: run_full.C:25
Double_t fTime
Definition: PndRichDigi.h:117
virtual bool operator==(const PndRichDigi &hit) const
Definition: PndRichDigi.h:106
virtual void Print(const Option_t *opt="") const
Definition: PndRichDigi.cxx:72
std::vector< Int_t > fIndex
Definition: PndRichDigi.h:113
Double_t fX
Definition: PndRichDigi.h:116
TVector3 GetPosition() const
Definition: PndRichDigi.h:74
Double_t fY
Definition: PndRichDigi.h:116
void AddIndex(std::vector< Int_t > index)
Definition: PndRichDigi.h:84
Double_t
virtual bool operator>(const PndRichDigi &hit) const
Definition: PndRichDigi.h:102
Int_t fRefIndex
Definition: PndRichDigi.h:115
virtual Double_t GetTimeThreshold()
Definition: PndRichDigi.h:72
TFile * out
Definition: reco_muo.C:20
virtual bool operator<(const PndRichDigi &hit) const
Definition: PndRichDigi.h:98
virtual Int_t GetRefIndex()
Definition: PndRichDigi.h:73
Double_t fZ
Definition: PndRichDigi.h:116
Int_t GetSensorId() const
Definition: PndRichDigi.h:75
virtual bool equal(FairTimeStamp *data)
Definition: PndRichDigi.h:90
friend std::ostream & operator<<(std::ostream &out, PndRichDigi &hit)
Definition: PndRichDigi.h:18
virtual ~PndRichDigi()
Definition: PndRichDigi.cxx:67
PndSdsMCPoint * hit
Definition: anasim.C:70
std::vector< Int_t > GetIndices() const
Definition: PndRichDigi.h:76
virtual Double_t GetTime()
Definition: PndRichDigi.h:71
void AddIndex(int index)
Definition: PndRichDigi.h:78
Double_t fTimeThreshold
Definition: PndRichDigi.h:117
Int_t fSensorId
Definition: PndRichDigi.h:114