ATLAS Offline Software
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ActsLayerBuilder Class Reference

#include <ActsLayerBuilder.h>

Inheritance diagram for ActsLayerBuilder:
Collaboration diagram for ActsLayerBuilder:

Classes

struct  Config
 

Public Types

enum  Mode {
  Mode::Undefined, Mode::Pixel, Mode::SCT, Mode::TRT,
  Mode::ITkPixelInner, Mode::ITkPixelOuter, Mode::ITkStrip
}
 
using ElementVector = ActsElementVector
 

Public Member Functions

 ActsLayerBuilder (const Config &cfg, std::unique_ptr< const Acts::Logger > logger=Acts::getDefaultLogger("GMLayBldr", Acts::Logging::INFO))
 Constructor. More...
 
 ~ActsLayerBuilder ()
 Destructor. More...
 
const Acts::LayerVector negativeLayers (const Acts::GeometryContext &gctx) const override
 
const Acts::LayerVector centralLayers (const Acts::GeometryContext &gctx) const override
 
const Acts::LayerVector positiveLayers (const Acts::GeometryContext &gctx) const override
 
void setConfiguration (const Config &cfg)
 Name identification. More...
 
ActsLayerBuilder::Config getConfiguration () const
 get the configuration object More...
 
virtual const std::string & identification () const override
 
void setLogger (std::unique_ptr< const Acts::Logger > logger)
 set logging instance More...
 

Private Member Functions

const Acts::Logger & logger () const
 Private access to the logger. More...
 
std::vector< std::shared_ptr< const ActsDetectorElement > > getDetectorElements () const
 
void buildBarrel (const Acts::GeometryContext &gctx, Acts::LayerVector &layersOutput) const
 
void buildEndcap (const Acts::GeometryContext &gctx, Acts::LayerVector &layersOutput, int type=0) const
 

Private Attributes

Config m_cfg
 configuration object More...
 
std::unique_ptr< const Acts::Logger > m_logger
 logging instance More...
 

Detailed Description

Definition at line 37 of file ActsLayerBuilder.h.

Member Typedef Documentation

◆ ElementVector

Definition at line 44 of file ActsLayerBuilder.h.

Member Enumeration Documentation

◆ Mode

Enumerator
Undefined 
Pixel 
SCT 
TRT 
ITkPixelInner 
ITkPixelOuter 
ITkStrip 

Definition at line 40 of file ActsLayerBuilder.h.

40  {
41  Undefined, Pixel, SCT, TRT, ITkPixelInner, ITkPixelOuter, ITkStrip,
42  };

Constructor & Destructor Documentation

◆ ActsLayerBuilder()

ActsLayerBuilder::ActsLayerBuilder ( const Config cfg,
std::unique_ptr< const Acts::Logger >  logger = Acts::getDefaultLogger("GMLayBldr", Acts::Logging::INFO) 
)

Constructor.

Parameters
cfgis the configuration struct
loggerthe local logging instance

Definition at line 40 of file ActsLayerBuilder.cxx.

42  : m_cfg (cfg),
43  m_logger(std::move(logger))
44 {
45  if(m_cfg.mode == Mode::Undefined) {
46  throw std::invalid_argument("ALB mode is undefined");
47  }
48 }

◆ ~ActsLayerBuilder()

ActsLayerBuilder::~ActsLayerBuilder ( )
inline

Destructor.

Definition at line 97 of file ActsLayerBuilder.h.

97 {}

Member Function Documentation

◆ buildBarrel()

void ActsLayerBuilder::buildBarrel ( const Acts::GeometryContext &  gctx,
Acts::LayerVector &  layersOutput 
) const
private

Definition at line 106 of file ActsLayerBuilder.cxx.

