BmnRoot
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(),
11fTrackID(0),
12fFlag(0),
13fNofDim(1),
14fPhi(0.) {
15 fMeas[1] = fError[1] = 0.;
16}
17//------------------------------------------------------------------------------------------------------------------------
18
19BmnDchHitOriginal::BmnDchHitOriginal(Int_t detID, TVector3 pos, TVector3 dpos, Int_t index, Int_t flag, Int_t trackIndex, UInt_t dchlayer)
20: FairHit(detID, pos, dpos, index),
21fDetectorID(detID),
22fDchLayer(dchlayer),
23fTrackID(trackIndex),
24fFlag(flag),
25fNofDim(1),
26fPhi(0.) {
27 fMeas[1] = fError[1] = 0.;
28}
29//------------------------------------------------------------------------------------------------------------------------
30
31BmnDchHitOriginal::BmnDchHitOriginal(Int_t detID, TVector3 pos, TVector3 dpos, Int_t index, Int_t flag)
32: FairHit(detID, pos, dpos, index),
33fFlag(flag),
34fNofDim(1),
35fPhi(0.) {
36 fMeas[1] = fError[1] = 0.;
37}
38//------------------------------------------------------------------------------------------------------------------------
39
40BmnDchHitOriginal::BmnDchHitOriginal(Int_t detID, TVector3 pos, TVector3 dpos, Int_t index)
41: FairHit(detID, pos, dpos, index),
42fFlag(0),
43fNofDim(1),
44fPhi(0.) {
45 fMeas[1] = fError[1] = 0.;
46}
47//------------------------------------------------------------------------------------------------------------------------
48
51//------------------------------------------------------------------------------------------------------------------------
52
53void BmnDchHitOriginal::Print(const Option_t* opt) const {
54 cout << "-I- BmnDchHitOriginal" << endl;
55 cout << " DetectorID: " << fDetectorID << endl;
56 cout << " Position: (" << fX << ", " << fY << ", " << fZ << ") cm" << endl;
57 cout << " Position error: (" << fDx << ", " << fDy << ", " << fDz << ") cm" << endl;
58 cout << " Flag: " << fFlag << endl;
59}
60//------------------------------------------------------------------------------------------------------------------------
61
64
65 Int_t size = fIndex.GetSize();
66 fIndex.Set(size + 1);
67 fIndex[size] = indx;
68}
69//------------------------------------------------------------------------------------------------------------------------
70
71Int_t BmnDchHitOriginal::Compare(const TObject* hit) const {
73
75 if (GetLayer() < kHit->GetLayer()) return -1;
76 else if (GetLayer() > kHit->GetLayer()) return 1;
77 else {
78 if (TMath::Abs(fZ) < TMath::Abs(kHit->GetZ())) return -1;
79 else if (TMath::Abs(fZ) > TMath::Abs(kHit->GetZ())) return 1;
80 else return 0;
81 }
82}
83//-------------------------------------------------------------------------------------------------------------------------
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)
STL namespace.