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 TRTCond {
35 class StrawDxContainer;
36}
37
38namespace InDetDD {
39
40 class SurfaceCacheBase;
41 class SurfaceCache;
42 class TRT_Conditions;
43
55
57
58 public:
59
61
63 TRT_BaseElement(const GeoVFullPhysVol* volume,
64 const Identifier& id,
65 const TRT_ID* idHelper,
67
68 TRT_BaseElement(const TRT_BaseElement& right);
69
71 virtual ~TRT_BaseElement() = default;
72
74 virtual TRT_BaseElement::Type type() const = 0;
75
77 virtual Identifier identify() const override final;
78
80 virtual IdentifierHash identifyHash() const override final;
81
82 // --- GeoModel transformation forwards ----------------------------------------------------- //
83
86
89
90 // ---- Surface & Tracking information cache ------------------------------------------------ //
91 // (a) Element Surface section - accesses the m_surfaceCache store
92
94 virtual const Trk::Surface& surface () const override final;
95
97 virtual const Trk::SurfaceBounds& bounds() const override final;
98
100 virtual const Amg::Transform3D& transform() const override final;
101
103 virtual const Amg::Vector3D& center() const override final;
104
106 virtual const Amg::Vector3D& normal() const override final;
107
109 virtual Trk::DetectorElemType detectorType() const override final;
110
111 // (b) Straw Surface section - accesses the vector<SurfaceCache> m_strawSurfacesCache store
112
114 virtual const Trk::Surface& surface (const Identifier& id) const override final;
115
118
120 virtual const Trk::SurfaceBounds& bounds(const Identifier& id) const override final;
121
123 virtual const Amg::Transform3D& transform(const Identifier& id) const override final;
124
127 const Amg::Transform3D& strawTransform(unsigned int straw) const;
128
137
138 virtual const Amg::Vector3D& center(const Identifier& id) const override final;
139
141 virtual const Amg::Vector3D& normal(const Identifier& id) const override final;
142
144 const Trk::StraightLineSurface& strawSurface(int straw) const;
145
148
150 const Amg::Vector3D& strawCenter(int straw) const;
151
156 Amg::Vector3D strawAxis(int straw) const;
157
159 unsigned int nStraws() const;
160
162 virtual const double& strawLength() const = 0;
163
165 virtual int strawDirection() const = 0;
166
168 void invalidate();
169
171 void updateAllCaches(GeoAlignmentStore* alignStore=nullptr) const;
172
175
176 void setDxContainer(const TRTCond::StrawDxContainer* dxContainer) {m_dxContainer=dxContainer;}
177
179 virtual HepGeom::Transform3D calculateStrawTransform(int straw, GeoAlignmentStore* alignStore=nullptr) const = 0;
180
182 virtual const Trk::SurfaceBounds& strawBounds() const = 0;
183
185 virtual const Trk::Surface& elementSurface() const = 0;
186
188 virtual void createSurfaceCache(GeoAlignmentStore* alignStore=nullptr) const = 0;
189
191 void createSurfaceCache(Identifier id, GeoAlignmentStore* alignStore=nullptr) const;
192
194 void invalidateOther() const {};
195
196 private:
197
201 void deleteCache();
202 std::unique_ptr<SurfaceCacheBase> createSurfaceCacheHelper(int straw, GeoAlignmentStore* alignStore=nullptr) const;
203
204 protected:
207 /*
208 * The number of straws and the vector below need to
209 * initialosed in the derived constructors for now.
210 * This should fine as this is pure virtual class
211 */
212 unsigned int m_nstraws = 0;
213 const TRT_ID* m_idHelper=nullptr;
217 // Amg cache for the straw surfaces
218 std::vector<CxxUtils::CachedUniquePtr<Trk::StraightLineSurface>> m_strawSurfaces{};
219 std::vector<CxxUtils::CachedUniquePtr<SurfaceCacheBase>> m_strawSurfacesCache{};
223
224 // Helper function for the use by derived classes
225 const Amg::Vector3D& center(const Identifier& id, GeoAlignmentStore* alignStore) const;
226 };
227
228}
230#endif
231
232
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:
void setDxContainer(const TRTCond::StrawDxContainer *dxContainer)
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.
const TRTCond::StrawDxContainer * m_dxContainer
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.
specialise to detector level
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:82
Abstract base class for surface bounds to be specified.
Abstract Base Class for tracking surfaces.
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.