ATLAS Offline Software
HGTD_LayerBuilderCond.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // HGTD_LayerBuilderCond.h, (c) ATLAS Detector software
8 
9 #ifndef HGTD_TRACKINGGEOMETRY_HGTDLAYERBUILDERCOND_H
10 #define HGTD_TRACKINGGEOMETRY_HGTDLAYERBUILDERCOND_H
11 
12 // Athena
15 
16 // Amg
18 // Trk
22 // STL
23 #include <memory>
24 #include <vector>
25 //
27 
28 class HGTD_ID;
30 
31 namespace Trk {
32  class Surface;
33  class CylinderLayer;
34  class DiscLayer;
35  class PlaneLayer;
36  class BinnedLayerMaterial;
37  typedef std::pair< std::shared_ptr<Surface>, Amg::Vector3D > SurfaceOrderPosition;
38 }
39 
48 //This class in not thread safe although the checker does nor readily see this.
49 //The issue is that the input is still modifiable. For details see discussion in
50 //https://gitlab.cern.ch/atlas/athena/-/merge_requests/79401#note_9399034
51 class ATLAS_NOT_THREAD_SAFE HGTD_LayerBuilderCond : public extends<AthAlgTool, Trk::ILayerBuilderCond> {
52 
53  public:
54 
56  HGTD_LayerBuilderCond(const std::string&,const std::string&,const IInterface*);
57 
60 
62  virtual StatusCode initialize() override;
63 
65  virtual std::unique_ptr<const std::vector<Trk::CylinderLayer*> >
66  cylindricalLayers(const EventContext& ctx,
67  SG::WriteCondHandle<Trk::TrackingGeometry>& whandle) const override final;
68 
70  virtual std::unique_ptr<const std::vector<Trk::DiscLayer*> >
71  discLayers(const EventContext& ctx,
72  SG::WriteCondHandle<Trk::TrackingGeometry>& whandle) const override final;
73 
75  virtual std::unique_ptr<const std::vector<Trk::PlaneLayer*> >
76  planarLayers(const EventContext& ctx,
77  SG::WriteCondHandle<Trk::TrackingGeometry>& whandle) const override final;
78 
80  virtual const std::string& identification() const override final;
81 
82  private:
83  SG::ReadCondHandle<InDetDD::HGTD_DetectorElementCollection> retrieveHGTDdetElements(const EventContext& ctx) const;
85  const Trk::BinnedLayerMaterial discLayerMaterial(double rMin, double rMax) const;
86 
88  void registerSurfacesToLayer( std::span<Trk::Surface * const>& surfaces,const Trk::Layer& layer) const;
89 
90  static void evaluateBestBinning(std::vector<Trk::SurfaceOrderPosition>& surfaces,
91  std::vector<float>& rBins,
92  float& maxRadius,
93  std::vector<std::vector<float>>& phiBins) ;
94 
96  const HGTD_ID* m_hgtdHelper;
97 
98  bool m_setLayerAssociation;
99 
100  std::string m_identification;
101 
102  int m_rBins;
103  int m_phiBins;
104 
105  float m_discEnvelopeR;
106  float m_discThickness;
107 
108  bool m_runGeometryValidation;
109 
110  SG::ReadCondHandleKey<InDetDD::HGTD_DetectorElementCollection>
111  m_HGTD_ReadKey{
112  this,
113  "HGTD_ReadKey",
114  "HGTD_DetectorElementCollection",
115  "Key of output HGTD_DetectorElementCollection for HGTD"
116  };
117 };
118 
119 inline std::unique_ptr<const std::vector<Trk::CylinderLayer*> >
122 {
123  return nullptr;
124 }
125 
126 inline std::unique_ptr<const std::vector<Trk::PlaneLayer*> >
129 {
130  return nullptr;
131 }
132 
133 inline const std::string& HGTD_LayerBuilderCond::identification() const
134 { return m_identification; }
135 
136 #endif // HGTD_TRACKINGGEOMETRY_HGTDLAYERBUILDERCOND_H
CxxUtils::span
span(T *ptr, std::size_t sz) -> span< T >
A couple needed deduction guides.
HGTD_LayerBuilderCond
Definition: HGTD_LayerBuilderCond.h:51
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
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
BinnedArray.h
initialize
void initialize()
Definition: run_EoverP.cxx:894
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
HGTD_LayerBuilderCond::cylindricalLayers
virtual std::unique_ptr< const std::vector< Trk::CylinderLayer * > > cylindricalLayers(const EventContext &ctx, SG::WriteCondHandle< Trk::TrackingGeometry > &whandle) const override final
LayerBuilder interface method - returning Barrel-like layers.
Definition: HGTD_LayerBuilderCond.h:120
python.RingerConstants.Layer
Layer
Definition: RingerConstants.py:42
GeoPrimitives.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
vector
Definition: MultiHisto.h:13
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
AthAlgTool.h
Trk::SurfaceOrderPosition
std::pair< std::shared_ptr< Surface >, Amg::Vector3D > SurfaceOrderPosition
Definition: HGTD_LayerBuilderCond.h:36
HGTD_ID
Definition: HGTD_ID.h:47
columnar::final
CM final
Definition: ColumnAccessor.h:106
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
HGTD_DetectorElementCollection.h
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
HGTD_LayerBuilderCond::~HGTD_LayerBuilderCond
virtual ~HGTD_LayerBuilderCond()
Destructor.
HGTD_LayerBuilderCond::identification
virtual const std::string & identification() const override final
Name identification.
Definition: HGTD_LayerBuilderCond.h:133
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
HGTD_LayerBuilderCond::m_identification
std::string m_identification
string identification
Definition: HGTD_LayerBuilderCond.h:100
HGTD_DetectorManager
Definition: HGTD_DetectorManager.h:33
private
#define private
Definition: xAODTruthCnvAlg.h:20
TrackingGeometry.h
HGTD_LayerBuilderCond::planarLayers
virtual std::unique_ptr< const std::vector< Trk::PlaneLayer * > > planarLayers(const EventContext &ctx, SG::WriteCondHandle< Trk::TrackingGeometry > &whandle) const override final
LayerBuilder interface method - returning Planar-like layers.
Definition: HGTD_LayerBuilderCond.h:127
checker_macros.h
Define macros for attributes used to control the static checker.
InDetDD::HGTD_DetectorElementCollection
DataVector< HGTD_DetectorElement > HGTD_DetectorElementCollection
Definition: HGTD_DetectorElementCollection.h:20
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
ILayerBuilderCond.h