107  {
108 
109  ACTS_VERBOSE("Build layers: BARREL");
110  std::vector<std::shared_ptr<const ActsDetectorElement>> elements =
112 
113  std::map<int, std::vector<std::shared_ptr<const Acts::Surface>>> layers{};
114 
115  for (const auto &element : elements) {
116 
117  IdentityHelper id = element->identityHelper();
118  if (id.bec() != 0)
119  continue;
120 
122  if(id.layer_disk() >= 2) continue;
123  }
125  if(id.layer_disk() <= 1) continue;
126  }
127 
128  m_cfg.elementStore->push_back(element);
129 
130  int elementLayer;
131  elementLayer = id.layer_disk();
132 
133  layers[elementLayer].push_back(element->surface().getSharedPtr());
134  }
135 
136 
137  if (m_cfg.objDebugOutput) {
138  std::string lab;
139  for (auto &[key, layerSurfaces] : layers) {
140 
141  std::stringstream name;
142 
143 
144 
145  name << "obj/" << m_cfg.mode << "_brl_" << std::setfill('0') << std::setw(2)
146  << std::to_string(key) + "_bec"
147  << ".obj";
148 
149  std::ofstream ofs{name.str()};
150  Acts::ObjVisualization3D vis{};
151  Acts::ViewConfig vc = Acts::s_viewSensitive;
152  vc.quarterSegments = 200;
153  for (const auto &surface : layerSurfaces) {
154  Acts::GeometryView3D::drawSurface(vis, *surface, gctx,
155  Acts::Transform3::Identity(), vc);
156  }
157 
158  vis.write(ofs);
159  }
160  }
161 
162  ACTS_VERBOSE("Found " << layers.size() << " barrel layers");
163  // pre loop for more concise output. only do if we actually print it
164  if (logger().doPrint(Acts::Logging::VERBOSE)) {
165  size_t n = 1;
166  for (const auto &[key, surfaces] : layers) {
167  Acts::ProtoLayer pl(gctx, surfaces);
168  ACTS_VERBOSE("Layer #" << n << " with layerKey: (" << key << ")");
169  ACTS_VERBOSE(" -> at rMin / rMax: " << pl.min(Acts::BinningValue::binR) << " / "
170  << pl.max(Acts::BinningValue::binR));
171  ACTS_VERBOSE(" -> at zMin / zMax: " << pl.min(Acts::BinningValue::binZ) << " / "
172  << pl.max(Acts::BinningValue::binZ));
173 
174  n++;
175  }
176  }
177 
178  for (const auto &[key, surfaces] : layers) {
179 
180  std::unique_ptr<Acts::ApproachDescriptor> approachDescriptor = nullptr;
181  std::shared_ptr<const Acts::ProtoSurfaceMaterial> materialProxy = nullptr;
182 
183  // layers and extent are determined, build actual layer
184  Acts::ProtoLayer pl(gctx, surfaces);
187 
188  double layerZ = pl.medium(Acts::BinningValue::binZ, true);
189  double layerHalfZ = 0.5 * pl.range(Acts::BinningValue::binZ);
190 
191  Acts::Transform3 transform(Translation3(0., 0., -layerZ));
192  // set up approach descriptor
193 
194  std::shared_ptr<Acts::CylinderSurface> innerBoundary =
195  Acts::Surface::makeShared<Acts::CylinderSurface>(
196  transform, pl.min(Acts::BinningValue::binR), layerHalfZ);
197 
198  std::shared_ptr<Acts::CylinderSurface> outerBoundary =
199  Acts::Surface::makeShared<Acts::CylinderSurface>(
200  transform, pl.max(Acts::BinningValue::binR), layerHalfZ);
201 
202  std::shared_ptr<Acts::CylinderSurface> centralSurface =
203  Acts::Surface::makeShared<Acts::CylinderSurface>(
205  layerHalfZ);
206 
207  size_t binsPhi = m_cfg.barrelMaterialBins.first;
208  size_t binsZ = m_cfg.barrelMaterialBins.second;
209 
210  Acts::BinUtility materialBinUtil(binsPhi, -M_PI, M_PI, Acts::closed,
212  materialBinUtil += Acts::BinUtility(binsZ, -layerHalfZ, layerHalfZ,
214 
215  materialProxy =
216  std::make_shared<const Acts::ProtoSurfaceMaterial>(materialBinUtil);
217 
218  ACTS_VERBOSE("[L] Layer is marked to carry support material on Surface ( "
219  "inner=0 / center=1 / outer=2 ) : "
220  << "inner");
221  ACTS_VERBOSE("with binning: [" << binsPhi << ", " << binsZ << "]");
222 
223  ACTS_VERBOSE("Created ApproachSurfaces for cylinder layer at:");
224  ACTS_VERBOSE(" - inner: R=" << pl.min(Acts::BinningValue::binR));
225  ACTS_VERBOSE(" - central: R=" << (pl.min(Acts::BinningValue::binR) + pl.max(Acts::BinningValue::binR)) /
226  2.);
227  ACTS_VERBOSE(" - outer: R=" << pl.max(Acts::BinningValue::binR));
228 
229  // set material on inner
230  innerBoundary->assignSurfaceMaterial(materialProxy);
231 
232  std::vector<std::shared_ptr<const Acts::Surface>> aSurfaces;
233  aSurfaces.push_back(std::move(innerBoundary));
234  aSurfaces.push_back(std::move(centralSurface));
235  aSurfaces.push_back(std::move(outerBoundary));
236 
237  approachDescriptor =
238  std::make_unique<Acts::GenericApproachDescriptor>(std::move(aSurfaces));
239 
240  // count the number of relevant modules in each direction
241  auto phiEqual = [this](const Acts::Surface &a,
242  const Acts::Surface &b) {
243  Acts::GeometryContext gctx; // unused in matcher
245  return m_cfg.surfaceMatcher(gctx, bv, &a, &b);
246  };
247 
248  auto zEqual = [this](const Acts::Surface &a,
249  const Acts::Surface &b) {
250  Acts::GeometryContext gctx; // unused in matcher
252  return m_cfg.surfaceMatcher(gctx, bv, &a, &b);
253  };
254 
255  // Work around issue with clang10 --- it doesn't allow
256  // listing surfaces directly in the capture list.
257  auto& xsurfaces = surfaces;
258  auto countKey = [&xsurfaces](auto equal) -> size_t {
259  std::vector<const Acts::Surface *> keySurfaces;
260  for (const auto &surface : xsurfaces) {
261  bool exists = false;
262  for (const auto* existing : keySurfaces) {
263  if (equal(*surface, *existing)) {
264  exists = true;
265  break;
266  }
267  }
268  if (!exists) {
269  keySurfaces.push_back(surface.get());
270  }
271  }
272  return keySurfaces.size();
273  };
274 
275  size_t nModPhi = countKey(phiEqual);
276  size_t nModZ = countKey(zEqual);
277 
278  ACTS_VERBOSE("Found " << nModPhi << " modules in phi " << nModZ
279  << " modules in z");
280 
281  std::shared_ptr<Acts::Layer> layer;
282  if (m_cfg.mode == Mode::ITkStrip) {
283  double f = 1.0;
284  if (key <= 1) {
285  f = 4.0; // four rows per module
286  } else {
287  f = 2.0; // two rows per module
288  }
289  size_t nBinsPhi = nModPhi / f;
290  size_t nBinsZ = nModZ / f;
291  layer = m_cfg.layerCreator->cylinderLayer(gctx, surfaces, nBinsPhi,
292  nBinsZ, pl, transform,
293  std::move(approachDescriptor));
294  } else if (m_cfg.mode == Mode::ITkPixelInner ||
296  double f = 1.0;
297  if (key == 0) {
298  f = 2.0;
299  }
300  size_t nBinsPhi = nModPhi / f;
301  size_t nBinsZ = nModZ / f;
302  layer = m_cfg.layerCreator->cylinderLayer(gctx, surfaces, nBinsPhi,
303  nBinsZ, pl, transform,
304  std::move(approachDescriptor));
305  } else {
306  layer = m_cfg.layerCreator->cylinderLayer(
307  gctx, surfaces, Acts::equidistant, Acts::equidistant, pl, transform,
308  std::move(approachDescriptor));
309  }
310 
311  layersOutput.push_back(layer);
312  }
313 }

◆ buildEndcap()

void ActsLayerBuilder::buildEndcap ( const Acts::GeometryContext &  gctx,
Acts::LayerVector &  layersOutput,
int  type = 0 
) const
private

Definition at line 315 of file ActsLayerBuilder.cxx.

317 {
318 
319  ACTS_VERBOSE("Build layers: " << (type < 0 ? "NEGATIVE" : "POSITIVE")
320  << " ENDCAP");
321  std::vector<std::shared_ptr<const ActsDetectorElement>> elements =
323  std::map<std::tuple<int, int, int>, std::vector<const Acts::Surface *>>
324  initialLayers{};
325 
326  for (const auto &element : elements) {
327 
328  IdentityHelper id = element->identityHelper();
329  if (id.bec() * type <= 0) {
330  continue;
331  }
332 
334  if(id.layer_disk() >= 3) continue;
335  }
337  if(id.layer_disk() <= 2) continue;
338  }
339 
340  m_cfg.elementStore->push_back(element);
341 
342  std::tuple<int, int, int> key{id.bec(), id.layer_disk(), id.eta_module()};
343 
344  initialLayers[key].push_back(&element->surface());
345  }
346 
347  ACTS_VERBOSE("Found " << initialLayers.size() << " "
348  << (type < 0 ? "NEGATIVE" : "POSITIVE")
349  << " ENDCAP inital layers");
350 
351  std::vector<Acts::ProtoLayer> protoLayers;
352  protoLayers.reserve(initialLayers.size());
353 
354  for (const auto &[key, surfaces] : initialLayers) {
355  auto &pl = protoLayers.emplace_back(gctx, surfaces);
358  }
359 
360  // sort proto layers by their medium z position
361  std::sort(protoLayers.begin(), protoLayers.end(),
362  [type](const Acts::ProtoLayer &a, const Acts::ProtoLayer &b) {
363  double midA = (a.min(Acts::BinningValue::binZ) + a.max(Acts::BinningValue::binZ)) / 2.0;
364  double midB = (b.min(Acts::BinningValue::binZ) + b.max(Acts::BinningValue::binZ)) / 2.0;
365  if (type < 0) {
366  return midA < midB;
367  } else {
368  return midA > midB;
369  }
370  });
371 
372  auto plPrintZ = [](const auto &pl) -> std::string {
373  std::stringstream ss;
374  double zMid = (pl.min(Acts::BinningValue::binZ) + pl.max(Acts::BinningValue::binZ)) / 2.0;
375  ss << " < " << pl.min(Acts::BinningValue::binZ) << " | " << zMid << " | "
376  << pl.max(Acts::BinningValue::binZ) << " > ";
377  return ss.str();
378  };
379  if (logger().doPrint(Acts::Logging::VERBOSE)) {
380  for (const auto &pl : protoLayers) {
381 
382  ACTS_VERBOSE(" -> at < zMin | zMid | zMax >: " << plPrintZ(pl));
383 
384  ACTS_VERBOSE(" -> at rMin / rMax: " << pl.min(Acts::BinningValue::binR) << " / "
385  << pl.max(Acts::BinningValue::binR));
386  }
387  }
388 
389  std::vector<Acts::ProtoLayer> mergedProtoLayers;
390 
392  mergedProtoLayers.push_back(protoLayers.front());
393  std::vector<const Acts::Surface *> surfaces;
394  for (size_t i = 1; i < protoLayers.size(); i++) {
395  auto &pl = protoLayers[i];
396  auto &pl_prev = mergedProtoLayers.back();
397  // do they intersect?
398  ACTS_VERBOSE("Compare: " << plPrintZ(pl_prev) << " and " << plPrintZ(pl));
399  bool overlap = (pl.min(Acts::BinningValue::binZ) <= pl_prev.max(Acts::BinningValue::binZ) &&
400  pl.max(Acts::BinningValue::binZ) >= pl_prev.min(Acts::BinningValue::binZ));
401  ACTS_VERBOSE(" -> overlap? " << (overlap ? "yes" : "no"));
402  if (overlap) {
403  ACTS_VERBOSE(" ===> merging");
404  surfaces.clear();
405  surfaces.reserve(pl.surfaces().size() + pl_prev.surfaces().size());
406  surfaces.insert(surfaces.end(), pl.surfaces().begin(),
407  pl.surfaces().end());
408  surfaces.insert(surfaces.end(), pl_prev.surfaces().begin(),
409  pl_prev.surfaces().end());
410  mergedProtoLayers.pop_back();
411  auto &new_pl =
412  mergedProtoLayers.emplace_back(gctx, std::move(surfaces));
413  new_pl.envelope[Acts::BinningValue::binR] = pl.envelope[Acts::BinningValue::binR];
414  new_pl.envelope[Acts::BinningValue::binZ] = pl.envelope[Acts::BinningValue::binZ];
415  } else {
416  mergedProtoLayers.push_back(std::move(pl));
417  }
418  }
419 
420  ACTS_VERBOSE("" << mergedProtoLayers.size() << " "
421  << (type < 0 ? "NEGATIVE" : "POSITIVE")
422  << " ENDCAP layers remain after merging");
423  } else {
424  mergedProtoLayers = protoLayers;
425  }
426 
427  if (m_cfg.objDebugOutput) {
428  for (size_t i = 0; i < mergedProtoLayers.size(); i++) {
429 
430  std::stringstream ss;
431  ss << "obj/" << m_cfg.mode << "_" << (type < 0 ? "neg" : "pos")
432  << "_disk_" << std::setfill('0') << std::setw(2) << i << ".obj";
433 
434  std::ofstream ofs{ss.str()};
435  Acts::ObjVisualization3D vis{};
436  Acts::ViewConfig vc = Acts::s_viewSensitive;
437  vc.quarterSegments = 200;
438  for (const auto &surface : mergedProtoLayers[i].surfaces()) {
439  Acts::GeometryView3D::drawSurface(vis, *surface, gctx,
440  Acts::Transform3::Identity(), vc);
441  }
442 
443  vis.write(ofs);
444  }
445  }
446 
447  std::vector<std::shared_ptr<const Surface>> ownedSurfaces;
448  for (const auto &pl : mergedProtoLayers) {
449 
450  std::unique_ptr<Acts::ApproachDescriptor> approachDescriptor = nullptr;
451  std::shared_ptr<const Acts::ProtoSurfaceMaterial> materialProxy = nullptr;
452 
453  double layerZ = pl.medium(Acts::BinningValue::binZ);
454  double layerHalfZ = 0.5 * pl.range(Acts::BinningValue::binZ);
455  double layerThickness = pl.range(Acts::BinningValue::binZ);
456 
457  double layerZInner = layerZ - layerHalfZ;
458  double layerZOuter = layerZ + layerHalfZ;
459 
460  if (std::abs(layerZInner) > std::abs(layerZOuter))
461  std::swap(layerZInner, layerZOuter);
462 
463  std::vector<std::shared_ptr<const Acts::Surface>> aSurfaces;
464 
465  Acts::Transform3 transformNominal(Translation3(0., 0., layerZ));
466  Acts::Transform3 transformInner(Translation3(0., 0., layerZInner));
467  Acts::Transform3 transformOuter(Translation3(0., 0., layerZOuter));
468 
469  std::shared_ptr<Acts::DiscSurface> innerBoundary =
470  Acts::Surface::makeShared<Acts::DiscSurface>(
471  transformInner, pl.min(Acts::BinningValue::binR), pl.max(Acts::BinningValue::binR));
472  aSurfaces.push_back(innerBoundary);
473 
474  std::shared_ptr<Acts::DiscSurface> nominalSurface =
475  Acts::Surface::makeShared<Acts::DiscSurface>(
476  transformNominal, pl.min(Acts::BinningValue::binR), pl.max(Acts::BinningValue::binR));
477  aSurfaces.push_back(nominalSurface);
478 
479  std::shared_ptr<Acts::DiscSurface> outerBoundary =
480  Acts::Surface::makeShared<Acts::DiscSurface>(
481  transformOuter, pl.min(Acts::BinningValue::binR), pl.max(Acts::BinningValue::binR));
482  aSurfaces.push_back(outerBoundary);
483 
484  if(layerThickness > 2_mm) {
485  ACTS_VERBOSE("Wide disc layer ("<< layerThickness << ") => adding cylinder like approach surfaces");
486  Acts::Transform3 trf{Translation3{0, 0, layerZ}};
487  auto cylinderInner =
488  Acts::Surface::makeShared<Acts::CylinderSurface>(
489  trf, pl.min(Acts::BinningValue::binR), layerHalfZ);
490  aSurfaces.push_back(cylinderInner);
491 
492  auto cylinderOuter =
493  Acts::Surface::makeShared<Acts::CylinderSurface>(
494  trf, pl.max(Acts::BinningValue::binR), layerHalfZ);
495  aSurfaces.push_back(cylinderOuter);
496  }
497 
498 
499  size_t matBinsPhi = m_cfg.endcapMaterialBins.first;
500  size_t matBinsR = m_cfg.endcapMaterialBins.second;
501 
502  Acts::BinUtility materialBinUtil(matBinsPhi, -M_PI, M_PI, Acts::closed,
504  materialBinUtil +=
505  Acts::BinUtility(matBinsR, pl.min(Acts::BinningValue::binR), pl.max(Acts::BinningValue::binR),
506  Acts::open, Acts::BinningValue::binR, transformNominal);
507 
508  materialProxy =
509  std::make_shared<const Acts::ProtoSurfaceMaterial>(materialBinUtil);
510 
511  ACTS_VERBOSE("[L] Layer is marked to carry support material on Surface ( "
512  "inner=0 / center=1 / outer=2 ) : "
513  << "inner");
514  ACTS_VERBOSE("with binning: [" << matBinsPhi << ", " << matBinsR << "]");
515 
516  ACTS_VERBOSE("Created ApproachSurfaces for disc layer at:");
517  ACTS_VERBOSE(" - inner: Z=" << layerZInner);
518  ACTS_VERBOSE(" - central: Z=" << layerZ);
519  ACTS_VERBOSE(" - outer: Z=" << layerZOuter);
520 
521  // set material on inner
522  innerBoundary->assignSurfaceMaterial(materialProxy);
523 
524 
525  // std::set<int> ringIds;
526  bool isITk = m_cfg.mode == Mode::ITkPixelInner ||
529 
530  std::map<int, std::set<int>> phiModuleByRing;
531 
532  // want to figure out bins in phi
533  for (const auto &srf : pl.surfaces()) {
534  auto elm = dynamic_cast<const ActsDetectorElement *>(
535  srf->associatedDetectorElement());
536  if (elm) {
537  auto id = elm->identityHelper();
538  int ring_number;
539  if(m_cfg.mode == Mode::ITkStrip || !isITk) {
540  ring_number = id.eta_module();
541  }
542  else {
543  ring_number = id.layer_disk();
544  }
545  phiModuleByRing[ring_number].insert(id.phi_module());
546  }
547  }
548  size_t nModPhi = std::numeric_limits<size_t>::max();
549  for(const auto& [ring, phiModules] : phiModuleByRing) {
550  nModPhi = std::min(nModPhi, phiModules.size());
551  }
552 
553  size_t nModR = phiModuleByRing.size();
554 
555  ACTS_VERBOSE("Identifier reports: " << nModPhi << " is lowest for " << nModR
556  << " r-rings");
557 
558  size_t nBinsPhi = nModPhi;
559  size_t nBinsR = nModR;
560 
561  if(!isITk) {
562  // In the ID, the modules in the innermost r-rings are exactly shifted by
563  // one half module width since it's the same number of modules, this gives
564  // binning trouble. Reduce bins by half: about 2 module pairs should be in
565  // each bin. This should be fine.
566  // @TODO: evaluate
567  nBinsPhi /= 2.0;
568  }
569  if(m_cfg.mode == Mode::ITkStrip) {
570  // up to four rows per module
571  nBinsR /= 4.0;
572  }
573 
574  ACTS_VERBOSE("Creating r x phi binned layer with " << nBinsR << " x "
575  << nBinsPhi << " bins");
576 
577 
578  approachDescriptor =
579  std::make_unique<Acts::GenericApproachDescriptor>(aSurfaces);
580 
581  // get ownership of pl surfaces
582  ownedSurfaces.clear();
583  ownedSurfaces.reserve(pl.surfaces().size());
584  std::transform(pl.surfaces().begin(), pl.surfaces().end(),
585  std::back_inserter(ownedSurfaces),
586  [](const auto &s) { return s->getSharedPtr(); });
587 
588  auto layer = m_cfg.layerCreator->discLayer(gctx, ownedSurfaces, nBinsR,
589  nBinsPhi, pl, transformNominal,
590  std::move(approachDescriptor));
591 
592  layersOutput.push_back(layer);
593  }
594 }

