Project
Loading...
Searching...
No Matches
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
21namespace boost {
22namespace serialization {
23class access;
24}
25} // namespace boost
26#include <boost/serialization/base_object.hpp>
27
29{
30 public:
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;
117 Double32_t fX, fY, fZ;
118
120};
121
122inline void FairMCPoint::SetMomentum(const TVector3& mom)
123{
124 fPx = mom.Px();
125 fPy = mom.Py();
126 fPz = mom.Pz();
127}
128
129inline void FairMCPoint::SetXYZ(Double_t x, Double_t y, Double_t z)
130{
131 fX = x;
132 fY = y;
133 fZ = z;
134}
135
136inline void FairMCPoint::SetPosition(const TVector3& pos)
137{
138 fX = pos.X();
139 fY = pos.Y();
140 fZ = pos.Z();
141}
142
143#endif
int16_t time
Definition RawEventData.h:4
uint16_t pos
Definition RawData.h:3
Double32_t fZ
Position of hit [cm].
Double_t GetZ() const
Definition FairMCPoint.h:69
Double_t GetPx() const
Definition FairMCPoint.h:59
Double32_t fPy
void SetMomentum(const TVector3 &mom)
Double_t GetEnergyLoss() const
Definition FairMCPoint.h:64
Int_t fDetectorID
Detector unique identifier.
Double_t GetLength() const
Definition FairMCPoint.h:63
Double_t GetX() const
Definition FairMCPoint.h:67
Double_t GetPz() const
Definition FairMCPoint.h:61
Double32_t fPz
Momentum components [GeV].
void SetEnergyLoss(Double_t eLoss)
Definition FairMCPoint.h:77
Double32_t fX
Double_t GetTime() const
Definition FairMCPoint.h:62
void SetXYZ(Double_t x, Double_t y, Double_t z)
virtual ~FairMCPoint()
Int_t GetDetectorID() const
Definition FairMCPoint.h:66
void SetX(Double_t x)
Definition FairMCPoint.h:80
virtual void Print(const Option_t *opt=0) const
Double32_t fTime
Time since event start [ns].
Double32_t fY
void Momentum(TVector3 &mom) const
Definition FairMCPoint.h:65
ClassDef(FairMCPoint, 5)
void SetEventID(UInt_t eventId)
Definition FairMCPoint.h:73
Double32_t fELoss
Energy loss at this point [GeV].
void SetDetectorID(Int_t detID)
Definition FairMCPoint.h:79
void SetZ(Double_t z)
Definition FairMCPoint.h:82
Double32_t fLength
Track length since creation [cm].
void SetLength(Double_t length)
Definition FairMCPoint.h:76
Int_t fTrackID
Track index.
void Position(TVector3 &pos) const
Definition FairMCPoint.h:70
void SetTime(Double_t time)
Definition FairMCPoint.h:75
void serialize(Archive &ar, const unsigned int)
Definition FairMCPoint.h:90
UInt_t GetEventID() const
Definition FairMCPoint.h:57
Int_t GetTrackID() const
event identifier
Definition FairMCPoint.h:58
friend class boost::serialization::access
Double32_t fPx
void SetY(Double_t y)
Definition FairMCPoint.h:81
Double_t GetPy() const
Definition FairMCPoint.h:60
virtual void SetTrackID(Int_t id)
Definition FairMCPoint.h:74
void SetPosition(const TVector3 &pos)
Double_t GetY() const
Definition FairMCPoint.h:68
UInt_t fEventId
MC Event id.
GLint GLenum GLint x
Definition glcorearb.h:403
GLint y
Definition glcorearb.h:270
GLuint GLsizei GLsizei * length
Definition glcorearb.h:790
GLuint GLint GLboolean GLint GLenum access
Definition glcorearb.h:2196
GLuint id
Definition glcorearb.h:650
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843