PandaRoot
PndFtsHit.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 
22 #ifndef PNDFTSHIT_H
23 #define PNDFTSHIT_H 1
24 
25 #include "TVector3.h"
26 #include "FairHit.h"
27 
28 class PndFtsHit : public FairHit {
29 
30  public:
32  PndFtsHit();
33 
48  // THIS ONE!
49  PndFtsHit(Int_t detID, Int_t tubeID, Int_t chamberID, Int_t layerID, Int_t skew, Int_t mcindex, TVector3 &pos, TVector3 &dpos, Double_t p, Double_t isochrone,
50  Double_t isochroneError, Double_t chDep);
51 
53  virtual ~PndFtsHit();
54 
56  virtual void Print(const Option_t *opt = nullptr) const
57  {
58  std::cout << " opt = " << opt << std::endl;
59  return;
60  }
61 
65  void Clear();
66 
68  Double_t GetIsochrone() const { return fIsochrone; };
69  Double_t GetIsochroneError() const { return fIsochroneError; };
70  Double_t GetPulse() const { return fPulse; };
71  Double_t GetDepCharge() const { return fDepCharge; };
72  Double_t GetEnergyLoss() const { return fDepCharge / 1e6; };
73 
75  void SetIsochrone(Double_t isochrone) { fIsochrone = isochrone; };
76  void SetIsochroneError(Double_t isochroneError) { fIsochroneError = isochroneError; };
77  void SetDepCharge(Double_t depcharge) { fDepCharge = depcharge; }
78 
79  // tube ID // CHECK added
80  void SetTubeID(Int_t tubeid) { fTubeID = tubeid; }
81  Int_t GetTubeID() const { return fTubeID; }
82  void SetChamberID(Int_t chamberid) { fChamberID = chamberid; }
83  Int_t GetChamberID() const { return fChamberID; }
84  void SetLayerID(Int_t layerid) { fLayerID = layerid; }
85  Int_t GetLayerID() const { return fLayerID; }
86  Int_t GetSkewed() const { return fSkewed; }
87 
88  virtual bool equal(FairTimeStamp *data) const
89  {
90  PndFtsHit *myDigi = dynamic_cast<PndFtsHit *>(data);
91  if (myDigi != nullptr) {
92  if (fTubeID == myDigi->GetTubeID())
93  return true;
94  }
95  return false;
96  }
97 
98  virtual bool operator<(const PndFtsHit &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, PndFtsHit &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  Double_t fIsochrone;
117  Double_t fIsochroneError;
118 
120  Double_t fPulse;
121 
123  Double_t fDepCharge;
124 
126  Int_t fTubeID; // CHECK added
127  Int_t fChamberID;
128  Int_t fLayerID;
129  Int_t fSkewed;
130 
131  ClassDef(PndFtsHit, 2);
132 };
133 
134 #endif
void SetIsochrone(Double_t isochrone)
Definition: PndFtsHit.h:75
Int_t GetTubeID() const
Definition: PndFtsHit.h:81
void SetChamberID(Int_t chamberid)
Definition: PndFtsHit.h:82
Int_t fLayerID
Definition: PndFtsHit.h:128
Int_t GetLayerID() const
Definition: PndFtsHit.h:85
void SetTubeID(Int_t tubeid)
Definition: PndFtsHit.h:80
Double_t fDepCharge
Definition: PndFtsHit.h:123
Int_t GetChamberID() const
Definition: PndFtsHit.h:83
virtual ~PndFtsHit()
Int_t fSkewed
Definition: PndFtsHit.h:129
Int_t GetSkewed() const
Definition: PndFtsHit.h:86
virtual bool operator<(const PndFtsHit &myDigi) const
Definition: PndFtsHit.h:98
Double_t GetDepCharge() const
Definition: PndFtsHit.h:71
Double_t fIsochroneError
Definition: PndFtsHit.h:117
Double_t GetPulse() const
Definition: PndFtsHit.h:70
Double_t fPulse
Definition: PndFtsHit.h:120
void SetDepCharge(Double_t depcharge)
Definition: PndFtsHit.h:77
Double_t GetIsochrone() const
Definition: PndFtsHit.h:68
Int_t fChamberID
Definition: PndFtsHit.h:127
Double_t GetEnergyLoss() const
Definition: PndFtsHit.h:72
virtual bool equal(FairTimeStamp *data) const
Definition: PndFtsHit.h:88
Double_t fIsochrone
Definition: PndFtsHit.h:115
Int_t fTubeID
Definition: PndFtsHit.h:126
Double_t GetIsochroneError() const
Definition: PndFtsHit.h:69
void SetLayerID(Int_t layerid)
Definition: PndFtsHit.h:84
virtual void Print(const Option_t *opt=nullptr) const
Definition: PndFtsHit.h:56
void Clear()
friend std::ostream & operator<<(std::ostream &out, PndFtsHit &digi)
Definition: PndFtsHit.h:106
void SetIsochroneError(Double_t isochroneError)
Definition: PndFtsHit.h:76
ClassDef(PndFtsHit, 2)