Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AbstractVolume.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file AbstractVolume.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 
14 
15 #include <utility>
16 
18  const Transform3& transform, std::shared_ptr<const VolumeBounds> volbounds)
19  : Volume(transform, std::move(volbounds)) {
20  createBoundarySurfaces();
21 }
22 
23 const std::vector<Acts::BoundarySurfacePtr>&
25  return m_boundarySurfaces;
26 }
27 
29  using Boundary = BoundarySurfaceT<AbstractVolume>;
30 
31  // Transform Surfaces To BoundarySurfaces
32  auto orientedSurfaces = Volume::volumeBounds().orientedSurfaces(m_transform);
33 
34  m_boundarySurfaces.reserve(orientedSurfaces.size());
35  for (auto& osf : orientedSurfaces) {
36  AbstractVolume* opposite = nullptr;
37  AbstractVolume* along = nullptr;
38  if (osf.second == Direction::Negative) {
39  opposite = this;
40  } else {
41  along = this;
42  }
43  m_boundarySurfaces.push_back(std::make_shared<const Boundary>(
44  std::move(osf.first), opposite, along));
45  }
46 }