BmnRoot
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
22BmnDchHit::BmnDchHit(Int_t detID, TVector3 pos, TVector3 dpos, Int_t index, Int_t flag, Int_t trackIndex, UChar_t dchlayer)
23: BmnHit(detID, pos, dpos, index),
24 fDetectorID(detID),
25 fDchLayer(dchlayer),
26 fTrackID(trackIndex),
27 fFlag(flag),
28 fNofDim(1),
29 fPhi(0.),
30 fUsing(kFALSE)
31{
32 fMeas[1] = fError[1] = 0.;
33 fDchLayerType = "";
34 fDchIdNumber = -1;
35 fWireNumber = -1;
36 fDistanceToWire = 0.0;
37}
38
39BmnDchHit::BmnDchHit(Int_t detID, TVector3 pos, TVector3 dpos, Int_t index, Int_t flag)
40: BmnHit(detID, pos, dpos, index),
41 fFlag(flag),
42 fNofDim(1),
43 fPhi(0.),
44 fUsing(kFALSE)
45{
46 fMeas[1] = fError[1] = 0.;
47 fDchLayerType = "";
48 fDchIdNumber = -1;
49 fWireNumber = -1;
50 fDistanceToWire = 0.0;
51}
52
53BmnDchHit::BmnDchHit(Int_t detID, TVector3 pos, TVector3 dpos, Int_t index)
54: BmnHit(detID, pos, dpos, index),
55 fFlag(0),
56 fNofDim(1),
57 fPhi(0.),
58 fUsing(kFALSE)
59{
60 fMeas[1] = fError[1] = 0.;
61 fDchLayerType = "";
62 fDchIdNumber = -1;
63 fWireNumber = -1;
64 fDistanceToWire = 0.0;
65}
66
69
70void BmnDchHit::Print(const Option_t* opt) const {
71 cout << "-I- BmnDchHit" << endl;
72 cout << " DetectorID: " << fDetectorID << endl;
73 cout << " Position: (" << fX << ", " << fY << ", " << fZ << ") cm" << endl;
74 cout << " Position error: (" << fDx << ", " << fDy << ", " << fDz << ") cm" << endl;
75 cout << " Flag: " << fFlag << endl;
76}
77
78/*
79void BmnDchHit::SetIndex(Int_t indx) {
81
82 Int_t size = fIndex.GetSize();
83 fIndex.Set(size + 1);
84 fIndex[size] = indx;
85}*/
86
87Int_t BmnDchHit::Compare(const TObject* hit) const {
89
90 BmnDchHit *kHit = (BmnDchHit*) hit;
91 if (GetLayer() < kHit->GetLayer()) return -1;
92 else if (GetLayer() > kHit->GetLayer()) return 1;
93 else {
94 if (TMath::Abs(fZ) < TMath::Abs(kHit->GetZ())) return -1;
95 else if (TMath::Abs(fZ) > TMath::Abs(kHit->GetZ())) return 1;
96 else return 0;
97 }
98}
Int_t fWireNumber
Definition BmnDchHit.h:93
Double32_t fError[2]
Definition BmnDchHit.h:100
void Print(const Option_t *opt=0) const
Definition BmnDchHit.cxx:70
virtual ~BmnDchHit()
Definition BmnDchHit.cxx:67
Int_t fDetectorID
Definition BmnDchHit.h:89
UShort_t fDchIdNumber
Definition BmnDchHit.h:103
Int_t fFlag
Definition BmnDchHit.h:96
Double_t fDistanceToWire
Definition BmnDchHit.h:94
Int_t Compare(const TObject *hit) const
sort in ascending order in abs(Z)
Definition BmnDchHit.cxx:87
UChar_t GetLayer() const
Definition BmnDchHit.h:29
Double32_t fMeas[2]
Definition BmnDchHit.h:99
TString fDchLayerType
Definition BmnDchHit.h:92
STL namespace.