ATLAS Offline Software
Loading...
Searching...
No Matches
TRT_BaseElement.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
8
9#ifndef TRT_READOUTGEOMETRY_TRT_BASEELEMENT_H
10#define TRT_READOUTGEOMETRY_TRT_BASEELEMENT_H
11
12//include the Amg packages they include the Eigen plug-ins
15
16#include "TrkSurfaces/Surface.h"
18
22#include "Identifier/Identifier.h"
23
24#include "CLHEP/Geometry/Transform3D.h"
25#include "CLHEP/Geometry/Point3D.h"
26
29#include <vector>
30
31class TRT_ID;
33
34namespace InDetDD {
35
36 class SurfaceCacheBase;
37 class SurfaceCache;
38 class TRT_Conditions;
39
51
53
54 public:
55
57
59 TRT_BaseElement(const GeoVFullPhysVol* volume,
60 const Identifier& id,
61 const TRT_ID* idHelper,
63
64 TRT_BaseElement(const TRT_BaseElement& right);
65
67 virtual ~TRT_BaseElement() = default;
68
70 virtual TRT_BaseElement::Type type() const = 0;
71
73 virtual Identifier identify() const override final;
74
76 virtual IdentifierHash identifyHash() const override final;
77
78 // --- GeoModel transformation forwards ----------------------------------------------------- //
79
82
85
86 // ---- Surface & Tracking information cache ------------------------------------------------ //
87 // (a) Element Surface section - accesses the m_surfaceCache store
88
90 virtual const Trk::Surface& surface () const override final;
91
93 virtual const Trk::SurfaceBounds& bounds() const override final;
94
96 virtual const Amg::Transform3D& transform() const override final;
97
99 virtual const Amg::Vector3D& center() const override final;
100
102 virtual const Amg::Vector3D& normal() const override final;
103
105 virtual Trk::DetectorElemType detectorType() const override final;
106
107 // (b) Straw Surface section - accesses the vector<SurfaceCache> m_strawSurfacesCache store
108
110 virtual const Trk::Surface& surface (const Identifier& id) const override final;
111
114
116 virtual const Trk::SurfaceBounds& bounds(const Identifier& id) const override final;
117
119 virtual const Amg::Transform3D& transform(const Identifier& id) const override final;
120
123 const Amg::Transform3D& strawTransform(unsigned int straw) const;
124
133
134 virtual const Amg::Vector3D& center(const Identifier& id) const override final;
135
137 virtual const Amg::Vector3D& normal(const Identifier& id) const override final;
138
140 const Trk::StraightLineSurface& strawSurface(int straw) const;
141
144
146 const Amg::Vector3D& strawCenter(int straw) const;
147
152 Amg::Vector3D strawAxis(int straw) const;
153
155 unsigned int nStraws() const;
156
158 virtual const double& strawLength() const = 0;
159
161 virtual int strawDirection() const = 0;
162
164 void invalidate();
165
167 void updateAllCaches(GeoAlignmentStore* alignStore=nullptr) const;
168
171
173 virtual HepGeom::Transform3D calculateStrawTransform(int straw, GeoAlignmentStore* alignStore=nullptr) const = 0;
174
176 virtual const Trk::SurfaceBounds& strawBounds() const = 0;
177
180
182 virtual void createSurfaceCache(GeoAlignmentStore* alignStore=nullptr) const = 0;
183
185 void createSurfaceCache(Identifier id, GeoAlignmentStore* alignStore=nullptr) const;
186
188 void invalidateOther() const {};
189
190 private:
191
195 void deleteCache();
196 std::unique_ptr<SurfaceCacheBase> createSurfaceCacheHelper(int straw, GeoAlignmentStore* alignStore=nullptr) const;
197
198 protected:
201 /*
202 * The number of straws and the vector below need to
203 * initialosed in the derived constructors for now.
204 * This should fine as this is pure virtual class
205 */
206 unsigned int m_nstraws = 0;
207 const TRT_ID* m_idHelper=nullptr;
210 // Amg cache for the straw surfaces
211 std::vector<CxxUtils::CachedUniquePtr<Trk::StraightLineSurface>> m_strawSurfaces{};
212 std::vector<CxxUtils::CachedUniquePtr<SurfaceCacheBase>> m_strawSurfacesCache{};
216
217 // Helper function for the use by derived classes
218 const Amg::Vector3D& center(const Identifier& id, GeoAlignmentStore* alignStore) const;
219 };
220
221}
223#endif
224
225
Cached unique_ptr with atomic update.
Cached value with atomic update.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Cached value with atomic update.
Definition CachedValue.h:55
Ensure that the extensions for the Vector3D are properly loaded.
This is a "hash" representation of an Identifier.
Virtual base class of TRT readout elements.
const std::vector< const Trk::Surface * > & surfaces() const
Returns the full list of all detection surfaces associated to this detector element.
const HepGeom::Transform3D getAbsoluteTransform(int straw) const
This is an alias to strawTransform(int straw)
virtual const double & strawLength() const =0
Active straw length.
void updateAllCaches(GeoAlignmentStore *alignStore=nullptr) const
Update all caches.
const TRT_Conditions * m_conditions
virtual IdentifierHash identifyHash() const override final
identifier hash
unsigned int nStraws() const
Number of straws in the element.
virtual const Trk::SurfaceBounds & bounds() const override final
Straw layer bounds.
virtual const Trk::Surface & elementSurface() const =0
creates surface for detector element, to be implemented in derived class
std::unique_ptr< SurfaceCacheBase > createSurfaceCacheHelper(int straw, GeoAlignmentStore *alignStore=nullptr) const
virtual Identifier identify() const override final
identifier of this detector element:
TRT_BaseElement(const GeoVFullPhysVol *volume, const Identifier &id, const TRT_ID *idHelper, const TRT_Conditions *conditions)
Constructor:
virtual const Trk::Surface & surface() const override final
Element Surface: access to the Surface (straw layer)
virtual int strawDirection() const =0
StrawDirection.
virtual TRT_BaseElement::Type type() const =0
Type information: returns BARREL or ENDCAP.
void invalidate()
Invalidate cache.
virtual HepGeom::Transform3D calculateStrawTransform(int straw, GeoAlignmentStore *alignStore=nullptr) const =0
to be overloaded by the extended classes
const TRT_Conditions * conditions() const
Return the TRT_Conditions object associated to this Detector element.
virtual ~TRT_BaseElement()=default
Destructor:
CxxUtils::CachedValue< std::vector< const Trk::Surface * > > m_surfaces
void deleteCache()
Helper method for cache dealing.
virtual const Amg::Vector3D & normal() const override final
Element Surface: normal of a straw layer.
virtual const Amg::Transform3D & transform() const override final
Element Surface: Get Transform of element in Tracking frame: Amg.
virtual const Amg::Vector3D & center() const override final
Element Surface: center of a straw layer.
CxxUtils::CachedValue< SurfaceCache > m_surfaceCache
const Amg::Transform3D & strawTransform(unsigned int straw) const
Straw transform - fast access in array, in Tracking frame: Amg.
void invalidateOther() const
invalidate action on the cache
virtual Trk::DetectorElemType detectorType() const override final
TrkDetElementBase interface detectorTyoe.
virtual const Trk::SurfaceBounds & strawBounds() const =0
the straw bounds
virtual void createSurfaceCache(GeoAlignmentStore *alignStore=nullptr) const =0
create the surface cache of the detector element, to be implementd in the deried class
const GeoTrf::Transform3D & defTransform() const
Get Default Transform (of module in barrel, layer in endcap) from GeoModel before alignment correctio...
std::vector< CxxUtils::CachedUniquePtr< SurfaceCacheBase > > m_strawSurfacesCache
helper element surface for the cache
Amg::Vector3D strawAxis(int straw) const
Straw axis.
const TRT_BaseElement & operator=(const TRT_BaseElement &right)
Illegal operations:
CxxUtils::CachedUniquePtr< Trk::Surface > m_surface
const Amg::Vector3D & strawCenter(int straw) const
Straw Surface: Local -> global transform of the straw via integer.
std::vector< CxxUtils::CachedUniquePtr< Trk::StraightLineSurface > > m_strawSurfaces
const Trk::StraightLineSurface & strawSurface(int straw) const
Straw Surface: access to the surface via integer.
This class is an interface to conditions objects.
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:82
This is the base class for all tracking detector elements with read-out relevant information.
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Matrix< double, 3, 1 > Vector3D
CachedUniquePtrT< const T > CachedUniquePtr
Message Stream Member.
Ensure that the ATLAS eigen extensions are properly loaded.
STL namespace.