ATLAS Offline Software
Loading...
Searching...
No Matches
BoundarySurface.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
6// BoundarySurface.h, (c) ATLAS Detector software
8
9#ifndef TRKVOLUMES_BOUNDARYSURFACE_H
10#define TRKVOLUMES_BOUNDARYSURFACE_H
11
12// Trk
14#include <memory>
17#include "TrkVolumes/Volume.h"
18// Gaudi
20#include "GaudiKernel/MsgStream.h"
22
23namespace Trk {
24
25// class TrackParameters;
26class Surface;
27
40
41
42template <class Tvol>
46 public:
48 BoundarySurface() = default;
49
56
58 BoundarySurface(std::shared_ptr<const VolumeArray> insideArray,
59 std::shared_ptr<const VolumeArray> outsideArray)
62 m_insideVolumeArray(std::move(insideArray)),
63 m_outsideVolumeArray(std::move(outsideArray)) {}
64
67 virtual const Tvol* attachedVolume(const TrackParameters& parms,
68 PropDirection dir) const = 0;
69
73 virtual const Tvol* attachedVolume(const Amg::Vector3D& pos,
74 const Amg::Vector3D& mom,
75 PropDirection dir) const = 0;
76
78 template <class T>
79 bool onBoundary(const T& pars) const {
80 return surfaceRepresentation().onSurface(pars);
81 }
82
84 virtual const Surface& surfaceRepresentation() const = 0;
86
88 virtual ~BoundarySurface() {}
89
91 void debugInfo(MsgStream& msg) const;
92
94 Tvol const* insideVolume() const{
95 return m_insideVolume;
96 }
97 void setInsideVolume(const Tvol* vol){
98 m_insideVolume = vol;
99 }
100
101 Tvol const* outsideVolume() const{
102 return m_outsideVolume;
103 }
104 void setOutsideVolume(const Tvol* vol){
105 m_outsideVolume = vol;
106 }
107
110 return m_insideVolumeArray.get();
111 }
112 void setInsideVolumeArray(std::shared_ptr<const VolumeArray> volArray){
113 m_insideVolumeArray = std::move(volArray);
114 }
116 return m_outsideVolumeArray.get();
117 }
118 void setOutsideVolumeArray(std::shared_ptr<const VolumeArray> volArray){
119 m_outsideVolumeArray = std::move(volArray);
120 }
121
122 protected:
123 //Not owning ptr to the volumes
124 const Tvol* m_insideVolume{};
125 const Tvol* m_outsideVolume{};
126 //The volume arrays can be shared when we glue volumes
127 std::shared_ptr<const VolumeArray> m_insideVolumeArray{};
128 std::shared_ptr<const VolumeArray> m_outsideVolumeArray{};
129};
130
131
132template <class Tvol>
133inline void BoundarySurface<Tvol>::debugInfo(MsgStream& msg) const {
134 msg << "BoundarySurface debug information: " << std::endl;
135 msg << " -> pointer to insideVolume = " << m_insideVolume
136 << std::endl;
137 msg << " -> pointer to insideVolumeArray = "
138 << m_insideVolumeArray.get() << std::endl;
139 msg << " -> pointer to outsideVolume = " << m_outsideVolume
140 << std::endl;
141 msg << " -> pointer to outsideVolumeArray = "
142 << m_outsideVolumeArray.get() << endmsg;
143}
144
145} // end of namespace Trk
146
147#endif // TRKVOLUMES_BOUNDARYSURFACE_H
148
#define endmsg
Define macros for attributes used to control the static checker.
Binned Array for avoiding map searches/.
Definition BinnedArray.h:36
virtual Surface & surfaceRepresentation()=0
virtual ~BoundarySurface()
Virtual Destructor.
Tvol const * outsideVolume() const
BinnedArray< Tvol > VolumeArray
typedef the BinnedArray
BoundarySurface()=default
Default Constructor - needed for pool and inherited classes.
const Tvol * m_insideVolume
std::shared_ptr< const VolumeArray > m_insideVolumeArray
const Tvol * m_outsideVolume
void setInsideVolume(const Tvol *vol)
void debugInfo(MsgStream &msg) const
output debug information
const VolumeArray * insideVolumeArray() const
getters/setters for inside/outside Volume arrays
bool onBoundary(const T &pars) const
templated onBoundary method
virtual const Tvol * attachedVolume(const Amg::Vector3D &pos, const Amg::Vector3D &mom, PropDirection dir) const =0
Get the next Volume depending on GlobalPosition, GlobalMomentum, dir on the TrackParameters and the r...
const VolumeArray * outsideVolumeArray() const
BoundarySurface(std::shared_ptr< const VolumeArray > insideArray, std::shared_ptr< const VolumeArray > outsideArray)
Constructor for a Boundary with exact two Volumes attached to it.
void setInsideVolumeArray(std::shared_ptr< const VolumeArray > volArray)
void setOutsideVolumeArray(std::shared_ptr< const VolumeArray > volArray)
BoundarySurface(const Tvol *inside, const Tvol *outside)
Constructor for a Boundary with exact two Volumes attached to it.
std::shared_ptr< const VolumeArray > m_outsideVolumeArray
virtual const Tvol * attachedVolume(const TrackParameters &parms, PropDirection dir) const =0
Get the next Volume depending on the TrackParameters and the requested direction.
void setOutsideVolume(const Tvol *vol)
virtual const Surface & surfaceRepresentation() const =0
The Surface Representation of this.
Tvol const * insideVolume() const
getters/setters for inside/outside Volume
Abstract Base Class for tracking surfaces.
bool onSurface(const T &parameters, const BoundaryCheck &bchk=BoundaryCheck(true)) const
The templated Parameters OnSurface method - checks on surface pointer first.
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the ATLAS eigen extensions are properly loaded.
PropDirection
PropDirection, enum for direction of the propagation.
ParametersBase< TrackParametersDim, Charged > TrackParameters
@ outside
STL namespace.
MsgStream & msg
Definition testRead.cxx:32