ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsMonitoring
src
ReadoutGeoDumpAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
ReadoutGeoDumpAlg.h
"
5
6
7
#include "Acts/Geometry/TrackingGeometry.hpp"
8
#include "
ActsGeometryInterfaces/ISurfacePlacement.h
"
9
namespace
ActsTrk
{
10
11
StatusCode
ReadoutGeoDumpAlg::initialize
() {
12
ATH_CHECK
(
m_tree
.init(
this
));
13
ATH_CHECK
(
m_ctxProvider
.initialize());
14
ATH_CHECK
(
m_trackingGeometrySvc
.retrieve());
15
for
(
const
auto
type
:
m_detTypes
){
16
try
{
17
m_selTypes
.insert(
static_cast<
DetectorType
>
(
type
));
18
}
catch
(...) {
19
ATH_MSG_ERROR
(
"Cannot translate "
<<
m_detTypes
);
20
return
StatusCode::FAILURE;
21
}
22
}
23
24
return
StatusCode::SUCCESS;
25
}
26
StatusCode
ReadoutGeoDumpAlg::finalize
() {
27
ATH_CHECK
(
m_tree
.write());
28
return
StatusCode::SUCCESS;
29
}
30
StatusCode
ReadoutGeoDumpAlg::execute
(
const
EventContext& ctx) {
31
if
(
m_executed
) {
32
return
StatusCode::SUCCESS;
33
}
34
35
const
Acts::GeometryContext tgContext{
m_ctxProvider
.getGeometryContext(ctx)};
36
37
const
auto
trackingGeo =
m_trackingGeometrySvc
->trackingGeometry();
38
39
trackingGeo->visitSurfaces([&](
const
Acts::Surface* surface){
40
// We only want alignable surfaces
41
if
(!surface->isAlignable() || !surface->isSensitive()) {
42
return
;
43
}
44
const
auto
* detEl =
dynamic_cast<
const
ISurfacePlacement
*
>
(surface->surfacePlacement());
45
// Somehow it's not a known detector element
46
if
(!detEl) {
47
return
;
48
}
49
// The detector element is from another system
50
if
(!
m_selTypes
.empty() && !
m_selTypes
.count(detEl->detectorType())){
51
return
;
52
}
53
//
54
m_readoutTransform
= surface->localToGlobalTransform(tgContext);
55
m_identifier
= detEl->identify().get_compact();
56
m_detType
= Acts::toUnderlying(detEl->detectorType());
57
const
auto
& bounds = surface->bounds();
58
m_boundsType
= Acts::toUnderlying(bounds.type());
59
m_thickness
= surface->thickness();
60
for
(
const
double
val : bounds.values()){
61
m_boundValues
.push_back(val);
62
}
63
if
(!
m_tree
.fill(ctx)) {
64
THROW_EXCEPTION
(
"Failed to fill the tree"
);
65
}
66
},
false
);
67
m_executed
=
false
;
68
return
StatusCode::SUCCESS;
69
}
70
71
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ISurfacePlacement.h
ReadoutGeoDumpAlg.h
ActsTrk::ISurfacePlacement
Extension of the interface of the Acts::SurfacePlacementBase for ATLAS.
Definition
ISurfacePlacement.h:19
ActsTrk::ReadoutGeoDumpAlg::m_boundsType
MuonVal::ScalarBranch< std::uint8_t > & m_boundsType
What is the type of the associated Acts Bounds.
Definition
ReadoutGeoDumpAlg.h:40
ActsTrk::ReadoutGeoDumpAlg::m_identifier
MuonVal::ScalarBranch< Identifier::value_type > & m_identifier
the Ahtena identifier of the readout element
Definition
ReadoutGeoDumpAlg.h:36
ActsTrk::ReadoutGeoDumpAlg::m_thickness
MuonVal::ScalarBranch< double > & m_thickness
Thickness of the readout surface.
Definition
ReadoutGeoDumpAlg.h:44
ActsTrk::ReadoutGeoDumpAlg::m_executed
bool m_executed
Flag whether the algorithm is executed.
Definition
ReadoutGeoDumpAlg.h:61
ActsTrk::ReadoutGeoDumpAlg::execute
StatusCode execute(const EventContext &ctx) override
Execute method.
Definition
ReadoutGeoDumpAlg.cxx:30
ActsTrk::ReadoutGeoDumpAlg::m_trackingGeometrySvc
ServiceHandle< ActsTrk::ITrackingGeometrySvc > m_trackingGeometrySvc
Tool handle to the tracking geometry.
Definition
ReadoutGeoDumpAlg.h:49
ActsTrk::ReadoutGeoDumpAlg::m_tree
MuonVal::MuonTesterTree m_tree
Write a TTree for validation purposes.
Definition
ReadoutGeoDumpAlg.h:33
ActsTrk::ReadoutGeoDumpAlg::m_readoutTransform
MuonVal::CoordTransformBranch m_readoutTransform
Final transform of the readout element.
Definition
ReadoutGeoDumpAlg.h:46
ActsTrk::ReadoutGeoDumpAlg::finalize
StatusCode finalize() override
Definition
ReadoutGeoDumpAlg.cxx:26
ActsTrk::ReadoutGeoDumpAlg::m_detType
MuonVal::ScalarBranch< std::uint8_t > & m_detType
The DetectorType of the readout element.
Definition
ReadoutGeoDumpAlg.h:38
ActsTrk::ReadoutGeoDumpAlg::initialize
StatusCode initialize() override
Definition
ReadoutGeoDumpAlg.cxx:11
ActsTrk::ReadoutGeoDumpAlg::m_selTypes
std::unordered_set< DetectorType > m_selTypes
Definition
ReadoutGeoDumpAlg.h:58
ActsTrk::ReadoutGeoDumpAlg::m_boundValues
MuonVal::VectorBranch< double > & m_boundValues
The defining parameter of the surface bounds.
Definition
ReadoutGeoDumpAlg.h:42
ActsTrk::ReadoutGeoDumpAlg::m_ctxProvider
ActsTrk::ContextUtility m_ctxProvider
Context provider for geometry, magnetic field and calibration contexts.
Definition
ReadoutGeoDumpAlg.h:51
ActsTrk::ReadoutGeoDumpAlg::m_detTypes
Gaudi::Property< std::set< unsigned short > > m_detTypes
Configure which detector types shall be dumped.
Definition
ReadoutGeoDumpAlg.h:54
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition
MdtCalibInput.h:31
ActsTrk::DetectorType
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
Definition
GeometryDefs.h:25
type
THROW_EXCEPTION
#define THROW_EXCEPTION(MESSAGE)
Definition
throwExcept.h:10
Generated on
for ATLAS Offline Software by
1.17.0