CbmRoot
Loading...
Searching...
No Matches
CbmMCEvent.h
Go to the documentation of this file.
1/* Copyright (C) 2009-2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Volker Friese [committer] */
4
5#
13#ifndef CBMMCEVENT_H
14#define CBMMCEVENT_H 1
15
16#include <Rtypes.h>
17#include <RtypesCore.h>
18#include <TNamed.h>
19#include <TVector3.h>
20
21#include <cstdint>
22
23
24class CbmMCEvent : public TNamed {
25
26public:
28 CbmMCEvent();
29
30
41 CbmMCEvent(uint32_t runId, int32_t iEvent, double x, double y, double z, double t, double b, double phi,
42 int32_t nPrim);
43
44
46 CbmMCEvent(uint32_t runId);
47
48
50 virtual ~CbmMCEvent();
51
52
54 uint32_t GetRunID() const { return fRunId; } // run identifier
55 int32_t GetEventID() const { return fEventId; } // event identifier
56 double GetX() const { return fX; } // vertex x [cm]
57 double GetY() const { return fY; } // vertex y [cm]
58 double GetZ() const { return fZ; } // vertex z [cm]
59 double GetT() const { return fT; } // event time [ns]
60 double GetB() const { return fB; } // impact parameter [fm]
61 double GetPhi() const { return fPhi; } // event plane angle [rad]
62 int32_t GetNPrim() const { return fNPrim; } // number of input tracks
63 bool IsSet() const { return fIsSet; } // Flag
64 void GetVertex(TVector3& vertex) { vertex.SetXYZ(fX, fY, fZ); }
65
66
68 void SetEventID(int32_t eventId) { fEventId = eventId; }
69 void SetTime(double t) { fT = t; }
70 void SetB(double b) { fB = b; }
71 void SetPhi(double phi) { fPhi = phi; }
72 void SetNPrim(int32_t nPrim) { fNPrim = nPrim; }
73 void MarkSet(bool isSet) { fIsSet = isSet; }
74 void SetVertex(double x, double y, double z);
75 void SetVertex(const TVector3& vertex);
76
77
79 void Reset();
80
81
82private:
83 uint32_t fRunId; // Run identifier
84 uint32_t fEventId; // Event identifier
85 Double32_t fX; // Primary vertex x [cm]
86 Double32_t fY; // Primary vertex y [cm]
87 Double32_t fZ; // Primary vertex z [cm]
88 Double32_t fT; // Event time [s]
89 Double32_t fB; // Impact parameter [fm] (if relevant)
90 Double32_t fPhi; // Event plane angle [rad] (if relevant)
91 int32_t fNPrim; // Number of input tracks
92 bool fIsSet; // Flag whether variables are filled
93
94
96};
97
98
99inline void CbmMCEvent::SetVertex(double x, double y, double z)
100{
101 fX = x;
102 fY = y;
103 fZ = z;
104}
105
106
107inline void CbmMCEvent::SetVertex(const TVector3& vertex)
108{
109 fX = vertex.X();
110 fY = vertex.Y();
111 fZ = vertex.Z();
112}
113
114
115#endif
uint32_t fEventId
Definition CbmMCEvent.h:84
int32_t fNPrim
Definition CbmMCEvent.h:91
double GetB() const
Definition CbmMCEvent.h:60
void SetB(double b)
Definition CbmMCEvent.h:70
double GetY() const
Definition CbmMCEvent.h:57
void SetEventID(int32_t eventId)
Definition CbmMCEvent.h:68
ClassDef(CbmMCEvent, 1)
void SetPhi(double phi)
Definition CbmMCEvent.h:71
double GetZ() const
Definition CbmMCEvent.h:58
bool IsSet() const
Definition CbmMCEvent.h:63
Double32_t fZ
Definition CbmMCEvent.h:87
Double32_t fT
Definition CbmMCEvent.h:88
void GetVertex(TVector3 &vertex)
Definition CbmMCEvent.h:64
void SetVertex(double x, double y, double z)
Definition CbmMCEvent.h:99
virtual ~CbmMCEvent()
void Reset()
Double32_t fB
Definition CbmMCEvent.h:89
int32_t GetNPrim() const
Definition CbmMCEvent.h:62
Double32_t fPhi
Definition CbmMCEvent.h:90
void MarkSet(bool isSet)
Definition CbmMCEvent.h:73
bool fIsSet
Definition CbmMCEvent.h:92
double GetPhi() const
Definition CbmMCEvent.h:61
void SetTime(double t)
Definition CbmMCEvent.h:69
int32_t GetEventID() const
Definition CbmMCEvent.h:55
Double32_t fX
Definition CbmMCEvent.h:85
uint32_t fRunId
Definition CbmMCEvent.h:83
double GetX() const
Definition CbmMCEvent.h:56
void SetNPrim(int32_t nPrim)
Definition CbmMCEvent.h:72
uint32_t GetRunID() const
Definition CbmMCEvent.h:54
Double32_t fY
Definition CbmMCEvent.h:86
double GetT() const
Definition CbmMCEvent.h:59