PandaRoot
PndSciTHit.h
Go to the documentation of this file.
1 // --------------------------------------------------------------------------
2 // ----- Forward tof header file -----
3 // ----- created by A. Sanchez -----
4 // ----- modified by D. Steinschaden -----
5 // ----- last update 05.2015 -----
6 // --------------------------------------------------------------------------
7 
17 #ifndef PNDSCITHIT_H
18 #define PNDSCITHIT_H
19 
20 #include "TVector3.h"
21 #include "TString.h"
22 #include "FairHit.h"
23 
24 #include <stdio.h>
25 #include <iostream>
26 
27 class PndSciTHit : public FairHit {
28 
29  public:
30  //** Default constructor (not for use) **/
31  PndSciTHit();
32 
33  PndSciTHit(Int_t detID, TString detName, Double_t time, Double_t dt, Double_t sipm1, Double_t dsipm1, Double_t sipm2, Double_t dsipm2, TVector3 &pos, TVector3 &dpos, Int_t index,
34  Double_t charge);
35 
36  // PndSciTHit(PndSciTHit& c);
37  //** Destructor **/
38  virtual ~PndSciTHit();
39 
40  //** Accessors **/
41 
42  TString GetDetName() const { return fDetName; };
43  Double_t GetCharge() { return fCharge; };
44 
45  Double_t GetSiPm1() { return fSiPm1; };
46  Double_t GetDSiPm1() { return fDSiPm1; };
47  Double_t GetSiPm2() { return fSiPm2; };
48  Double_t GetDSiPm2() { return fDSiPm2; };
49 
50  // Following functions are redundant and should be removed.
51  // use the base funktion provided by FairHit instead!!
52 
53  Double_t GetTime() { return GetTimeStamp(); };
54  Double_t GetDt() { return GetTimeStampError(); };
55  TVector3 GetPosition() const { return TVector3(fX, fY, fZ); };
56 
59  void SetDetName(TString name) { fDetName = name; };
60  void SetCharge(Double_t charge) { fCharge = charge; };
61  void AddCharge(double charge) { fCharge += charge; }
62 
63  void SetSiPm1(Double_t sipm1) { fSiPm1 = sipm1; };
64  void SetDSiPm1(Double_t dsipm1) { fDSiPm1 = dsipm1; };
65  void SetSiPm2(Double_t sipm2) { fSiPm2 = sipm2; };
66  void SetDSiPm2(Double_t dsipm2) { fDSiPm2 = dsipm2; };
67 
68  //** Operator overload**/
69 
70  friend std::ostream &operator<<(std::ostream &out, PndSciTHit &hit);
71 
72  virtual bool operator<(const PndSciTHit &right) const;
73  virtual bool operator>(const PndSciTHit &right) const;
74 
75  virtual bool equal(FairTimeStamp *data);
76 
78  virtual void Print(const Option_t *opt = nullptr) const;
79 
80  public:
81  TString fDetName; // Detector name
82  Double_t fCharge; //, Eloss [GeV]
83 
84  Double_t fSiPm1; // Timestamp for SiPm1 [ns]
85  Double_t fDSiPm1; // Timing error for SiPm1
86  Double_t fSiPm2; // Timestamp for SiPm2
87  Double_t fDSiPm2; // Timing error for SiPm2
88 
89  ClassDef(PndSciTHit, 3);
90 };
91 
92 #endif
void SetDSiPm2(Double_t dsipm2)
Definition: PndSciTHit.h:66
void SetSiPm2(Double_t sipm2)
Definition: PndSciTHit.h:65
TVector3 GetPosition() const
Definition: PndSciTHit.h:55
virtual bool operator>(const PndSciTHit &right) const
void SetDetName(TString name)
Definition: PndSciTHit.h:59
void SetDSiPm1(Double_t dsipm1)
Definition: PndSciTHit.h:64
Double_t fDSiPm1
Definition: PndSciTHit.h:85
void SetCharge(Double_t charge)
Definition: PndSciTHit.h:60
Double_t fSiPm2
Definition: PndSciTHit.h:86
virtual bool equal(FairTimeStamp *data)
ClassDef(PndSciTHit, 3)
Double_t fCharge
Definition: PndSciTHit.h:82
Double_t GetDSiPm2()
Definition: PndSciTHit.h:48
friend std::ostream & operator<<(std::ostream &out, PndSciTHit &hit)
Double_t GetDt()
Definition: PndSciTHit.h:54
virtual bool operator<(const PndSciTHit &right) const
Double_t GetSiPm2()
Definition: PndSciTHit.h:47
TString GetDetName() const
Definition: PndSciTHit.h:42
virtual void Print(const Option_t *opt=nullptr) const
Double_t GetDSiPm1()
Definition: PndSciTHit.h:46
TString fDetName
Definition: PndSciTHit.h:81
Double_t GetSiPm1()
Definition: PndSciTHit.h:45
Double_t fSiPm1
Definition: PndSciTHit.h:84
Double_t GetTime()
Definition: PndSciTHit.h:53
Double_t fDSiPm2
Definition: PndSciTHit.h:87
void SetSiPm1(Double_t sipm1)
Definition: PndSciTHit.h:63
void AddCharge(double charge)
Definition: PndSciTHit.h:61
virtual ~PndSciTHit()
Double_t GetCharge()
Definition: PndSciTHit.h:43