Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PlaneLayer.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PlaneLayer.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 
15 
16 #include <algorithm>
17 #include <vector>
18 
20  std::shared_ptr<const PlanarBounds>& pbounds,
21  std::unique_ptr<SurfaceArray> surfaceArray,
22  double thickness,
23  std::unique_ptr<ApproachDescriptor> ades,
24  LayerType laytyp)
25  : PlaneSurface(transform, pbounds),
26  Layer(std::move(surfaceArray), thickness, std::move(ades), laytyp) {
27  // @todo create representing volume
28  // register the layer to the surface
30  // deal with the approach descriptor
33  }
34  // register the layer to the approach descriptor
37  }
38 }
39 
41  return (*this);
42 }
43 
45  return (*this);
46 }
47 
49  // delete it
50  m_approachDescriptor.reset(nullptr);
51  // delete the surfaces
52  std::vector<std::shared_ptr<const Acts::Surface>> aSurfaces;
53  // get the appropriate transform, the center and the normal vector
54 
55  //@todo fix with representing volume
56  const Transform3& lTransform = PlaneSurface::transform(GeometryContext());
57  RotationMatrix3 lRotation = lTransform.rotation();
58  const Vector3& lCenter = PlaneSurface::center(GeometryContext());
59  const Vector3& lVector = Surface::normal(GeometryContext(), lCenter);
60  // create new surfaces
61  const Transform3 apnTransform = Transform3(
62  Translation3(lCenter - 0.5 * Layer::m_layerThickness * lVector) *
63  lRotation);
64  const Transform3 appTransform = Transform3(
65  Translation3(lCenter + 0.5 * Layer::m_layerThickness * lVector) *
66  lRotation);
67  // create the new surfaces
68  aSurfaces.push_back(Surface::makeShared<Acts::PlaneSurface>(
69  apnTransform, PlaneSurface::m_bounds));
70  aSurfaces.push_back(Surface::makeShared<Acts::PlaneSurface>(
71  appTransform, PlaneSurface::m_bounds));
72  // set the layer and make TrackingGeometry
73  for (auto& sfPtr : aSurfaces) {
74  auto mutableSf = const_cast<Surface*>(sfPtr.get());
75  mutableSf->associateLayer(*this);
76  }
77  // @todo check if we can provide the layer at surface creation
78  m_approachDescriptor =
79  std::make_unique<const GenericApproachDescriptor>(std::move(aSurfaces));
80 }