BmnRoot
26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
CbmStsPoint.cxx
Go to the documentation of this file.
1
// -------------------------------------------------------------------------
2
// ----- CbmStsPoint source file -----
3
// ----- Created 26/07/04 by V. Friese -----
4
// -------------------------------------------------------------------------
5
6
#include "
CbmStsPoint.h
"
7
8
#include "
BmnDetectorList.h
"
9
10
#include <iostream>
11
12
using
std::cout;
13
using
std::endl;
14
using
std::flush;
15
16
// ----- Default constructor -------------------------------------------
17
CbmStsPoint::CbmStsPoint
()
18
:
FairMCPoint
()
19
,
fX_out
(0.)
20
,
fY_out
(0.)
21
,
fZ_out
(0.)
22
,
fPx_out
(0.)
23
,
fPy_out
(0.)
24
,
fPz_out
(0.)
25
,
fStation
(-1)
26
,
fModule
(-1)
27
{}
28
// -------------------------------------------------------------------------
29
30
// ----- Standard constructor ------------------------------------------
31
CbmStsPoint::CbmStsPoint
(
Int_t
trackID,
32
Int_t
detID,
33
TVector3
posIn,
34
TVector3
posOut,
35
TVector3
momIn,
36
TVector3
momOut,
37
Double_t
tof,
38
Double_t
length,
39
Double_t
eLoss,
40
Int_t
eventId)
41
:
FairMCPoint
(trackID, detID, posIn, momIn, tof, length, eLoss, eventId)
42
,
fX_out
(posOut.X())
43
,
fY_out
(posOut.Y())
44
,
fZ_out
(posOut.Z())
45
,
fPx_out
(momOut.Px())
46
,
fPy_out
(momOut.Py())
47
,
fPz_out
(momOut.Pz())
48
,
fStation
(-1)
49
,
fModule
(-1)
50
{
51
SetLink(FairLink(
kMCTrack
, trackID));
52
}
53
// -------------------------------------------------------------------------
54
55
// ----- Destructor ----------------------------------------------------
56
CbmStsPoint::~CbmStsPoint
() {}
57
// -------------------------------------------------------------------------
58
59
// ----- Copy constructor with event and epoch time --------------------
60
CbmStsPoint::CbmStsPoint
(
const
CbmStsPoint
& point,
Int_t
eventId,
Double_t
eventTime,
Double_t
epochTime)
61
:
FairMCPoint
(point)
62
,
fX_out
(point.
fX_out
)
63
,
fY_out
(point.
fY_out
)
64
,
fZ_out
(point.
fZ_out
)
65
,
fPx_out
(point.
fPx_out
)
66
,
fPy_out
(point.
fPy_out
)
67
,
fPz_out
(point.
fPz_out
)
68
,
fStation
(point.
fStation
)
69
,
fModule
(point.
fModule
)
70
{
71
// *this = point;
72
if
(eventId > 0)
73
fEventId = eventId;
74
fTime = point.GetTime() + eventTime - epochTime;
75
}
76
// -------------------------------------------------------------------------
77
78
// ----- Public method Print -------------------------------------------
79
void
CbmStsPoint::Info
()
const
80
{
81
LOG(debug2) <<
"StsPoint: track ID "
<< fTrackID <<
", detector ID "
<< fDetectorID;
82
LOG(debug2) <<
" IN Position ("
<< fX <<
", "
<< fY <<
", "
<< fZ <<
") cm"
;
83
LOG(debug2) <<
" OUT Position ("
<<
fX_out
<<
", "
<<
fY_out
<<
", "
<<
fZ_out
<<
") cm"
;
84
LOG(debug2) <<
" Momentum ("
<< fPx <<
", "
<< fPy <<
", "
<< fPz <<
") GeV"
;
85
LOG(debug2) <<
" Time "
<< fTime <<
" ns, Length "
<< fLength <<
" cm, Energy loss "
<< fELoss * 1.0e06
86
<<
" keV"
;
87
LOG(debug2) <<
" StationNum "
<<
fStation
<<
", ModuleNum "
<<
fModule
;
88
}
89
// -------------------------------------------------------------------------
90
91
// ----- Point x coordinate from linear extrapolation ------------------
92
Double_t
CbmStsPoint::GetX
(
Double_t
z)
const
93
{
94
// cout << fZ << " " << z << " " << fZ_out << endl;
95
if
((
fZ_out
- z) * (fZ - z) >= 0.)
96
return
(
fX_out
+ fX) / 2.;
97
Double_t
dz =
fZ_out
- fZ;
98
return
(fX + (z - fZ) / dz * (
fX_out
- fX));
99
}
100
// -------------------------------------------------------------------------
101
102
// ----- Point y coordinate from linear extrapolation ------------------
103
Double_t
CbmStsPoint::GetY
(
Double_t
z)
const
104
{
105
if
((
fZ_out
- z) * (fZ - z) >= 0.)
106
return
(
fY_out
+ fY) / 2.;
107
Double_t
dz =
fZ_out
- fZ;
108
// if ( TMath::Abs(dz) < 1.e-3 ) return (fY_out+fY)/2.;
109
return
(fY + (z - fZ) / dz * (
fY_out
- fY));
110
}
111
// -------------------------------------------------------------------------
112
113
// ----- Public method IsUsable ----------------------------------------
114
Bool_t
CbmStsPoint::IsUsable
()
const
115
{
116
Double_t
dz =
fZ_out
- fZ;
117
if
(
TMath::Abs
(dz) < 1.e-4)
118
return
kFALSE
;
119
return
kTRUE
;
120
}
121
// -------------------------------------------------------------------------
BmnDetectorList.h
Defines unique identifiers (enum) for all BM@N detector systems.
kMCTrack
@ kMCTrack
Definition
BmnDetectorList.h:46
CbmStsPoint.h
Bool_t
bool Bool_t
Int_t
int Int_t
kFALSE
constexpr Bool_t kFALSE
Double_t
double Double_t
kTRUE
constexpr Bool_t kTRUE
CbmStsPoint::fPy_out
Double32_t fPy_out
Definition
CbmStsPoint.h:103
CbmStsPoint::fPz_out
Double32_t fPz_out
Definition
CbmStsPoint.h:103
CbmStsPoint::IsUsable
Bool_t IsUsable() const
Check for distance between in and out.
Definition
CbmStsPoint.cxx:114
CbmStsPoint::GetY
Double_t GetY(Double_t z) const
Definition
CbmStsPoint.cxx:103
CbmStsPoint::GetX
Double_t GetX(Double_t z) const
Point coordinates at given z from linear extrapolation.
Definition
CbmStsPoint.cxx:92
CbmStsPoint::~CbmStsPoint
virtual ~CbmStsPoint()
Destructor.
Definition
CbmStsPoint.cxx:56
CbmStsPoint::fX_out
Double32_t fX_out
Definition
CbmStsPoint.h:102
CbmStsPoint::fStation
Int_t fStation
Definition
CbmStsPoint.h:104
CbmStsPoint::fModule
Int_t fModule
Definition
CbmStsPoint.h:105
CbmStsPoint::fZ_out
Double32_t fZ_out
Definition
CbmStsPoint.h:102
CbmStsPoint::fY_out
Double32_t fY_out
Definition
CbmStsPoint.h:102
CbmStsPoint::fPx_out
Double32_t fPx_out
Definition
CbmStsPoint.h:103
CbmStsPoint::Info
void Info() const
Definition
CbmStsPoint.cxx:79
CbmStsPoint::CbmStsPoint
CbmStsPoint()
Default constructor.
Definition
CbmStsPoint.cxx:17
FairMCPoint
TVector3
TMath::Abs
Double_t Abs(Double_t d)
base
cbm
CbmStsPoint.cxx
Generated on
for BmnRoot by
1.17.0