ATLAS Offline Software
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 
8 std::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 " << 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 
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 
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
Amg::Vector2D
Eigen::Matrix< double, 2, 1 > Vector2D
Definition: GeoPrimitives.h:48
Muon::IMuonIdHelperSvc::stationEta
virtual int stationEta(const Identifier &id) const =0
Return stationEta for all technologies.
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
operator<<
std::ostream & operator<<(std::ostream &ostr, const sTGCAsBuiltData::Parameters &par)
Definition: sTGCAsBuiltData.cxx:8
sTGCAsBuiltData::Parameters
Definition: sTGCAsBuiltData.h:35
Muon::IMuonIdHelperSvc::stationNameString
virtual std::string stationNameString(const Identifier &id) const =0
Return the stationName string for all technologies.
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
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:121
sTGCAsBuiltData::m_asBuiltData
ParMap m_asBuiltData
Definition: sTGCAsBuiltData.h:47
createCoolChannelIdFile.par
par
Definition: createCoolChannelIdFile.py:28
sTGCAsBuiltData::setParameters
StatusCode setParameters(const Identifier &gasGapId, const Parameters &pars)
Definition: sTGCAsBuiltData.cxx:39
sTGCAsBuiltData::m_idHelperSvc
const Muon::IMuonIdHelperSvc * m_idHelperSvc
Definition: sTGCAsBuiltData.h:45
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:16
Muon::IMuonIdHelperSvc::toString
virtual std::string toString(const Identifier &id) const =0
print all fields to string
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
sTGCAsBuiltData::correctPosition
Amg::Vector2D correctPosition(const Identifier &channelId, const Amg::Vector2D &pos) const
Definition: sTGCAsBuiltData.cxx:19
GeoPrimitivesToStringConverter.h
Muon::IMuonIdHelperSvc
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition: IMuonIdHelperSvc.h:27
sTGCAsBuiltData.h
sTGCAsBuiltData::sTGCAsBuiltData
sTGCAsBuiltData(const Muon::IMuonIdHelperSvc *idHelperSvc)
Definition: sTGCAsBuiltData.cxx:13
Identifier
Definition: IdentifierFieldParser.cxx:14