BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnDchHit.cxx
Go to the documentation of this file.
1#include "BmnDchHit.h"
2
3#include <iostream>
4using namespace std;
5
7 : BmnHit()
8 , fID(0)
9 , fTrackID(0)
10 , fFlag(0)
11 , fNofDim(1)
12 , fPhi(0.)
13 , fUsing(kFALSE)
14{
15 fMeas[1] = fError[1] = 0.;
16 fDchLayerType = "";
17 fDchIdNumber = -1;
18 fWireNumber = -1;
19 fDistanceToWire = 0.0;
20}
21
23 TVector3 pos,
24 TVector3 dpos,
25 Int_t index,
26 Int_t flag,
27 Int_t trackIndex,
28 UChar_t dchlayer)
29 : BmnHit(detID, pos, dpos, index)
30 , fDetectorID(detID)
31 , fDchLayer(dchlayer)
32 , fTrackID(trackIndex)
33 , fFlag(flag)
34 , fNofDim(1)
35 , fPhi(0.)
36 , fUsing(kFALSE)
37{
38 fMeas[1] = fError[1] = 0.;
39 fDchLayerType = "";
40 fDchIdNumber = -1;
41 fWireNumber = -1;
42 fDistanceToWire = 0.0;
43}
44
45BmnDchHit::BmnDchHit(Int_t detID, TVector3 pos, TVector3 dpos, Int_t index, Int_t flag)
46 : BmnHit(detID, pos, dpos, index)
47 , fFlag(flag)
48 , fNofDim(1)
49 , fPhi(0.)
50 , fUsing(kFALSE)
51{
52 fMeas[1] = fError[1] = 0.;
53 fDchLayerType = "";
54 fDchIdNumber = -1;
55 fWireNumber = -1;
56 fDistanceToWire = 0.0;
57}
58
60 : BmnHit(detID, pos, dpos, index)
61 , fFlag(0)
62 , fNofDim(1)
63 , fPhi(0.)
64 , fUsing(kFALSE)
65{
66 fMeas[1] = fError[1] = 0.;
67 fDchLayerType = "";
68 fDchIdNumber = -1;
69 fWireNumber = -1;
70 fDistanceToWire = 0.0;
71}
72
74
75void BmnDchHit::Print(const Option_t* opt) const
76{
77 cout << "-I- BmnDchHit" << endl;
78 cout << " DetectorID: " << fDetectorID << endl;
79 cout << " Position: (" << fX << ", " << fY << ", " << fZ << ") cm" << endl;
80 cout << " Position error: (" << fDx << ", " << fDy << ", " << fDz << ") cm" << endl;
81 cout << " Flag: " << fFlag << endl;
82}
83
84/*
85void BmnDchHit::SetIndex(Int_t indx) {
86 /// Add point index
87
88 Int_t size = fIndex.GetSize();
89 fIndex.Set(size + 1);
90 fIndex[size] = indx;
91}*/
92
94{
95 /// "Compare" function to sort in ascending order in abs(Z)
96
97 BmnDchHit* kHit = (BmnDchHit*)hit;
98 if (GetLayer() < kHit->GetLayer())
99 return -1;
100 else if (GetLayer() > kHit->GetLayer())
101 return 1;
102 else {
103 if (TMath::Abs(fZ) < TMath::Abs(kHit->GetZ()))
104 return -1;
105 else if (TMath::Abs(fZ) > TMath::Abs(kHit->GetZ()))
106 return 1;
107 else
108 return 0;
109 }
110}
int Int_t
unsigned char UChar_t
constexpr Bool_t kFALSE
const char Option_t
Int_t fWireNumber
Definition BmnDchHit.h:90
Double32_t fError[2]
Definition BmnDchHit.h:97
Int_t fTrackID
Definition BmnDchHit.h:92
void Print(const Option_t *opt=0) const
Definition BmnDchHit.cxx:75
Bool_t fUsing
Definition BmnDchHit.h:104
virtual ~BmnDchHit()
Definition BmnDchHit.cxx:73
Int_t fDetectorID
Definition BmnDchHit.h:86
UShort_t fDchIdNumber
Definition BmnDchHit.h:100
Int_t fID
Definition BmnDchHit.h:85
Int_t fFlag
Definition BmnDchHit.h:93
Double_t fDistanceToWire
Definition BmnDchHit.h:91
Int_t fNofDim
Definition BmnDchHit.h:94
Int_t Compare(const TObject *hit) const
sort in ascending order in abs(Z)
Definition BmnDchHit.cxx:93
UChar_t GetLayer() const
Definition BmnDchHit.h:33
Double32_t fPhi
Definition BmnDchHit.h:95
Double32_t fMeas[2]
Definition BmnDchHit.h:96
UChar_t fDchLayer
Definition BmnDchHit.h:87
TString fDchLayerType
Definition BmnDchHit.h:89
BmnHit()
Default constructor.
Definition BmnHit.cxx:12
Double_t Abs(Double_t d)
Definition json.hpp:4446