ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Trk::DetachedTrackingVolume Class Reference

#include <DetachedTrackingVolume.h>

Collaboration diagram for Trk::DetachedTrackingVolume:

Public Member Functions

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

Private Member Functions

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

Private Attributes

TrackingVolumem_trkVolume
 
const std::string m_name
 
Layerm_layerRepresentation
 
const std::vector< Layer * > * m_multilayerRepresentation
 
Amg::Transform3Dm_baseTransform
 
const std::vector< std::pair< std::unique_ptr< const Trk::Volume >, float > > * m_constituents
 

Friends

class TrackingVolume
 Declare the IDetachedTrackingVolumeBuilder as a friend, to be able to change the volumelink. More...
 
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 46 of file DetachedTrackingVolume.h.

Constructor & Destructor Documentation

◆ DetachedTrackingVolume() [1/3]

Trk::DetachedTrackingVolume::DetachedTrackingVolume ( )

Default Constructor.

Definition at line 17 of file DetachedTrackingVolume.cxx.

18  : m_trkVolume()
19  , m_name("undefined")
20  , m_layerRepresentation(nullptr)
22  , m_baseTransform(nullptr)
23  , m_constituents(nullptr)
24 {}

◆ DetachedTrackingVolume() [2/3]

Trk::DetachedTrackingVolume::DetachedTrackingVolume ( std::string  name,
Trk::TrackingVolume volume 
)

Constructor with name.

Definition at line 26 of file DetachedTrackingVolume.cxx.

28  : m_trkVolume(volume)
29  , m_name(std::move(name))
30  , m_layerRepresentation(nullptr)
32  , m_baseTransform(nullptr)
33  , m_constituents(nullptr)
34 {}

◆ DetachedTrackingVolume() [3/3]

Trk::DetachedTrackingVolume::DetachedTrackingVolume ( std::string  name,
Trk::TrackingVolume volume,
Trk::Layer lay,
const std::vector< Layer * > *  multilayer = nullptr 
)

Constructor with name & layer representation.

Definition at line 36 of file DetachedTrackingVolume.cxx.

41  : m_trkVolume(volume)
42  , m_name(std::move(name))
44  , m_multilayerRepresentation(multilay)
45  , m_baseTransform(nullptr)
46  , m_constituents(nullptr)
47 {}

◆ ~DetachedTrackingVolume()

Trk::DetachedTrackingVolume::~DetachedTrackingVolume ( )

Destructor.

Definition at line 49 of file DetachedTrackingVolume.cxx.

49  {
50  delete m_trkVolume;
53  for (auto *layer : *m_multilayerRepresentation)
54  delete layer;
56  }
57  delete m_baseTransform;
58 }

Member Function Documentation

◆ clone()

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

clone with transform

Definition at line 75 of file DetachedTrackingVolume.cxx.

