ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::DetachedTrackingVolume Class Referencefinal

Base Class for a navigation object (active/passive) in the Tracking realm. More...

#include <DetachedTrackingVolume.h>

Collaboration diagram for Trk::DetachedTrackingVolume:

Public Member Functions

 DetachedTrackingVolume ()
 Default Constructor.
 DetachedTrackingVolume (std::string name, std::unique_ptr< TrackingVolume > vol)
 Constructor with name.
 DetachedTrackingVolume (std::string name, std::unique_ptr< TrackingVolume > vol, std::unique_ptr< Layer > layer, std::unique_ptr< const std::vector< Layer * > > multilayer=nullptr)
 Constructor with name & layer representation.
 ~DetachedTrackingVolume ()
 Destructor.
const TrackingVolumetrackingVolume () const
 returns the TrackingVolume
TrackingVolumetrackingVolume ()
const std::string & name () const
 returns the Name
void move (Amg::Transform3D &shift)
 moving object around
DetachedTrackingVolumeclone (const std::string &name, Amg::Transform3D &shift) const
 clone with transform
const LayerlayerRepresentation () const
 returns layer representation
LayerlayerRepresentation ()
std::span< Layer const *const > multilayerRepresentation () const
 returns (multi)layer representation
std::span< Layer *const > multilayerRepresentation ()
void sign (GeometrySignature signat, GeometryType geotype)
 sign the volume - the geometry builder has to do that
GeometrySignature geometrySignature () const
 return the Signature
GeometryType geometryType () const
 return the Type
void setBaseTransform (std::unique_ptr< Amg::Transform3D > transf=nullptr)
 alignment methods: set base transform / default argument to current transform

Private Member Functions

void compactify (size_t &cSurfaces, size_t &tSurfaces)
 Compactify – set TG as owner to surfaces.

Private Attributes

std::unique_ptr< TrackingVolumem_trkVolume = nullptr
std::unique_ptr< Layerm_layerRepresentation = nullptr
std::unique_ptr< const std::vector< Layer * > > m_multilayerRepresentation = nullptr
const std::string m_name {"undefined"}
std::unique_ptr< Amg::Transform3Dm_baseTransform = nullptr

Friends

class TrackingVolume
 Declare the IDetachedTrackingVolumeBuilder as a friend, to be able to change the volumelink.
class DetachedTrackingVolumeBuilder
class IDetachedTrackingVolumeBuilder

Detailed Description

Base Class for a navigation object (active/passive) in the Tracking realm.

Author
Sarka.nosp@m..Tod.nosp@m.orova.nosp@m.@cer.nosp@m.n.ch

Definition at line 37 of file DetachedTrackingVolume.h.

Constructor & Destructor Documentation

◆ DetachedTrackingVolume() [1/3]

Trk::DetachedTrackingVolume::DetachedTrackingVolume ( )

Default Constructor.

◆ DetachedTrackingVolume() [2/3]

Trk::DetachedTrackingVolume::DetachedTrackingVolume ( std::string name,
std::unique_ptr< TrackingVolume > vol )

Constructor with name.

Definition at line 17 of file DetachedTrackingVolume.cxx.

19 : m_trkVolume(std::move(volume))
20 , m_name(std::move(name))
21{}
const std::string & name() const
returns the Name
std::unique_ptr< TrackingVolume > m_trkVolume

◆ DetachedTrackingVolume() [3/3]

Trk::DetachedTrackingVolume::DetachedTrackingVolume ( std::string name,
std::unique_ptr< TrackingVolume > vol,
std::unique_ptr< Layer > layer,
std::unique_ptr< const std::vector< Layer * > > multilayer = nullptr )

Constructor with name & layer representation.

Definition at line 23 of file DetachedTrackingVolume.cxx.

