ATLAS Offline Software
Loading...
Searching...
No Matches
MdtAlignmentStore Class Referencefinal

Helper struct to cache simulatenously the As-built and the BLine corrections of the Mdts for fast access within the new MdtReadout geometry. More...

#include <MdtAlignmentStore.h>

Inheritance diagram for MdtAlignmentStore:
Collaboration diagram for MdtAlignmentStore:

Classes

struct  chamberDistortions
 Helper struct to store the pointer to the Mdt distrotion parameters, namely the As-built and the BLine chamber deformations. More...

Public Member Functions

 MdtAlignmentStore (const Muon::IMuonIdHelperSvc *idHelperSvc)
chamberDistortions getDistortion (const Identifier &detElId) const
 Returns a chamber distortion that's cached for the corresponding Mdt chamber element.
void storeDistortion (const Identifier &detElId, const BLinePar *bline, const MdtAsBuiltPar *asBuilt)

Private Attributes

const Muon::IMuonIdHelperSvcm_idHelperSvc {nullptr}
std::vector< chamberDistortionsm_alignMap {}

Detailed Description

Helper struct to cache simulatenously the As-built and the BLine corrections of the Mdts for fast access within the new MdtReadout geometry.

Definition at line 26 of file MdtAlignmentStore.h.

Constructor & Destructor Documentation

◆ MdtAlignmentStore()

MdtAlignmentStore::MdtAlignmentStore ( const Muon::IMuonIdHelperSvc * idHelperSvc)

Reserve enough space in the vector

Definition at line 11 of file MdtAlignmentStore.cxx.

11 :
12 m_idHelperSvc{idHelperSvc}{
14 m_alignMap.resize(m_idHelperSvc->mdtIdHelper().module_hash_max());
15}
std::vector< chamberDistortions > m_alignMap
const Muon::IMuonIdHelperSvc * m_idHelperSvc

Member Function Documentation

◆ getDistortion()

chamberDistortions MdtAlignmentStore::getDistortion ( const Identifier & detElId) const
inline

Returns a chamber distortion that's cached for the corresponding Mdt chamber element.

Definition at line 40 of file MdtAlignmentStore.h.

40 {
41 const unsigned int idx = m_idHelperSvc->moduleHash(detElId);
42 assert(m_idHelperSvc->technologyIndex(detElId) == Muon::MuonStationIndex::TechnologyIndex::MDT);
43 return idx < m_alignMap.size() ? m_alignMap[idx] : chamberDistortions{};
44 }
Helper struct to store the pointer to the Mdt distrotion parameters, namely the As-built and the BLin...

◆ storeDistortion()

void MdtAlignmentStore::storeDistortion ( const Identifier & detElId,
const BLinePar * bline,
const MdtAsBuiltPar * asBuilt )

Definition at line 16 of file MdtAlignmentStore.cxx.

16 {
17 if (!bline && !asBuilt) return;
18 unsigned int idx = m_idHelperSvc->moduleHash(detElId);
19 if (idx >= m_alignMap.size()) {
20 THROW_EXCEPTION("Invalid hash for "<<m_idHelperSvc->toString(detElId));
21 }
23 if (distorts &&(distorts.bLine != bline || distorts.asBuilt != asBuilt)) {
24 THROW_EXCEPTION("The alignment parameter "<<m_idHelperSvc->toString(detElId)<<" is already cached ");
25 }
26 distorts.bLine = bline;
27 distorts.asBuilt = asBuilt;
28}
#define THROW_EXCEPTION(MESSAGE)
Definition throwExcept.h:10

Member Data Documentation

◆ m_alignMap

std::vector<chamberDistortions> MdtAlignmentStore::m_alignMap {}
private

Definition at line 48 of file MdtAlignmentStore.h.

48{};

◆ m_idHelperSvc

const Muon::IMuonIdHelperSvc* MdtAlignmentStore::m_idHelperSvc {nullptr}
private

Definition at line 47 of file MdtAlignmentStore.h.

47{nullptr};

The documentation for this class was generated from the following files: