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-2020 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 
18 
20  const PassiveLayerBuilder::Config& plConfig,
21  std::unique_ptr<const Logger> logger)
22  : m_cfg(), m_logger(std::move(logger)) {
23  setConfiguration(plConfig);
24 }
25 
27  const PassiveLayerBuilder::Config& plConfig) {
29  m_cfg = plConfig;
30 }
31 
33  std::unique_ptr<const Logger> newLogger) {
34  m_logger = std::move(newLogger);
35 }
36 
38  const GeometryContext& gctx) const {
39  return endcapLayers(gctx, 1);
40 }
41 
43  const GeometryContext& gctx) const {
44  return endcapLayers(gctx, -1);
45 }
46 
48  const Acts::GeometryContext& /*gctx*/, int side) const {
49  LayerVector eLayers;
50  // pos/neg layers
51  size_t numpnLayers = m_cfg.posnegLayerPositionZ.size();
52  if (numpnLayers != 0u) {
53  ACTS_DEBUG("Configured to build " << numpnLayers
54  << " passive layers on side :" << side);
55  eLayers.reserve(numpnLayers);
56  // loop through
57  for (size_t ipnl = 0; ipnl < numpnLayers; ++ipnl) {
58  // some screen output
59  ACTS_VERBOSE("- build layers "
60  << (ipnl)
61  << " at = " << side * m_cfg.posnegLayerPositionZ.at(ipnl)
62  << " and rMin/rMax = " << m_cfg.posnegLayerRmin.at(ipnl)
63  << " / " << m_cfg.posnegLayerRmax.at(ipnl));
64  // create the share disc bounds
65  std::shared_ptr<const DiscBounds> dBounds =
66  std::make_shared<const RadialBounds>(m_cfg.posnegLayerRmin.at(ipnl),
67  m_cfg.posnegLayerRmax.at(ipnl));
68  // create the layer transforms
69  const Transform3D eTransform(
70  Translation3D(0., 0., side * m_cfg.posnegLayerPositionZ.at(ipnl)));
71  // create the layers
73  eTransform, dBounds, nullptr, m_cfg.posnegLayerThickness.at(ipnl));
74 
75  // assign the material to the layer surface
76  std::shared_ptr<const ISurfaceMaterial> material = nullptr;
77  // create the material from jobOptions
78  if (!m_cfg.posnegLayerMaterial.empty()) {
79  // create homogeneous material
80  material = m_cfg.posnegLayerMaterial.at(ipnl);
81  // sign it to the surface
82  eLayer->surfaceRepresentation().assignSurfaceMaterial(material);
83  }
84  // push it into the layer vector
85  eLayers.push_back(eLayer);
86  }
87  }
88  return eLayers;
89 }
90 
92  const Acts::GeometryContext& /*gctx*/) const {
93  LayerVector cLayers;
94  // the central layers
95  size_t numcLayers = m_cfg.centralLayerRadii.size();
96  if (numcLayers != 0u) {
97  ACTS_DEBUG("Configured to build " << numcLayers
98  << " passive central layers.");
99  cLayers.reserve(numcLayers);
100  // loop through
101  for (size_t icl = 0; icl < numcLayers; ++icl) {
102  // some screen output
103  ACTS_VERBOSE("- build layer "
104  << icl
105  << " with radius = " << m_cfg.centralLayerRadii.at(icl)
106  << " and halfZ = " << m_cfg.centralLayerHalflengthZ.at(icl));
107  // create the layer and push it back
108  auto cBounds = std::make_shared<const CylinderBounds>(
109  m_cfg.centralLayerRadii[icl], m_cfg.centralLayerHalflengthZ.at(icl));
110  // create the layer
112  s_idTransform, cBounds, nullptr, m_cfg.centralLayerThickness.at(icl));
113  // assign the material to the layer surface
114  std::shared_ptr<const ISurfaceMaterial> material = nullptr;
115  // create the material from jobOptions
116  if (!m_cfg.centralLayerMaterial.empty()) {
117  // create homogeneous material
118  material = m_cfg.centralLayerMaterial.at(icl);
119  // sign it to the surface
120  cLayer->surfaceRepresentation().assignSurfaceMaterial(material);
121  }
122  // push it into the layer vector
123  cLayers.push_back(cLayer);
124  }
125  }
126  return cLayers;
127 }