FairRoot/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 
8 #ifndef PNDRICHTSPDHIT_H
9 #define PNDRICHTSPDHIT_H
10 
11 #include "TVector3.h"
12 #include "FairTimeStamp.h"
13 
14 class PndRichTSPDHit : public FairTimeStamp {
15 
16 public:
18  out << "PndRichTSPDHi in: " << hit.GetSensorId()
19  << ", 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:
30 
33 
34  PndRichTSPDHit(Int_t detID,
35  Int_t sensorId,
36  TVector3 pos,
37  TVector3 dpos,
38  Double_t time,
39  Double_t timeThreshold);
40 
42  virtual ~PndRichTSPDHit();
43 
45  virtual void Print(const Option_t* opt ="") const;
46 
51  virtual Double_t GetTime() {return fTime;}
53  //virtual Int_t GetRefIndex() {return fRefIndex;}
54  //TVector3 GetPosition() const { return TVector3(fX, fY, fZ); }
55  Int_t GetSensorId() const {return fSensorId;}
56  std::vector<Int_t> GetIndices() const { return fIndex;}
57 
58  void AddIndex(int index)
59  {
60  fIndex.push_back(index);
61  AddLink(FairLink("PndRichPDHit", index));
62  }
63 
64  void AddIndex(std::vector<Int_t> index)
65  {
66  fIndex = index;
67  AddLinks(FairMultiLinkedData("PndRichPDHit", index));
68  }
69 
70  virtual bool equal(FairTimeStamp* data){
71  PndRichTSPDHit* hit = dynamic_cast <PndRichTSPDHit*> (data);
72  if (hit != 0){
73  if (fSensorId == hit->GetSensorId()) return true;
74  }
75  return false;
76  }
77 
78  virtual bool operator<(const PndRichTSPDHit& hit) const{
79  if (fSensorId < hit.GetSensorId()) return true;
80  return false;
81  }
82  virtual bool operator>(const PndRichTSPDHit& hit) const{
83  if (fSensorId > hit.GetSensorId()) return true;
84  return false;
85  }
86  virtual bool operator==(const PndRichTSPDHit& hit) const{
87  if (fSensorId == hit.GetSensorId()) return true;
88  return false;
89  }
90 
91  protected:
92 
93  std::vector<Int_t> fIndex; // indice of mc points contributing to this digi
94  Int_t fDetID;
95  Int_t fSensorId;
96  TVector3 fPos;
97  TVector3 fdPos;
99 
100  ClassDef(PndRichTSPDHit,1)
101 };
102 
103 #endif //PNDRICHTSPDHIT_H
TVector3 pos
std::vector< Int_t > GetIndices() const
virtual bool equal(FairTimeStamp *data)
Int_t i
Definition: run_full.C:25
Int_t GetSensorId() const
void AddIndex(int index)
virtual Double_t GetTimeThreshold()
Double_t fTimeThreshold
std::vector< Int_t > fIndex
virtual Double_t GetTime()
Double_t
virtual ~PndRichTSPDHit()
void AddIndex(std::vector< Int_t > index)
TFile * out
Definition: reco_muo.C:20
virtual bool operator==(const PndRichTSPDHit &hit) const
virtual bool operator<(const PndRichTSPDHit &hit) const
PndSdsMCPoint * hit
Definition: anasim.C:70
virtual bool operator>(const PndRichTSPDHit &hit) const
friend std::ostream & operator<<(std::ostream &out, PndRichTSPDHit &hit)
virtual void Print(const Option_t *opt="") const