BmnRoot
Loading...
Searching...
No Matches
BmnRamIterator.cxx
Go to the documentation of this file.
1/*
2 BM@N alignment routine
3 BM@N experiment at NICA complex, JINR, 2025
4
5 Department: Math & Soft Group of HEP lab
6 Author: Igor Polev, polev@jinr.ru
7
8 BmnRamIterator class implementation
9*/
10
11#include "BmnRamIterator.h"
12
13template<typename HitType>
15{
16 fHitIdx = fpFirstHits[fTrackIdx];
17 fEndOfHits = (fHitsInTrack <= 0);
18}
19
20template<typename HitType>
22{
23 fTrackIdx = 0;
24 fEndOfTracks = (fTracksCount <= 0);
25 CountHitsInTrack();
26 ResetHits();
27}
28
29template<typename HitType>
31{
32 fEndOfTracks |= (++fTrackIdx >= fTracksCount);
33 CountHitsInTrack();
34 ResetHits();
35 ProgressTick();
38template<typename HitType>
41 fEndOfHits |= (++fHitIdx >= fNextFirstHit);
44template<typename HitType>
47 if (fEndOfTracks) {
48 fHitsInTrack = 0;
49 return;
50 }
51 fNextFirstHit = fpFirstHits[fTrackIdx + 1]; // works for the last track because
52 // the array contains special extra element
53 // paticularly for this case
54 fHitsInTrack = fNextFirstHit - fpFirstHits[fTrackIdx];
55}
56
57template<typename HitType>
59{
60 if (fEndOfHits)
61 return 0.0;
62 return fpHits[fHitIdx].GetX();
63}
64
65template<typename HitType>
67{
68 if (fEndOfHits)
69 return 0.0;
70 return fpHits[fHitIdx].GetY();
71}
72
73template<typename HitType>
75{
76 if (fEndOfHits)
77 return 0.0;
78 return fpHits[fHitIdx].GetZ();
79}
80
81template<typename HitType>
83{
84 if (fEndOfHits)
85 return 0.0;
86 return fpHits[fHitIdx].GetWx();
87}
88
89template<typename HitType>
91{
92 if (fEndOfHits)
93 return 0.0;
94 return fpHits[fHitIdx].GetWy();
95}
96
97template<typename HitType>
99{
100 if (fEndOfHits)
101 return 0;
102 return fpHits[fHitIdx].GetDetectorID();
103 // RAM data contains ID allready encoded in alignment variant
104}
105
106template<typename HitType>
108{
109 return fHitsInTrack;
110}
111
112// Instantiate the template
113template class BmnRamIterator<BmnHitRecord>;
114
115#include "BmnATestHit.h"
116template class BmnRamIterator<BmnATestHit>;
virtual Double_t HitWy() const override
virtual Int_t HitDetectorID() const override
virtual Double_t HitWx() const override
virtual Int_t HitsInTrack() const override
virtual void NextHit() override
virtual Double_t HitY() const override
virtual Double_t HitZ() const override
virtual Double_t HitX() const override
virtual void ResetAll() override
virtual void ResetHits() override
virtual void NextTrack() override