ATLAS Offline Software
TrackingVolumeManipulator.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TrackingVolumeManipulator.cxx, (c) ATLAS Detector software
8 
10 
11 #include <utility>
12 
15 
16 void
18  Trk::TrackingVolume& firstVol,
19  Trk::BoundarySurfaceFace firstFace,
20  Trk::TrackingVolume& secondVol,
21  Trk::BoundarySurfaceFace secondFace) const
22 {
23  // check if it is a cylinder volume
24  const Trk::CylinderVolumeBounds* cylBounds =
25  dynamic_cast<const Trk::CylinderVolumeBounds*>(&(firstVol.volumeBounds()));
26 
27  if (firstFace == Trk::tubeOuterCover && secondFace == Trk::tubeInnerCover)
28  return glueVolumes(secondVol, secondFace, firstVol, firstFace);
29 
30  // the second volume gets the face of the first volume assigned
31  (secondVol.m_boundarySurfaces)[secondFace] =
32  (firstVol.m_boundarySurfaces)[firstFace];
33  // the face of the first volume has been an inner tube
34  if (cylBounds && firstFace == Trk::tubeInnerCover &&
35  secondFace == Trk::tubeOuterCover) {
36  (secondVol.m_boundarySurfaces)[secondFace]->setInsideVolume(&secondVol);
37  } else {
38  (secondVol.m_boundarySurfaces)[secondFace]->setOutsideVolume(&secondVol);
39  }
40 }
41 
42 void
44  Trk::TrackingVolume& tvol,
47 {
48  (tvol.m_boundarySurfaces)[face] = std::move(bsurf);
49 }
50 
51 void
54  Trk::TrackingVolume* insidevol)
55 {
56 
57  (tvol.m_boundarySurfaces)[face]->setInsideVolume(insidevol);
58 }
59 
60 void
62  Trk::TrackingVolume& tvol,
65 {
66 
67  (tvol.m_boundarySurfaces)[face]->setInsideVolumeArray(
69 }
70 
71 void
73  Trk::TrackingVolume& tvol,
76  insidevolarray)
77 {
78  (tvol.m_boundarySurfaces)[face]->setInsideVolumeArray(insidevolarray);
79 }
80 
81 void
83  Trk::TrackingVolume& tvol,
85  Trk::TrackingVolume* outsidevol)
86 {
87  (tvol.m_boundarySurfaces)[face]->setOutsideVolume(outsidevol);
88 }
89 
90 void
92  Trk::TrackingVolume& tvol,
95 {
96 
97  (tvol.m_boundarySurfaces)[face]->setOutsideVolumeArray(
99 }
100 
101 void
103  Trk::TrackingVolume& tvol,
106  outsidevolarray)
107 {
108  (tvol.m_boundarySurfaces)[face]->setOutsideVolumeArray(outsidevolarray);
109 }
110 
111 void
113  TrackingVolume* outsideVol)
114 {
115 
116  const auto& bounds = tvol.boundarySurfaces();
117  for (const auto & bound : bounds) {
118  if (bound->outsideVolume() == nullptr) {
119  bound->setOutsideVolume(outsideVol);
120  }
121  if (bound->insideVolume() == nullptr) {
122  bound->setInsideVolume(outsideVol);
123  }
124  }
125 }
Trk::BoundarySurface
Definition: BoundarySurface.h:50
Trk::TrackingVolume::boundarySurfaces
std::vector< SharedObject< BoundarySurface< TrackingVolume > > > & boundarySurfaces()
Method to return the BoundarySurfaces.
Definition: TrackingVolume.cxx:982
bound
@ bound
Definition: L1CaloPprPlotManager.h:74
Trk::TrackingVolumeManipulator::setOutsideVolume
static void setOutsideVolume(TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *outsidevol)
protected method to set outside Volume of a BoundarySurface: input:
Definition: TrackingVolumeManipulator.cxx:82
Trk::TrackingVolumeManipulator::setInsideVolumeArray
static void setInsideVolumeArray(TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *insidevolarray)
protected method to set inside VolumeArray of a BoundarySurface: input:
Definition: TrackingVolumeManipulator.cxx:61
Trk::BoundarySurfaceFace
BoundarySurfaceFace
Definition: BoundarySurfaceFace.h:31
Trk::TrackingVolumeManipulator::setOutsideVolumeArray
static void setOutsideVolumeArray(TrackingVolume &tvol, BoundarySurfaceFace face, BinnedArray< TrackingVolume > *outsidevolarray)
protected method to set outside VolumeArray of a BoundarySurface: input:
Definition: TrackingVolumeManipulator.cxx:91
CylinderVolumeBounds.h
Trk::CylinderVolumeBounds
Definition: CylinderVolumeBounds.h:70
TrackingVolumeManipulator.h
Trk::TrackingVolumeManipulator::setInsideVolume
static void setInsideVolume(TrackingVolume &tvol, BoundarySurfaceFace face, TrackingVolume *insidevol)
protected method to set inside Volume of a BoundarySurface: input:
Definition: TrackingVolumeManipulator.cxx:52
TrackingVolume.h
Trk::SharedObject
std::shared_ptr< T > SharedObject
Definition: SharedObject.h:24
Trk::TrackingVolumeManipulator::setBoundarySurface
static void setBoundarySurface(TrackingVolume &tvol, SharedObject< BoundarySurface< TrackingVolume >> bsurf, BoundarySurfaceFace face)
protected method to set the boundary surface of a tracking volume
Definition: TrackingVolumeManipulator.cxx:43
Trk::TrackingVolumeManipulator::glueVolumes
void glueVolumes(TrackingVolume &firstVol, BoundarySurfaceFace firstFace, TrackingVolume &secondVol, BoundarySurfaceFace secondFace) const
protected method to glue two Volumes together input:
Definition: TrackingVolumeManipulator.cxx:17
Trk::TrackingVolumeManipulator::confineVolume
static void confineVolume(TrackingVolume &tvol, TrackingVolume *outsidevol)
protected method to confine (dense) volumes: input:
Definition: TrackingVolumeManipulator.cxx:112
Trk::Volume::volumeBounds
const VolumeBounds & volumeBounds() const
returns the volumeBounds()
Definition: Volume.h:97
Trk::tubeOuterCover
@ tubeOuterCover
Definition: BoundarySurfaceFace.h:40
Trk::tubeInnerCover
@ tubeInnerCover
Definition: BoundarySurfaceFace.h:39
Trk::BinnedArray
Definition: BinnedArray.h:38
Trk::TrackingVolume::m_boundarySurfaces
std::vector< SharedObject< BoundarySurface< TrackingVolume > > > m_boundarySurfaces
Definition: TrackingVolume.h:454
Trk::TrackingVolume
Definition: TrackingVolume.h:121