FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairMCPoint.h
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
13 #ifndef FAIRMCPOINT_H
14 #define FAIRMCPOINT_H
15 
16 #include "FairMultiLinkedData_Interface.h" // for FairMultiLinkedData
17 
18 #include <Rtypes.h> // for Double_t, Double32_t, Int_t, etc
19 #include <TVector3.h> // for TVector3
20 
21 namespace boost {
22 namespace serialization {
23 class access;
24 }
25 } // namespace boost
26 #include <boost/serialization/base_object.hpp>
27 
29 {
30  public:
32  FairMCPoint();
33 
44  FairMCPoint(Int_t trackID,
45  Int_t detID,
46  TVector3 pos,
47  TVector3 mom,
48  Double_t tof,
49  Double_t length,
50  Double_t eLoss,
51  UInt_t EventId = 0);
52 
54  virtual ~FairMCPoint();
55 
57  UInt_t GetEventID() const { return fEventId; }
58  Int_t GetTrackID() const { return fTrackID; }
59  Double_t GetPx() const { return fPx; }
60  Double_t GetPy() const { return fPy; }
61  Double_t GetPz() const { return fPz; }
62  Double_t GetTime() const { return fTime; }
63  Double_t GetLength() const { return fLength; }
64  Double_t GetEnergyLoss() const { return fELoss; }
65  void Momentum(TVector3& mom) const { mom.SetXYZ(fPx, fPy, fPz); }
66  Int_t GetDetectorID() const { return fDetectorID; };
67  Double_t GetX() const { return fX; };
68  Double_t GetY() const { return fY; };
69  Double_t GetZ() const { return fZ; };
70  void Position(TVector3& pos) const { pos.SetXYZ(fX, fY, fZ); }
71 
73  void SetEventID(UInt_t eventId) { fEventId = eventId; }
74  virtual void SetTrackID(Int_t id) { fTrackID = id; }
75  void SetTime(Double_t time) { fTime = time; }
76  void SetLength(Double_t length) { fLength = length; }
77  void SetEnergyLoss(Double_t eLoss) { fELoss = eLoss; }
78  void SetMomentum(const TVector3& mom);
79  void SetDetectorID(Int_t detID) { fDetectorID = detID; }
80  void SetX(Double_t x) { fX = x; }
81  void SetY(Double_t y) { fY = y; }
82  void SetZ(Double_t z) { fZ = z; }
83  void SetXYZ(Double_t x, Double_t y, Double_t z);
84  void SetPosition(const TVector3& pos);
85 
87  virtual void Print(const Option_t* opt = 0) const;
88 
89  template<class Archive>
90  void serialize(Archive& ar, const unsigned int)
91  {
92  // ar & boost::serialization::base_object<FairMultiLinkedData>(*this);
93  ar& fTrackID;
94  ar& fEventId;
95  ar& fDetectorID;
96  ar& fX;
97  ar& fY;
98  ar& fZ;
99  ar& fPx;
100  ar& fPy;
101  ar& fPz;
102  ar& fTime;
103  ar& fLength;
104  ar& fELoss;
105  }
106 
107  protected:
109 
110  Int_t fTrackID;
111  UInt_t fEventId;
112  Double32_t fPx, fPy, fPz;
113  Double32_t fTime;
114  Double32_t fLength;
115  Double32_t fELoss;
116  Int_t fDetectorID;
117  Double32_t fX, fY, fZ;
118 
119  ClassDef(FairMCPoint, 5);
120 };
121 
122 inline void FairMCPoint::SetMomentum(const TVector3& mom)
123 {
124  fPx = mom.Px();
125  fPy = mom.Py();
126  fPz = mom.Pz();
127 }
128 
129 inline void FairMCPoint::SetXYZ(Double_t x, Double_t y, Double_t z)
130 {
131  fX = x;
132  fY = y;
133  fZ = z;
134 }
135 
136 inline void FairMCPoint::SetPosition(const TVector3& pos)
137 {
138  fX = pos.X();
139  fY = pos.Y();
140  fZ = pos.Z();
141 }
142 
143 #endif
Double32_t fPy
Definition: FairMCPoint.h:112
Double32_t fZ
Position of hit [cm].
Definition: FairMCPoint.h:117
virtual ~FairMCPoint()
Definition: FairMCPoint.cxx:51
Double_t GetPx() const
Definition: FairMCPoint.h:59
Double_t GetZ() const
Definition: FairMCPoint.h:69
Double_t GetX() const
Definition: FairMCPoint.h:67
void Momentum(TVector3 &mom) const
Definition: FairMCPoint.h:65
UInt_t fEventId
MC Event id.
Definition: FairMCPoint.h:111
ClassDef(FairMCPoint, 5)
Double32_t fLength
Track length since creation [cm].
Definition: FairMCPoint.h:114
void SetEnergyLoss(Double_t eLoss)
Definition: FairMCPoint.h:77
void SetDetectorID(Int_t detID)
Definition: FairMCPoint.h:79
Double32_t fELoss
Energy loss at this point [GeV].
Definition: FairMCPoint.h:115
Int_t fTrackID
Track index.
Definition: FairMCPoint.h:110
void Position(TVector3 &pos) const
Definition: FairMCPoint.h:70
void SetZ(Double_t z)
Definition: FairMCPoint.h:82
Double32_t fX
Definition: FairMCPoint.h:117
Double32_t fPx
Definition: FairMCPoint.h:112
void SetPosition(const TVector3 &pos)
Definition: FairMCPoint.h:136
Int_t GetTrackID() const
event identifier
Definition: FairMCPoint.h:58
void SetXYZ(Double_t x, Double_t y, Double_t z)
Definition: FairMCPoint.h:129
friend class boost::serialization::access
Definition: FairMCPoint.h:108
Double_t GetEnergyLoss() const
Definition: FairMCPoint.h:64
Double_t GetPz() const
Definition: FairMCPoint.h:61
void SetLength(Double_t length)
Definition: FairMCPoint.h:76
void SetY(Double_t y)
Definition: FairMCPoint.h:81
void SetEventID(UInt_t eventId)
Definition: FairMCPoint.h:73
void SetMomentum(const TVector3 &mom)
Definition: FairMCPoint.h:122
Double32_t fPz
Momentum components [GeV].
Definition: FairMCPoint.h:112
virtual void SetTrackID(Int_t id)
Definition: FairMCPoint.h:74
Double_t GetPy() const
Definition: FairMCPoint.h:60
virtual void Print(const Option_t *opt=0) const
Definition: FairMCPoint.cxx:53
Double32_t fTime
Time since event start [ns].
Definition: FairMCPoint.h:113
Double_t GetLength() const
Definition: FairMCPoint.h:63
void SetTime(Double_t time)
Definition: FairMCPoint.h:75
UInt_t GetEventID() const
Definition: FairMCPoint.h:57
Double_t GetY() const
Definition: FairMCPoint.h:68
void SetX(Double_t x)
Definition: FairMCPoint.h:80
void serialize(Archive &ar, const unsigned int)
Definition: FairMCPoint.h:90
Double_t GetTime() const
Definition: FairMCPoint.h:62
Int_t GetDetectorID() const
Definition: FairMCPoint.h:66
Int_t fDetectorID
Detector unique identifier.
Definition: FairMCPoint.h:116
Double32_t fY
Definition: FairMCPoint.h:117