EIC 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 
20 
22  const Transform3D& transform,
23  const std::shared_ptr<const CylinderBounds>& cBounds,
24  std::unique_ptr<SurfaceArray> surfaceArray, double thickness,
25  std::unique_ptr<ApproachDescriptor> ades, LayerType laytyp)
26  : CylinderSurface(transform, cBounds),
27  Layer(std::move(surfaceArray), thickness, std::move(ades), laytyp) {
28  // create the representing volume
29  auto cVolumeBounds = std::make_shared<const CylinderVolumeBounds>(
31  // @todo rotate around x for the avePhi if you have a sector
33  std::make_unique<AbstractVolume>(m_transform, cVolumeBounds);
34 
35  // associate the layer to the surface
37  // an approach descriptor is automatically created if there's a surface array
40  }
41  // register the layer to the approach descriptor surfaces
44  }
45 }
46 
48  const {
49  return (*this);
50 }
51 
53  return (*this);
54 }
55 
57  // delete and reset as you build a new one
58  m_approachDescriptor.reset(nullptr);
59 
60  // take the boundary surfaces of the representving volume if they exist
61  if (m_representingVolume != nullptr) {
62  // get the boundary surfaces
63  const std::vector<std::shared_ptr<const BoundarySurfaceT<AbstractVolume>>>&
64  bSurfaces = m_representingVolume->boundarySurfaces();
65 
66  // fill in the surfaces into the vector
67  std::vector<std::shared_ptr<const Surface>> aSurfaces;
68  if (bSurfaces.size() > size_t(tubeOuterCover)) {
69  aSurfaces.push_back(
70  bSurfaces.at(tubeInnerCover)->surfaceRepresentation().getSharedPtr());
71  }
72  aSurfaces.push_back(
73  bSurfaces.at(tubeOuterCover)->surfaceRepresentation().getSharedPtr());
74  // create an ApproachDescriptor with Boundary surfaces
75  m_approachDescriptor =
76  std::make_unique<const GenericApproachDescriptor>(std::move(aSurfaces));
77  }
78 
79  for (auto& sfPtr : (m_approachDescriptor->containedSurfaces())) {
80  if (sfPtr != nullptr) {
81  auto& mutableSf = *(const_cast<Surface*>(sfPtr));
82  mutableSf.associateLayer(*this);
83  }
84  }
85 }