CbmRoot
|
Maps local detector and station indices to the material maps and field slices. More...
#include <KfModuleIndexMap.h>
Public Member Functions | |
int | GetNofLayers () const |
Gets total number of components. | |
template<class EDetID = int> | |
std::pair< EDetID, int > | GlobalToLocal (int globId) const |
Converts internal layer index to pair (detID, locID) | |
template<class EDetID > | |
int | LocalToGlobal (EDetID detId, int locId) const |
Converts external pair (detID, locID) to internal layer index. | |
template<class EDetID > | |
void | Disable (EDetID detId, int locId) |
Disables a component. | |
void | Reset () |
Resets the instance. | |
std::string | ToString (int indentLevel=0) const |
String representation of the instance. | |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int) |
Private Attributes | |
std::vector< int > | fvLocToGlb {} |
std::vector< std::pair< int, int > > | fvGlbToLoc {} |
std::vector< int > | fvDetLocOffset {} |
First index of component for det. | |
std::vector< int > | fvDetIntToExt {} |
Maps external detID to internal. | |
std::vector< int > | fvDetExtToInt {} |
Maps internal detID to external. | |
Friends | |
class | ModuleIndexMapFactory |
class | boost::serialization::access |
Maps local detector and station indices to the material maps and field slices.
The class maps external indices of components combined into subsets to a plain global index. The indices both of the components inside a subset (iLoc) and the indices of the subsets themselves (iDetExt) must be unique, but can be unsorted and can have holes in their ranges. The global index (iGlob) is assigned automatically depending on the element ordering.
The mapping is organized with the sequential contiguous containers (std::vector). The containers used are: (i) fvDetExtToInt [ iDetExt ] => iDetInt size: max(iDetExt) (ii) fvDetIntToExt [ iDetInt ] => iDetExt (int) size: number of registered subsystems (iii) fvDetLocOffset [ iDetInt ] => max number of elements for iDetInt - 1 size: max possible number of elements (including inactive/unused) fvDetLocOffset[0] = 0, fvDetLocOffset.back() = n of max possible elements (iv) fvGlbToLoc [ iGlob ] => pair(iDetInt, iLoc) size: number of registered components (v) fvLocToGlb [ fvDetLocOffset[iDetInt] + iLoc] => iGlob size: max possible number of components (including inactive/unused)
Definition at line 49 of file KfModuleIndexMap.h.
void cbm::algo::kf::ModuleIndexMap::Disable | ( | EDetID | detId, |
int | locId ) |
Disables a component.
EDetID | concrete index type of the det ID (can be either an enum, or an integral type) |
locId | Local ID of the layer |
detId | Detector ID of the component |
Definition at line 141 of file KfModuleIndexMap.h.
|
inline |
Gets total number of components.
Definition at line 55 of file KfModuleIndexMap.h.
Referenced by ToString().
|
inline |
Converts internal layer index to pair (detID, locID)
EDetID | concrete index type of the det ID (can be either an enum, or an integral type) |
globId | Internal layer index |
Definition at line 166 of file KfModuleIndexMap.h.
|
inline |
Converts external pair (detID, locID) to internal layer index.
EDetID | concrete index type of the det ID (can be either an enum, or an integral type) |
locId | Local ID of the layer |
detId | Detector ID of the component |
Definition at line 71 of file KfModuleIndexMap.h.
void cbm::algo::kf::ModuleIndexMap::Reset | ( | ) |
Resets the instance.
Definition at line 16 of file KfModuleIndexMap.cxx.
References fvDetExtToInt, fvDetIntToExt, fvDetLocOffset, fvGlbToLoc, and fvLocToGlb.
|
inlineprivate |
Definition at line 91 of file KfModuleIndexMap.h.
std::string cbm::algo::kf::ModuleIndexMap::ToString | ( | int | indentLevel = 0 | ) | const |
String representation of the instance.
Definition at line 27 of file KfModuleIndexMap.cxx.
References fvGlbToLoc, and GetNofLayers().
|
friend |
Definition at line 51 of file KfModuleIndexMap.h.
|
friend |
Definition at line 50 of file KfModuleIndexMap.h.
|
private |
Maps internal detID to external.
Definition at line 104 of file KfModuleIndexMap.h.
Referenced by cbm::algo::kf::ModuleIndexMapFactory::MakeIndexMap(), and Reset().
|
private |
Maps external detID to internal.
Definition at line 103 of file KfModuleIndexMap.h.
Referenced by cbm::algo::kf::ModuleIndexMapFactory::MakeIndexMap(), and Reset().
|
private |
First index of component for det.
Definition at line 102 of file KfModuleIndexMap.h.
Referenced by cbm::algo::kf::ModuleIndexMapFactory::MakeIndexMap(), and Reset().
|
private |
Definition at line 101 of file KfModuleIndexMap.h.
Referenced by cbm::algo::kf::ModuleIndexMapFactory::MakeIndexMap(), Reset(), and ToString().
|
private |
Definition at line 100 of file KfModuleIndexMap.h.
Referenced by cbm::algo::kf::ModuleIndexMapFactory::MakeIndexMap(), and Reset().