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