ATLAS Offline Software
RobustTrackingGeometryBuilderImpl.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INDETTRACKINGGEOMETRY_ROBUSTTRACKINGGEOMETRYBUILDERIMPL_H
6 #define INDETTRACKINGGEOMETRY_ROBUSTTRACKINGGEOMETRYBUILDERIMPL_H
7 
8 // Trk
14 // EnvelopeDefinitionService
16 // Athena
20 // Gaudi
21 #include "GaudiKernel/ServiceHandle.h"
22 #include "GaudiKernel/SystemOfUnits.h"
23 #include "GaudiKernel/ToolHandle.h"
27 #include "TrkGeometry/DiscLayer.h"
28 #include "TrkGeometry/Layer.h"
29 #include "TrkGeometry/Material.h"
32 #include "TrkSurfaces/DiscBounds.h"
35 // STL
36 #include <string>
37 #include <vector>
38 
40 
41 #ifndef TRKDETDESCR_TAKESMALLERBIGGER
42 #define TRKDETDESCR_TAKESMALLERBIGGER
43 #define takeSmaller(current, test) current = current < test ? current : test
44 #define takeBigger(current, test) current = current > test ? current : test
45 #define takeSmallerBigger(cSmallest, cBiggest, test) \
46  takeSamller(cSmallest, cBiggest, test); \
47  takeBigger(cSmallest, cBiggest, test)
48 #endif
49 
50 namespace InDet {
51 
66  RobustTrackingGeometryBuilderImpl // not safe indexStaticLayers
67  : public AthAlgTool,
69 
70  public:
72  RobustTrackingGeometryBuilderImpl(const std::string&, const std::string&,
73  const IInterface*);
74 
77 
79  virtual StatusCode initialize() override;
80 
81  protected:
82  enum ToolType {
83  Cond = 0,
84  Svc = 1,
85  };
86  template <ToolType type, typename LayerBuilders, typename PipeBuilder>
87  std::unique_ptr<Trk::TrackingGeometry> trackingGeometryImpl(
88  const LayerBuilders& layerHandles, const PipeBuilder& pipeHandle,
89  const EventContext* ctx = nullptr,
90  SG::WriteCondHandle<Trk::TrackingGeometry>* whandle = nullptr) const;
91 
94  Trk::TrackingVolume* packVolumeTriple(
95  const std::vector<Trk::Layer*>& negLayers,
96  const std::vector<Trk::Layer*>& centralLayers,
97  const std::vector<Trk::Layer*>& posLayers, double rMin, double rMax,
98  double zMin, double zPosCentral,
99  const std::string& baseName = "UndefinedVolume", int colorCode = 21,
100  Trk::BinningType bintype = Trk::arbitrary) const;
101 
104  Trk::TrackingVolume* packVolumeTriple(
105  const std::vector<Trk::TrackingVolume*>& negVolumes,
106  const std::vector<Trk::TrackingVolume*>& centralVolumes,
107  const std::vector<Trk::TrackingVolume*>& posVolumes,
108  const std::string& baseName = "UndefinedVolume") const;
109 
110  // material configuration
113 
114  // Configurable Properties
115  // helper tools for the geometry building
116  PublicToolHandle<Trk::ITrackingVolumeCreator> m_trackingVolumeCreator{
117  this, "TrackingVolumeCreator",
118  "Trk::CylinderVolumeCreator/"
119  "CylinderVolumeCreator"};
120  PublicToolHandle<Trk::ILayerArrayCreator> m_layerArrayCreator{
123  this, "LayerArrayCreator",
124  "Trk::LayerArrayCreator/LayerArrayCreator"};
125 
127  // configurations for the layer builders
128  IntegerArrayProperty m_layerBinningType{
129  this, "LayerBinningType", {}};
130  IntegerArrayProperty m_colorCodesConfig{
131  this, "ColorCodes", {}};
132 
133  // enclosing endcap/cylinder layer
134  ServiceHandle<IEnvelopeDefSvc> m_enclosingEnvelopeSvc{
135  this, "EnvelopeDefinitionSvc",
136  "AtlasEnvelopeDefSvc"};
137  DoubleArrayProperty m_enclosingCylinderRadius{
139  this,
140  "VolumeEnclosureCylinderRadii",
141  {}};
142  DoubleArrayProperty m_enclosingDiscPositionZ{
143  this,
144  "VolumeEnclosureDiscPositions",
145  {}};
146 
147  DoubleProperty m_layerEnvelopeCover{
148  this, "EnvelopeCover", 2 * Gaudi::Units::mm};
149  BooleanProperty m_buildBoundaryLayers{this, "BuildBoundaryLayers",
150  true};
151  BooleanProperty m_replaceJointBoundaries{
152  this, "ReplaceAllJointBoundaries",
153  true};
154 
155  // outer envelope
156  DoubleProperty m_outwardsFraction{
157  this, "OutwardsFraction",
158  0.75};
159  // robust layer indexing
161  BooleanProperty m_indexStaticLayers{
162  this, "IndexStaticLayers", true};
163  // naming schema
164  StringProperty m_namespace{this, "VolumeNamespace",
165  "InDet::"};
166  // ID container
167  StringProperty m_exitVolume{
168  this, "ExitVolumeName",
169  "InDet::Containers::InnerDetector"};
170  BooleanProperty m_isITk{
171  this, "isITk",
172  false};
173 };
174 
175 } // namespace InDet
177 #endif // INDETTRACKINGGEOMETRY_ROBUSTTRACKINGGEOMETRYBUILDERIMPL_H
Trk::TrackingVolumeManipulator
Definition: TrackingVolumeManipulator.h:32
InDet::RobustTrackingGeometryBuilderImpl::~RobustTrackingGeometryBuilderImpl
virtual ~RobustTrackingGeometryBuilderImpl()=default
Destructor.
InDet::RobustTrackingGeometryBuilderImpl
Definition: RobustTrackingGeometryBuilderImpl.h:68
DiscBounds.h
IEnvelopeDefSvc.h
ATLAS_NOT_THREAD_SAFE
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Definition: checker_macros.h:212
RobustTrackingGeometryBuilderImpl.icc
InDet::RobustTrackingGeometryBuilderImpl::m_materialProperties
CxxUtils::CachedUniquePtrT< Trk::Material > m_materialProperties
overal material properties of the ID
Definition: RobustTrackingGeometryBuilderImpl.h:112
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
BinnedArray.h
initialize
void initialize()
Definition: run_EoverP.cxx:894
CxxUtils::CachedUniquePtrT< Trk::Material >
DiscLayer.h
BinningType.h
VolumeBounds.h
Layer.h
Trk::BinningType
BinningType
Definition: BinningType.h:31
ILayerArrayCreator.h
InDet::RobustTrackingGeometryBuilderImpl::trackingGeometryImpl
std::unique_ptr< Trk::TrackingGeometry > trackingGeometryImpl(const LayerBuilders &layerHandles, const PipeBuilder &pipeHandle, const EventContext *ctx=nullptr, SG::WriteCondHandle< Trk::TrackingGeometry > *whandle=nullptr) const
Trk::arbitrary
@ arbitrary
Definition: BinningType.h:34
CylinderVolumeBounds.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
ITrackingVolumeCreator.h
CachedUniquePtr.h
Cached unique_ptr with atomic update.
CylinderLayer.h
InDet::RobustTrackingGeometryBuilderImpl::ToolType
ToolType
Definition: RobustTrackingGeometryBuilderImpl.h:82
TrackingVolumeManipulator.h
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
TrackingVolume.h
TrackingGeometry.h
AthAlgTool
Definition: AthAlgTool.h:26
checker_macros.h
Define macros for attributes used to control the static checker.
Trk::TrackingVolume
Definition: TrackingVolume.h:121
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
Material.h
ServiceHandle< IEnvelopeDefSvc >