28 : m_trkVolume(std::move(volume))
29 , m_layerRepresentation(std::move(lay))
30 , m_multilayerRepresentation(std::move(multilay))
31 , m_name(std::move(name))
32 , m_baseTransform(nullptr)
33{}
std::unique_ptr< Layer > m_layerRepresentation
std::unique_ptr< Amg::Transform3D > m_baseTransform
std::unique_ptr< const std::vector< Layer * > > m_multilayerRepresentation

◆ ~DetachedTrackingVolume()

Trk::DetachedTrackingVolume::~DetachedTrackingVolume ( )

Destructor.

Definition at line 35 of file DetachedTrackingVolume.cxx.

35 {
36 //These we have to delete manually
38 for (auto *layer : *m_multilayerRepresentation)
39 delete layer;
40 }
41}
@ layer
Definition HitInfo.h:79

Member Function Documentation

◆ clone()

Trk::DetachedTrackingVolume * Trk::DetachedTrackingVolume::clone ( const std::string & name,
Amg::Transform3D & shift ) const

clone with transform

Definition at line 58 of file DetachedTrackingVolume.cxx.

60{
61 auto newTV = std::make_unique<TrackingVolume>(*(this->trackingVolume()), shift);
62 TrackingVolumeArray* confinedVolumes = newTV->confinedVolumes();
63 LayerArray* confinedLayers= newTV->confinedLayers();
64 Trk::ArraySpan<Trk::Layer* const> confinedArbitraryLayers = newTV->confinedArbitraryLayers();
65 //
66 Trk::DetachedTrackingVolume* newStat = nullptr;
67 // layer representation ?
68 std::unique_ptr<Trk::PlaneLayer> newLay = nullptr;
69 if (this->layerRepresentation()) {
70 std::unique_ptr<std::vector<Trk::Layer*>> newMulti = nullptr;
71 const Trk::PlaneLayer* pl = dynamic_cast<const Trk::PlaneLayer*>(this->layerRepresentation());
72 if (pl) {
73 newLay = std::make_unique<Trk::PlaneLayer>(*pl);
74 newLay->moveLayer(shift);
75 if (!this->multilayerRepresentation().empty()) {
76 newMulti = std::make_unique<std::vector<Trk::Layer*>>();
77 for (unsigned int i = 0; i < this->multilayerRepresentation().size(); i++) {
78 const Trk::PlaneLayer* mpl = dynamic_cast<const Trk::PlaneLayer*>((this->multilayerRepresentation())[i]);
79 if (mpl) {
80 Trk::PlaneLayer* newPl = new Trk::PlaneLayer(*mpl);
81 newPl->moveLayer(shift);
82 newMulti->push_back(newPl);
83 } else
84 std::cout << "WARNING Trk::DetachedTrackingVolume::clone() "
85 "dynamic cast to 'const Trk::PlaneLayer* mpl' failed!"
86 << std::endl;
87 }
88 }
89 newStat = new Trk::DetachedTrackingVolume(name, std::move(newTV), std::move(newLay), std::move(newMulti));
90 } else {
91 std::cout << "WARNING Trk::DetachedTrackingVolume::clone() dynamic "
92 "cast to 'const Trk::PlaneLayer* pl' failed!"
93 << std::endl;
94 newStat = new Trk::DetachedTrackingVolume(name, std::move(newTV));
95 }
96 } else {
97 newStat = new Trk::DetachedTrackingVolume(name, std::move(newTV));
98 }
99 //
100 // enclose layers
101 if (confinedVolumes) {
102 std::span<Trk::TrackingVolume * const> vols = confinedVolumes->arrayObjects();
103 for (auto *vol : vols) {
104 Trk::LayerArray* layAr = vol->confinedLayers();
105 Trk::ArraySpan<Trk::Layer* const> alays = vol->confinedArbitraryLayers();
106 if (layAr) {
107 std::span<Trk::Layer* const> lays = layAr->arrayObjects();
108 for (auto *lay : lays) {
109 lay->encloseDetachedTrackingVolume(*newStat);
110 }
111 }
112 if (!alays.empty()) {
113 for (auto *alay : alays) {
114 alay->encloseDetachedTrackingVolume(*newStat);
115 }
116 }
117 }
118 }
119 if (confinedLayers) {
120 std::span<Trk::Layer* const> lays = confinedLayers->arrayObjects();
121 for (auto *lay : lays){
122 lay->encloseDetachedTrackingVolume(*newStat);
123 }
124 }
125 if (!confinedArbitraryLayers.empty()) {
126 for (auto *alay : confinedArbitraryLayers) {
127 alay->encloseDetachedTrackingVolume(*newStat);
128 }
129 }
130 return newStat;
131}
static const Attributes_t empty
virtual std::span< T *const > arrayObjects()=0
Return all objects of the Array non-const we can still modify the T.
const Layer * layerRepresentation() const
returns layer representation
const TrackingVolume * trackingVolume() const
returns the TrackingVolume
std::span< Layer const *const > multilayerRepresentation() const
returns (multi)layer representation
virtual void moveLayer(Amg::Transform3D &shift) override final
move the Layer
BinnedArray< Layer > LayerArray
simply for the eye
std::span< T > ArraySpan
BinnedArray< TrackingVolume > TrackingVolumeArray
simply for the eye

