Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
MdtCalibTestAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "MdtCalibTestAlg.h"
6 
9 namespace Muon{
10 
12  ATH_CHECK(m_idHelperSvc.retrieve());
15  return StatusCode::SUCCESS;
16  }
17  StatusCode MdtCalibTestAlg::execute(const EventContext& ctx) const {
18  SG::ReadCondHandle calibContainer{m_readKey, ctx};
19  if (!calibContainer.isValid()) {
20  ATH_MSG_FATAL("Failed to retrieve "<<m_readKey.fullKey());
21  return StatusCode::FAILURE;
22  }
23  std::vector<const MuonGMR4::MdtReadoutElement*> mdtMls = m_detMgr->getAllMdtReadoutElements();
24  std::set<MuonCalib::MdtFullCalibData::RtRelationPtr> testedRt{};
25  for (const MuonGMR4::MdtReadoutElement* re : mdtMls){
26  const MuonCalib::MdtFullCalibData* calibData = calibContainer->getCalibData(re->identify(), msgStream());
27  if (!calibData) {
28  ATH_MSG_FATAL("No calibration constants were defined for multilayer "<<m_idHelperSvc->toStringDetEl(re->identify()));
29  return StatusCode::FAILURE;
30  }
31  if (false && testedRt.insert(calibData->rtRelation).second) {
33  double r =0.;
34  while (r < re->innerTubeRadius()) {
35 
36  const std::optional<double> t = calibData->rtRelation->tr()->driftTime(r);
37  if (!t) {
38  r+=m_stepR;
39  continue;
40  }
41  const double backR = calibData->rtRelation->rt()->radius(*t);
42  if (std::abs(r - backR) > m_mapTolerance) {
43  ATH_MSG_FATAL("The drift radius "<<r<<" is mapped back to "<<backR<<". Difference: "<<std::abs(r -backR)
44  <<" "<<m_idHelperSvc->toStringDetEl(re->identify()));
45  return StatusCode::FAILURE;
46  }
47  r+=m_stepR;
48  }
49  }
50  }
51  return StatusCode::SUCCESS;
52  }
53 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
beamspotman.r
def r
Definition: beamspotman.py:676
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
Muon::MdtCalibTestAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MdtCalibTestAlg.h:25
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
MuonCalib::MdtFullCalibData::rtRelation
RtRelationPtr rtRelation
Definition: MdtFullCalibData.h:21
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
MuonCalib::MdtFullCalibData
class which holds the full set of calibration constants for a given tube
Definition: MdtFullCalibData.h:15
ReadCondHandle.h
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
MdtCalibTestAlg.h
Muon::MdtCalibTestAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Definition: MdtCalibTestAlg.cxx:17
Muon::MdtCalibTestAlg::m_detMgr
const MuonGMR4::MuonDetectorManager * m_detMgr
Definition: MdtCalibTestAlg.h:34
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MuonGMR4::MdtReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h:22
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Muon::MdtCalibTestAlg::initialize
virtual StatusCode initialize() override final
Definition: MdtCalibTestAlg.cxx:11
Muon::MdtCalibTestAlg::m_stepR
Gaudi::Property< double > m_stepR
Step width to scan the compatibility of the R-t relation.
Definition: MdtCalibTestAlg.h:30
MdtReadoutElement.h
re
const boost::regex re(r_e)
Muon::MdtCalibTestAlg::m_readKey
SG::ReadCondHandleKey< MuonCalib::MdtCalibDataContainer > m_readKey
Definition: MdtCalibTestAlg.h:26
Muon::MdtCalibTestAlg::m_mapTolerance
Gaudi::Property< double > m_mapTolerance
Compatibility window.
Definition: MdtCalibTestAlg.h:33