EIC 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 <iostream>
16 #include <utility>
17 
19  const Transform3D& transform, std::shared_ptr<const VolumeBounds> volbounds)
20  : Volume(transform, std::move(volbounds)) {
21  createBoundarySurfaces();
22 }
23 
24 const std::vector<Acts::BoundarySurfacePtr>&
26  return m_boundarySurfaces;
27 }
28 
30  using Boundary = BoundarySurfaceT<AbstractVolume>;
31 
32  // Transform Surfaces To BoundarySurfaces
33  auto orientedSurfaces = Volume::volumeBounds().orientedSurfaces(m_transform);
34 
35  m_boundarySurfaces.reserve(orientedSurfaces.size());
36  for (auto& osf : orientedSurfaces) {
37  AbstractVolume* opposite = nullptr;
38  AbstractVolume* along = nullptr;
39  if (osf.second == backward) {
40  opposite = this;
41  } else {
42  along = this;
43  }
44  m_boundarySurfaces.push_back(std::make_shared<const Boundary>(
45  std::move(osf.first), opposite, along));
46  }
47 }