77 {
78  Trk::TrackingVolume* newTV =
79  new TrackingVolume(*(this->trackingVolume()), shift);
80  Trk::DetachedTrackingVolume* newStat = nullptr;
81  // layer representation ?
82  Trk::PlaneLayer* newLay = nullptr;
83  if (this->layerRepresentation()) {
84  std::vector<Trk::Layer*>* newMulti = nullptr;
85  const Trk::PlaneLayer* pl =
86  dynamic_cast<const Trk::PlaneLayer*>(this->layerRepresentation());
87  if (pl) {
88  newLay = new Trk::PlaneLayer(*pl);
89  newLay->moveLayer(shift);
90  if (!this->multilayerRepresentation().empty()) {
91  newMulti = new std::vector<Trk::Layer*>;
92  for (unsigned int i = 0; i < this->multilayerRepresentation().size();
93  i++) {
94  const Trk::PlaneLayer* mpl = dynamic_cast<const Trk::PlaneLayer*>(
95  (this->multilayerRepresentation())[i]);
96  if (mpl) {
97  Trk::PlaneLayer* newPl = new Trk::PlaneLayer(*mpl);
98  newPl->moveLayer(shift);
99  newMulti->push_back(newPl);
100  } else
101  std::cout << "WARNING Trk::DetachedTrackingVolume::clone() "
102  "dynamic cast to 'const Trk::PlaneLayer* mpl' failed!"
103  << std::endl;
104  }
105  }
106  newStat = new Trk::DetachedTrackingVolume(name, newTV, newLay, newMulti);
107  } else {
108  std::cout << "WARNING Trk::DetachedTrackingVolume::clone() dynamic "
109  "cast to 'const Trk::PlaneLayer* pl' failed!"
110  << std::endl;
111  newStat = new Trk::DetachedTrackingVolume(name, newTV);
112  }
113  } else {
114  newStat = new Trk::DetachedTrackingVolume(name, newTV);
115  }
116  //
117  // enclose layers
118  if (newTV->confinedVolumes()) {
119  BinnedArraySpan<Trk::TrackingVolume * const> vols =
120  newTV->confinedVolumes()->arrayObjects();
121  for (auto *vol : vols) {
122  Trk::LayerArray* layAr = vol->confinedLayers();
124  vol->confinedArbitraryLayers();
125  if (layAr) {
127  for (auto *lay : lays) {
128  lay->encloseDetachedTrackingVolume(*newStat);
129  }
130  }
131  if (!alays.empty()) {
132  for (auto *alay : alays) {
133  alay->encloseDetachedTrackingVolume(*newStat);
134  }
135  }
136  }
137  }
138  if (newTV->confinedLayers()) {
139  BinnedArraySpan<Trk::Layer* const> lays =
140  newTV->confinedLayers()->arrayObjects();
141  for (auto *lay : lays){
142  lay->encloseDetachedTrackingVolume(*newStat);
143  }
144  }
145  if (!newTV->confinedArbitraryLayers().empty()) {
147  newTV->confinedArbitraryLayers();
148  for (auto *alay : alays) {
149  alay->encloseDetachedTrackingVolume(*newStat);
150  }
151  }
152  //
153  newStat->saveConstituents(this->constituents());
154  return newStat;
155 }

◆ compactify()

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

Compactify – set TG as owner to surfaces.

Definition at line 158 of file DetachedTrackingVolume.cxx.

159 {
160  // deal with the Tracking Volume representation
161  if (m_trkVolume)
162  m_trkVolume->compactify(cSurfaces, tSurfaces);
163 
164  // deal with the layer representation
165  if (layerRepresentation()) {
166  ++tSurfaces;
167  if (layerRepresentation()->surfaceRepresentation().owner() == Trk::noOwn) {
169  ++cSurfaces;
170  }
171  }
172  // deal with the multi-layer representation
173  if (!multilayerRepresentation().empty()) {
174  tSurfaces += m_multilayerRepresentation->size();
175  for (const auto& mLayerIter : (*m_multilayerRepresentation)) {
176  if ((*mLayerIter).surfaceRepresentation().owner() == Trk::noOwn) {
177  (*mLayerIter).surfaceRepresentation().setOwner(Trk::TGOwn);
178  ++cSurfaces;
179  }
180  }
181  }
182  //<< !@ TODO include volumes
183 }

◆ constituents()

const std::vector< std::pair< std::unique_ptr< const Trk::Volume >, float > > * Trk::DetachedTrackingVolume::constituents ( ) const
inline

get the simplified calculable components

Definition at line 171 of file DetachedTrackingVolume.h.

171  {
172  return m_constituents;
173 }

◆ geometrySignature()

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

return the Signature

Definition at line 192 of file DetachedTrackingVolume.cxx.

192  {
193  return m_trkVolume->geometrySignature();
194 }

◆ geometryType()

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

return the Type

Definition at line 196 of file DetachedTrackingVolume.cxx.

196  {
197  return m_trkVolume->geometryType();
198 }

◆ layerRepresentation() [1/2]

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

Definition at line 140 of file DetachedTrackingVolume.h.

140  {
141  return (m_layerRepresentation);
142 }

◆ layerRepresentation() [2/2]

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

returns layer representation

Definition at line 136 of file DetachedTrackingVolume.h.

136  {
137  return (m_layerRepresentation);
138 }

◆ move()

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

moving object around

Definition at line 61 of file DetachedTrackingVolume.cxx.

62 {
63  m_trkVolume->moveTV(shift);
66  }
68  for (auto *layer : *m_multilayerRepresentation) {
69  layer->moveLayer(shift);
70  }
71  }
72 }

