BmnRoot 26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
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
12using std::cout;
13using std::endl;
14using std::flush;
15
16// ----- Default constructor -------------------------------------------
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 ------------------------------------------
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 ----------------------------------------------------
57// -------------------------------------------------------------------------
58
59// ----- Copy constructor with event and epoch time --------------------
60CbmStsPoint::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 -------------------------------------------
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 ------------------
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 ------------------
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 ----------------------------------------
115{
116 Double_t dz = fZ_out - fZ;
117 if (TMath::Abs(dz) < 1.e-4)
118 return kFALSE;
119 return kTRUE;
120}
121// -------------------------------------------------------------------------
Defines unique identifiers (enum) for all BM@N detector systems.
@ kMCTrack
bool Bool_t
int Int_t
constexpr Bool_t kFALSE
double Double_t
constexpr Bool_t kTRUE
Double32_t fPy_out
Double32_t fPz_out
Bool_t IsUsable() const
Check for distance between in and out.
Double_t GetY(Double_t z) const
Double_t GetX(Double_t z) const
Point coordinates at given z from linear extrapolation.
virtual ~CbmStsPoint()
Destructor.
Double32_t fX_out
Double32_t fZ_out
Double32_t fY_out
Double32_t fPx_out
void Info() const
CbmStsPoint()
Default constructor.
Double_t Abs(Double_t d)