BmnRoot
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
#include "BmnDetectorList.h"
8
9
#include <iostream>
10
11
using
std::cout;
12
using
std::endl;
13
using
std::flush;
14
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
31
32
33
// ----- Standard constructor ------------------------------------------
34
CbmStsPoint::CbmStsPoint
(Int_t trackID, Int_t detID, TVector3 posIn,
35
TVector3 posOut, TVector3 momIn, TVector3 momOut,
36
Double_t tof, Double_t length, Double_t eLoss,
37
Int_t eventId)
38
: FairMCPoint(trackID, detID, posIn, momIn, tof, length, eLoss, eventId),
39
fX_out(posOut.X()),
40
fY_out(posOut.Y()),
41
fZ_out(posOut.Z()),
42
fPx_out(momOut.Px()),
43
fPy_out(momOut.Py()),
44
fPz_out(momOut.Pz()),
45
fStation(-1),
46
fModule(-1)
47
{
48
SetLink(FairLink(
kMCTrack
, trackID));
49
}
50
// -------------------------------------------------------------------------
51
52
53
54
// ----- Destructor ----------------------------------------------------
55
CbmStsPoint::~CbmStsPoint
() { }
56
// -------------------------------------------------------------------------
57
58
59
60
// ----- Copy constructor with event and epoch time --------------------
61
CbmStsPoint::CbmStsPoint
(
const
CbmStsPoint
& point, Int_t eventId,
62
Double_t eventTime, Double_t epochTime)
63
: FairMCPoint(point),
64
fX_out(point.fX_out),
65
fY_out(point.fY_out),
66
fZ_out(point.fZ_out),
67
fPx_out(point.fPx_out),
68
fPy_out(point.fPy_out),
69
fPz_out(point.fPz_out),
70
fStation(point.fStation),
71
fModule(point.fModule)
72
{
73
// *this = point;
74
if
( eventId > 0 ) fEventId = eventId;
75
fTime = point.GetTime() + eventTime - epochTime;
76
}
77
// -------------------------------------------------------------------------
78
79
80
81
82
// ----- Public method Print -------------------------------------------
83
void
CbmStsPoint::Info
()
const
{
84
LOG(debug2) <<
"StsPoint: track ID "
<< fTrackID <<
", detector ID "
85
<< fDetectorID;
86
LOG(debug2) <<
" IN Position ("
<< fX <<
", "
<< fY
87
<<
", "
<< fZ <<
") cm"
;
88
LOG(debug2) <<
" OUT Position ("
<<
fX_out
<<
", "
<<
fY_out
89
<<
", "
<<
fZ_out
<<
") cm"
;
90
LOG(debug2) <<
" Momentum ("
<< fPx <<
", "
<< fPy <<
", "
<< fPz
91
<<
") GeV"
;
92
LOG(debug2) <<
" Time "
<< fTime <<
" ns, Length "
<< fLength
93
<<
" cm, Energy loss "
<< fELoss*1.0e06 <<
" keV"
;
94
LOG(debug2) <<
" StationNum "
<<
fStation
<<
", ModuleNum "
<<
fModule
;
95
}
96
// -------------------------------------------------------------------------
97
98
99
100
// ----- Point x coordinate from linear extrapolation ------------------
101
Double_t
CbmStsPoint::GetX
(Double_t z)
const
{
102
// cout << fZ << " " << z << " " << fZ_out << endl;
103
if
( (
fZ_out
-z)*(fZ-z) >= 0. )
return
(
fX_out
+fX)/2.;
104
Double_t dz =
fZ_out
- fZ;
105
return
( fX + (z-fZ) / dz * (
fX_out
-fX) );
106
}
107
// -------------------------------------------------------------------------
108
109
110
111
// ----- Point y coordinate from linear extrapolation ------------------
112
Double_t
CbmStsPoint::GetY
(Double_t z)
const
{
113
if
( (
fZ_out
-z)*(fZ-z) >= 0. )
return
(
fY_out
+fY)/2.;
114
Double_t dz =
fZ_out
- fZ;
115
// if ( TMath::Abs(dz) < 1.e-3 ) return (fY_out+fY)/2.;
116
return
( fY + (z-fZ) / dz * (
fY_out
-fY) );
117
}
118
// -------------------------------------------------------------------------
119
120
121
122
// ----- Public method IsUsable ----------------------------------------
123
Bool_t
CbmStsPoint::IsUsable
()
const
{
124
Double_t dz =
fZ_out
- fZ;
125
if
( TMath::Abs(dz) < 1.e-4 )
return
kFALSE;
126
return
kTRUE;
127
}
128
// -------------------------------------------------------------------------
kMCTrack
@ kMCTrack
Definition
BmnDetectorList.h:46
CbmStsPoint
Definition
CbmStsPoint.h:26
CbmStsPoint::IsUsable
Bool_t IsUsable() const
Definition
CbmStsPoint.cxx:123
CbmStsPoint::GetY
Double_t GetY(Double_t z) const
Definition
CbmStsPoint.cxx:112
CbmStsPoint::GetX
Double_t GetX(Double_t z) const
Definition
CbmStsPoint.cxx:101
CbmStsPoint::~CbmStsPoint
virtual ~CbmStsPoint()
Definition
CbmStsPoint.cxx:55
CbmStsPoint::fX_out
Double32_t fX_out
Definition
CbmStsPoint.h:112
CbmStsPoint::fStation
Int_t fStation
Definition
CbmStsPoint.h:114
CbmStsPoint::fModule
Int_t fModule
Definition
CbmStsPoint.h:115
CbmStsPoint::fZ_out
Double32_t fZ_out
Definition
CbmStsPoint.h:112
CbmStsPoint::fY_out
Double32_t fY_out
Definition
CbmStsPoint.h:112
CbmStsPoint::Info
void Info() const
Definition
CbmStsPoint.cxx:83
CbmStsPoint::CbmStsPoint
CbmStsPoint()
Definition
CbmStsPoint.cxx:17
CbmStsPoint.h
base
cbm
CbmStsPoint.cxx
Generated on Fri May 15 2026 10:40:50 for BmnRoot by
1.9.8