ATLAS Offline Software
MuonSPCalibrationTest.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "GaudiKernel/PhysicalConstants.h"
7 
8 
9 using namespace MuonValR4;
11 
13  ATH_MSG_VERBOSE("Initializing MdtCalibDbAlgTest");
15  ATH_CHECK(m_idHelperSvc.retrieve());
16  ATH_CHECK(m_calibTool.retrieve());
17  ATH_CHECK(m_spKeyArray.initialize());
18  return StatusCode::SUCCESS;
19 }
20 
22  const EventContext& ctx = Gaudi::Hive::currentContext();
23  SG::ReadHandle geoCtx{m_geoCtxKey, ctx};
24  ATH_CHECK(geoCtx.isPresent());
25 
26  for (const auto& spContainer : m_spKeyArray) {
27  SG::ReadHandle<MuonR4::SpacePointContainer> spHandle{spContainer, ctx};
28  ATH_CHECK(spHandle.isValid());
29 
30  for (const MuonR4::SpacePointBucket* spBucket : *spHandle) {
31  if (!spBucket) continue;
32  for(const auto& sp : *spBucket) {
33  if (!sp) continue;
34  ATH_MSG_ALWAYS("Processing SpacePoint " << m_idHelperSvc->toString(sp->identify()) << " with dimension " << sp->dimension()
35  << " and position " << Amg::toString(sp->positionInChamber())
36  << " and direction " << Amg::toString(sp->directionInChamber()));
37 
38  // Get the seed position and direction in the chamber
39  Amg::Vector3D seedPosInChamb = sp->positionInChamber();
40  Amg::Vector3D seedDirInChamb = sp->directionInChamber();
41 
42  CalibSpacePointPtr calibSP = m_calibTool->calibrate(ctx, sp.get(), seedPosInChamb, seedDirInChamb, 0.0);
43  ATH_MSG_ALWAYS("Calibrated SpacePoint: with position " << Amg::toString(calibSP->positionInChamber())
44  << " and direction " << Amg::toString(calibSP->directionInChamber()));
45  }
46 
47  }
48  }
49  return StatusCode::SUCCESS;
50 }
MuonValR4::MuonSPCalibrationTest::initialize
virtual StatusCode initialize() override
Definition: MuonSPCalibrationTest.cxx:12
MuonR4::SpacePointBucket
: The muon space point bucket represents a collection of points that will bre processed together in t...
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/MuonSpacePoint/SpacePointContainer.h:21
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
MuonValR4::MuonSPCalibrationTest::m_geoCtxKey
SG::ReadHandleKey< ActsGeometryContext > m_geoCtxKey
Definition: MuonSPCalibrationTest.h:37
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
MuonValR4::MuonSPCalibrationTest::m_spKeyArray
SG::ReadHandleKeyArray< MuonR4::SpacePointContainer > m_spKeyArray
Definition: MuonSPCalibrationTest.h:36
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_ALWAYS
#define ATH_MSG_ALWAYS(x)
Definition: AthMsgStreamMacros.h:35
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
MuonValR4
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
Definition: IPatternVisualizationTool.h:23
MuonR4::ISpacePointCalibrator::CalibSpacePointPtr
std::unique_ptr< CalibratedSpacePoint > CalibSpacePointPtr
Definition: ISpacePointCalibrator.h:30
MuonSPCalibrationTest.h
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
MuonR4::CalibSpacePointPtr
ISpacePointCalibrator::CalibSpacePointPtr CalibSpacePointPtr
Definition: SpacePointCalibrator.cxx:32
MuonValR4::MuonSPCalibrationTest::execute
virtual StatusCode execute() override
Definition: MuonSPCalibrationTest.cxx:21
MuonValR4::MuonSPCalibrationTest::m_calibTool
ToolHandle< MuonR4::ISpacePointCalibrator > m_calibTool
Definition: MuonSPCalibrationTest.h:41
MuonValR4::MuonSPCalibrationTest::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
pointer to MdtCalibSvc
Definition: MuonSPCalibrationTest.h:39