ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonPhaseII
MuonValidation
MuonSPCalibrationTest
src
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
5
#include "
MuonSPCalibrationTest.h
"
6
#include "GaudiKernel/PhysicalConstants.h"
7
8
9
using namespace
MuonValR4
;
10
using
CalibSpacePointPtr
=
MuonR4::ISpacePointCalibrator::CalibSpacePointPtr
;
11
12
StatusCode
MuonSPCalibrationTest::initialize
() {
13
ATH_MSG_VERBOSE
(
"Initializing MdtCalibDbAlgTest"
);
14
ATH_CHECK
(
m_geoCtxKey
.initialize());
15
ATH_CHECK
(
m_idHelperSvc
.retrieve());
16
ATH_CHECK
(
m_calibTool
.retrieve());
17
ATH_CHECK
(
m_spKeyArray
.initialize());
18
return
StatusCode::SUCCESS;
19
}
20
21
StatusCode
MuonSPCalibrationTest::execute
(
const
EventContext& ctx) {
22
23
const
ActsTrk::GeometryContext
* geoCtx{
nullptr
};
24
ATH_CHECK
(
SG::get
(geoCtx,
m_geoCtxKey
, ctx));
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
->localPosition())
36
<<
" and direction "
<<
Amg::toString
(
sp
->sensorDirection()));
37
38
// Get the seed position and direction in the chamber
39
Amg::Vector3D
seedPosInChamb =
sp
->localPosition();
40
const
Amg::Transform3D
& locToGlob{
sp
->msSector()->localToGlobalTransform(*geoCtx)};
41
Amg::Vector3D
seedDirInChamb = locToGlob*(
sp
->localPosition());
42
seedDirInChamb = seedDirInChamb.unit();
43
44
CalibSpacePointPtr
calibSP =
m_calibTool
->calibrate(ctx,
sp
.get(), seedPosInChamb, seedDirInChamb, 0.0);
45
ATH_MSG_ALWAYS
(
"Calibrated SpacePoint: with position "
<<
Amg::toString
(calibSP->localPosition())
46
<<
" and direction "
<<
Amg::toString
(calibSP->sensorDirection()));
47
}
48
49
}
50
}
51
return
StatusCode::SUCCESS;
52
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
ATH_MSG_ALWAYS
#define ATH_MSG_ALWAYS(x)
Definition
AthMsgStreamMacros.h:35
sp
static Double_t sp
Definition
LArPhysWaveHECTool.cxx:37
MuonSPCalibrationTest.h
ActsTrk::GeometryContext
Definition
GeometryContext.h:30
MuonR4::ISpacePointCalibrator::CalibSpacePointPtr
Acts::CloneablePtr< CalibratedSpacePoint > CalibSpacePointPtr
Definition
ISpacePointCalibrator.h:41
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
MuonValR4::MuonSPCalibrationTest::m_calibTool
ToolHandle< MuonR4::ISpacePointCalibrator > m_calibTool
Definition
MuonSPCalibrationTest.h:41
MuonValR4::MuonSPCalibrationTest::m_geoCtxKey
ActsTrk::GeoContextReadKey_t m_geoCtxKey
Definition
MuonSPCalibrationTest.h:37
MuonValR4::MuonSPCalibrationTest::m_spKeyArray
SG::ReadHandleKeyArray< MuonR4::SpacePointContainer > m_spKeyArray
Definition
MuonSPCalibrationTest.h:36
MuonValR4::MuonSPCalibrationTest::initialize
virtual StatusCode initialize() override
Definition
MuonSPCalibrationTest.cxx:12
MuonValR4::MuonSPCalibrationTest::execute
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Definition
MuonSPCalibrationTest.cxx:21
MuonValR4::MuonSPCalibrationTest::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
pointer to MdtCalibSvc
Definition
MuonSPCalibrationTest.h:39
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition
GeoPrimitivesToStringConverter.h:40
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition
GeoPrimitives.h:46
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:47
MuonR4::CalibSpacePointPtr
ISpacePointCalibrator::CalibSpacePointPtr CalibSpacePointPtr
Definition
SpacePointCalibrator.cxx:47
MuonValR4
Lightweight algorithm to read xAOD MDT sim hits and (fast-digitised) drift circles from SG and fill a...
Definition
SpacePointWriter.cxx:32
SG::get
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Definition
ReadCondHandle.h:282
Generated on
for ATLAS Offline Software by
1.17.0