PandaRoot
PndRichDigi.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // -------------------------------------------------------------------------
14 // ----- PndRichDigi header file -----
15 // ----- Created 05/04/17 by Konstantin Beloborodov -----
16 // ----- -----
17 // -------------------------------------------------------------------------
18 
19 #ifndef PNDRICHDIGI_H
20 #define PNDRICHDIGI_H
21 
22 #include "TVector3.h"
23 #include "FairHit.h"
24 #include "FairTimeStamp.h"
25 
26 class PndRichDigi : public FairTimeStamp {
27 
28  public:
29  friend std::ostream &operator<<(std::ostream &out, PndRichDigi &hit)
30  {
31  out << "PndRichDigi in: " << hit.GetSensorId() << ", from Point(s) ";
32  std::vector<Int_t> indices = hit.GetIndices();
33  for (unsigned int i = 0; i < indices.size(); i++) {
34  out << indices[i] << " ";
35  }
36  out << std::endl;
37 
38  return out;
39  }
40 
41  public:
43  PndRichDigi();
44 
45  PndRichDigi(Int_t index, Int_t detID, Int_t sensorId, TVector3 &pos, TVector3 &dpos, Double_t time, Double_t timeThreshold, Double_t timeStamp);
46 
47  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);
48 
50  /* PndRichDigi(const PndRichDigi& hit) : FairHit(hit),
51  fSensorId(hit.fSensorId),
52  fTime(hit.fTime),
53  fTimeThreshold(hit.fTimeThreshold)
54  { *this = hit; };
55  */
57  virtual ~PndRichDigi();
58 
60  virtual void Print(const Option_t *opt = "") const;
61 
65  virtual Double_t GetTime() { return fTime; }
66  virtual Double_t GetTimeThreshold() { return fTimeThreshold; }
67  virtual Int_t GetRefIndex() { return fRefIndex; }
68  TVector3 GetPosition() const { return TVector3(fX, fY, fZ); }
69  Int_t GetSensorId() const { return fSensorId; }
70  std::vector<Int_t> GetIndices() const { return fIndex; }
71 
72  void AddIndex(int index)
73  {
74  fIndex.push_back(index);
75  AddLink(FairLink("PndRichDigi", index));
76  }
77 
78  void AddIndex(std::vector<Int_t> index)
79  {
80  fIndex = index;
81  AddLinks(FairMultiLinkedData("PndRichDigi", index));
82  }
83 
84  virtual bool equal(FairTimeStamp *data)
85  {
86  PndRichDigi *hit = dynamic_cast<PndRichDigi *>(data);
87  if (hit != nullptr) {
88  if (fSensorId == hit->GetSensorId())
89  return true;
90  }
91  return false;
92  }
93 
94  virtual bool operator<(const PndRichDigi &hit) const
95  {
96  if (fSensorId < hit.GetSensorId())
97  return true;
98  return false;
99  }
100  virtual bool operator>(const PndRichDigi &hit) const
101  {
102  if (fSensorId > hit.GetSensorId())
103  return true;
104  return false;
105  }
106  virtual bool operator==(const PndRichDigi &hit) const
107  {
108  if (fSensorId == hit.GetSensorId())
109  return true;
110  return false;
111  }
112 
113  protected:
114  std::vector<Int_t> fIndex; // indice of mc points contributing to this digi
115  Int_t fSensorId;
116  Int_t fRefIndex;
117  Double_t fX, fY, fZ;
119 
120  ClassDef(PndRichDigi, 1)
121 };
122 
123 #endif // PNDRICHDIGI_H
virtual void Print(const Option_t *opt="") const
std::vector< Int_t > GetIndices() const
Definition: PndRichDigi.h:70
Double_t fTime
Definition: PndRichDigi.h:118
TVector3 GetPosition() const
Definition: PndRichDigi.h:68
virtual bool operator<(const PndRichDigi &hit) const
Definition: PndRichDigi.h:94
unsigned int i
Definition: P4_F32vec4.h:33
std::vector< Int_t > fIndex
Definition: PndRichDigi.h:114
Double_t fX
Definition: PndRichDigi.h:117
Double_t fY
Definition: PndRichDigi.h:117
void AddIndex(std::vector< Int_t > index)
Definition: PndRichDigi.h:78
virtual bool operator>(const PndRichDigi &hit) const
Definition: PndRichDigi.h:100
Int_t fRefIndex
Definition: PndRichDigi.h:116
virtual Double_t GetTimeThreshold()
Definition: PndRichDigi.h:66
virtual ~PndRichDigi()
virtual Int_t GetRefIndex()
Definition: PndRichDigi.h:67
Double_t fZ
Definition: PndRichDigi.h:117
virtual bool operator==(const PndRichDigi &hit) const
Definition: PndRichDigi.h:106
virtual bool equal(FairTimeStamp *data)
Definition: PndRichDigi.h:84
friend std::ostream & operator<<(std::ostream &out, PndRichDigi &hit)
Definition: PndRichDigi.h:29
Int_t GetSensorId() const
Definition: PndRichDigi.h:69
virtual Double_t GetTime()
Definition: PndRichDigi.h:65
void AddIndex(int index)
Definition: PndRichDigi.h:72
Double_t fTimeThreshold
Definition: PndRichDigi.h:118
Int_t fSensorId
Definition: PndRichDigi.h:115