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