ATLAS Offline Software
sTGCAsBuiltData2.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
6 
8  AthMessaging{"sTGCAsBuiltData2"},
9  m_idHelperSvc{idHelperSvc} {}
10 
11 
12 
14  ParMap::const_iterator par_itr = m_asBuiltData.find(m_idHelperSvc->gasGapId(channelId));
15  if(par_itr == m_asBuiltData.end()){
16  ATH_MSG_WARNING("Missing as built parameters for gas gap " << m_idHelperSvc->toString(channelId));
17  return pos;
18  }
19  Amg::Vector2D correctedPos = pos;
20  Parameters pars = par_itr->second;
21  constexpr double convScale = 1.e-3; // parameters are stored in um and mrad therefore dividing by 1000
22  correctedPos.x() = pos.x() + (pars.offset * convScale + pars.rotation *convScale * pos.y() + pars.scale*convScale*pos.x() + pars.nonPara * convScale * convScale * pos.x()*pos.y());
23  return correctedPos;
24 }
25 
26 
28  const Identifier gasGapId = m_idHelperSvc->gasGapId(channelId);
29  auto insert_itr = m_asBuiltData.insert(std::make_pair(gasGapId, pars));
30  if (!insert_itr.second) {
31  ATH_MSG_ERROR("As built parameters for gasGap "<<m_idHelperSvc->toStringGasGap(gasGapId)
32  <<" has already been stored ");
33  return StatusCode::FAILURE;
34  }
35  return StatusCode::SUCCESS;
36 }
37 
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
sTGCAsBuiltData2::correctPosition
Amg::Vector2D correctPosition(const Identifier &channelId, const Amg::Vector2D &pos) const
Definition: sTGCAsBuiltData2.cxx:13
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
sTGCAsBuiltData2::setParameters
StatusCode setParameters(const Identifier &gasGapId, const Parameters &pars)
Definition: sTGCAsBuiltData2.cxx:27
sTGCAsBuiltData2::sTGCAsBuiltData2
sTGCAsBuiltData2(const Muon::IMuonIdHelperSvc *idHelperSvc)
Definition: sTGCAsBuiltData2.cxx:7
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Muon::IMuonIdHelperSvc::toStringGasGap
virtual std::string toStringGasGap(const Identifier &id) const =0
print all fields up to gas gap to string
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
sTGCAsBuiltData2::Parameters
Definition: sTGCAsBuiltData2.h:35
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
sTGCAsBuiltData2.h
Muon::IMuonIdHelperSvc::gasGapId
virtual Identifier gasGapId(const Identifier &id) const =0
create a gasGap ID (will return layer Id for MDTs)
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
Muon::IMuonIdHelperSvc::toString
virtual std::string toString(const Identifier &id) const =0
print all fields to string
sTGCAsBuiltData2::m_asBuiltData
ParMap m_asBuiltData
Definition: sTGCAsBuiltData2.h:47
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
GeoPrimitivesToStringConverter.h
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:27
sTGCAsBuiltData2::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition: sTGCAsBuiltData2.h:45
Identifier
Definition: IdentifierFieldParser.cxx:14