PandaRoot
PndGemMCPoint.h
Go to the documentation of this file.
1 // -------------------------------------------------------------------------
2 // ----- PndGemPoint header file -----
3 // ----- Created 27/10/08 by R. Kliemt -----
4 // -------------------------------------------------------------------------
5 
14 #ifndef PNDGEMMCPOINT_H
15 #define PNDGEMMCPOINT_H
16 
17 #include "TObject.h"
18 #include "TVector3.h"
19 #include "FairMCPoint.h"
20 #include "TString.h"
21 
22 #include <stdio.h>
23 #include <iostream>
24 
25 using namespace std;
26 
27 class PndGemMCPoint : public FairMCPoint {
28  friend std::ostream &operator<<(std::ostream &out, const PndGemMCPoint &point)
29  {
30  out << "-I- PndGemMCPoint: PndGem Point for track " << point.GetTrackID() << " in detector " << point.GetDetectorID() << " with sensorID " << point.GetSensorId() << std::endl;
31  out << " Position in (" << point.GetX() << ", " << point.GetY() << ", " << point.GetZ() << ") cm" << std::endl;
32  out << " Position out (" << point.GetXOut() << ", " << point.GetYOut() << ", " << point.GetZOut() << ") cm" << std::endl;
33  out << " Momentum (" << point.GetPx() << ", " << point.GetPy() << ", " << point.GetPz() << ") GeV" << std::endl;
34  out << " Time " << point.GetTime() << " ns, Length " << point.GetLength() << " cm, Energy loss " << point.GetEnergyLoss() * 1.0e06 << " keV" << std::endl;
35  return out;
36  }
37 
38  public:
40  PndGemMCPoint();
41 
54  PndGemMCPoint(Int_t trackID, Int_t detID, Int_t sensID, TVector3 posIn, TVector3 posOut, TVector3 momIn, TVector3 momOut, Double_t tof, Double_t length, Double_t eLoss);
55 
57  PndGemMCPoint(const PndGemMCPoint &point) : FairMCPoint(point), fXfOut(0.), fYfOut(0.), fZfOut(0.), fPxfOut(0.), fPyfOut(0.), fPzfOut(0.), fSensorId(0) { *this = point; };
58 
60  virtual ~PndGemMCPoint();
61 
63  Double_t GetXOut() const { return fXfOut; };
64  Double_t GetYOut() const { return fYfOut; };
65  Double_t GetZOut() const { return fZfOut; };
66 
67  Double_t GetPxOut() const { return fPxfOut; }
68  Double_t GetPyOut() const { return fPyfOut; }
69  Double_t GetPzOut() const { return fPzfOut; }
70  Int_t GetSensorId() const { return fSensorId; }
71  TVector3 GetPosition() const { return TVector3(fX, fY, fZ); }
72  TVector3 GetPositionOut() const { return TVector3(fXfOut, fYfOut, fZfOut); }
73 
74  void PositionOut(TVector3 &pos) const { pos.SetXYZ(fXfOut, fYfOut, fZfOut); };
75  void MomentumOut(TVector3 &mom) const { mom.SetXYZ(fPxfOut, fPyfOut, fPzfOut); }
76 
78  void SetPositionOut(TVector3 pos);
79  void SetMomentumOut(TVector3 mom);
80  void SetSensorId(Int_t sensId) { fSensorId = sensId; };
81 
83  virtual void Print(const Option_t *opt = nullptr) const;
84 
85  protected:
86  Double32_t fXfOut, fYfOut, fZfOut;
87 
88  Double32_t fPxfOut, fPyfOut, fPzfOut;
89  Int_t fSensorId;
90 
91  ClassDef(PndGemMCPoint, 1);
92 };
93 
94 inline void PndGemMCPoint::SetPositionOut(TVector3 pos)
95 {
96  fXfOut = pos.X();
97  fYfOut = pos.Y();
98  fZfOut = pos.Z();
99 }
100 
101 inline void PndGemMCPoint::SetMomentumOut(TVector3 mom)
102 {
103  fPxfOut = mom.Px();
104  fPyfOut = mom.Py();
105  fPzfOut = mom.Pz();
106 }
107 
108 #endif
Double32_t fZfOut
Definition: PndGemMCPoint.h:86
Double_t GetXOut() const
Definition: PndGemMCPoint.h:63
TVector3 GetPosition() const
Definition: PndGemMCPoint.h:71
void SetPositionOut(TVector3 pos)
Definition: PndGemMCPoint.h:94
TVector3 GetPositionOut() const
Definition: PndGemMCPoint.h:72
Double32_t fPzfOut
Definition: PndGemMCPoint.h:88
STL namespace.
Int_t GetSensorId() const
Definition: PndGemMCPoint.h:70
friend std::ostream & operator<<(std::ostream &out, const PndGemMCPoint &point)
Definition: PndGemMCPoint.h:28
void SetSensorId(Int_t sensId)
Definition: PndGemMCPoint.h:80
Double_t GetPxOut() const
Definition: PndGemMCPoint.h:67
void MomentumOut(TVector3 &mom) const
Definition: PndGemMCPoint.h:75
PndGemMCPoint(const PndGemMCPoint &point)
Definition: PndGemMCPoint.h:57
Double_t GetPyOut() const
Definition: PndGemMCPoint.h:68
void SetMomentumOut(TVector3 mom)
Double_t GetZOut() const
Definition: PndGemMCPoint.h:65
Double_t GetPzOut() const
Definition: PndGemMCPoint.h:69
basic_ostream< char, char_traits< char > > ostream
Double_t GetYOut() const
Definition: PndGemMCPoint.h:64
void PositionOut(TVector3 &pos) const
Definition: PndGemMCPoint.h:74