ECCE @ EIC 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 // PlaneLayer.cpp, Acts project
12 
13 // Geometry module
14 #include <utility>
15 
20 
21 Acts::PlaneLayer::PlaneLayer(std::shared_ptr<const Transform3D> transform,
22  std::shared_ptr<const PlanarBounds>& pbounds,
23  std::unique_ptr<SurfaceArray> surfaceArray,
24  double thickness,
25  std::unique_ptr<ApproachDescriptor> ades,
26  LayerType laytyp)
27  : PlaneSurface(std::move(transform), pbounds),
28  Layer(std::move(surfaceArray), thickness, std::move(ades), laytyp) {
29  // @todo create representing volume
30  // register the layer to the surface
32  // deal with the approach descriptor
35  }
36  // register the layer to the approach descriptor
39  }
40 }
41 
43  return (*this);
44 }
45 
47  return (*this);
48 }
49 
51  // delete it
52  m_approachDescriptor.reset(nullptr);
53  // delete the surfaces
54  std::vector<std::shared_ptr<const Acts::Surface>> aSurfaces;
55  // get the appropriate transform, the center and the normal vector
56 
57  //@todo fix with representing volume
59  RotationMatrix3D lRotation = lTransform.rotation();
60  const Vector3D& lCenter = PlaneSurface::center(GeometryContext());
61  const Vector3D& lVector = Surface::normal(GeometryContext(), lCenter);
62  // create new surfaces
63  const Transform3D* apnTransform = new Transform3D(
64  Translation3D(lCenter - 0.5 * Layer::m_layerThickness * lVector) *
65  lRotation);
66  const Transform3D* appTransform = new Transform3D(
67  Translation3D(lCenter + 0.5 * Layer::m_layerThickness * lVector) *
68  lRotation);
69  // create the new surfaces
70  aSurfaces.push_back(Surface::makeShared<Acts::PlaneSurface>(
71  std::shared_ptr<const Transform3D>(apnTransform),
73  aSurfaces.push_back(Surface::makeShared<Acts::PlaneSurface>(
74  std::shared_ptr<const Transform3D>(appTransform),
76  // set the layer and make TrackingGeometry
77  for (auto& sfPtr : aSurfaces) {
78  auto mutableSf = const_cast<Surface*>(sfPtr.get());
79  mutableSf->associateLayer(*this);
80  }
81  // @todo check if we can provide the layer at surface creation
82  m_approachDescriptor =
83  std::make_unique<const GenericApproachDescriptor>(std::move(aSurfaces));
84 }