ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PassiveLayerBuilder.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PassiveLayerBuilder.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 // PassiveLayerBuilder.cpp, Acts project
12 
21 
23  const PassiveLayerBuilder::Config& plConfig,
24  std::unique_ptr<const Logger> logger)
25  : m_cfg(), m_logger(std::move(logger)) {
26  setConfiguration(plConfig);
27 }
28 
30  const PassiveLayerBuilder::Config& plConfig) {
32  m_cfg = plConfig;
33 }
34 
36  std::unique_ptr<const Logger> newLogger) {
37  m_logger = std::move(newLogger);
38 }
39 
41  const GeometryContext& gctx) const {
42  return endcapLayers(gctx, 1);
43 }
44 
46  const GeometryContext& gctx) const {
47  return endcapLayers(gctx, -1);
48 }
49 
51  const Acts::GeometryContext& /*gctx*/, int side) const {
52  LayerVector eLayers;
53  // pos/neg layers
54  size_t numpnLayers = m_cfg.posnegLayerPositionZ.size();
55  if (numpnLayers != 0u) {
56  ACTS_DEBUG("Configured to build " << numpnLayers
57  << " passive layers on side :" << side);
58  eLayers.reserve(numpnLayers);
59  // loop through
60  for (size_t ipnl = 0; ipnl < numpnLayers; ++ipnl) {
61  // some screen output
62  ACTS_VERBOSE("- build layers "
63  << (ipnl)
64  << " at = " << side * m_cfg.posnegLayerPositionZ.at(ipnl)
65  << " and rMin/rMax = " << m_cfg.posnegLayerRmin.at(ipnl)
66  << " / " << m_cfg.posnegLayerRmax.at(ipnl));
67  // create the share disc bounds
68  std::shared_ptr<const DiscBounds> dBounds =
69  std::make_shared<const RadialBounds>(m_cfg.posnegLayerRmin.at(ipnl),
70  m_cfg.posnegLayerRmax.at(ipnl));
71  // create the layer transforms
72  const Transform3D* eTransform = new Transform3D(
73  Translation3D(0., 0., side * m_cfg.posnegLayerPositionZ.at(ipnl)));
74  // create the layers
76  std::shared_ptr<const Transform3D>(eTransform), dBounds, nullptr,
77  m_cfg.posnegLayerThickness.at(ipnl));
78 
79  // assign the material to the layer surface
80  std::shared_ptr<const ISurfaceMaterial> material = nullptr;
81  // create the material from jobOptions
82  if (!m_cfg.posnegLayerMaterial.empty()) {
83  // create homogeneous material
84  material = m_cfg.posnegLayerMaterial.at(ipnl);
85  // sign it to the surface
86  eLayer->surfaceRepresentation().assignSurfaceMaterial(material);
87  }
88  // push it into the layer vector
89  eLayers.push_back(eLayer);
90  }
91  }
92  return eLayers;
93 }
94 
96  const Acts::GeometryContext& /*gctx*/) const {
97  LayerVector cLayers;
98  // the central layers
99  size_t numcLayers = m_cfg.centralLayerRadii.size();
100  if (numcLayers != 0u) {
101  ACTS_DEBUG("Configured to build " << numcLayers
102  << " passive central layers.");
103  cLayers.reserve(numcLayers);
104  // loop through
105  for (size_t icl = 0; icl < numcLayers; ++icl) {
106  // some screen output
107  ACTS_VERBOSE("- build layer "
108  << icl
109  << " with radius = " << m_cfg.centralLayerRadii.at(icl)
110  << " and halfZ = " << m_cfg.centralLayerHalflengthZ.at(icl));
111  // create the layer and push it back
112  auto cBounds = std::make_shared<const CylinderBounds>(
113  m_cfg.centralLayerRadii[icl], m_cfg.centralLayerHalflengthZ.at(icl));
114  // create the layer
116  nullptr, cBounds, nullptr, m_cfg.centralLayerThickness.at(icl));
117  // assign the material to the layer surface
118  std::shared_ptr<const ISurfaceMaterial> material = nullptr;
119  // create the material from jobOptions
120  if (!m_cfg.centralLayerMaterial.empty()) {
121  // create homogeneous material
122  material = m_cfg.centralLayerMaterial.at(icl);
123  // sign it to the surface
124  cLayer->surfaceRepresentation().assignSurfaceMaterial(material);
125  }
126  // push it into the layer vector
127  cLayers.push_back(cLayer);
128  }
129  }
130  return cLayers;
131 }