◆ centralLayers()

const Acts::LayerVector ActsLayerBuilder::centralLayers ( const Acts::GeometryContext &  gctx) const
override

Definition at line 59 of file ActsLayerBuilder.cxx.

59  {
60  ACTS_VERBOSE("Building central layers");
61  Acts::LayerVector cVector;
62  buildBarrel(gctx, cVector);
63  return cVector;
64 }

◆ getConfiguration()

ActsLayerBuilder::Config ActsLayerBuilder::getConfiguration ( ) const
inline

get the configuration object

Definition at line 123 of file ActsLayerBuilder.h.

124  {
125  return m_cfg;
126  }

◆ getDetectorElements()

std::vector< std::shared_ptr< const ActsDetectorElement > > ActsLayerBuilder::getDetectorElements ( ) const
private

Definition at line 75 of file ActsLayerBuilder.cxx.

75  {
76  ACTS_VERBOSE("Retrieving detector elements from detector manager");
77  if (m_cfg.mng == nullptr) {
78  ACTS_ERROR("Manager is null");
79  throw std::runtime_error{"Detector manager is null"};
80  }
81  auto siDetMng = static_cast<const InDetDD::SiDetectorManager *>(m_cfg.mng);
82  ACTS_VERBOSE("Detector manager has "
83  << std::distance(siDetMng->getDetectorElementBegin(),
84  siDetMng->getDetectorElementEnd())
85  << " elements");
86 
87  std::vector<std::shared_ptr<const ActsDetectorElement>> elements;
88 
89  InDetDD::SiDetectorElementCollection::const_iterator iter;
90  for (iter = siDetMng->getDetectorElementBegin();
91  iter != siDetMng->getDetectorElementEnd(); ++iter) {
92  const InDetDD::SiDetectorElement *siDetElement =
93  dynamic_cast<InDetDD::SiDetectorElement *>(*iter);
94  if (siDetElement == nullptr) {
95  ACTS_ERROR("Detector element was nullptr");
96  throw std::runtime_error{"Corrupt detector element collection"};
97  }
98  elements.push_back(
99  std::make_shared<const ActsDetectorElement>(*siDetElement));
100  }
101  ACTS_VERBOSE("Retrieved " << elements.size() << " elements");
102 
103  return elements;
104 }