◆ compactify()

void Trk::DetachedTrackingVolume::compactify ( size_t & cSurfaces,
size_t & tSurfaces )
private

Compactify – set TG as owner to surfaces.

Definition at line 134 of file DetachedTrackingVolume.cxx.

135{
136 // deal with the Tracking Volume representation
137 if (m_trkVolume){
138 m_trkVolume->compactify(cSurfaces, tSurfaces);
139 }
140
141 // deal with the layer representation
142 if (layerRepresentation()) {
143 ++tSurfaces;
144 if (layerRepresentation()->surfaceRepresentation().owner() == Trk::noOwn) {
146 ++cSurfaces;
147 }
148 }
149 // deal with the multi-layer representation
151 tSurfaces += m_multilayerRepresentation->size();
152 for (const auto& mLayerIter : (*m_multilayerRepresentation)) {
153 if ((*mLayerIter).surfaceRepresentation().owner() == Trk::noOwn) {
154 (*mLayerIter).surfaceRepresentation().setOwner(Trk::TGOwn);
155 ++cSurfaces;
156 }
157 }
158 }
159}
virtual const Surface & surfaceRepresentation() const =0
Transforms the layer into a Surface representation for extrapolation.
void setOwner(SurfaceOwner x)
set Ownership

◆ geometrySignature()

Trk::GeometrySignature Trk::DetachedTrackingVolume::geometrySignature ( ) const

return the Signature

Definition at line 168 of file DetachedTrackingVolume.cxx.

168 {
169 return m_trkVolume->geometrySignature();
170}

◆ geometryType()

Trk::GeometryType Trk::DetachedTrackingVolume::geometryType ( ) const

return the Type

Definition at line 172 of file DetachedTrackingVolume.cxx.

172 {
173 return m_trkVolume->geometryType();
174}

◆ layerRepresentation() [1/2]

Layer * Trk::DetachedTrackingVolume::layerRepresentation ( )
inline

Definition at line 121 of file DetachedTrackingVolume.h.

121 {
122 return m_layerRepresentation.get();
123}

◆ layerRepresentation() [2/2]

const Layer * Trk::DetachedTrackingVolume::layerRepresentation ( ) const
inline

returns layer representation

Definition at line 117 of file DetachedTrackingVolume.h.

117 {
118 return m_layerRepresentation.get();
119}

◆ move()

void Trk::DetachedTrackingVolume::move ( Amg::Transform3D & shift)

moving object around

Definition at line 44 of file DetachedTrackingVolume.cxx.

45{
46 m_trkVolume->moveTV(shift);
48 m_layerRepresentation->moveLayer(shift);
49 }
51 for (auto* layer : *m_multilayerRepresentation) {
52 layer->moveLayer(shift);
53 }
54 }
55}

