BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
BmnMCInfoDst.cxx
Go to the documentation of this file.
1
/********************************************************************************
2
* BmnMCInfoDst.cxx *
3
*******************************************************************************/
4
#include "
BmnMCInfoDst.h
"
5
6
// Default constructor
7
BmnMCInfoDst::BmnMCInfoDst
()
8
:
TNamed
(
"BmnMCInfoDST"
,
"MC"
)
9
,
fB
(0.)
10
,
fX
(0.)
11
,
fY
(0.)
12
,
fZ
(0.)
13
,
fRotX
(0.)
14
,
fRotY
(0.)
15
,
fRotZ
(0.)
16
{
17
fMCTracks
=
new
TClonesArray
(
"CbmMCTrack"
);
18
}
19
20
// Copy constructor
21
BmnMCInfoDst::BmnMCInfoDst
(
const
BmnMCInfoDst
& other)
22
:
TNamed
(
"BmnMCInfoDST"
,
"MC"
)
23
,
fB
{other.
fB
}
24
,
fX
(other.
fX
)
25
,
fY
(other.
fY
)
26
,
fZ
(other.
fZ
)
27
,
fRotX
(other.
fRotX
)
28
,
fRotY
(other.
fRotY
)
29
,
fRotZ
(other.
fRotZ
)
30
{
31
if
(other.
fMCTracks
)
32
fMCTracks
=
new
TClonesArray
(*other.
fMCTracks
);
33
else
34
fMCTracks
=
nullptr
;
35
}
36
37
// Copy assignment operator
38
BmnMCInfoDst
&
BmnMCInfoDst::operator=
(
const
BmnMCInfoDst
& other)
39
{
40
if
(&other !=
this
) {
41
fB
= other.
fB
;
42
fX
= other.
fX
;
43
fY
= other.
fY
;
44
fZ
= other.
fZ
;
45
fRotX
= other.
fRotX
;
46
fRotY
= other.
fRotY
;
47
fRotZ
= other.
fRotZ
;
48
49
// delete the previous fMCTrack
50
if
(
fMCTracks
) {
51
fMCTracks
->Delete();
52
delete
fMCTracks
;
53
}
54
if
(other.
fMCTracks
)
55
fMCTracks
=
new
TClonesArray
(*other.
fMCTracks
);
56
else
57
fMCTracks
=
nullptr
;
58
}
59
return
*
this
;
60
}
61
62
// Move constructor
63
BmnMCInfoDst::BmnMCInfoDst
(
BmnMCInfoDst
&& other)
64
:
TNamed
(
"BmnMCInfoDST"
,
"MC"
)
65
,
fB
{other.
fB
}
66
,
fX
(other.
fX
)
67
,
fY
(other.
fY
)
68
,
fZ
(other.
fZ
)
69
,
fRotX
(other.
fRotX
)
70
,
fRotY
(other.
fRotY
)
71
,
fRotZ
(other.
fRotZ
)
72
{
73
fMCTracks
= std::exchange(other.fMCTracks,
nullptr
);
74
}
75
76
// Move assignment operator
77
BmnMCInfoDst
&
BmnMCInfoDst::operator=
(
BmnMCInfoDst
&& other)
78
{
79
fB
= other.fB;
80
fX
= other.fX;
81
fY
= other.fY;
82
fZ
= other.fZ;
83
fRotX
= other.fRotX;
84
fRotY
= other.fRotY;
85
fRotZ
= other.fRotZ;
86
87
// delete the previous fMCTrack
88
if
(
fMCTracks
) {
89
fMCTracks
->Delete();
90
delete
fMCTracks
;
91
}
92
fMCTracks
= std::exchange(other.fMCTracks,
nullptr
);
93
94
return
*
this
;
95
}
96
97
void
BmnMCInfoDst::SetVertex
(
Double_t
x,
Double_t
y,
Double_t
z)
98
{
99
fX
= x;
100
fY
= y;
101
fZ
= z;
102
}
103
104
void
BmnMCInfoDst::Reset
()
105
{
106
fX
=
fY
=
fZ
=
fB
= 0.;
107
fRotX
=
fRotY
=
fRotZ
= 0.;
108
if
(
fMCTracks
)
109
fMCTracks
->Delete();
110
}
111
112
// Destructor
113
BmnMCInfoDst::~BmnMCInfoDst
()
114
{
115
if
(
fMCTracks
) {
116
fMCTracks
->Delete();
117
delete
fMCTracks
;
118
}
119
}
Double_t
double Double_t
BmnMCInfoDst.h
BmnMCInfoDst::Reset
void Reset()
Definition
BmnMCInfoDst.cxx:104
BmnMCInfoDst::operator=
BmnMCInfoDst & operator=(const BmnMCInfoDst &other)
Copy assignment operator.
Definition
BmnMCInfoDst.cxx:38
BmnMCInfoDst::fY
Double32_t fY
Primary vertex x [cm].
Definition
BmnMCInfoDst.h:47
BmnMCInfoDst::fRotZ
Double32_t fRotZ
Rotation around y-axis (beam tilt) [rad].
Definition
BmnMCInfoDst.h:51
BmnMCInfoDst::fB
Double32_t fB
Definition
BmnMCInfoDst.h:45
BmnMCInfoDst::BmnMCInfoDst
BmnMCInfoDst()
Default constructor.
Definition
BmnMCInfoDst.cxx:7
BmnMCInfoDst::fRotY
Double32_t fRotY
Rotation around x-axis (beam tilt) [rad].
Definition
BmnMCInfoDst.h:50
BmnMCInfoDst::SetVertex
void SetVertex(Double_t x, Double_t y, Double_t z)
Definition
BmnMCInfoDst.cxx:97
BmnMCInfoDst::fZ
Double32_t fZ
Primary vertex y [cm].
Definition
BmnMCInfoDst.h:48
BmnMCInfoDst::fRotX
Double32_t fRotX
Primary vertex z [cm].
Definition
BmnMCInfoDst.h:49
BmnMCInfoDst::fMCTracks
TClonesArray * fMCTracks
Rotation around z-axis (event plane) [rad].
Definition
BmnMCInfoDst.h:53
BmnMCInfoDst::~BmnMCInfoDst
~BmnMCInfoDst()
Destructor.
Definition
BmnMCInfoDst.cxx:113
BmnMCInfoDst::fX
Double32_t fX
Impact parameter [fm] (if relevant).
Definition
BmnMCInfoDst.h:46
TNamed::TNamed
TNamed()
TObject::TClonesArray
friend friend class TClonesArray
base
data
BmnMCInfoDst.cxx
Generated on
for BmnRoot by
1.17.0