BmnRoot
Loading...
Searching...
No Matches
BmnDataIterator.h
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 BmnDataIterator abstract class header-only implementation
9 Base class for ROOT file and RAM iterators
10*/
11
12#ifndef BMNDATAITERATOR_H
13#define BMNDATAITERATOR_H
14
16#include "RtypesCore.h"
17
19{
20 public:
22 : fpProgressBar(pb)
23 {}
24 virtual ~BmnDataIterator() = default;
25
26 virtual Double_t HitX() const = 0;
27 virtual Double_t HitY() const = 0;
28 virtual Double_t HitZ() const = 0;
29 virtual Double_t HitWx() const = 0; // 1 / dx^2
30 virtual Double_t HitWy() const = 0; // 1 / dy^2
31 virtual Int_t HitDetectorID() const = 0;
32 virtual Int_t HitsInTrack() const = 0;
33 virtual void ResetHits() = 0;
34 virtual void ResetAll() = 0;
35 virtual void NextHit() = 0;
36 virtual void NextTrack() = 0;
37
38 Bool_t Initialized() const noexcept { return fInitialized; }
39 Bool_t EndOfTracks() const noexcept { return fEndOfTracks; }
40 Bool_t EndOfHits() const noexcept { return fEndOfHits; }
41
42 protected:
43 Bool_t fInitialized{kFALSE}, fEndOfTracks{kTRUE}, fEndOfHits{kTRUE};
44
45 // progress bar interface
46 private:
47 BmnSimpleProgressBar* fpProgressBar;
48 Float_t fTickProgress{0.0f}, fProgress{0.0f};
49
50 protected:
51 BmnSimpleProgressBar* GetProgressBar() const noexcept { return fpProgressBar; }
52 Float_t GetTickProgress() const noexcept { return fTickProgress; }
53 void SetTickProgress(Float_t progress) { fTickProgress = progress; }
55 {
56 if (!fpProgressBar)
57 return;
58 fProgress += fTickProgress;
59 if (fProgress >= 0.01f) // fixed interval in BmnSimpleProgressBar
60 {
61 fpProgressBar->Tick();
62 fProgress = 0.0f;
63 }
64 }
66 {
67 if (!fpProgressBar)
68 return;
69 fpProgressBar->Init();
70 fProgress = 0.0f;
71 }
73 {
74 if (!fpProgressBar)
75 return;
76 fpProgressBar->Clear();
77 }
78};
79
80#endif
virtual Double_t HitX() const =0
virtual Double_t HitY() const =0
virtual Double_t HitZ() const =0
BmnDataIterator(BmnSimpleProgressBar *pb=nullptr)
virtual Double_t HitWx() const =0
void SetTickProgress(Float_t progress)
virtual void ResetHits()=0
virtual void ResetAll()=0
virtual void NextTrack()=0
BmnSimpleProgressBar * GetProgressBar() const noexcept
Bool_t EndOfTracks() const noexcept
Float_t GetTickProgress() const noexcept
virtual ~BmnDataIterator()=default
virtual Int_t HitDetectorID() const =0
virtual void NextHit()=0
virtual Double_t HitWy() const =0
Bool_t EndOfHits() const noexcept
virtual Int_t HitsInTrack() const =0
Bool_t Initialized() const noexcept