ATLAS Offline Software
Loading...
Searching...
No Matches
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); }
std::vector< const InDetDD::SiDetectorElementCollection * > m_collections

Member Function Documentation

◆ collecionMap()

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

◆ 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 }
const InDetDD::SiDetectorElementCollection * collection(unsigned int volume_id) const

Member Data Documentation

◆ m_collectionId

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

Definition at line 40 of file ActsVolumeIdToDetectorElementCollectionMap.h.

40{};

◆ 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: