BmnRoot
Loading...
Searching...
No Matches
BmnRootIterator.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 BmnRootIterator class declaration
9 Iterator for tracks and hits stored in ROOT files
10*/
11
12#ifndef BMNROOTITERATOR_H
13#define BMNROOTITERATOR_H
14
15#include "BmnAlignDefines.h"
16#include "BmnDataIterator.h"
17#include "BmnDataReader.h"
18#include "BmnDetectorModel.h"
20#include "CbmStsHit.h"
21#include "CbmStsTrack.h"
22#include "TTreeReaderValue.h"
23
24#define BMN_TRACKS_BRACH_NAME "StsVector"
25#define BMN_HITS_BRACH_NAME "StsHit"
26#define BMN_HIT_CLASS_NAME "CbmStsHit"
27
29{
30 private:
31 static constexpr Double_t MAX_WEIGHT{1.0 / (BMN_CLOSE_TO_ZERO * BMN_CLOSE_TO_ZERO)};
32
33 public:
36
37 BmnRootIterator() = delete;
38 BmnRootIterator(const char* filesPathList, const BmnDetectorModel& detModel, BmnSimpleProgressBar* pb = nullptr);
40
41 virtual void ResetHits() override;
42 virtual void ResetAll() override;
43 virtual void NextTrack() override;
44 virtual void NextHit() override;
45 virtual Double_t HitX() const override;
46 virtual Double_t HitY() const override;
47 virtual Double_t HitZ() const override;
48 virtual Double_t HitWx() const override;
49 virtual Double_t HitWy() const override;
50 virtual Int_t HitDetectorID() const override;
51 virtual Int_t HitsInTrack() const override;
52
54 Long64_t GetTotalEvents() const noexcept { return fTotalEvents; }
55 Int_t GetTotalTracks() const noexcept { return fTotalTracks; }
56 Int_t GetTotalHits() const noexcept { return fTotalHits; }
57 const Hit_t* GetHit() const noexcept { return fpCurrentHit; }
58
59 private:
60 const BmnDetectorModel* fpDetModel;
61 // the class is involved into ROOT dictionary schema which utilizes forward
62 // declarations - only pointers (or refs) to classes are possible as a field
63 BmnDataReader* fpData{nullptr};
64 TTreeReader* fpReader{nullptr};
65 TTreeReaderValue<TClonesArray>*fpRootTracks{nullptr}, *fpRootHits{nullptr};
66
67 Track_t* fpCurrentTrack{nullptr};
68 Hit_t* fpCurrentHit{nullptr};
69 Long64_t fTotalEvents{0};
70 Int_t fTotalTracks{0}, fTotalHits{0}, fTracksInEvent{0}, fHitsInTrack{0}, fTrackIdx, fHitIdx;
71
72 Bool_t fProgressByTracks{kTRUE};
73
74 void UnsetProperties();
75};
76
77#endif
#define BMN_CLOSE_TO_ZERO
virtual void NextTrack() override
virtual Double_t HitX() const override
virtual void ResetAll() override
const Hit_t * GetHit() const noexcept
virtual Int_t HitDetectorID() const override
BmnRootIterator()=delete
virtual Double_t HitWx() const override
virtual Double_t HitY() const override
BmnRootIterator(const char *filesPathList, const BmnDetectorModel &detModel, BmnSimpleProgressBar *pb=nullptr)
virtual void NextHit() override
Int_t GetTotalTracks() const noexcept
Int_t GetTotalHits() const noexcept
void CountElements()
CbmStsTrack Track_t
virtual Double_t HitWy() const override
virtual Int_t HitsInTrack() const override
virtual void ResetHits() override
Long64_t GetTotalEvents() const noexcept
virtual ~BmnRootIterator()
virtual Double_t HitZ() const override