Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
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 
28 #include "CxxUtils/CachedValue.h"
29 #include <vector>
30 
31 class TRT_ID;
32 class GeoAlignmentStore;
33 
34 namespace InDetDD {
35 
36  class SurfaceCacheBase;
37  class SurfaceCache;
38  class TRT_Conditions;
39 
53 
54  public:
55 
56  enum Type {BARREL, ENDCAP};
57 
59  TRT_BaseElement(const GeoVFullPhysVol* volume,
60  const Identifier& id,
61  const TRT_ID* idHelper,
62  const TRT_Conditions* conditions);
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 
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 
147 
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);
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;
208  const TRT_Conditions* m_conditions=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  };
218 
219 }
221 #endif
222 
223 
GeoAlignmentStore
Ensure that the extensions for the Vector3D are properly loaded.
Definition: GeoAlignmentStore.h:24
TrkDetElementBase.h
InDetDD::TRT_BaseElement::strawLength
virtual const double & strawLength() const =0
Active straw length.
InDetDD::TRT_BaseElement::strawDirection
virtual int strawDirection() const =0
StrawDirection.
TRT::Hit::straw
@ straw
Definition: HitInfo.h:82
StraightLineSurface.h
InDetDD::TRT_BaseElement::surfaces
const std::vector< const Trk::Surface * > & surfaces() const
Returns the full list of all detection surfaces associated to this detector element.
Definition: TRT_BaseElement.cxx:58
InDetDD::TRT_BaseElement::elementSurface
virtual const Trk::Surface & elementSurface() const =0
creates surface for detector element, to be implemented in derived class
InDetDD::TRT_BaseElement::defTransform
const GeoTrf::Transform3D & defTransform() const
Get Default Transform (of module in barrel, layer in endcap) from GeoModel before alignment correctio...
Surface.h
InDetDD::TRT_BaseElement::deleteCache
void deleteCache()
Helper method for cache dealing.
Definition: TRT_BaseElement.cxx:200
InDetDD::TRT_BaseElement::nStraws
unsigned int nStraws() const
Number of straws in the element.
CxxUtils::CachedUniquePtrT
Cached pointer with atomic update.
Definition: CachedUniquePtr.h:54
InDetDD::TRT_BaseElement::strawAxis
Amg::Vector3D strawAxis(int straw) const
Straw axis.
Definition: TRT_BaseElement.cxx:154
Surface
Definition: Trigger/TrigAccel/TrigCudaFitter/src/Surface.h:8
InDetDD::TRT_BaseElement::strawCenter
const Amg::Vector3D & strawCenter(int straw) const
Straw Surface: Local -> global transform of the straw via integer.
Definition: TRT_BaseElement.cxx:143
InDetDD::TRT_BaseElement::TRT_BaseElement
TRT_BaseElement(const GeoVFullPhysVol *volume, const Identifier &id, const TRT_ID *idHelper, const TRT_Conditions *conditions)
Constructor:
Definition: TRT_BaseElement.cxx:17
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
TRT_BaseElement.icc
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
InDetDD::TRT_Conditions
Definition: TRT_Conditions.h:30
InDetDD::TRT_BaseElement::createSurfaceCache
virtual void createSurfaceCache(GeoAlignmentStore *alignStore=nullptr) const =0
create the surface cache of the detector element, to be implementd in the deried class
InDetDD::TRT_BaseElement::operator=
const TRT_BaseElement & operator=(const TRT_BaseElement &right)
Illegal operations:
InDetDD::TRT_BaseElement::m_nstraws
unsigned int m_nstraws
Definition: TRT_BaseElement.h:206
SurfaceCache.h
GeoPrimitives.h
InDetDD::TRT_BaseElement::m_strawSurfaces
std::vector< CxxUtils::CachedUniquePtr< Trk::StraightLineSurface > > m_strawSurfaces
Definition: TRT_BaseElement.h:211
InDetDD::TRT_BaseElement::m_surfaceCache
CxxUtils::CachedValue< SurfaceCache > m_surfaceCache
Definition: TRT_BaseElement.h:215
InDetDD::TRT_BaseElement::~TRT_BaseElement
virtual ~TRT_BaseElement()=default
Destructor:
InDetDD::TRT_BaseElement::calculateStrawTransform
virtual HepGeom::Transform3D calculateStrawTransform(int straw, GeoAlignmentStore *alignStore=nullptr) const =0
to be overloaded by the extended classes
InDetDD::TRT_BaseElement::ENDCAP
@ ENDCAP
Definition: TRT_BaseElement.h:56
vector
Definition: MultiHisto.h:13
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
CachedUniquePtr.h
Cached unique_ptr with atomic update.
InDetDD::TRT_BaseElement::m_idHelper
const TRT_ID * m_idHelper
Definition: TRT_BaseElement.h:207
CxxUtils::CachedValue
Cached value with atomic update.
Definition: CachedValue.h:55
InDetDD::TRT_BaseElement::conditions
const TRT_Conditions * conditions() const
Return the TRT_Conditions object associated to this Detector element.
InDetDD::TRT_BaseElement::BARREL
@ BARREL
Definition: TRT_BaseElement.h:56
InDetDD::TRT_BaseElement::getAbsoluteTransform
const HepGeom::Transform3D getAbsoluteTransform(int straw) const
This is an alias to strawTransform(int straw)
Definition: TRT_BaseElement.cxx:42
InDetDD::TRT_BaseElement::identify
virtual Identifier identify() const override final
identifier of this detector element:
InDetDD::TRT_BaseElement::type
virtual TRT_BaseElement::Type type() const =0
Type information: returns BARREL or ENDCAP.
Trk::DetectorElemType
DetectorElemType
Definition: TrkDetElementBase.h:39
xAODType
Definition: ObjectType.h:13
InDetDD::TRT_BaseElement::identifyHash
virtual IdentifierHash identifyHash() const override final
identifier hash
InDetDD::TRT_BaseElement::m_surfaces
CxxUtils::CachedValue< std::vector< const Trk::Surface * > > m_surfaces
Definition: TRT_BaseElement.h:214
InDetDD::TRT_BaseElement::Type
Type
Definition: TRT_BaseElement.h:56
EventPrimitives.h
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
Amg
Definition of ATLAS Math & Geometry primitives (Amg)
Definition: AmgStringHelpers.h:19
InDetDD::TRT_BaseElement::m_strawSurfacesCache
std::vector< CxxUtils::CachedUniquePtr< SurfaceCacheBase > > m_strawSurfacesCache
helper element surface for the cache
Definition: TRT_BaseElement.h:212
CachedValue.h
Cached value with atomic update.
InDetDD::TRT_BaseElement::invalidateOther
void invalidateOther() const
invalidate action on the cache
Definition: TRT_BaseElement.h:188
IdentifierHash.h
InDetDD::TRT_BaseElement::invalidate
void invalidate()
Invalidate cache.
Definition: TRT_BaseElement.cxx:190
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
InDetDD::TRT_BaseElement::bounds
virtual const Trk::SurfaceBounds & bounds() const override final
Straw layer bounds.
InDetDD::TRT_BaseElement::updateAllCaches
void updateAllCaches(GeoAlignmentStore *alignStore=nullptr)
Update all caches.
Definition: TRT_BaseElement.cxx:209
HepGeom
Definition: VP1String.h:30
InDetDD::TRT_BaseElement::detectorType
virtual Trk::DetectorElemType detectorType() const override final
TrkDetElementBase interface detectorTyoe.
TRT_ID
Definition: TRT_ID.h:84
InDetDD::TRT_BaseElement::createSurfaceCacheHelper
std::unique_ptr< SurfaceCacheBase > createSurfaceCacheHelper(int straw, GeoAlignmentStore *alignStore=nullptr) const
Definition: TRT_BaseElement.cxx:178
InDetDD::TRT_BaseElement::strawTransform
const Amg::Transform3D & strawTransform(unsigned int straw) const
Straw transform - fast access in array, in Tracking frame: Amg.
Definition: TRT_BaseElement.cxx:89
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
InDetDD::TRT_BaseElement::m_idHash
IdentifierHash m_idHash
Definition: TRT_BaseElement.h:200
InDetDD::TRT_BaseElement::center
virtual const Amg::Vector3D & center() const override final
Element Surface: center of a straw layer.
InDetDD::TRT_BaseElement::strawSurface
const Trk::StraightLineSurface & strawSurface(int straw) const
Straw Surface: access to the surface via integer.
Definition: TRT_BaseElement.cxx:121
InDetDD::TRT_BaseElement::strawBounds
virtual const Trk::SurfaceBounds & strawBounds() const =0
the straw bounds
InDetDD::TRT_BaseElement::m_conditions
const TRT_Conditions * m_conditions
Definition: TRT_BaseElement.h:208
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
InDetDD::TRT_BaseElement::normal
virtual const Amg::Vector3D & normal() const override final
Element Surface: normal of a straw layer.
InDetDD::TRT_BaseElement::surface
virtual const Trk::Surface & surface() const override final
Element Surface: access to the Surface (straw layer)
InDetDD::TRT_BaseElement::m_surface
CxxUtils::CachedUniquePtr< Trk::Surface > m_surface
Definition: TRT_BaseElement.h:209
InDetDD::TRT_BaseElement
Definition: TRT_BaseElement.h:52
InDetDD::TRT_BaseElement::transform
virtual const Amg::Transform3D & transform() const override final
Element Surface: Get Transform of element in Tracking frame: Amg.
InDetDD::TRT_BaseElement::m_id
Identifier m_id
Definition: TRT_BaseElement.h:199
Identifier
Definition: IdentifierFieldParser.cxx:14