ATLAS Offline Software
Classes | Public Member Functions | Private Attributes | List of all members
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. More...
 
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 19 of file MdtAlignmentStore.h.

Constructor & Destructor Documentation

◆ MdtAlignmentStore()

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

Reserve enough space in the vector

Definition at line 7 of file MdtAlignmentStore.cxx.

7  :
8  m_idHelperSvc{idHelperSvc}{
11 }

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 33 of file MdtAlignmentStore.h.

33  {
34  const unsigned int idx = m_idHelperSvc->moduleHash(detElId);
36  return idx < m_alignMap.size() ? m_alignMap[idx] : chamberDistortions{};
37  }

◆ storeDistortion()

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

Definition at line 12 of file MdtAlignmentStore.cxx.

12  {
13  if (!bline && !asBuilt) return;
14  unsigned int idx = m_idHelperSvc->moduleHash(detElId);
15  if (idx >= m_alignMap.size()) {
16  THROW_EXCEPTION("Invalid hash for "<<m_idHelperSvc->toString(detElId));
17  }
18  chamberDistortions& distorts = m_alignMap[idx];
19  if (distorts &&(distorts.bLine != bline || distorts.asBuilt != asBuilt)) {
20  THROW_EXCEPTION("The alignment parameter "<<m_idHelperSvc->toString(detElId)<<" is already cached ");
21  }
22  distorts.bLine = bline;
23  distorts.asBuilt = asBuilt;
24 }

Member Data Documentation

◆ m_alignMap

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

Definition at line 41 of file MdtAlignmentStore.h.

◆ m_idHelperSvc

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

Definition at line 40 of file MdtAlignmentStore.h.


The documentation for this class was generated from the following files:
Muon::IMuonIdHelperSvc::moduleHash
virtual IdentifierHash moduleHash(const Identifier &id) const =0
Returns the module hash associated to an Identifier.
THROW_EXCEPTION
#define THROW_EXCEPTION(MSG)
Definition: MMReadoutElement.cxx:48
MdtAlignmentStore::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition: MdtAlignmentStore.h:40
MdtAlignmentStore::m_alignMap
std::vector< chamberDistortions > m_alignMap
Definition: MdtAlignmentStore.h:41
Muon::IMuonIdHelperSvc::technologyIndex
virtual MuonStationIndex::TechnologyIndex technologyIndex(const Identifier &id) const =0
calculate layer index from Identifier
Muon::IMuonIdHelperSvc::mdtIdHelper
virtual const MdtIdHelper & mdtIdHelper() const =0
access to MdtIdHelper
MuonIdHelper::module_hash_max
size_type module_hash_max() const
the maximum hash value
Definition: MuonIdHelper.cxx:752
Muon::IMuonIdHelperSvc::toString
virtual std::string toString(const Identifier &id) const =0
print all fields to string
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
MDT
@ MDT
Definition: RegSelEnums.h:31