Loading [MathJax]/jax/input/TeX/config.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
ActsTrk::ActsVolumeIdToDetectorElementCollectionMap Class Reference

#include <ActsVolumeIdToDetectorElementCollectionMap.h>

Collaboration diagram for ActsTrk::ActsVolumeIdToDetectorElementCollectionMap:

Public Member Functions

 ActsVolumeIdToDetectorElementCollectionMap ()
 
void registerCollection (unsigned int volume_id, const InDetDD::SiDetectorElementCollection *collection)
 
const InDetDD::SiDetectorElementCollectioncollection (unsigned int volume_id) const
 
const std::array< unsigned char, 256 > & collecionMap () const
 
const std::vector< const InDetDD::SiDetectorElementCollection * > & collections () const
 

Private Attributes

std::array< unsigned char, 256 > m_collectionId {}
 
std::vector< const InDetDD::SiDetectorElementCollection * > m_collections
 

Detailed Description

Definition at line 13 of file ActsVolumeIdToDetectorElementCollectionMap.h.

Constructor & Destructor Documentation

◆ ActsVolumeIdToDetectorElementCollectionMap()

ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::ActsVolumeIdToDetectorElementCollectionMap ( )
inline

Definition at line 15 of file ActsVolumeIdToDetectorElementCollectionMap.h.

15 { m_collections.push_back(nullptr); }

Member Function Documentation

◆ collecionMap()

const std::array<unsigned char,256>& ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::collecionMap ( ) const
inline

Definition at line 36 of file ActsVolumeIdToDetectorElementCollectionMap.h.

36 { return m_collectionId; }

◆ collection()

const InDetDD::SiDetectorElementCollection* ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::collection ( unsigned int  volume_id) const
inline

Definition at line 33 of file ActsVolumeIdToDetectorElementCollectionMap.h.

33  {
34  return m_collections.at( volume_id >= m_collectionId.size() ? static_cast<unsigned char>(0u) : m_collectionId[volume_id] );
35  }

◆ collections()

const std::vector<const InDetDD::SiDetectorElementCollection*>& ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::collections ( ) const
inline

Definition at line 37 of file ActsVolumeIdToDetectorElementCollectionMap.h.

37 { return m_collections; }

◆ registerCollection()

void ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::registerCollection ( unsigned int  volume_id,
const InDetDD::SiDetectorElementCollection collection 
)
inline

Definition at line 16 of file ActsVolumeIdToDetectorElementCollectionMap.h.

16  {
17  std::vector<const InDetDD::SiDetectorElementCollection *>::const_iterator iter=std::find(m_collections.begin(), m_collections.end(), collection);
18  unsigned char col_i;
19  if (iter == m_collections.end()) {
20  assert(m_collections.size()<256u);
21  col_i=static_cast<unsigned char>(m_collections.size());
22  m_collections.push_back(collection);
23  }
24  else {
25  assert( iter - m_collections.begin()< 256u);
26  col_i = static_cast<unsigned char>(iter - m_collections.begin());
27  }
28  if (m_collectionId.at(volume_id) != 0 && m_collectionId.at(volume_id) != col_i) {
29  throw std::runtime_error("Volume id maps to multiple detector element collections.");
30  }
31  m_collectionId.at(volume_id) = col_i;
32  }

Member Data Documentation

◆ m_collectionId

std::array<unsigned char,256> ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::m_collectionId {}
private

Definition at line 40 of file ActsVolumeIdToDetectorElementCollectionMap.h.

◆ m_collections

std::vector<const InDetDD::SiDetectorElementCollection*> ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::m_collections
private

Definition at line 41 of file ActsVolumeIdToDetectorElementCollectionMap.h.


The documentation for this class was generated from the following file:
ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::m_collections
std::vector< const InDetDD::SiDetectorElementCollection * > m_collections
Definition: ActsVolumeIdToDetectorElementCollectionMap.h:41
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::m_collectionId
std::array< unsigned char, 256 > m_collectionId
Definition: ActsVolumeIdToDetectorElementCollectionMap.h:40
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::collection
const InDetDD::SiDetectorElementCollection * collection(unsigned int volume_id) const
Definition: ActsVolumeIdToDetectorElementCollectionMap.h:33