◆ multilayerRepresentation() [1/2]

std::span< Layer *const > Trk::DetachedTrackingVolume::multilayerRepresentation ( )
inline

Definition at line 137 of file DetachedTrackingVolume.h.

138{
140 return std::span<Layer* const>(m_multilayerRepresentation->begin(),
142 }
143 return {};
144}

◆ multilayerRepresentation() [2/2]

std::span< Layer const *const > Trk::DetachedTrackingVolume::multilayerRepresentation ( ) const
inline

returns (multi)layer representation

Definition at line 127 of file DetachedTrackingVolume.h.

128{
130 return std::span<Layer const* const>(m_multilayerRepresentation->begin(),
132 }
133 return {};
134}

◆ name()

const std::string & Trk::DetachedTrackingVolume::name ( ) const
inline

returns the Name

Definition at line 115 of file DetachedTrackingVolume.h.

115{ return (m_name); }

◆ setBaseTransform()

void Trk::DetachedTrackingVolume::setBaseTransform ( std::unique_ptr< Amg::Transform3D > transf = nullptr)

alignment methods: set base transform / default argument to current transform

Definition at line 176 of file DetachedTrackingVolume.cxx.

176 {
177 if (transf){
178 m_baseTransform = std::move(transf);
179 }
180 else {
181 m_baseTransform = std::make_unique<Amg::Transform3D>(this->trackingVolume()->transform());
182 }
183}
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.

◆ sign()

void Trk::DetachedTrackingVolume::sign ( GeometrySignature signat,
GeometryType geotype )

sign the volume - the geometry builder has to do that

Definition at line 162 of file DetachedTrackingVolume.cxx.

164{
165 m_trkVolume->sign(signat, geotype);
166}

◆ trackingVolume() [1/2]

TrackingVolume * Trk::DetachedTrackingVolume::trackingVolume ( )
inline

Definition at line 111 of file DetachedTrackingVolume.h.

111 {
112 return m_trkVolume.get();
113}

◆ trackingVolume() [2/2]

const TrackingVolume * Trk::DetachedTrackingVolume::trackingVolume ( ) const
inline

returns the TrackingVolume

Definition at line 107 of file DetachedTrackingVolume.h.

107 {
108 return m_trkVolume.get();
109}

◆ DetachedTrackingVolumeBuilder

friend class DetachedTrackingVolumeBuilder
friend

Definition at line 41 of file DetachedTrackingVolume.h.

◆ IDetachedTrackingVolumeBuilder

friend class IDetachedTrackingVolumeBuilder
friend

Definition at line 42 of file DetachedTrackingVolume.h.

◆ TrackingVolume

friend class TrackingVolume
friend

Declare the IDetachedTrackingVolumeBuilder as a friend, to be able to change the volumelink.

Definition at line 40 of file DetachedTrackingVolume.h.

Member Data Documentation

◆ m_baseTransform

std::unique_ptr<Amg::Transform3D> Trk::DetachedTrackingVolume::m_baseTransform = nullptr
private

Definition at line 104 of file DetachedTrackingVolume.h.

◆ m_layerRepresentation

std::unique_ptr<Layer> Trk::DetachedTrackingVolume::m_layerRepresentation = nullptr
private

Definition at line 99 of file DetachedTrackingVolume.h.

◆ m_multilayerRepresentation

std::unique_ptr<const std::vector<Layer*> > Trk::DetachedTrackingVolume::m_multilayerRepresentation = nullptr
private

Definition at line 101 of file DetachedTrackingVolume.h.

◆ m_name

const std::string Trk::DetachedTrackingVolume::m_name {"undefined"}
private

Definition at line 102 of file DetachedTrackingVolume.h.

102{"undefined"};

◆ m_trkVolume

std::unique_ptr<TrackingVolume> Trk::DetachedTrackingVolume::m_trkVolume = nullptr
private

Definition at line 98 of file DetachedTrackingVolume.h.


The documentation for this class was generated from the following files: