ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonPhaseII
MuonDetDescr
MuonReadoutGeometryR4
src
CylinderBoundsExpander.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 "
MuonReadoutGeometryR4/CylinderBoundsExpander.h
"
5
6
#ifndef SIMULATIONBASE
7
8
#include "
ActsGeometryInterfaces/GeometryContext.h
"
9
#include "Acts/Geometry/CylinderVolumeBounds.hpp"
10
namespace
MuonGMR4
{
11
CylinderBoundsExpander::CylinderBoundsExpander
(std::unique_ptr<const Acts::Logger> loggerObj):
12
BoundsExpander
{
Acts
::Transform3::Identity(),
std
::move(loggerObj)} {}
13
void
CylinderBoundsExpander::setMargin
(
const
double
extraR,
const
double
extraZ) {
14
m_extraR
= extraR;
15
m_extraZ
= extraZ;
16
}
17
void
CylinderBoundsExpander::expand
(
const
Acts::GeometryContext& tgContext,
18
const
Acts::Volume& volume) {
19
20
for
(
const
Amg::Vector3D
& vertex:
cornerPoints
(tgContext, volume)) {
21
const
double
r
= vertex.perp();
22
m_rMax
= std::max(
m_rMax
,
r
);
23
m_rMin
= std::min(
m_rMin
,
r
);
24
m_zMax
= std::max(
m_zMax
, vertex.z());
25
m_zMin
= std::min(
m_zMin
, vertex.z());
26
}
27
ACTS_VERBOSE(__func__<<
"() "
<<__LINE__<<
" New boundaries are: ["
<<
m_rMin
<<
";"
<<
m_rMax
<<
"]"
28
<<
", z: ["
<<
m_zMax
<<
";"
<<
m_zMin
<<
"]"
);
29
}
30
std::shared_ptr<Acts::VolumeBounds>
31
CylinderBoundsExpander::makeBounds
(Acts::VolumeBoundFactory& factory) {
32
reCenter
(std::array{
Amg::Vector3D
{0.,0.,
m_zMax
},
33
Amg::Vector3D
{0.,0.,
m_zMin
}});
34
auto
bounds = factory.makeBounds<Acts::CylinderVolumeBounds>(std::max(
m_rMin
-
m_extraR
, 0.),
35
m_rMax
+
m_extraR
,
36
0.5*(
m_zMax
-
m_zMin
) +
m_extraZ
);
37
ACTS_DEBUG(__func__<<
"() "
<<__LINE__<<
" - created new bounds "
<<(bounds));
38
return
bounds;
39
}
40
double
CylinderBoundsExpander::rMin
()
const
{
return
m_rMin
; }
41
double
&
CylinderBoundsExpander::rMin
() {
return
m_rMin
; }
42
double
CylinderBoundsExpander::rMax
()
const
{
return
m_rMax
; }
43
double
&
CylinderBoundsExpander::rMax
() {
return
m_rMax
; }
44
double
CylinderBoundsExpander::zMin
()
const
{
return
m_zMin
; }
45
double
&
CylinderBoundsExpander::zMin
() {
return
m_zMin
; }
46
double
CylinderBoundsExpander::zMax
()
const
{
return
m_zMax
; }
47
double
&
CylinderBoundsExpander::zMax
() {
return
m_zMax
; }
48
}
49
#endif
CylinderBoundsExpander.h
GeometryContext.h
MuonGMR4::BoundsExpander::cornerPoints
static std::vector< Amg::Vector3D > cornerPoints(const Acts::GeometryContext &tgContext, const Acts::Volume &volume, const std::size_t nSegments=3)
Returns the vertices from a volume.
Definition
BoundsExpander.cxx:114
MuonGMR4::BoundsExpander::BoundsExpander
BoundsExpander()=default
Default constructor.
MuonGMR4::BoundsExpander::reCenter
void reCenter(std::span< const Amg::Vector3D > vertices)
Update the center point from a list of global vertices.
Definition
BoundsExpander.cxx:91
MuonGMR4::CylinderBoundsExpander::setMargin
void setMargin(const double extraR, const double extraZ)
Assign an extra margin to the constructed bounds.
Definition
CylinderBoundsExpander.cxx:13
MuonGMR4::CylinderBoundsExpander::zMin
double zMin() const
Minimum seen longitudinal displacement.
Definition
CylinderBoundsExpander.cxx:44
MuonGMR4::CylinderBoundsExpander::m_extraZ
double m_extraZ
Extra margin to be applied in z.
Definition
CylinderBoundsExpander.h:59
MuonGMR4::CylinderBoundsExpander::makeBounds
virtual std::shared_ptr< Acts::VolumeBounds > makeBounds(Acts::VolumeBoundFactory &factory) override final
Crate volume bounds that enclose the readout element from the central localToGlobalTransform.
Definition
CylinderBoundsExpander.cxx:31
MuonGMR4::CylinderBoundsExpander::m_extraR
double m_extraR
Extra margin to be applied in R.
Definition
CylinderBoundsExpander.h:57
MuonGMR4::CylinderBoundsExpander::CylinderBoundsExpander
CylinderBoundsExpander(std::unique_ptr< const Acts::Logger > loggerObj=nullptr)
Constructor with an optional logger instance.
Definition
CylinderBoundsExpander.cxx:11
MuonGMR4::CylinderBoundsExpander::expand
virtual void expand(const Acts::GeometryContext &tgContext, const Acts::Volume &volume) override
Expand the bounds from a chamber.
Definition
CylinderBoundsExpander.cxx:17
MuonGMR4::CylinderBoundsExpander::zMax
double zMax() const
Maximum seen longitudinal displacement.
Definition
CylinderBoundsExpander.cxx:46
MuonGMR4::CylinderBoundsExpander::m_rMin
double m_rMin
Minimum r of any shown vertex.
Definition
CylinderBoundsExpander.h:49
MuonGMR4::CylinderBoundsExpander::m_zMin
double m_zMin
Minimum z of any shown vertex.
Definition
CylinderBoundsExpander.h:53
MuonGMR4::CylinderBoundsExpander::rMax
double rMax() const
Maximum seen radius.
Definition
CylinderBoundsExpander.cxx:42
MuonGMR4::CylinderBoundsExpander::rMin
double rMin() const
Minimum seen radius.
Definition
CylinderBoundsExpander.cxx:40
MuonGMR4::CylinderBoundsExpander::m_rMax
double m_rMax
Maximum r of any shown vertex.
Definition
CylinderBoundsExpander.h:51
MuonGMR4::CylinderBoundsExpander::m_zMax
double m_zMax
Maximum z of any shown vertex.
Definition
CylinderBoundsExpander.h:55
r
int r
Definition
globals.cxx:22
Acts
This class is not to needed in AthSimulation.
Definition
MuonSpectrometer/MuonPhaseII/Event/xAOD/xAODMuonPrepData/xAODMuonPrepData/UtilFunctions.h:23
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition
GeoPrimitives.h:48
MuonGMR4
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
Definition
MdtCalibInput.h:19
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0