◆ multilayerRepresentation() [1/2]

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

Definition at line 155 of file DetachedTrackingVolume.h.

156 {
158  return ArraySpan<Layer* const>(&*m_multilayerRepresentation->begin(),
159  &*m_multilayerRepresentation->end());
160  }
161  return {};
162 }

◆ multilayerRepresentation() [2/2]

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

returns (multi)layer representation

Definition at line 145 of file DetachedTrackingVolume.h.

146 {
148  return ArraySpan<Layer const* const>(&*m_multilayerRepresentation->begin(),
149  &*m_multilayerRepresentation->end());
150  }
151  return {};
152 }

◆ name()

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

returns the Name

Definition at line 134 of file DetachedTrackingVolume.h.

134 { return (m_name); }

◆ saveConstituents()

void Trk::DetachedTrackingVolume::saveConstituents ( const std::vector< std::pair< std::unique_ptr< const Trk::Volume >, float >> *  constituents)
inline

set the simplified calculable components

Definition at line 164 of file DetachedTrackingVolume.h.

166  {
168 }

◆ setBaseTransform()

void Trk::DetachedTrackingVolume::setBaseTransform ( Amg::Transform3D transf = nullptr)

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

Definition at line 200 of file DetachedTrackingVolume.cxx.

200  {
201  if (transf)
202  m_baseTransform = transf;
203  else {
204  delete m_baseTransform;
206  }
207 }

◆ sign()

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

sign the volume - the geometry builder has to do that

Definition at line 186 of file DetachedTrackingVolume.cxx.

188 {
189  m_trkVolume->sign(signat, geotype);
190 }

◆ trackingVolume() [1/2]

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

Definition at line 129 of file DetachedTrackingVolume.h.

129  {
130  return (m_trkVolume);
131 }

◆ trackingVolume() [2/2]

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

returns the TrackingVolume

Definition at line 125 of file DetachedTrackingVolume.h.

125  {
126  return (m_trkVolume);
127 }

Friends And Related Function Documentation

◆ DetachedTrackingVolumeBuilder

friend class DetachedTrackingVolumeBuilder
friend

Definition at line 50 of file DetachedTrackingVolume.h.

◆ IDetachedTrackingVolumeBuilder

friend class IDetachedTrackingVolumeBuilder
friend

Definition at line 51 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 49 of file DetachedTrackingVolume.h.

Member Data Documentation

◆ m_baseTransform

Amg::Transform3D* Trk::DetachedTrackingVolume::m_baseTransform
private

Definition at line 120 of file DetachedTrackingVolume.h.

◆ m_constituents

const std::vector<std::pair<std::unique_ptr<const Trk::Volume>, float> >* Trk::DetachedTrackingVolume::m_constituents
private

Definition at line 122 of file DetachedTrackingVolume.h.

◆ m_layerRepresentation

Layer* Trk::DetachedTrackingVolume::m_layerRepresentation
private

Definition at line 118 of file DetachedTrackingVolume.h.

◆ m_multilayerRepresentation

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

Definition at line 119 of file DetachedTrackingVolume.h.

◆ m_name

const std::string Trk::DetachedTrackingVolume::m_name
private

Definition at line 117 of file DetachedTrackingVolume.h.

◆ m_trkVolume

TrackingVolume* Trk::DetachedTrackingVolume::m_trkVolume
private

Definition at line 116 of file DetachedTrackingVolume.h.


