ATLAS Offline Software
MdtAlignmentStore.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
5 
6 #include "GeoModelHelpers/throwExcept.h"
8  m_idHelperSvc{idHelperSvc}{
10  m_alignMap.resize(m_idHelperSvc->mdtIdHelper().module_hash_max());
11 }
12 void MdtAlignmentStore::storeDistortion(const Identifier& detElId, const BLinePar* bline, const MdtAsBuiltPar* asBuilt) {
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 }
MdtAlignmentStore::chamberDistortions::bLine
const BLinePar * bLine
Definition: MdtAlignmentStore.h:26
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::chamberDistortions
Helper struct to store the pointer to the Mdt distrotion parameters, namely the As-built and the BLin...
Definition: MdtAlignmentStore.h:25
MdtAlignmentStore::storeDistortion
void storeDistortion(const Identifier &detElId, const BLinePar *bline, const MdtAsBuiltPar *asBuilt)
Definition: MdtAlignmentStore.cxx:12
MdtAlignmentStore::m_alignMap
std::vector< chamberDistortions > m_alignMap
Definition: MdtAlignmentStore.h:41
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
MdtAlignmentStore.h
BLinePar
Definition: BLinePar.h:14
MdtAlignmentStore::chamberDistortions::asBuilt
const MdtAsBuiltPar * asBuilt
Definition: MdtAlignmentStore.h:27
MdtAsBuiltPar
Container classifier the MDT as-built parameters See parameter description in http://atlas-muon-align...
Definition: MdtAsBuiltPar.h:18
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
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:26
MdtAlignmentStore::MdtAlignmentStore
MdtAlignmentStore(const Muon::IMuonIdHelperSvc *idHelperSvc)
Definition: MdtAlignmentStore.cxx:7