ATLAS Offline Software
Loading...
Searching...
No Matches
sTGCAsBuiltData.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
6
7
8std::ostream& operator<<(std::ostream& ostr, const sTGCAsBuiltData::Parameters& par){
9 return ostr << "Offset " << par.offset << " rotxy " << par.rotation << " scale " << par.scale << " nonPara " << par.nonPara;
10}
11
12
14 AthMessaging{"sTGCAsBuiltData"},
15 m_idHelperSvc{idHelperSvc} {}
16
17
18
20 ParMap::const_iterator par_itr = m_asBuiltData.find(m_idHelperSvc->gasGapId(channelId));
21 if(par_itr == m_asBuiltData.end()){
22 ATH_MSG_WARNING("Missing as built parameters for gas gap " << m_idHelperSvc->toString(channelId));
23 return pos;
24 }
25 Amg::Vector2D correctedPos = pos;
26 Parameters pars = par_itr->second;
27 constexpr double convScale = 1.e-3; // parameters are stored in um and mrad therefore dividing by 1000
28
29 // For the QL3 modules described by the legacy (Run 3) geometry EDM the origin of the local frame is shifted with respect to the actual center of the gap.
30 // Therefore a shift is introduced which stabilizes the as built fit which must also be applied here since the parameters are expressed using the actual center of the gap.
31 float shift = (std::fabs(m_idHelperSvc->stationEta(channelId)) == 3 && m_idHelperSvc->stationNameString(channelId) == "STL" ? 24.74 : 0.0);
32 ATH_MSG_VERBOSE("applying as built parameters for gas gap " << m_idHelperSvc->toString(m_idHelperSvc->gasGapId(channelId)) << " parameters " << pars);
33
34 correctedPos.x() = pos.x() + (pars.offset * convScale + pars.rotation *convScale * pos.y() + pars.scale*convScale*(pos.x() + shift ) + pars.nonPara * convScale * convScale * (pos.x() + shift )*pos.y());
35 return correctedPos;
36}
37
38
39StatusCode sTGCAsBuiltData::setParameters(const Identifier& channelId, const Parameters& pars){
40 const Identifier gasGapId = m_idHelperSvc->gasGapId(channelId);
41 auto insert_itr = m_asBuiltData.insert(std::make_pair(gasGapId, pars));
42 if (!insert_itr.second) {
43 ATH_MSG_ERROR("As built parameters for gasGap "<<m_idHelperSvc->toStringGasGap(gasGapId)
44 <<" has already been stored ");
45 return StatusCode::FAILURE;
46 }
47 return StatusCode::SUCCESS;
48}
49
#define ATH_MSG_ERROR(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
sTGCAsBuiltData(const Muon::IMuonIdHelperSvc *idHelperSvc)
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Amg::Vector2D correctPosition(const Identifier &channelId, const Amg::Vector2D &pos) const
StatusCode setParameters(const Identifier &gasGapId, const Parameters &pars)
Eigen::Matrix< double, 2, 1 > Vector2D
std::ostream & operator<<(std::ostream &ostr, const sTGCAsBuiltData::Parameters &par)