The documentation for this class was generated from the following files:
Trk::DetachedTrackingVolume::TrackingVolume
friend class TrackingVolume
Declare the IDetachedTrackingVolumeBuilder as a friend, to be able to change the volumelink.
Definition: DetachedTrackingVolume.h:49
Trk::DetachedTrackingVolume::m_baseTransform
Amg::Transform3D * m_baseTransform
Definition: DetachedTrackingVolume.h:120
Trk::DetachedTrackingVolume::m_trkVolume
TrackingVolume * m_trkVolume
Definition: DetachedTrackingVolume.h:116
Trk::Surface::setOwner
void setOwner(SurfaceOwner x)
set Ownership
Trk::noOwn
@ noOwn
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:54
Trk::TrackingVolume::geometrySignature
GeometrySignature geometrySignature() const
return the Signature
Trk::DetachedTrackingVolume::trackingVolume
const TrackingVolume * trackingVolume() const
returns the TrackingVolume
Definition: DetachedTrackingVolume.h:125
Trk::TrackingVolume::geometryType
GeometryType geometryType() const
return the Signature
Trk::DetachedTrackingVolume::m_layerRepresentation
Layer * m_layerRepresentation
Definition: DetachedTrackingVolume.h:118
empty
bool empty(TH1 *h)
Definition: computils.cxx:295
Trk::TrackingVolume::confinedLayers
const LayerArray * confinedLayers() const
Return the subLayer array.
Trk::Layer::moveLayer
virtual void moveLayer(Amg::Transform3D &)=0
move the Layer
Trk::Layer::surfaceRepresentation
virtual const Surface & surfaceRepresentation() const =0
Transforms the layer into a Surface representation for extrapolation.
lumiFormat.i
int i
Definition: lumiFormat.py:85
Trk::ArraySpan
std::span< T > ArraySpan
Definition: DetachedTrackingVolume.h:34
Trk::DetachedTrackingVolume::m_constituents
const std::vector< std::pair< std::unique_ptr< const Trk::Volume >, float > > * m_constituents
Definition: DetachedTrackingVolume.h:122
Trk::TrackingVolume::confinedArbitraryLayers
ArraySpan< Layer const *const > confinedArbitraryLayers() const
Return the confined subLayer array.
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
Trk::DetachedTrackingVolume::saveConstituents
void saveConstituents(const std::vector< std::pair< std::unique_ptr< const Trk::Volume >, float >> *)
set the simplified calculable components
Definition: DetachedTrackingVolume.h:164
Trk::PlaneLayer
Definition: PlaneLayer.h:40
Trk::PlaneLayer::moveLayer
virtual void moveLayer(Amg::Transform3D &shift) override final
move the Layer
Definition: PlaneLayer.cxx:83
Trk::TGOwn
@ TGOwn
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:55
Trk::BinnedArray::arrayObjects
virtual BinnedArraySpan< T *const > arrayObjects()=0
Return all objects of the Array non-const we can still modify the T.
Trk::TrackingVolume::moveTV
void moveTV(Amg::Transform3D &transform)
move the Tracking Volume
Definition: TrackingVolume.cxx:1387
Trk::DetachedTrackingVolume::name
const std::string & name() const
returns the Name
Definition: DetachedTrackingVolume.h:134
Trk::DetachedTrackingVolume::constituents
const std::vector< std::pair< std::unique_ptr< const Trk::Volume >, float > > * constituents() const
get the simplified calculable components
Definition: DetachedTrackingVolume.h:171
Trk::DetachedTrackingVolume::multilayerRepresentation
ArraySpan< Layer const *const > multilayerRepresentation() const
returns (multi)layer representation
Definition: DetachedTrackingVolume.h:145
Trk::TrackingVolume::sign
void sign(GeometrySignature signat, GeometryType gtype=Static)
sign the volume - the geometry builder has to do that
Definition: TrackingVolume.cxx:941
Trk::TrackingVolume::confinedVolumes
const TrackingVolumeArray * confinedVolumes() const
Return the subLayer array.
Trk::TrackingVolume::compactify
void compactify(size_t &rSurfaces, size_t &tSurfaces)
compactify the memory usage in the event by setting ownership to TackingGeometry the referenced types...
Definition: TrackingVolume.cxx:1455
Trk::DetachedTrackingVolume::m_name
const std::string m_name
Definition: DetachedTrackingVolume.h:117
Trk::DetachedTrackingVolume::m_multilayerRepresentation
const std::vector< Layer * > * m_multilayerRepresentation
Definition: DetachedTrackingVolume.h:119
Trk::DetachedTrackingVolume::layerRepresentation
const Layer * layerRepresentation() const
returns layer representation
Definition: DetachedTrackingVolume.h:136
Trk::BinnedArray
Definition: BinnedArray.h:38
Trk::DetachedTrackingVolume
Definition: DetachedTrackingVolume.h:46
Trk::TrackingVolume
Definition: TrackingVolume.h:121
Trk::BinnedArraySpan
std::span< T > BinnedArraySpan
Definition: BinnedArray.h:34