◆ identification()

virtual const std::string& ActsLayerBuilder::identification ( ) const
inlineoverridevirtual

Definition at line 130 of file ActsLayerBuilder.h.

131  {
132  return m_cfg.configurationName;
133  }

◆ logger()

const Acts::Logger& ActsLayerBuilder::logger ( ) const
inlineprivate

Private access to the logger.

Definition at line 145 of file ActsLayerBuilder.h.

146  {
147  return *m_logger;
148  }

◆ negativeLayers()

const Acts::LayerVector ActsLayerBuilder::negativeLayers ( const Acts::GeometryContext &  gctx) const
override

Definition at line 51 of file ActsLayerBuilder.cxx.

51  {
52  ACTS_VERBOSE("Building negative layers");
53  Acts::LayerVector nVector;
54  buildEndcap(gctx, nVector, -1);
55  return nVector;
56 }

◆ positiveLayers()

const Acts::LayerVector ActsLayerBuilder::positiveLayers ( const Acts::GeometryContext &  gctx) const
override

Definition at line 67 of file ActsLayerBuilder.cxx.

67  {
68  ACTS_VERBOSE("Building positive layers");
69  Acts::LayerVector pVector;
70  buildEndcap(gctx, pVector, 1);
71  return pVector;
72 }

◆ setConfiguration()

