BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
BmnNdetPoint.h
Go to the documentation of this file.
1
#ifndef BMNNDETPOINT_H
2
#define BMNNDETPOINT_H
3
4
#include "
BmnNdetAddressMixin.h
"
5
#include "FairMCPoint.h"
6
#include "
TVector3.h
"
7
8
#include <iostream>
9
10
using namespace
std
;
11
12
class
BmnNdetPoint
13
:
public
FairMCPoint
14
,
public
BmnNdetAddressMixin
<BmnNdetPoint>
15
{
16
public
:
17
//! Default constructor
18
BmnNdetPoint
()
19
:
FairMCPoint
()
20
,
fAddress
(0)
21
{
22
fDetectorID =
kNDET
;
23
}
24
25
/*! Constructor with arguments
26
*@param trackID Index of MCTrack
27
*@param address see BmnNdetAddress
28
*@param pos Coordinates [cm]
29
*@param mom Momentum of track [GeV]
30
*@param tof Time of flight [ns]
31
*@param length Track length since creation [cm]
32
*@param eLoss Energy deposit [GeV]
33
*/
34
BmnNdetPoint
(
Int_t
trackID,
35
uint32_t address,
36
const
TVector3
& pos,
37
const
TVector3
& mom,
38
Double_t
tof,
39
Double_t
length,
40
Double_t
eLoss,
41
UInt_t EventId = 0)
42
:
FairMCPoint
(trackID,
kNDET
, pos, mom, tof, length, eLoss, EventId)
43
,
fAddress
(address)
44
{}
45
46
//! Copy constructor
47
BmnNdetPoint
(
const
BmnNdetPoint
& point)
48
:
FairMCPoint
(point)
49
,
fAddress
(point.
fAddress
)
50
{}
51
52
//! Move constructor
53
BmnNdetPoint
(
BmnNdetPoint
&& point)
noexcept
54
:
FairMCPoint
(std::move(point))
55
,
fAddress
(point.fAddress)
56
{
57
point.fAddress = 0;
58
}
59
60
//! Copy assignment operator
61
BmnNdetPoint
&
operator=
(
const
BmnNdetPoint
& point)
62
{
63
if
(
this
!= &point) {
64
FairMCPoint::operator=(point);
65
fAddress
= point.
fAddress
;
66
}
67
return
*
this
;
68
}
69
70
//! Move assignment operator
71
BmnNdetPoint
&
operator=
(
BmnNdetPoint
&& point)
noexcept
72
{
73
if
(
this
!= &point) {
74
FairMCPoint::operator=(std::move(point));
75
fAddress
= point.fAddress;
76
point.fAddress = 0;
77
}
78
return
*
this
;
79
}
80
81
//! Destructor
82
virtual
~BmnNdetPoint
() =
default
;
83
84
uint32_t
GetAddress
()
const
{
return
fAddress
; }
85
void
SetAddress
(uint32_t address) {
fAddress
= address; }
86
87
//! Output to screen
88
virtual
const
char
*
GetClassName
()
const
{
return
"BmnNdetPoint"
; }
89
virtual
void
Print
(
const
Option_t
* opt =
""
)
const
90
{
91
printf(
"%s: %s\n"
,
GetClassName
(),
BmnNdetAddress::GetInfoString
(
fAddress
).c_str());
92
printf(
" track %d\n"
, GetTrackID());
93
printf(
" Position (%.2f, %.2f, %.2f) cm\n"
, GetX(), GetY(), GetZ());
94
printf(
" Momentum (%.2f, %.2f, %.2f) GeV\n"
, GetPx(), GetPy(), GetPz());
95
printf(
" Time %.2f ns, Length %.2f cm\n"
, GetTime(), GetLength());
96
printf(
" Energy loss %.6f GeV\n"
, GetEnergyLoss());
97
}
98
99
private
:
100
uint32_t
fAddress
;
101
102
ClassDef
(
BmnNdetPoint
, 5)
103
};
104
105
#endif
/* BMNNDETPOINT_H */
Int_t
int Int_t
Double_t
double Double_t
Option_t
const char Option_t
ClassDef
#define ClassDef(name, id)
TVector3.h
kNDET
@ kNDET
Definition
BmnDetectorList.h:35
BmnNdetAddressMixin
interface to use the address methods
Definition
BmnNdetAddressMixin.h:16
BmnNdetAddress::GetInfoString
static std::string GetInfoString(uint32_t address)
Return a formatted string with all address components.
Definition
BmnNdetAddress.h:55
BmnNdetPoint::GetClassName
virtual const char * GetClassName() const
Output to screen.
Definition
BmnNdetPoint.h:88
BmnNdetPoint::BmnNdetPoint
BmnNdetPoint(BmnNdetPoint &&point) noexcept
Move constructor.
Definition
BmnNdetPoint.h:53
BmnNdetPoint::Print
virtual void Print(const Option_t *opt="") const
Definition
BmnNdetPoint.h:89
BmnNdetPoint::GetAddress
uint32_t GetAddress() const
Definition
BmnNdetPoint.h:84
BmnNdetPoint::~BmnNdetPoint
virtual ~BmnNdetPoint()=default
Destructor.
BmnNdetPoint::BmnNdetPoint
BmnNdetPoint(const BmnNdetPoint &point)
Copy constructor.
Definition
BmnNdetPoint.h:47
BmnNdetPoint::BmnNdetPoint
BmnNdetPoint(Int_t trackID, uint32_t address, const TVector3 &pos, const TVector3 &mom, Double_t tof, Double_t length, Double_t eLoss, UInt_t EventId=0)
Constructor with arguments.
Definition
BmnNdetPoint.h:34
BmnNdetPoint::SetAddress
void SetAddress(uint32_t address)
Definition
BmnNdetPoint.h:85
BmnNdetPoint::fAddress
uint32_t fAddress
Definition
BmnNdetPoint.h:100
BmnNdetPoint::operator=
BmnNdetPoint & operator=(const BmnNdetPoint &point)
Copy assignment operator.
Definition
BmnNdetPoint.h:61
BmnNdetPoint::operator=
BmnNdetPoint & operator=(BmnNdetPoint &&point) noexcept
Move assignment operator.
Definition
BmnNdetPoint.h:71
BmnNdetPoint::BmnNdetPoint
BmnNdetPoint()
Default constructor.
Definition
BmnNdetPoint.h:18
FairMCPoint
TVector3
BmnNdetAddressMixin.h
std
Definition
json.hpp:4446
std::noexcept
*brief exchanges the values of two JSON objects *sa nlohmann::NLOHMANN_BASIC_JSON_TPL &j2 noexcept(is_nothrow_move_constructible< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value &&is_nothrow_move_assignable< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value)
Definition
json.hpp:20347
detectors
ndet
BmnNdetPoint.h
Generated on
for BmnRoot by
1.17.0