ATLAS Offline Software
Loading...
Searching...
No Matches
ActsVolumeIdToDetectorElementCollectionMap.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4#ifndef ACTSTRK_ActsVolumeIdToDetectorElementCollectionMap_H
5#define ACTSTRK_ActsVolumeIdToDetectorElementCollectionMap_H
6#include <vector>
7#include <array>
8#include <stdexcept>
10
11
12namespace ActsTrk {
14 public:
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 }
33 const InDetDD::SiDetectorElementCollection *collection(unsigned int volume_id) const {
34 return m_collections.at( volume_id >= m_collectionId.size() ? static_cast<unsigned char>(0u) : m_collectionId[volume_id] );
35 }
36 const std::array<unsigned char,256> &collecionMap() const { return m_collectionId; }
37 const std::vector<const InDetDD::SiDetectorElementCollection*> &collections() const { return m_collections; }
38
39 private:
40 std::array<unsigned char,256> m_collectionId{};
41 std::vector<const InDetDD::SiDetectorElementCollection*> m_collections;
42 };
43}
44
45
49CONDCONT_MIXED_DEF(ActsTrk::ActsVolumeIdToDetectorElementCollectionMap, 1289614908);
50
51#endif
Hold mappings of ranges to condition objects.
#define CONDCONT_MIXED_DEF(...)
Definition CondCont.h:1446
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
const std::vector< const InDetDD::SiDetectorElementCollection * > & collections() const
const InDetDD::SiDetectorElementCollection * collection(unsigned int volume_id) const
std::vector< const InDetDD::SiDetectorElementCollection * > m_collections
void registerCollection(unsigned int volume_id, const InDetDD::SiDetectorElementCollection *collection)
Class to hold the SiDetectorElement objects to be put in the detector store.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...