ATLAS Offline Software
TRT_BaseElement.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // TRT_BaseElement.h
8 // (c) ATLAS Detector software
10 
11 #ifndef TRT_BaseElement_h
12 #define TRT_BaseElement_h 1
13 
14 
15 //include the Amg packages they include the Eigen plug-ins
18 
19 #include "TrkSurfaces/Surface.h"
21 
25 #include "Identifier/Identifier.h"
26 
27 #include "CLHEP/Geometry/Transform3D.h"
28 #include "CLHEP/Geometry/Point3D.h"
29 
31 #include "CxxUtils/CachedValue.h"
32 #include <vector>
33 
34 
35 
36 class TRT_ID;
37 class GeoAlignmentStore;
38 
39 namespace InDetDD {
40 
41  class SurfaceCacheBase;
42  class SurfaceCache;
43  class TRT_Conditions;
44 
58 
59  public:
60 
61  enum Type {BARREL, ENDCAP};
62 
64  TRT_BaseElement(const GeoVFullPhysVol* volume,
65  const Identifier& id,
66  const TRT_ID* idHelper,
67  const TRT_Conditions* conditions);
68 
69  TRT_BaseElement(const TRT_BaseElement& right);
70 
72  virtual ~TRT_BaseElement() = default;
73 
75  virtual TRT_BaseElement::Type type() const = 0;
76 
78  virtual Identifier identify() const override final;
79 
81  virtual IdentifierHash identifyHash() const override final;
82 
83  // --- GeoModel transformation forwards ----------------------------------------------------- //
84 
87 
90 
91  // ---- Surface & Tracking information cache ------------------------------------------------ //
92  // (a) Element Surface section - accesses the m_surfaceCache store
93 
95  virtual const Trk::Surface& surface () const override final;
96 
98  virtual const Trk::SurfaceBounds& bounds() const override final;
99 
101  virtual const Amg::Transform3D& transform() const override final;
102 
104  virtual const Amg::Vector3D& center() const override final;
105 
107  virtual const Amg::Vector3D& normal() const override final;
108 
110  virtual Trk::DetectorElemType detectorType() const override final;
111 
112  // (b) Straw Surface section - accesses the vector<SurfaceCache> m_strawSurfacesCache store
113 
115  virtual const Trk::Surface& surface (const Identifier& id) const override final;
116 
119 
121  virtual const Trk::SurfaceBounds& bounds(const Identifier& id) const override final;
122 
124  virtual const Amg::Transform3D& transform(const Identifier& id) const override final;
125 
128  const Amg::Transform3D& strawTransform(unsigned int straw) const;
129 
139  virtual const Amg::Vector3D& center(const Identifier& id) const override final;
140 
142  virtual const Amg::Vector3D& normal(const Identifier& id) const override final;
143 
145  const Trk::StraightLineSurface& strawSurface(int straw) const;
146 
149 
152 
158 
160  unsigned int nStraws() const;
161 
163  virtual const double& strawLength() const = 0;
164 
166  virtual int strawDirection() const = 0;
167 
169  void invalidate();
170 
172  void updateAllCaches();
173 
176 
179 
181  virtual const Trk::SurfaceBounds& strawBounds() const = 0;
182 
185 
187  virtual void createSurfaceCache() const = 0;
188 
191 
193  void invalidateOther() const {};
194 
195  private:
196 
200  void deleteCache();
201  std::unique_ptr<SurfaceCacheBase> createSurfaceCacheHelper(int straw) const;
202 
203  protected:
206  /*
207  * The number of straws and the vector below need to
208  * initialosed in the derived constructors for now.
209  * This should fine as this is pure virtual class
210  */
211  unsigned int m_nstraws = 0;
212  const TRT_ID* m_idHelper=nullptr;
213  const TRT_Conditions* m_conditions=nullptr;
215  // Amg cache for the straw surfaces
216  std::vector<CxxUtils::CachedUniquePtr<Trk::StraightLineSurface>> m_strawSurfaces{};
217  std::vector<CxxUtils::CachedUniquePtr<SurfaceCacheBase>> m_strawSurfacesCache{};
221 
222  };
223 
224 }
226 #endif
227 
228 
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
InDetDD::TRT_BaseElement::calculateStrawTransform
virtual HepGeom::Transform3D calculateStrawTransform(int straw) const =0
to be overloaded by the extended classes
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::updateAllCaches
void updateAllCaches()
Update all caches.
Definition: TRT_BaseElement.cxx:209
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:7
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:562
InDetDD::TRT_Conditions
Definition: TRT_Conditions.h:30
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:211
InDetDD::TRT_BaseElement::createSurfaceCacheHelper
std::unique_ptr< SurfaceCacheBase > createSurfaceCacheHelper(int straw) const
Definition: TRT_BaseElement.cxx:178
SurfaceCache.h
GeoPrimitives.h
InDetDD::TRT_BaseElement::m_strawSurfaces
std::vector< CxxUtils::CachedUniquePtr< Trk::StraightLineSurface > > m_strawSurfaces
Definition: TRT_BaseElement.h:216
InDetDD::TRT_BaseElement::m_surfaceCache
CxxUtils::CachedValue< SurfaceCache > m_surfaceCache
Definition: TRT_BaseElement.h:220
InDetDD::TRT_BaseElement::createSurfaceCache
virtual void createSurfaceCache() const =0
create the surface cache of the detector element, to be implementd in the deried class
InDetDD::TRT_BaseElement::~TRT_BaseElement
virtual ~TRT_BaseElement()=default
Destructor:
InDetDD::TRT_BaseElement::ENDCAP
@ ENDCAP
Definition: TRT_BaseElement.h:61
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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:212
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:61
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:219
InDetDD::TRT_BaseElement::Type
Type
Definition: TRT_BaseElement.h:61
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:217
CachedValue.h
Cached value with atomic update.
InDetDD::TRT_BaseElement::invalidateOther
void invalidateOther() const
invalidate action on the cache
Definition: TRT_BaseElement.h:193
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.
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::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:205
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:213
IdentifierHash
Definition: IdentifierHash.h:38
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:214
InDetDD::TRT_BaseElement
Definition: TRT_BaseElement.h:57
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:204