PandaRoot
PndSdsMCPoint.h
Go to the documentation of this file.
1 
9 #ifndef PNDSDSMCPOINT_H
10 #define PNDSDSMCPOINT_H
11 
12 #include "TObject.h"
13 #include "TVector3.h"
14 #include "FairMCPoint.h"
15 #include "TString.h"
16 #include "PndDetectorList.h"
17 
18 #include <stdio.h>
19 #include <iostream>
20 
21 using namespace std;
22 
23 class PndSdsMCPoint : public FairMCPoint {
24  friend std::ostream &operator<<(std::ostream &out, const PndSdsMCPoint &point)
25  {
26  out << "-I- PndSdsMCPoint: PndSds Point for track " << point.GetTrackID() << " in detector " << point.GetDetectorID() << " with sensor " << point.GetSensorID() << std::endl;
27  out << " Position in (" << point.GetX() << ", " << point.GetY() << ", " << point.GetZ() << ") cm" << std::endl;
28  out << " Position out (" << point.GetXOut() << ", " << point.GetYOut() << ", " << point.GetZOut() << ") cm" << std::endl;
29  out << " Momentum (" << point.GetPx() << ", " << point.GetPy() << ", " << point.GetPz() << ") GeV" << std::endl;
30  out << " Time " << point.GetTime() << " ns, Length " << point.GetLength() << " cm, Energy loss " << point.GetEnergyLoss() * 1.0e06 << " keV" << std::endl;
31  return out;
32  }
33 
34  public:
36  PndSdsMCPoint();
37 
50  PndSdsMCPoint(Int_t trackID, Int_t detID, Int_t sensorID, TVector3 posIn, TVector3 posOut, TVector3 momIn, TVector3 momOut, Double_t tof, Double_t length, Double_t eLoss);
51 
54  : FairMCPoint(point), fXfOut(point.fXfOut), fYfOut(point.fYfOut), fZfOut(point.fZfOut), fPxfOut(point.fPxfOut), fPyfOut(point.fPyfOut), fPzfOut(point.fPzfOut),
55  fSensorID(point.fSensorID)
56  {
57  *this = point;
58  };
59 
61  virtual ~PndSdsMCPoint();
62 
64  Double_t GetXOut() const { return fXfOut; };
65  Double_t GetYOut() const { return fYfOut; };
66  Double_t GetZOut() const { return fZfOut; };
67 
68  Double_t GetPxOut() const { return fPxfOut; }
69  Double_t GetPyOut() const { return fPyfOut; }
70  Double_t GetPzOut() const { return fPzfOut; }
71  // TString GetDetName() const { return fDetName;}
72  Int_t GetSensorID() const { return fSensorID; }
73  TVector3 GetPosition() const { return TVector3(fX, fY, fZ); }
74  TVector3 GetPositionOut() const { return TVector3(fXfOut, fYfOut, fZfOut); }
75 
76  void PositionOut(TVector3 &pos) const { pos.SetXYZ(fXfOut, fYfOut, fZfOut); };
77  void MomentumOut(TVector3 &mom) const { mom.SetXYZ(fPxfOut, fPyfOut, fPzfOut); }
78 
80  void SetPositionOut(TVector3 pos);
81  void SetMomentumOut(TVector3 mom);
82  // void SetDetName(TString name) {fDetName = name;};
83  void SetSensorID(Int_t sensorID) { fSensorID = sensorID; }
84  virtual void SetTrackID(Int_t id)
85  {
86  // SetLink("MCTrack", id);
87  FairMCPoint::SetTrackID(id);
88  };
89 
91  virtual void Print(const Option_t *opt = nullptr) const;
92 
93  protected:
94  Double32_t fXfOut, fYfOut, fZfOut;
95 
96  Double32_t fPxfOut, fPyfOut, fPzfOut;
97  Int_t fSensorID;
98 
99  ClassDef(PndSdsMCPoint, 6);
100 };
101 
102 inline void PndSdsMCPoint::SetPositionOut(TVector3 pos)
103 {
104  fXfOut = pos.X();
105  fYfOut = pos.Y();
106  fZfOut = pos.Z();
107 }
108 
109 inline void PndSdsMCPoint::SetMomentumOut(TVector3 mom)
110 {
111  fPxfOut = mom.Px();
112  fPyfOut = mom.Py();
113  fPzfOut = mom.Pz();
114 }
115 
116 #endif
PndSdsMCPoint(const PndSdsMCPoint &point)
Definition: PndSdsMCPoint.h:53
virtual void SetTrackID(Int_t id)
Definition: PndSdsMCPoint.h:84
STL namespace.
Int_t GetSensorID() const
Definition: PndSdsMCPoint.h:72
Double_t GetZOut() const
Definition: PndSdsMCPoint.h:66
void PositionOut(TVector3 &pos) const
Definition: PndSdsMCPoint.h:76
Double_t GetYOut() const
Definition: PndSdsMCPoint.h:65
Double32_t fZfOut
Definition: PndSdsMCPoint.h:94
Double32_t fPzfOut
Definition: PndSdsMCPoint.h:96
Double_t GetPxOut() const
Definition: PndSdsMCPoint.h:68
TVector3 GetPosition() const
Definition: PndSdsMCPoint.h:73
friend std::ostream & operator<<(std::ostream &out, const PndSdsMCPoint &point)
Definition: PndSdsMCPoint.h:24
void SetMomentumOut(TVector3 mom)
Double_t GetPzOut() const
Definition: PndSdsMCPoint.h:70
TVector3 GetPositionOut() const
Definition: PndSdsMCPoint.h:74
basic_ostream< char, char_traits< char > > ostream
void SetSensorID(Int_t sensorID)
Definition: PndSdsMCPoint.h:83
void MomentumOut(TVector3 &mom) const
Definition: PndSdsMCPoint.h:77
Double_t GetXOut() const
Definition: PndSdsMCPoint.h:64
void SetPositionOut(TVector3 pos)
Double_t GetPyOut() const
Definition: PndSdsMCPoint.h:69