PandaRoot
PndSciTHit.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 // ----- Forward tof header file -----
15 // ----- created by A. Sanchez -----
16 // ----- modified by D. Steinschaden -----
17 // ----- last update 05.2015 -----
18 // --------------------------------------------------------------------------
19 
29 #ifndef PNDSCITHIT_H
30 #define PNDSCITHIT_H
31 
32 #include "TVector3.h"
33 #include "TString.h"
34 #include "FairHit.h"
35 
36 #include <stdio.h>
37 #include <iostream>
38 
39 class PndSciTHit : public FairHit {
40 
41  public:
42  //** Default constructor (not for use) **/
43  PndSciTHit();
44 
45  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,
46  Double_t charge);
47 
48  // PndSciTHit(PndSciTHit& c);
49  //** Destructor **/
50  virtual ~PndSciTHit();
51 
52  //** Accessors **/
53 
54  TString GetDetName() const { return fDetName; };
55  Double_t GetCharge() { return fCharge; };
56 
57  Double_t GetSiPm1() { return fSiPm1; };
58  Double_t GetDSiPm1() { return fDSiPm1; };
59  Double_t GetSiPm2() { return fSiPm2; };
60  Double_t GetDSiPm2() { return fDSiPm2; };
61 
62  // Following functions are redundant and should be removed.
63  // use the base funktion provided by FairHit instead!!
64 
65  Double_t GetTime() { return GetTimeStamp(); };
66  Double_t GetDt() { return GetTimeStampError(); };
67  TVector3 GetPosition() const { return TVector3(fX, fY, fZ); };
68 
71  void SetDetName(TString name) { fDetName = name; };
72  void SetCharge(Double_t charge) { fCharge = charge; };
73  void AddCharge(double charge) { fCharge += charge; }
74 
75  void SetSiPm1(Double_t sipm1) { fSiPm1 = sipm1; };
76  void SetDSiPm1(Double_t dsipm1) { fDSiPm1 = dsipm1; };
77  void SetSiPm2(Double_t sipm2) { fSiPm2 = sipm2; };
78  void SetDSiPm2(Double_t dsipm2) { fDSiPm2 = dsipm2; };
79 
80  //** Operator overload**/
81 
82  friend std::ostream &operator<<(std::ostream &out, PndSciTHit &hit);
83 
84  virtual bool operator<(const PndSciTHit &right) const;
85  virtual bool operator>(const PndSciTHit &right) const;
86 
87  virtual bool equal(FairTimeStamp *data);
88 
90  virtual void Print(const Option_t *opt = nullptr) const;
91 
92  public:
93  TString fDetName; // Detector name
94  Double_t fCharge; //, Eloss [GeV]
95 
96  Double_t fSiPm1; // Timestamp for SiPm1 [ns]
97  Double_t fDSiPm1; // Timing error for SiPm1
98  Double_t fSiPm2; // Timestamp for SiPm2
99  Double_t fDSiPm2; // Timing error for SiPm2
100 
101  ClassDef(PndSciTHit, 3);
102 };
103 
104 #endif
void SetDSiPm2(Double_t dsipm2)
Definition: PndSciTHit.h:78
void SetSiPm2(Double_t sipm2)
Definition: PndSciTHit.h:77
TVector3 GetPosition() const
Definition: PndSciTHit.h:67
virtual bool operator>(const PndSciTHit &right) const
void SetDetName(TString name)
Definition: PndSciTHit.h:71
void SetDSiPm1(Double_t dsipm1)
Definition: PndSciTHit.h:76
Double_t fDSiPm1
Definition: PndSciTHit.h:97
void SetCharge(Double_t charge)
Definition: PndSciTHit.h:72
Double_t fSiPm2
Definition: PndSciTHit.h:98
virtual bool equal(FairTimeStamp *data)
ClassDef(PndSciTHit, 3)
Double_t fCharge
Definition: PndSciTHit.h:94
Double_t GetDSiPm2()
Definition: PndSciTHit.h:60
friend std::ostream & operator<<(std::ostream &out, PndSciTHit &hit)
Double_t GetDt()
Definition: PndSciTHit.h:66
virtual bool operator<(const PndSciTHit &right) const
Double_t GetSiPm2()
Definition: PndSciTHit.h:59
TString GetDetName() const
Definition: PndSciTHit.h:54
virtual void Print(const Option_t *opt=nullptr) const
Double_t GetDSiPm1()
Definition: PndSciTHit.h:58
TString fDetName
Definition: PndSciTHit.h:93
Double_t GetSiPm1()
Definition: PndSciTHit.h:57
Double_t fSiPm1
Definition: PndSciTHit.h:96
Double_t GetTime()
Definition: PndSciTHit.h:65
Double_t fDSiPm2
Definition: PndSciTHit.h:99
void SetSiPm1(Double_t sipm1)
Definition: PndSciTHit.h:75
void AddCharge(double charge)
Definition: PndSciTHit.h:73
virtual ~PndSciTHit()
Double_t GetCharge()
Definition: PndSciTHit.h:55