ATLAS Offline Software
ActsLayerBuilder.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ACTSGEOMETRY_ACTSLAYERBUILDER_H
6 #define ACTSGEOMETRY_ACTSLAYERBUILDER_H
7 
8 // PACKAGE
11 
12 // ATHENA
14 
15 // ACTS
16 #include "Acts/Geometry/ILayerBuilder.hpp"
17 #include "Acts/Utilities/Logger.hpp"
18 #include "Acts/Utilities/BinningType.hpp"
19 #include "Acts/Geometry/GeometryContext.hpp"
20 #include "Acts/Definitions/Units.hpp"
21 
22 #include <mutex>
23 #include <array>
24 
25 class ActsTrackingGeomtrySvc;
26 
27 namespace InDetDD {
28  class SiDetectorManager;
29 }
30 
31 namespace Acts {
32 class Surface;
33 class LayerCreator;
34 }
35 
37 class ActsLayerBuilder : public Acts::ILayerBuilder
38 {
39 public:
40  enum class Mode {
42  };
43 
45 
48 
49  struct Config
50  {
52  std::string configurationName = "undefined";
55  std::shared_ptr<const Acts::LayerCreator> layerCreator = nullptr;
65  std::shared_ptr<ElementVector> elementStore;
66 
67  std::array<double, 2> endcapEnvelopeR = {2 * Acts::UnitConstants::mm,
69  std::array<double, 2> endcapEnvelopeZ = {2 * Acts::UnitConstants::mm,
71 
72  std::array<double, 2> barrelEnvelopeR = {2 * Acts::UnitConstants::mm,
74  std::array<double, 2> barrelEnvelopeZ = {2 * Acts::UnitConstants::mm,
76 
77  std::pair<size_t, size_t> endcapMaterialBins = {20, 5};
78  std::pair<size_t, size_t> barrelMaterialBins = {10, 10};
79 
80  std::function<bool(const Acts::GeometryContext &, Acts::BinningValue,
81  const Acts::Surface *, const Acts::Surface *)>
83 
84  bool doEndcapLayerMerging = true;
85 
86  bool objDebugOutput = false;
87  };
88 
93  std::unique_ptr<const Acts::Logger> logger
94  = Acts::getDefaultLogger("GMLayBldr", Acts::Logging::INFO));
95 
98 
99  const Acts::LayerVector
100  negativeLayers(const Acts::GeometryContext& gctx) const override;
101 
102  const Acts::LayerVector
103  centralLayers(const Acts::GeometryContext& gctx) const override;
104 
105  const Acts::LayerVector
106  positiveLayers(const Acts::GeometryContext& gctx) const override;
107 
108 
110  // const std::string&
111  // identification() const final;
112 
115  void
117 
119  // Config
120  // getConfiguration() const;
121 
124  {
125  return m_cfg;
126  }
127 
128  virtual
129  const std::string&
130  identification() const override
131  {
132  return m_cfg.configurationName;
133  }
134 
136  void
137  setLogger(std::unique_ptr<const Acts::Logger> logger);
138 
139 private:
142 
144  const Acts::Logger&
145  logger() const
146  {
147  return *m_logger;
148  }
149 
150  std::vector<std::shared_ptr<const ActsDetectorElement>>
151  getDetectorElements() const;
152 
154  std::unique_ptr<const Acts::Logger> m_logger;
155 
157  //std::vector<std::shared_ptr<const ActsDetectorElement>> m_elementStore;
158 
159 
160  // Private helper method : build layers
161  // @param layers is goint to be filled
162  // @param type is the indication which ones to build -1 | 0 | 1
163  void
164  buildBarrel(const Acts::GeometryContext& gctx, Acts::LayerVector& layersOutput) const;
165 
166  void
167  buildEndcap(const Acts::GeometryContext& gctx, Acts::LayerVector& layersOutput, int type = 0) const;
168 
169 };
170 
171 std::ostream& operator<<(std::ostream& os, const ActsLayerBuilder::Mode& mode);
172 
173 #endif
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
ActsLayerBuilder::identification
virtual const std::string & identification() const override
Definition: ActsLayerBuilder.h:130
ActsLayerBuilder::logger
const Acts::Logger & logger() const
Private access to the logger.
Definition: ActsLayerBuilder.h:145
ActsLayerBuilder::centralLayers
const Acts::LayerVector centralLayers(const Acts::GeometryContext &gctx) const override
Definition: ActsLayerBuilder.cxx:59
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
ActsLayerBuilder::~ActsLayerBuilder
~ActsLayerBuilder()
Destructor.
Definition: ActsLayerBuilder.h:97
ActsLayerBuilder::Config::bTypeR
Acts::BinningType bTypeR
the binning type of the contained surfaces in r (equidistant/arbitrary)
Definition: ActsLayerBuilder.h:61
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
ActsLayerBuilder::negativeLayers
const Acts::LayerVector negativeLayers(const Acts::GeometryContext &gctx) const override
Definition: ActsLayerBuilder.cxx:51
ActsLayerBuilder::buildBarrel
void buildBarrel(const Acts::GeometryContext &gctx, Acts::LayerVector &layersOutput) const
Definition: ActsLayerBuilder.cxx:106
Trk::BinningType
BinningType
Definition: BinningType.h:31
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
Definition: ActsLayerBuilder.h:50
ActsLayerBuilder::positiveLayers
const Acts::LayerVector positiveLayers(const Acts::GeometryContext &gctx) const override
Definition: ActsLayerBuilder.cxx:67
ActsLayerBuilder::Mode::Pixel
@ Pixel
ActsLayerBuilder::Config::barrelEnvelopeR
std::array< double, 2 > barrelEnvelopeR
Definition: ActsLayerBuilder.h:72
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
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
Acts
Definition: ChamberAssembleTool.h:18
ActsLayerBuilder::Config::doEndcapLayerMerging
bool doEndcapLayerMerging
Definition: ActsLayerBuilder.h:84
ActsLayerBuilder::Config::barrelMaterialBins
std::pair< size_t, size_t > barrelMaterialBins
Definition: ActsLayerBuilder.h:78
ActsLayerBuilder::Config::bTypeZ
Acts::BinningType bTypeZ
the binning type of the contained surfaces in z (equidistant/arbitrary)
Definition: ActsLayerBuilder.h:64
Preparation.mode
mode
Definition: Preparation.py:94
ActsLayerBuilder
Definition: ActsLayerBuilder.h:38
ActsLayerBuilder::getConfiguration
ActsLayerBuilder::Config getConfiguration() const
get the configuration object
Definition: ActsLayerBuilder.h:123
ActsDetectorElement.h
ActsLayerBuilder::setConfiguration
void setConfiguration(const Config &cfg)
Name identification.
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
ActsLayerBuilder::Config::bTypePhi
Acts::BinningType bTypePhi
the binning type of the contained surfaces in phi (equidistant/arbitrary)
Definition: ActsLayerBuilder.h:58
operator<<
std::ostream & operator<<(std::ostream &os, const ActsLayerBuilder::Mode &mode)
Definition: ActsLayerBuilder.cxx:596
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
ActsElementVector
Helper to hold elements for deletion.
Definition: ActsElementVector.h:30
WriteCaloSwCorrections.cfg
cfg
Definition: WriteCaloSwCorrections.py:23
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
ActsLayerBuilder::Mode
Mode
Definition: ActsLayerBuilder.h:40
ActsLayerBuilder::Mode::TRT
@ TRT
ActsLayerBuilder::Config::layerCreator
std::shared_ptr< const Acts::LayerCreator > layerCreator
Definition: ActsLayerBuilder.h:55
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:16
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
InDetDD::SiDetectorManager
Definition: SiDetectorManager.h:60
ActsLayerBuilder::setLogger
void setLogger(std::unique_ptr< const Acts::Logger > logger)
set logging instance
ActsLayerBuilder::Config::mng
const InDetDD::SiDetectorManager * mng
Definition: ActsLayerBuilder.h:54
ActsLayerBuilder::ActsLayerBuilder
ActsLayerBuilder(const Config &cfg, std::unique_ptr< const Acts::Logger > logger=Acts::getDefaultLogger("GMLayBldr", Acts::Logging::INFO))
Constructor.
Definition: ActsLayerBuilder.cxx:40
checker_macros.h
Define macros for attributes used to control the static checker.
ActsElementVector.h
Helper to hold elements for deletion.
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
ActsLayerBuilder::Config::elementStore
std::shared_ptr< ElementVector > elementStore
Definition: ActsLayerBuilder.h:65
ActsLayerBuilder::Mode::SCT
@ SCT