Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CylinderLayer.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CylinderLayer.cpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2016-2020 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
10 
18 
19 #include <cstddef>
20 #include <vector>
21 
22 namespace Acts {
23 class CylinderBounds;
24 } // namespace Acts
25 
27 
29  const Transform3& transform,
30  const std::shared_ptr<const CylinderBounds>& cBounds,
31  std::unique_ptr<SurfaceArray> surfaceArray, double thickness,
32  std::unique_ptr<ApproachDescriptor> ades, LayerType laytyp)
33  : CylinderSurface(transform, cBounds),
34  Layer(std::move(surfaceArray), thickness, std::move(ades), laytyp) {
35  // create the representing volume
36  auto cVolumeBounds = std::make_shared<const CylinderVolumeBounds>(
38  // @todo rotate around x for the avePhi if you have a sector
40  std::make_unique<AbstractVolume>(m_transform, cVolumeBounds);
41 
42  // associate the layer to the surface
44  // an approach descriptor is automatically created if there's a surface array
47  }
48  // register the layer to the approach descriptor surfaces
51  }
52 }
53 
55  const {
56  return (*this);
57 }
58 
60  return (*this);
61 }
62 
64  // delete and reset as you build a new one
65  m_approachDescriptor.reset(nullptr);
66 
67  // take the boundary surfaces of the representving volume if they exist
68  if (m_representingVolume != nullptr) {
69  // get the boundary surfaces
70  const std::vector<std::shared_ptr<const BoundarySurfaceT<AbstractVolume>>>&
71  bSurfaces = m_representingVolume->boundarySurfaces();
72 
73  // fill in the surfaces into the vector
74  std::vector<std::shared_ptr<const Surface>> aSurfaces;
75  if (bSurfaces.size() > size_t(tubeInnerCover)) {
76  aSurfaces.push_back(
77  bSurfaces.at(tubeInnerCover)->surfaceRepresentation().getSharedPtr());
78  }
79  aSurfaces.push_back(
80  bSurfaces.at(tubeOuterCover)->surfaceRepresentation().getSharedPtr());
81  // create an ApproachDescriptor with Boundary surfaces
82  m_approachDescriptor =
83  std::make_unique<const GenericApproachDescriptor>(std::move(aSurfaces));
84  }
85 
86  for (auto& sfPtr : (m_approachDescriptor->containedSurfaces())) {
87  if (sfPtr != nullptr) {
88  auto& mutableSf = *(const_cast<Surface*>(sfPtr));
89  mutableSf.associateLayer(*this);
90  }
91  }
92 }