void ActsLayerBuilder::setConfiguration ( const Config cfg)

Name identification.

set the configuration object

Parameters
cfgis the configuration struct

◆ setLogger()

void ActsLayerBuilder::setLogger ( std::unique_ptr< const Acts::Logger >  logger)

set logging instance

Member Data Documentation

◆ m_cfg

Config ActsLayerBuilder::m_cfg
private

configuration object

Definition at line 141 of file ActsLayerBuilder.h.

◆ m_logger

std::unique_ptr<const Acts::Logger> ActsLayerBuilder::m_logger
private

logging instance

Definition at line 154 of file ActsLayerBuilder.h.


The documentation for this class was generated from the following files:
ActsLayerBuilder::Mode::Undefined
@ Undefined
ActsLayerBuilder::buildEndcap
void buildEndcap(const Acts::GeometryContext &gctx, Acts::LayerVector &layersOutput, int type=0) const
Definition: ActsLayerBuilder.cxx:315
ActsLayerBuilder::Config::surfaceMatcher
std::function< bool(const Acts::GeometryContext &, Acts::BinningValue, const Acts::Surface *, const Acts::Surface *)> surfaceMatcher
Definition: ActsLayerBuilder.h:82
Undefined
@ Undefined
Definition: MaterialTypes.h:8
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
ActsLayerBuilder::logger
const Acts::Logger & logger() const
Private access to the logger.
Definition: ActsLayerBuilder.h:145
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
ActsLayerBuilder::Mode::ITkPixelOuter
@ ITkPixelOuter
Trk::equidistant
@ equidistant
Definition: BinningType.h:32
ActsLayerBuilder::Config::objDebugOutput
bool objDebugOutput
Definition: ActsLayerBuilder.h:86
ActsLayerBuilder::Mode::ITkPixelInner
@ ITkPixelInner
ActsLayerBuilder::Config::mode
Mode mode
Definition: ActsLayerBuilder.h:53
ParticleGun_SamplingFraction.bec
int bec
Definition: ParticleGun_SamplingFraction.py:89
Pixel
Definition: PixelFEUtils.h:16
Trk::binZ
@ binZ
Definition: BinningType.h:49
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
min
constexpr double min()
Definition: ap_fixedTest.cxx:26
module_driven_slicing.layers
layers
Definition: module_driven_slicing.py:114
M_PI
#define M_PI
Definition: ActiveFraction.h:11
ChangeHistoRange.binsZ
list binsZ
Definition: ChangeHistoRange.py:63
Trk::closed
@ closed
Definition: BinningType.h:41
ActsLayerBuilder::buildBarrel
void buildBarrel(const Acts::GeometryContext &gctx, Acts::LayerVector &layersOutput) const
Definition: ActsLayerBuilder.cxx:106
ActsLayerBuilder::Config::endcapEnvelopeR
std::array< double, 2 > endcapEnvelopeR
Definition: ActsLayerBuilder.h:67
ActsLayerBuilder::getDetectorElements
std::vector< std::shared_ptr< const ActsDetectorElement > > getDetectorElements() const
Definition: ActsLayerBuilder.cxx:75
ActsLayerBuilder::Config::barrelEnvelopeR
std::array< double, 2 > barrelEnvelopeR
Definition: ActsLayerBuilder.h:72
CxxUtils::fpcompare::equal
bool equal(double a, double b)
Compare two FP numbers, working around x87 precision issues.
Definition: fpcompare.h:114
ActsLayerBuilder::m_cfg
Config m_cfg
configuration object
Definition: ActsLayerBuilder.h:141
ActsLayerBuilder::m_logger
std::unique_ptr< const Acts::Logger > m_logger
logging instance
Definition: ActsLayerBuilder.h:154
ActsLayerBuilder::Mode::ITkStrip
@ ITkStrip
Trk::BinningValue
BinningValue
how to take the global / local position
Definition: BinningType.h:46
TRT
Definition: HitInfo.h:33
ActsLayerBuilder::Config::configurationName
std::string configurationName
string based identification
Definition: ActsLayerBuilder.h:52
ActsLayerBuilder::Config::barrelEnvelopeZ
std::array< double, 2 > barrelEnvelopeZ
Definition: ActsLayerBuilder.h:74
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
ActsLayerBuilder::Config::doEndcapLayerMerging
bool doEndcapLayerMerging
Definition: ActsLayerBuilder.h:84
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
ActsLayerBuilder::Config::barrelMaterialBins
std::pair< size_t, size_t > barrelMaterialBins
Definition: ActsLayerBuilder.h:78
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
hist_file_dump.f
f
Definition: hist_file_dump.py:135
ActsDetectorElement
Definition: ActsDetectorElement.h:42
ActsDetectorElement::identityHelper
IdentityHelper identityHelper() const
Definition: ActsDetectorElement.cxx:229
WriteCalibToCool.swap
swap
Definition: WriteCalibToCool.py:94
SCT
Definition: SCT_ChipUtils.h:14
ActsLayerBuilder::Config::endcapEnvelopeZ
std::array< double, 2 > endcapEnvelopeZ
Definition: ActsLayerBuilder.h:69
ActsLayerBuilder::Config::endcapMaterialBins
std::pair< size_t, size_t > endcapMaterialBins
Definition: ActsLayerBuilder.h:77
IdentityHelper::eta_module
int eta_module() const
Definition: IdentityHelper.cxx:73
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
Trk::open
@ open
Definition: BinningType.h:40
Trk::binR
@ binR
Definition: BinningType.h:50
a
TList * a
Definition: liststreamerinfos.cxx:10
ActsLayerBuilder::Config::layerCreator
std::shared_ptr< const Acts::LayerCreator > layerCreator
Definition: ActsLayerBuilder.h:55
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
InDetDD::SiDetectorManager
Definition: SiDetectorManager.h:60
ActsLayerBuilder::Config::mng
const InDetDD::SiDetectorManager * mng
Definition: ActsLayerBuilder.h:54
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
python.dummyaccess.exists
def exists(filename)
Definition: dummyaccess.py:9
CaloLCW_tf.trf
trf
Definition: CaloLCW_tf.py:20
IdentityHelper
Definition: IdentityHelper.h:14
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
ActsLayerBuilder::Config::elementStore
std::shared_ptr< ElementVector > elementStore
Definition: ActsLayerBuilder.h:65
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37
Trk::binPhi
@ binPhi
Definition: BinningType.h:51