ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsGeometry
ActsGeometry
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>
9
#include "
InDetReadoutGeometry/SiDetectorElementCollection.h
"
10
11
12
namespace
ActsTrk
{
13
class
ActsVolumeIdToDetectorElementCollectionMap
{
14
public
:
15
ActsVolumeIdToDetectorElementCollectionMap
() {
m_collections
.push_back(
nullptr
); }
16
void
registerCollection
(
unsigned
int
volume_id,
const
InDetDD::SiDetectorElementCollection
*
collection
) {
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
46
#include "
AthenaKernel/CLASS_DEF.h
"
47
#include "
AthenaKernel/CondCont.h
"
48
CLASS_DEF
(
ActsTrk::ActsVolumeIdToDetectorElementCollectionMap
,1230701610 , 1 )
49
CONDCONT_MIXED_DEF
(
ActsTrk
::ActsVolumeIdToDetectorElementCollectionMap, 1289614908);
50
51
#endif
CondCont.h
Hold mappings of ranges to condition objects.
CONDCONT_MIXED_DEF
#define CONDCONT_MIXED_DEF(...)
Definition
CondCont.h:1446
CLASS_DEF.h
macros to associate a CLID to a type
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition
Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:67
SiDetectorElementCollection.h
ActsTrk::ActsVolumeIdToDetectorElementCollectionMap
Definition
ActsVolumeIdToDetectorElementCollectionMap.h:13
ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::collections
const std::vector< const InDetDD::SiDetectorElementCollection * > & collections() const
Definition
ActsVolumeIdToDetectorElementCollectionMap.h:37
ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::collecionMap
const std::array< unsigned char, 256 > & collecionMap() const
Definition
ActsVolumeIdToDetectorElementCollectionMap.h:36
ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::m_collectionId
std::array< unsigned char, 256 > m_collectionId
Definition
ActsVolumeIdToDetectorElementCollectionMap.h:40
ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::ActsVolumeIdToDetectorElementCollectionMap
ActsVolumeIdToDetectorElementCollectionMap()
Definition
ActsVolumeIdToDetectorElementCollectionMap.h:15
ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::collection
const InDetDD::SiDetectorElementCollection * collection(unsigned int volume_id) const
Definition
ActsVolumeIdToDetectorElementCollectionMap.h:33
ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::m_collections
std::vector< const InDetDD::SiDetectorElementCollection * > m_collections
Definition
ActsVolumeIdToDetectorElementCollectionMap.h:41
ActsTrk::ActsVolumeIdToDetectorElementCollectionMap::registerCollection
void registerCollection(unsigned int volume_id, const InDetDD::SiDetectorElementCollection *collection)
Definition
ActsVolumeIdToDetectorElementCollectionMap.h:16
InDetDD::SiDetectorElementCollection
Class to hold the SiDetectorElement objects to be put in the detector store.
Definition
SiDetectorElementCollection.h:27
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition
MdtCalibInput.h:31
Generated on
for ATLAS Offline Software by
1.17.0