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