BmnRoot 26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnDchHitOriginal.cxx
Go to the documentation of this file.
1//------------------------------------------------------------------------------------------------------------------------
2
3#include <iostream>
4using namespace std;
5
6#include "BmnDchHitOriginal.h"
7//------------------------------------------------------------------------------------------------------------------------
8
10 : FairHit()
11 , fTrackID(0)
12 , fFlag(0)
13 , fNofDim(1)
14 , fPhi(0.)
15{
16 fMeas[1] = fError[1] = 0.;
17}
18//------------------------------------------------------------------------------------------------------------------------
19
21 TVector3 pos,
22 TVector3 dpos,
23 Int_t index,
24 Int_t flag,
25 Int_t trackIndex,
26 UInt_t dchlayer)
27 : FairHit(detID, pos, dpos, index)
28 , fDetectorID(detID)
29 , fDchLayer(dchlayer)
30 , fTrackID(trackIndex)
31 , fFlag(flag)
32 , fNofDim(1)
33 , fPhi(0.)
34{
35 fMeas[1] = fError[1] = 0.;
36}
37//------------------------------------------------------------------------------------------------------------------------
38
40 : FairHit(detID, pos, dpos, index)
41 , fFlag(flag)
42 , fNofDim(1)
43 , fPhi(0.)
44{
45 fMeas[1] = fError[1] = 0.;
46}
47//------------------------------------------------------------------------------------------------------------------------
48
50 : FairHit(detID, pos, dpos, index)
51 , fFlag(0)
52 , fNofDim(1)
53 , fPhi(0.)
54{
55 fMeas[1] = fError[1] = 0.;
56}
57//------------------------------------------------------------------------------------------------------------------------
58
60//------------------------------------------------------------------------------------------------------------------------
61
62void BmnDchHitOriginal::Print(const Option_t* opt) const
63{
64 cout << "-I- BmnDchHitOriginal" << endl;
65 cout << " DetectorID: " << fDetectorID << endl;
66 cout << " Position: (" << fX << ", " << fY << ", " << fZ << ") cm" << endl;
67 cout << " Position error: (" << fDx << ", " << fDy << ", " << fDz << ") cm" << endl;
68 cout << " Flag: " << fFlag << endl;
69}
70//------------------------------------------------------------------------------------------------------------------------
71
73{
74 /// Add point index
75
76 Int_t size = fIndex.GetSize();
77 fIndex.Set(size + 1);
78 fIndex[size] = indx;
79}
80//------------------------------------------------------------------------------------------------------------------------
81
83{
84 /// "Compare" function to sort in ascending order in abs(Z)
85
87 if (GetLayer() < kHit->GetLayer())
88 return -1;
89 else if (GetLayer() > kHit->GetLayer())
90 return 1;
91 else {
92 if (TMath::Abs(fZ) < TMath::Abs(kHit->GetZ()))
93 return -1;
94 else if (TMath::Abs(fZ) > TMath::Abs(kHit->GetZ()))
95 return 1;
96 else
97 return 0;
98 }
99}
100//-------------------------------------------------------------------------------------------------------------------------
int Int_t
const char Option_t
UInt_t GetLayer() const
void SetIndex(Int_t indx)
Add index of detector hit.
void Print(const Option_t *opt=0) const
Int_t Compare(const TObject *hit) const
sort in ascending order in abs(Z)
Double_t Abs(Double_t d)