BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
BmnMCPoint.h
Go to the documentation of this file.
1
/**
2
* \file BmnMCPoint.h
3
* \brief Monte-Carlo point.
4
* \author Andrey Lebedev <andrey.lebedev@gsi.de>
5
* \date 2011
6
**/
7
#ifndef BMNMCPOINT_H_
8
#define BMNMCPOINT_H_
9
10
#include "
TObject.h
"
11
12
#include <cmath>
13
#include <sstream>
14
#include <string>
15
16
/**
17
* \class BmnMCPoint
18
* \brief Monte-Carlo point.
19
* \author Andrey Lebedev <andrey.lebedev@gsi.de>
20
* \date 2011
21
**/
22
class
BmnMCPoint
23
{
24
public
:
25
/*
26
* \brief Constructor.
27
*/
28
BmnMCPoint
()
29
:
fXIn
(0.)
30
,
fYIn
(0.)
31
,
fZIn
(0.)
32
,
fPxIn
(0.)
33
,
fPyIn
(0.)
34
,
fPzIn
(0.)
35
,
fXOut
(0.)
36
,
fYOut
(0.)
37
,
fZOut
(0.)
38
,
fPxOut
(0.)
39
,
fPyOut
(0.)
40
,
fPzOut
(0.)
41
,
fRefId
(-1)
42
,
fStationId
(-1)
43
,
fQ
(1.)
44
{}
45
46
/*
47
* \brief Destructor.
48
*/
49
virtual
~BmnMCPoint
() {}
50
51
/* Getters */
52
Double_t
GetX
()
const
{
return
(
fXIn
+
fXOut
) / 2.; }
53
Double_t
GetY
()
const
{
return
(
fYIn
+
fYOut
) / 2.; }
54
Double_t
GetZ
()
const
{
return
(
fZIn
+
fZOut
) / 2.; }
55
Double_t
GetPx
()
const
{
return
(
fPxIn
+
fPxOut
) / 2.; }
56
Double_t
GetPy
()
const
{
return
(
fPyIn
+
fPyOut
) / 2.; }
57
Double_t
GetPz
()
const
{
return
(
fPzIn
+
fPzOut
) / 2.; }
58
Double_t
GetTx
()
const
{
return
GetPx
() /
GetPz
(); }
59
Double_t
GetTy
()
const
{
return
GetPy
() /
GetPz
(); }
60
Double_t
GetP
()
const
{
return
std::sqrt(
GetPx
() *
GetPx
() +
GetPy
() *
GetPy
() +
GetPz
() *
GetPz
()); }
61
Double_t
GetQp
()
const
62
{
63
Double_t
p =
GetP
();
64
Double_t
res = (p != 0.) ?
fQ
/ p : 0.;
65
return
res;
66
}
67
Double_t
GetQ
()
const
{
return
fQ
; }
68
Double_t
GetXIn
()
const
{
return
fXIn
; }
69
Double_t
GetYIn
()
const
{
return
fYIn
; }
70
Double_t
GetZIn
()
const
{
return
fZIn
; }
71
Double_t
GetPxIn
()
const
{
return
fPxIn
; }
72
Double_t
GetPyIn
()
const
{
return
fPyIn
; }
73
Double_t
GetPzIn
()
const
{
return
fPzIn
; }
74
Double_t
GetTxIn
()
const
{
return
fPxIn
/
fPzIn
; }
75
Double_t
GetTyIn
()
const
{
return
fPyIn
/
fPzIn
; }
76
Double_t
GetPIn
()
const
{
return
std::sqrt(
fPxIn
*
fPxIn
+
fPyIn
*
fPyIn
+
fPzIn
*
fPzIn
); }
77
Double_t
GetQpIn
()
const
78
{
79
Double_t
p =
GetPIn
();
80
Double_t
res = (p != 0.) ?
fQ
/ p : 0.;
81
return
res;
82
}
83
Double_t
GetXOut
()
const
{
return
fXOut
; }
84
Double_t
GetYOut
()
const
{
return
fYOut
; }
85
Double_t
GetZOut
()
const
{
return
fZOut
; }
86
Double_t
GetPxOut
()
const
{
return
fPxOut
; }
87
Double_t
GetPyOut
()
const
{
return
fPyOut
; }
88
Double_t
GetPzOut
()
const
{
return
fPzOut
; }
89
Double_t
GetTxOut
()
const
{
return
fPxOut
/
fPzOut
; }
90
Double_t
GetTyOut
()
const
{
return
fPyOut
/
fPzOut
; }
91
Double_t
GetPOut
()
const
{
return
std::sqrt(
fPxOut
*
fPxOut
+
fPyOut
*
fPyOut
+
fPzOut
*
fPzOut
); }
92
Double_t
GetQpOut
()
const
93
{
94
Double_t
p =
GetPOut
();
95
Double_t
res = (p != 0.) ?
fQ
/ p : 0.;
96
return
res;
97
}
98
Int_t
GetRefId
()
const
{
return
fRefId
; }
99
Int_t
GetStationId
()
const
{
return
fStationId
; }
100
101
/* Setters */
102
void
SetXIn
(
Double_t
x) {
fXIn
= x; }
103
void
SetYIn
(
Double_t
y) {
fYIn
= y; }
104
void
SetZIn
(
Double_t
z) {
fZIn
= z; }
105
void
SetPxIn
(
Double_t
px) {
fPxIn
= px; }
106
void
SetPyIn
(
Double_t
py) {
fPyIn
= py; }
107
void
SetPzIn
(
Double_t
pz) {
fPzIn
= pz; }
108
void
SetXOut
(
Double_t
x) {
fXOut
= x; }
109
void
SetYOut
(
Double_t
y) {
fYOut
= y; }
110
void
SetZOut
(
Double_t
z) {
fZOut
= z; }
111
void
SetPxOut
(
Double_t
px) {
fPxOut
= px; }
112
void
SetPyOut
(
Double_t
py) {
fPyOut
= py; }
113
void
SetPzOut
(
Double_t
pz) {
fPzOut
= pz; }
114
void
SetQ
(
Double_t
q) {
fQ
= q; }
115
void
SetRefId
(
Int_t
refId) {
fRefId
= refId; }
116
void
SetStationId
(
Int_t
stationId) {
fStationId
= stationId; }
117
118
/**
119
* \brief Returns std::string representation of the class.
120
* \return Class representation as std::string.
121
*/
122
virtual
std::string
ToString
()
const
123
{
124
std::stringstream ss;
125
ss <<
"MCPoint: pos=("
<<
GetX
() <<
","
<<
GetY
() <<
","
<<
GetZ
() <<
") "
126
<<
"mom=("
<<
GetPx
() <<
","
<<
GetPy
() <<
","
<<
GetPz
() <<
") "
127
<<
"refId="
<<
GetRefId
() <<
" stationId="
<<
GetStationId
() << std::endl;
128
return
ss.str();
129
}
130
131
/**
132
* \brief Operator << for convenient output to std::ostream.
133
* \return Insertion stream in order to be able to call a succession of insertion operations.
134
*/
135
friend
std::ostream&
operator<<
(std::ostream& strm,
const
BmnMCPoint
& point)
136
{
137
strm << point.
ToString
();
138
return
strm;
139
}
140
141
private
:
142
Double_t
fXIn
,
fYIn
,
fZIn
;
// Space coordinates on entrance plane [cm].
143
Double_t
fPxIn
,
fPyIn
,
fPzIn
;
// Momentum components on entrance plane. [GeV/c]
144
Double_t
fXOut
,
fYOut
,
fZOut
;
// Space coordinates on exit plane [cm].
145
Double_t
fPxOut
,
fPyOut
,
fPzOut
;
// Momentum components on exit plane. [GeV/c]
146
Int_t
fRefId
;
// Reference index.
147
Int_t
fStationId
;
// Station index.
148
Double_t
fQ
;
// +/-1 - negative or positive charge
149
};
150
151
#endif
/* BmnMCPOINT_H_ */
Int_t
int Int_t
Double_t
double Double_t
TObject.h
BmnMCPoint::GetXIn
Double_t GetXIn() const
Definition
BmnMCPoint.h:68
BmnMCPoint::GetPxOut
Double_t GetPxOut() const
Definition
BmnMCPoint.h:86
BmnMCPoint::GetP
Double_t GetP() const
Definition
BmnMCPoint.h:60
BmnMCPoint::fQ
Double_t fQ
Definition
BmnMCPoint.h:148
BmnMCPoint::GetTxIn
Double_t GetTxIn() const
Definition
BmnMCPoint.h:74
BmnMCPoint::ToString
virtual std::string ToString() const
Returns std::string representation of the class.
Definition
BmnMCPoint.h:122
BmnMCPoint::SetYIn
void SetYIn(Double_t y)
Definition
BmnMCPoint.h:103
BmnMCPoint::GetPzIn
Double_t GetPzIn() const
Definition
BmnMCPoint.h:73
BmnMCPoint::fStationId
Int_t fStationId
Definition
BmnMCPoint.h:147
BmnMCPoint::SetPyOut
void SetPyOut(Double_t py)
Definition
BmnMCPoint.h:112
BmnMCPoint::SetPxOut
void SetPxOut(Double_t px)
Definition
BmnMCPoint.h:111
BmnMCPoint::GetPx
Double_t GetPx() const
Definition
BmnMCPoint.h:55
BmnMCPoint::GetPOut
Double_t GetPOut() const
Definition
BmnMCPoint.h:91
BmnMCPoint::SetPxIn
void SetPxIn(Double_t px)
Definition
BmnMCPoint.h:105
BmnMCPoint::GetPzOut
Double_t GetPzOut() const
Definition
BmnMCPoint.h:88
BmnMCPoint::GetQpOut
Double_t GetQpOut() const
Definition
BmnMCPoint.h:92
BmnMCPoint::SetStationId
void SetStationId(Int_t stationId)
Definition
BmnMCPoint.h:116
BmnMCPoint::~BmnMCPoint
virtual ~BmnMCPoint()
Definition
BmnMCPoint.h:49
BmnMCPoint::GetPz
Double_t GetPz() const
Definition
BmnMCPoint.h:57
BmnMCPoint::SetYOut
void SetYOut(Double_t y)
Definition
BmnMCPoint.h:109
BmnMCPoint::SetPzOut
void SetPzOut(Double_t pz)
Definition
BmnMCPoint.h:113
BmnMCPoint::GetPxIn
Double_t GetPxIn() const
Definition
BmnMCPoint.h:71
BmnMCPoint::fXIn
Double_t fXIn
Definition
BmnMCPoint.h:142
BmnMCPoint::GetTy
Double_t GetTy() const
Definition
BmnMCPoint.h:59
BmnMCPoint::fYOut
Double_t fYOut
Definition
BmnMCPoint.h:144
BmnMCPoint::GetX
Double_t GetX() const
Definition
BmnMCPoint.h:52
BmnMCPoint::fPyOut
Double_t fPyOut
Definition
BmnMCPoint.h:145
BmnMCPoint::fPzOut
Double_t fPzOut
Definition
BmnMCPoint.h:145
BmnMCPoint::SetPyIn
void SetPyIn(Double_t py)
Definition
BmnMCPoint.h:106
BmnMCPoint::fZIn
Double_t fZIn
Definition
BmnMCPoint.h:142
BmnMCPoint::GetYOut
Double_t GetYOut() const
Definition
BmnMCPoint.h:84
BmnMCPoint::GetQpIn
Double_t GetQpIn() const
Definition
BmnMCPoint.h:77
BmnMCPoint::fYIn
Double_t fYIn
Definition
BmnMCPoint.h:142
BmnMCPoint::fRefId
Int_t fRefId
Definition
BmnMCPoint.h:146
BmnMCPoint::SetZIn
void SetZIn(Double_t z)
Definition
BmnMCPoint.h:104
BmnMCPoint::GetTyOut
Double_t GetTyOut() const
Definition
BmnMCPoint.h:90
BmnMCPoint::GetZOut
Double_t GetZOut() const
Definition
BmnMCPoint.h:85
BmnMCPoint::SetPzIn
void SetPzIn(Double_t pz)
Definition
BmnMCPoint.h:107
BmnMCPoint::GetQp
Double_t GetQp() const
Definition
BmnMCPoint.h:61
BmnMCPoint::GetZIn
Double_t GetZIn() const
Definition
BmnMCPoint.h:70
BmnMCPoint::GetPIn
Double_t GetPIn() const
Definition
BmnMCPoint.h:76
BmnMCPoint::GetYIn
Double_t GetYIn() const
Definition
BmnMCPoint.h:69
BmnMCPoint::fPxOut
Double_t fPxOut
Definition
BmnMCPoint.h:145
BmnMCPoint::GetTxOut
Double_t GetTxOut() const
Definition
BmnMCPoint.h:89
BmnMCPoint::GetPy
Double_t GetPy() const
Definition
BmnMCPoint.h:56
BmnMCPoint::fXOut
Double_t fXOut
Definition
BmnMCPoint.h:144
BmnMCPoint::GetTyIn
Double_t GetTyIn() const
Definition
BmnMCPoint.h:75
BmnMCPoint::GetStationId
Int_t GetStationId() const
Definition
BmnMCPoint.h:99
BmnMCPoint::GetXOut
Double_t GetXOut() const
Definition
BmnMCPoint.h:83
BmnMCPoint::SetXIn
void SetXIn(Double_t x)
Definition
BmnMCPoint.h:102
BmnMCPoint::SetXOut
void SetXOut(Double_t x)
Definition
BmnMCPoint.h:108
BmnMCPoint::GetPyOut
Double_t GetPyOut() const
Definition
BmnMCPoint.h:87
BmnMCPoint::SetZOut
void SetZOut(Double_t z)
Definition
BmnMCPoint.h:110
BmnMCPoint::SetQ
void SetQ(Double_t q)
Definition
BmnMCPoint.h:114
BmnMCPoint::operator<<
friend std::ostream & operator<<(std::ostream &strm, const BmnMCPoint &point)
Operator << for convenient output to std::ostream.
Definition
BmnMCPoint.h:135
BmnMCPoint::fPzIn
Double_t fPzIn
Definition
BmnMCPoint.h:143
BmnMCPoint::SetRefId
void SetRefId(Int_t refId)
Definition
BmnMCPoint.h:115
BmnMCPoint::GetTx
Double_t GetTx() const
Definition
BmnMCPoint.h:58
BmnMCPoint::GetPyIn
Double_t GetPyIn() const
Definition
BmnMCPoint.h:72
BmnMCPoint::GetRefId
Int_t GetRefId() const
Definition
BmnMCPoint.h:98
BmnMCPoint::fPxIn
Double_t fPxIn
Definition
BmnMCPoint.h:143
BmnMCPoint::GetZ
Double_t GetZ() const
Definition
BmnMCPoint.h:54
BmnMCPoint::GetQ
Double_t GetQ() const
Definition
BmnMCPoint.h:67
BmnMCPoint::BmnMCPoint
BmnMCPoint()
Definition
BmnMCPoint.h:28
BmnMCPoint::GetY
Double_t GetY() const
Definition
BmnMCPoint.h:53
BmnMCPoint::fPyIn
Double_t fPyIn
Definition
BmnMCPoint.h:143
BmnMCPoint::fZOut
Double_t fZOut
Definition
BmnMCPoint.h:144
install
include
BmnMCPoint.h
Generated on
for BmnRoot by
1.17.0