PandaRoot
PndSttHit.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 
27 #ifndef PNDSTTHIT_H
28 #define PNDSTTHIT_H 1
29 
30 #include "TVector3.h"
31 #include "FairHit.h"
32 #include "PndTrack.h"
33 
34 class PndSttHit : public FairHit {
35 
36  public:
38  PndSttHit();
39 
51  // THIS ONE!
52  PndSttHit(Int_t detID, Int_t tubeID, Int_t mcindex, TVector3 &pos, TVector3 &dpos, Double_t p, Double_t isochrone, Double_t isochroneError, Double_t chDep);
53 
55  virtual ~PndSttHit();
56 
58  virtual void Print(const Option_t *opt = nullptr) const
59  {
60  std::cout << " opt = " << opt << std::endl;
61  return;
62  }
63 
67  void Clear();
68 
70  Double_t GetIsochrone() const { return fIsochrone; };
71  Double_t GetIsochroneError() const { return fIsochroneError; };
72  Double_t GetPulse() const { return fPulse; };
73  Double_t GetDepCharge() const { return fDepCharge; };
74  Double_t GetEnergyLoss() const { return fDepCharge / 1e6; };
75 
77  void SetIsochrone(Double_t isochrone) { fIsochrone = isochrone; };
78  void SetIsochroneError(Double_t isochroneError) { fIsochroneError = isochroneError; };
79  void SetDepCharge(Double_t depcharge) { fDepCharge = depcharge; }
80 
81  // tube ID // CHECK added
82  void SetTubeID(Int_t tubeid) { fTubeID = tubeid; }
83  Int_t GetTubeID() const { return fTubeID; }
84 
85  // computation of dE/dx
86  Double_t ComputedEdx(PndTrack *track, Double_t tuberadius);
87 
88  virtual bool equal(FairTimeStamp *data)
89  {
90  PndSttHit *myDigi = dynamic_cast<PndSttHit *>(data);
91  if (myDigi != nullptr) {
92  if (fTubeID == myDigi->GetTubeID())
93  return true;
94  }
95  return false;
96  }
97 
98  virtual bool operator<(const PndSttHit &myDigi) const
99  {
100  if (fTubeID < myDigi.GetTubeID())
101  return true;
102  else
103  return false;
104  }
105 
106  friend std::ostream &operator<<(std::ostream &out, PndSttHit &digi)
107  {
108  out << "PndSttHit in Tube: " << digi.GetTubeID() << " Isochrone: " << digi.GetIsochrone() << " +/- " << digi.GetIsochroneError() << " Charge: " << digi.GetDepCharge()
109  << " Pulse: " << digi.GetPulse() << std::endl;
110  return out;
111  }
112 
113  protected:
115  Int_t fTubeID; // CHECK added
117  Double_t fPulse;
119  Double_t fIsochrone;
121  Double_t fIsochroneError;
123  Double_t fDepCharge;
124 
125  ClassDef(PndSttHit, 1);
126 };
127 
128 #endif
Double_t GetEnergyLoss() const
Definition: PndSttHit.h:74
Int_t GetTubeID() const
Definition: PndSttHit.h:83
Double_t GetPulse() const
Definition: PndSttHit.h:72
void Clear()
void SetIsochrone(Double_t isochrone)
Definition: PndSttHit.h:77
virtual bool operator<(const PndSttHit &myDigi) const
Definition: PndSttHit.h:98
virtual bool equal(FairTimeStamp *data)
Definition: PndSttHit.h:88
Double_t fIsochrone
Definition: PndSttHit.h:119
void SetTubeID(Int_t tubeid)
Definition: PndSttHit.h:82
Double_t fIsochroneError
Definition: PndSttHit.h:121
void SetDepCharge(Double_t depcharge)
Definition: PndSttHit.h:79
void SetIsochroneError(Double_t isochroneError)
Definition: PndSttHit.h:78
Int_t fTubeID
Definition: PndSttHit.h:115
Double_t fDepCharge
Definition: PndSttHit.h:123
virtual void Print(const Option_t *opt=nullptr) const
Definition: PndSttHit.h:58
Double_t ComputedEdx(PndTrack *track, Double_t tuberadius)
virtual ~PndSttHit()
ClassDef(PndSttHit, 1)
Double_t fPulse
Definition: PndSttHit.h:117
Double_t GetIsochrone() const
Definition: PndSttHit.h:70
Double_t GetIsochroneError() const
Definition: PndSttHit.h:71
friend std::ostream & operator<<(std::ostream &out, PndSttHit &digi)
Definition: PndSttHit.h:106
Double_t GetDepCharge() const
Definition: PndSttHit.h:73