|
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 | GetNofLayers (EDetId detId) const |
| Gets number of layers of a given EDetId. | |
| 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 EDetId> | |
| int | GetIntDetIndex (EDetId detId) const |
| Gets internal index of the detector ID. | |
| 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. | |
| std::vector< int > | fvNofLayersIntDet {} |
| Number of layers in a detector. | |
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 50 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 162 of file KfModuleIndexMap.h.
References Disable(), fvDetExtToInt, fvDetIntToExt, fvDetLocOffset, fvGlbToLoc, fvLocToGlb, and fvNofLayersIntDet.
Referenced by Disable().
|
inlineprivate |
Gets internal index of the detector ID.
| EDetId |
Definition at line 104 of file KfModuleIndexMap.h.
References fvDetExtToInt.
Referenced by GetNofLayers().
|
inline |
Gets total number of components.
Definition at line 56 of file KfModuleIndexMap.h.
References fvGlbToLoc.
Referenced by ToString().
|
inline |
Gets number of layers of a given EDetId.
| EDetId | concrete index type of the det ID (can be either an enum, or an integral type) |
| detId | Detector ID of the component |
Definition at line 62 of file KfModuleIndexMap.h.
References fvNofLayersIntDet, and GetIntDetIndex().
|
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 189 of file KfModuleIndexMap.h.
References fvGlbToLoc, and GlobalToLocal().
Referenced by GlobalToLocal().
|
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 82 of file KfModuleIndexMap.h.
References fvDetExtToInt, fvDetLocOffset, and fvLocToGlb.
| 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 110 of file KfModuleIndexMap.h.
References fvDetExtToInt, fvDetIntToExt, fvDetLocOffset, fvGlbToLoc, fvLocToGlb, and fvNofLayersIntDet.
| 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 52 of file KfModuleIndexMap.h.
|
friend |
Definition at line 51 of file KfModuleIndexMap.h.
References ModuleIndexMapFactory.
Referenced by ModuleIndexMapFactory.
|
private |
Maps internal detID to external.
Definition at line 124 of file KfModuleIndexMap.h.
Referenced by Disable(), GetIntDetIndex(), LocalToGlobal(), cbm::algo::kf::ModuleIndexMapFactory::MakeIndexMap(), Reset(), and serialize().
|
private |
Maps external detID to internal.
Definition at line 123 of file KfModuleIndexMap.h.
Referenced by Disable(), cbm::algo::kf::ModuleIndexMapFactory::MakeIndexMap(), Reset(), and serialize().
|
private |
First index of component for det.
Definition at line 122 of file KfModuleIndexMap.h.
Referenced by Disable(), LocalToGlobal(), cbm::algo::kf::ModuleIndexMapFactory::MakeIndexMap(), Reset(), and serialize().
|
private |
Definition at line 121 of file KfModuleIndexMap.h.
Referenced by Disable(), GetNofLayers(), GlobalToLocal(), cbm::algo::kf::ModuleIndexMapFactory::MakeIndexMap(), Reset(), serialize(), and ToString().
|
private |
Definition at line 120 of file KfModuleIndexMap.h.
Referenced by Disable(), LocalToGlobal(), cbm::algo::kf::ModuleIndexMapFactory::MakeIndexMap(), Reset(), and serialize().
|
private |
Number of layers in a detector.
Definition at line 125 of file KfModuleIndexMap.h.
Referenced by Disable(), GetNofLayers(), cbm::algo::kf::ModuleIndexMapFactory::MakeIndexMap(), and serialize().