|
CbmRoot
|
Class for storing 2d objects in a grid. More...
#include <CaGrid.h>
Public Member Functions | |
| Grid ()=default | |
| Default constructor. | |
| ~Grid ()=default | |
| Destructor. | |
| void | BuildBins (fscal xMin, fscal xMax, fscal yMin, fscal yMax, fscal binWidthX, fscal binWidthY, fscal zRef) |
| Build the grid. | |
| void | StoreHits (const ca::Vector< ca::Hit > &hits, ca::HitIndex_t hitStartIndex, ca::HitIndex_t nHits, const ca::Vector< unsigned char > &hitKeyFlags) |
| Store objects in the grid. | |
| void | RemoveUsedHits (const ca::Vector< ca::Hit > &hits, const ca::Vector< unsigned char > &hitKeyFlags) |
| Remove grid entries that correspond to the used hits. | |
| int | GetBin (fscal X, fscal Y) const |
| Get bin index for (X,Y) point with boundary check. | |
| int | GetBinX (fscal X) const |
| Get bin X index with boundary check. | |
| int | GetBinY (fscal Y) const |
| Get bin Y index with boundary check. | |
| std::tuple< fscal, fscal > | GetBinBoundsX (int iBin) const |
| Get bin bounds along X. | |
| std::tuple< fscal, fscal > | GetBinBoundsY (int iBin) const |
| Get bin bounds along Y. | |
| int | GetNofBins () const |
| Get number of bins. | |
| int | GetNofBinsX () const |
| Get number of bins along X. | |
| int | GetNofBinsY () const |
| Get number of bins along Y. | |
| ca::HitIndex_t | GetFirstBinEntryIndex (int bin) const |
| Get index of the first bin entry in fHitsInBin array. | |
| const ca::Vector< ca::GridEntry > & | GetEntries () const |
| Get number of entries in the bin. | |
| fscal | GetMinX () const |
| Get minimal X value. | |
| fscal | GetMinY () const |
| Get minimal Y value. | |
| fscal | GetBinWidthX () const |
| Get bin width in X. | |
| fscal | GetBinWidthY () const |
| Get bin width in Y. | |
| fscal | GetZref () const |
| Get reference Z value for the stored hits. | |
| fscal | GetMaxRangeX () const |
| Get maximal entry range in X. | |
| fscal | GetMaxRangeY () const |
| Get maximal entry range in Y. | |
| fscal | GetMaxRangeT () const |
| Get maximal entry range in T. | |
| fscal | GetMinZ () const |
| Get minimal Z value of the stored hits. | |
| fscal | GetMaxZ () const |
| Get maximal Z value of the stored hits. | |
Private Attributes | |
| int | fN {0} |
| — Data members — | |
| int | fNx {0} |
| N bins in X. | |
| int | fNy {0} |
| N bins in Y. | |
| fscal | fMinX {0.} |
| minimal X value | |
| fscal | fMinY {0.} |
| minimal Y value | |
| fscal | fBinWidthX {0.} |
| bin width in X | |
| fscal | fBinWidthY {0.} |
| bin width in Y | |
| fscal | fBinWidthXinv {0.} |
| inverse bin width in X | |
| fscal | fBinWidthYinv {0.} |
| inverse bin width in Y | |
| fscal | fZref {0.} |
| reference Z value for the stored hits | |
| fscal | fMaxRangeX {0.} |
| maximal entry range in X | |
| fscal | fMaxRangeY {0.} |
| maximal entry range in Y | |
| fscal | fMaxRangeT {0.} |
| maximal entry range in T | |
| fscal | fMinZ {0.} |
| minimal Z value of the stored hits | |
| fscal | fMaxZ {0.} |
| maximal Z value of the stored hits | |
| ca::Vector< ca::HitIndex_t > | fFirstBinEntryIndex |
| index of the first entry in the bin | |
| ca::Vector< ca::HitIndex_t > | fNofBinEntries {"Grid::fNofBinEntries", 1, 0} |
| number of hits in the bin | |
| ca::Vector< ca::GridEntry > | fEntries |
| grid entries with references to the hit index in fWindowHits | |
Class for storing 2d objects in a grid.
It creates 2-dimensional backet-sorted grid of pointers to 2-dimensional objects.
The class provides an access to the objects in selected 2D bin without touching the rest of the data. To loop over the objects in arbitrary XY-area one can use the ca::GridArea class.
The class is used by CaTracker to speed-up the hit search operations The grid axis are named X and Y
|
default |
Default constructor.
|
default |
Destructor.
References hits.
| void cbm::algo::ca::Grid::BuildBins | ( | fscal | xMin, |
| fscal | xMax, | ||
| fscal | yMin, | ||
| fscal | yMax, | ||
| fscal | binWidthX, | ||
| fscal | binWidthY, | ||
| fscal | zRef ) |
Build the grid.
| xMin | - minimal X value |
| xMax | - maximal X value |
| yMin | - minimal Y value |
| yMax | - maximal Y value |
| binWidthX | - bin width in X |
| binWidthY | - bin width in Y |
Definition at line 19 of file CaGrid.cxx.
References fBinWidthX, fBinWidthXinv, fBinWidthY, fBinWidthYinv, fEntries, fFirstBinEntryIndex, fMaxRangeT, fMaxRangeX, fMaxRangeY, fMaxZ, fMinX, fMinY, fMinZ, fN, fNofBinEntries, fNx, fNy, and fZref.
Referenced by cbm::algo::ca::TrackFinderWindow::PrepareGrid().
Get bin bounds along X.
| iBin | - bin index |
Definition at line 188 of file CaGrid.h.
References fBinWidthX, fMinX, and fNx.
Get bin bounds along Y.
| iBin | - bin index |
Definition at line 194 of file CaGrid.h.
References fBinWidthY, fMinY, and fNx.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Get index of the first bin entry in fHitsInBin array.
Definition at line 100 of file CaGrid.h.
References fFirstBinEntryIndex, and fN.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| void cbm::algo::ca::Grid::RemoveUsedHits | ( | const ca::Vector< ca::Hit > & | hits, |
| const ca::Vector< unsigned char > & | hitKeyFlags ) |
Remove grid entries that correspond to the used hits.
Definition at line 113 of file CaGrid.cxx.
References cbm::algo::ca::Hit::BackKey(), fEntries, fFirstBinEntryIndex, fMaxRangeT, fMaxRangeX, fMaxRangeY, fMaxZ, fMinZ, fN, fNofBinEntries, cbm::algo::ca::Hit::FrontKey(), fZref, hits, and cbm::algo::ca::Hit::Z().
Referenced by cbm::algo::ca::TrackFinderWindow::PrepareCAIteration().
| void cbm::algo::ca::Grid::StoreHits | ( | const ca::Vector< ca::Hit > & | hits, |
| ca::HitIndex_t | hitStartIndex, | ||
| ca::HitIndex_t | nHits, | ||
| const ca::Vector< unsigned char > & | hitKeyFlags ) |
Store objects in the grid.
void StoreData(...);
Store ca::Hits in the grid
| hits | - vector of hits to store |
| hitStartIndex | - index of the first hit to store |
| nHits | - number of hits to store starting from the hitStartIndex |
| hitKeyFlags | - vector of flags to recognise used hits and skip them |
Definition at line 69 of file CaGrid.cxx.
References cbm::algo::ca::Hit::BackKey(), fEntries, fFirstBinEntryIndex, fMaxRangeT, fMaxRangeX, fMaxRangeY, fMaxZ, fMinZ, fN, fNofBinEntries, cbm::algo::ca::Hit::FrontKey(), fZref, GetBin(), hits, cbm::algo::ca::Hit::RangeT(), cbm::algo::ca::Hit::RangeX(), cbm::algo::ca::Hit::RangeY(), cbm::algo::ca::Hit::X(), cbm::algo::ca::Hit::Y(), and cbm::algo::ca::Hit::Z().
|
private |
bin width in X
Definition at line 147 of file CaGrid.h.
Referenced by BuildBins(), GetBinBoundsX(), and GetBinWidthX().
|
private |
inverse bin width in X
Definition at line 149 of file CaGrid.h.
Referenced by BuildBins(), and GetBinX().
|
private |
bin width in Y
Definition at line 148 of file CaGrid.h.
Referenced by BuildBins(), GetBinBoundsY(), and GetBinWidthY().
|
private |
inverse bin width in Y
Definition at line 150 of file CaGrid.h.
Referenced by BuildBins(), and GetBinY().
|
private |
grid entries with references to the hit index in fWindowHits
Definition at line 164 of file CaGrid.h.
Referenced by BuildBins(), GetEntries(), RemoveUsedHits(), and StoreHits().
|
private |
index of the first entry in the bin
Definition at line 159 of file CaGrid.h.
Referenced by BuildBins(), GetFirstBinEntryIndex(), RemoveUsedHits(), and StoreHits().
|
private |
maximal entry range in T
Definition at line 155 of file CaGrid.h.
Referenced by BuildBins(), GetMaxRangeT(), RemoveUsedHits(), and StoreHits().
|
private |
maximal entry range in X
Definition at line 153 of file CaGrid.h.
Referenced by BuildBins(), GetMaxRangeX(), RemoveUsedHits(), and StoreHits().
|
private |
maximal entry range in Y
Definition at line 154 of file CaGrid.h.
Referenced by BuildBins(), GetMaxRangeY(), RemoveUsedHits(), and StoreHits().
|
private |
maximal Z value of the stored hits
Definition at line 157 of file CaGrid.h.
Referenced by BuildBins(), GetMaxZ(), RemoveUsedHits(), and StoreHits().
|
private |
minimal X value
Definition at line 145 of file CaGrid.h.
Referenced by BuildBins(), GetBinBoundsX(), GetBinX(), and GetMinX().
|
private |
minimal Y value
Definition at line 146 of file CaGrid.h.
Referenced by BuildBins(), GetBinBoundsY(), GetBinY(), and GetMinY().
|
private |
minimal Z value of the stored hits
Definition at line 156 of file CaGrid.h.
Referenced by BuildBins(), GetMinZ(), RemoveUsedHits(), and StoreHits().
|
private |
— Data members —
total N bins
Definition at line 141 of file CaGrid.h.
Referenced by BuildBins(), GetFirstBinEntryIndex(), GetNofBins(), RemoveUsedHits(), and StoreHits().
|
private |
number of hits in the bin
Definition at line 162 of file CaGrid.h.
Referenced by BuildBins(), RemoveUsedHits(), and StoreHits().
|
private |
N bins in X.
Definition at line 142 of file CaGrid.h.
Referenced by BuildBins(), GetBin(), GetBinBoundsX(), GetBinBoundsY(), GetBinX(), and GetNofBinsX().
|
private |
N bins in Y.
Definition at line 143 of file CaGrid.h.
Referenced by BuildBins(), GetBinY(), and GetNofBinsY().
|
private |
reference Z value for the stored hits
Definition at line 151 of file CaGrid.h.
Referenced by BuildBins(), GetZref(), RemoveUsedHits(), and StoreHits().