ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
InDetDD::TRT_EndcapElement Class Referencefinal

#include <TRT_EndcapElement.h>

Inheritance diagram for InDetDD::TRT_EndcapElement:
Collaboration diagram for InDetDD::TRT_EndcapElement:

Public Types

enum  Type { BARREL, ENDCAP }
 

Public Member Functions

 TRT_EndcapElement (const GeoVFullPhysVol *volume, const TRT_EndcapDescriptor *descriptor, bool isPositive, unsigned int wheelIndex, unsigned int strawLayIndex, unsigned int phiIndex, const TRT_ID *idHelper, const TRT_Conditions *conditions)
 Constructor. More...
 
 TRT_EndcapElement (const TRT_EndcapElement &right)
 
virtual ~TRT_EndcapElement ()
 Destructor: More...
 
virtual TRT_BaseElement::Type type () const override final
 Type information: More...
 
virtual const double & strawLength () const override
 Active straw length. More...
 
virtual int strawDirection () const override final
 StrawDirection. More...
 
const TRT_EndcapDescriptorgetDescriptor () const
 Returns a pointer to a descriptor, giving common information on module construction. More...
 
const TRT_EndcapElementnextInZ () const
 Next in Z: More...
 
const TRT_EndcapElementpreviousInZ () const
 Prev in Z: More...
 
void setNextInZ (const TRT_EndcapElement *element)
 Set Next in Z. More...
 
void setPreviousInZ (const TRT_EndcapElement *element)
 Set Previous in Z. More...
 
const TRT_EndcapCodegetCode () const
 Doomed (??) More...
 
virtual const Trk::SurfaceBoundsstrawBounds () const override final
 the straw bounds More...
 
virtual Identifier identify () const override final
 identifier of this detector element: More...
 
virtual IdentifierHash identifyHash () const override final
 identifier hash More...
 
const GeoTrf::Transform3D & defTransform () const
 Get Default Transform (of module in barrel, layer in endcap) from GeoModel before alignment corrections. More...
 
const HepGeom::Transform3D getAbsoluteTransform (int straw) const
 This is an alias to strawTransform(int straw) More...
 
virtual const Trk::Surfacesurface () const override final
 Element Surface: access to the Surface (straw layer) More...
 
virtual const Trk::Surfacesurface (const Identifier &id) const override final
 Straw Surface: access to the surface via identifier. More...
 
virtual const Trk::SurfaceBoundsbounds () const override final
 Straw layer bounds. More...
 
virtual const Trk::SurfaceBoundsbounds (const Identifier &id) const override final
 Straw Surface: access to the bounds via Identifier. More...
 
virtual const Amg::Transform3Dtransform () const override final
 Element Surface: Get Transform of element in Tracking frame: Amg. More...
 
virtual const Amg::Transform3Dtransform (const Identifier &id) const override final
 Straw Surface: access to the transform of individual straw in Tracking frame: Amg. More...
 
virtual const Amg::Vector3Dcenter () const override final
 Element Surface: center of a straw layer. More...
 
virtual const Amg::Vector3Dcenter (const Identifier &id) const override final
 Straw Surface: Center of a straw using Identifier Straw center and straw axis can be obtained by the following: (The straw center is the center of the active region) Amg::Transform3D& transform = element->strawTransform(straw); Amb::Vector3D& center = element->strawCenter(); double r = element->strawCenter()->perp(); double phi = element->strawCenter()->phi(); Amg::Vector3D strawAxis = element->strawTransform(straw)* Vector3D(0,0,1) * strawDirection() More...
 
virtual const Amg::Vector3Dnormal () const override final
 Element Surface: normal of a straw layer. More...
 
virtual const Amg::Vector3Dnormal (const Identifier &id) const override final
 Normal of a straw. More...
 
virtual Trk::DetectorElemType detectorType () const override final
 TrkDetElementBase interface detectorTyoe. More...
 
const std::vector< const Trk::Surface * > & surfaces () const
 Returns the full list of all detection surfaces associated to this detector element. More...
 
const Amg::Transform3DstrawTransform (unsigned int straw) const
 Straw transform - fast access in array, in Tracking frame: Amg. More...
 
const Amg::Transform3DstrawTransform (int straw) const
 Straw Surface: Local -> global transform of the straw via integer. More...
 
const Trk::StraightLineSurfacestrawSurface (int straw) const
 Straw Surface: access to the surface via integer. More...
 
const Amg::Vector3DstrawCenter (int straw) const
 Straw Surface: Local -> global transform of the straw via integer. More...
 
Amg::Vector3D strawAxis (int straw) const
 Straw axis. More...
 
unsigned int nStraws () const
 Number of straws in the element. More...
 
void invalidate ()
 Invalidate cache. More...
 
void updateAllCaches ()
 Update all caches. More...
 
const TRT_Conditionsconditions () const
 Return the TRT_Conditions object associated to this Detector element. More...
 
void invalidateOther () const
 invalidate action on the cache More...
 
std::string detectorTypeString () const
 Returns a string of the Detector element type. More...
 

Static Public Member Functions

static const TRT_EndcapConditions * getConditionsData ()
 Returns a pointer to conditions data. More...
 

Protected Attributes

Identifier m_id
 
IdentifierHash m_idHash
 
unsigned int m_nstraws = 0
 
const TRT_IDm_idHelper =nullptr
 
const TRT_Conditionsm_conditions =nullptr
 
CxxUtils::CachedUniquePtr< Trk::Surfacem_surface
 
std::vector< CxxUtils::CachedUniquePtr< Trk::StraightLineSurface > > m_strawSurfaces {}
 
std::vector< CxxUtils::CachedUniquePtr< SurfaceCacheBase > > m_strawSurfacesCache {}
 helper element surface for the cache More...
 
CxxUtils::CachedValue< std::vector< const Trk::Surface * > > m_surfaces
 
CxxUtils::CachedValue< SurfaceCachem_surfaceCache
 

Private Member Functions

virtual HepGeom::Transform3D calculateStrawTransform (int straw) const override
 These transforms are effectively to the local coord system of a straw derived from GeoModel -> hence CLHEP. More...
 
HepGeom::Transform3D calculateLocalStrawTransform (int straw) const
 
virtual const Trk::SurfaceelementSurface () const override
 return the surface of the element More...
 
virtual void createSurfaceCache () const override
 create the cache for the element More...
 
SurfaceCache createSurfaceCacheHelper () const
 
void createSurfaceCache (Identifier id) const
 create the cache for the straw of identifier id More...
 
const TRT_EndcapElementoperator= (const TRT_EndcapElement &right)=delete
 
void deleteCache ()
 Helper method for cache dealing. More...
 

Private Attributes

TRT_EndcapCode m_code
 
const TRT_EndcapDescriptorm_descriptor
 
const TRT_EndcapElementm_nextInZ
 
const TRT_EndcapElementm_previousInZ
 

Detailed Description

Extended class of a TRT_BaseElement to describe a readout elment in the endcap. It secifies the strawTransfrom methods by getting the information from GeoModel

The readout element in the EC is a wheel with straws radially placed on it.

The number of straws described by this readout element can be retrieved by nStraws()

Author
: Grant Gorfine
  • modified & maintained: Nick Styles, Andreas Salzburger

Definition at line 44 of file TRT_EndcapElement.h.

Member Enumeration Documentation

◆ Type

Enumerator
BARREL 
ENDCAP 

Definition at line 61 of file TRT_BaseElement.h.

61 {BARREL, ENDCAP};

Constructor & Destructor Documentation

◆ TRT_EndcapElement() [1/2]

InDetDD::TRT_EndcapElement::TRT_EndcapElement ( const GeoVFullPhysVol *  volume,
const TRT_EndcapDescriptor descriptor,
bool  isPositive,
unsigned int  wheelIndex,
unsigned int  strawLayIndex,
unsigned int  phiIndex,
const TRT_ID idHelper,
const TRT_Conditions conditions 
)

Constructor.

Definition at line 27 of file TRT_EndcapElement.cxx.

35  :
36 
37  TRT_BaseElement(volume,
38  idHelper->layer_id((isPositive ? 2 : -2),
39  phiIndex,
40  wheelIndex,
41  strawLayIndex),
42  idHelper,
43  conditions)
44  , m_code(isPositive, wheelIndex, strawLayIndex, phiIndex)
45  , m_descriptor(descriptor)
46  , m_nextInZ(nullptr)
47  , m_previousInZ(nullptr)
48 {
50  m_strawSurfaces.resize(m_nstraws);
52 }

◆ TRT_EndcapElement() [2/2]

InDetDD::TRT_EndcapElement::TRT_EndcapElement ( const TRT_EndcapElement right)

Definition at line 54 of file TRT_EndcapElement.cxx.

55  : TRT_BaseElement(right)
56  , m_code(right.m_code)
57  , m_descriptor(right.m_descriptor)
58  , m_nextInZ(right.m_nextInZ)
59  , m_previousInZ(right.m_previousInZ)
60 {
61  m_nstraws = right.m_nstraws;
62  m_strawSurfaces.resize(m_nstraws);
64 }

◆ ~TRT_EndcapElement()

InDetDD::TRT_EndcapElement::~TRT_EndcapElement ( )
virtualdefault

Destructor:

Member Function Documentation

◆ bounds() [1/2]

virtual const Trk::SurfaceBounds& InDetDD::TRT_BaseElement::bounds ( ) const
finaloverridevirtualinherited

Straw layer bounds.

Implements Trk::TrkDetElementBase.

◆ bounds() [2/2]

const Trk::SurfaceBounds & InDetDD::TRT_BaseElement::bounds ( const Identifier id) const
finaloverridevirtualinherited

Straw Surface: access to the bounds via Identifier.

Implements Trk::TrkDetElementBase.

Definition at line 72 of file TRT_BaseElement.cxx.

73 {
74  return strawBounds();
75 }

◆ calculateLocalStrawTransform()

HepGeom::Transform3D InDetDD::TRT_EndcapElement::calculateLocalStrawTransform ( int  straw) const
private

Definition at line 144 of file TRT_EndcapElement.cxx.

145 {
146  const TRTCond::StrawDxContainer* container = conditions()->dxContainer();
148  if (container) {
149 
150  // important note: dx1 moves the 'negative' wire endpoint end dx2
151  // the 'positive' wire endpoint in the local straw frame.
152  // In the global frame, 'dx1' corresponds to the readout side and 'dx2'
153  // to the side closest the beampipe.
154 
155  int bec = getCode().isPosZ() ? +2 : -2;
156  int wheel = getCode().getWheelIndex();
157  int phimodule = getCode().getPhiIndex();
158  int strawlayer = getCode().getStrawLayerIndex();
161  wheel,
162  phimodule,
163  strawlayer,
164  straw,
166 
167  double dx1 = container->getDx1(id);
168  double dx2 = container->getDx2(id);
169  double ang = (dx2 - dx1) / strawLength();
170  double dy = -1 * (dx2 + dx1) / 2.;
171 
172  // In the local straw frame:
173  // - the z-axis is along the straw and points toward the beampipe
174  // - the x-axis is along global-z and away from the interaction point
175  // (locX = globZ A-side / locX = -1 *gobZ C-side)
176  // - the y-axis is along global phi_hat direction determined by the
177  // other 2.
178  // (clockwise C-side, counter clockwise A-Side)
179  rc = HepGeom::TranslateY3D(dy) * HepGeom::RotateX3D(ang);
180  }
181  return rc;
182 }

◆ calculateStrawTransform()

HepGeom::Transform3D InDetDD::TRT_EndcapElement::calculateStrawTransform ( int  straw) const
overrideprivatevirtual

These transforms are effectively to the local coord system of a straw derived from GeoModel -> hence CLHEP.

Implements InDetDD::TRT_BaseElement.

Definition at line 100 of file TRT_EndcapElement.cxx.

101 {
102  // NB The tranformation to a straw is reconstructed here precisely as
103  // it was ... hopefully... in the factory. One could eliminate this
104  // requirement and make the code a little more robust in this regard but
105  // at the cost of doubling the descriptors. (One descriptor now suffices
106  // for both positive and negative endcaps).
107  const GeoXF::Function* f = m_descriptor->getStrawTransform();
108 
109  if (f) {
110  int istraw = m_code.isPosZ() ? straw : m_descriptor->nStraws() - 1 - straw;
111 
112  size_t offsetInto = m_descriptor->getStrawTransformOffset();
113 
115  getMaterialGeom()->getAbsoluteTransform() *
116  ((*f)(istraw + offsetInto))) *
120 
121  } else {
122 
123  // Will not work properly with alignments.
124  std::cout << "ALTERNATIVE METHOD" << std::endl;
125 
127  double r = m_descriptor->innerRadius() + 0.5 * m_descriptor->strawLength();
128  CLHEP::Hep3Vector pos(
129  r * cos(phi),
130  r * sin(phi),
131  (Amg::EigenTransformToCLHEP(getMaterialGeom()->getAbsoluteTransform()) *
132  HepGeom::Point3D<double>())
133  .z());
134  CLHEP::HepRotation rot;
135  // Axis (in local (0,0,1)) points towards beam axis.
136  rot.rotateY(-0.5 * M_PI); // Make it point along -ve X.
137  rot.rotateZ(phi);
138  return HepGeom::Transform3D(rot, pos);
139  }
140 }

◆ center() [1/2]

virtual const Amg::Vector3D& InDetDD::TRT_BaseElement::center ( ) const
finaloverridevirtualinherited

Element Surface: center of a straw layer.

Implements Trk::TrkDetElementBase.

◆ center() [2/2]

const Amg::Vector3D & InDetDD::TRT_BaseElement::center ( const Identifier id) const
finaloverridevirtualinherited

Straw Surface: Center of a straw using Identifier Straw center and straw axis can be obtained by the following: (The straw center is the center of the active region) Amg::Transform3D& transform = element->strawTransform(straw); Amb::Vector3D& center = element->strawCenter(); double r = element->strawCenter()->perp(); double phi = element->strawCenter()->phi(); Amg::Vector3D strawAxis = element->strawTransform(straw)* Vector3D(0,0,1) * strawDirection()

Implements Trk::TrkDetElementBase.

Definition at line 110 of file TRT_BaseElement.cxx.

111 {
112  int straw = m_idHelper->straw(id);
113  if (!m_strawSurfacesCache[straw]) {
114  createSurfaceCache(id);
115  }
116  // forward the transform of the cache
117  return m_strawSurfacesCache[straw]->center();
118 }

◆ conditions()

const TRT_Conditions* InDetDD::TRT_BaseElement::conditions ( ) const
inherited

Return the TRT_Conditions object associated to this Detector element.

◆ createSurfaceCache() [1/2]

void InDetDD::TRT_EndcapElement::createSurfaceCache ( ) const
overrideprivatevirtual

create the cache for the element

Implements InDetDD::TRT_BaseElement.

Definition at line 199 of file TRT_EndcapElement.cxx.

200 {
201  if (!m_surfaceCache.isValid()) {
203  }
204  // create the surface if needed
205  if (!m_surface) {
206  elementSurface();
207  }
208 }

◆ createSurfaceCache() [2/2]

void InDetDD::TRT_EndcapElement::createSurfaceCache ( Identifier  id) const
private

create the cache for the straw of identifier id

◆ createSurfaceCacheHelper()

SurfaceCache InDetDD::TRT_EndcapElement::createSurfaceCacheHelper ( ) const
private

Definition at line 211 of file TRT_EndcapElement.cxx.

212 {
213  // Calculate the surface
214  double phiCenter = m_descriptor->startPhi() +
215  m_descriptor->strawPitch() * 0.5 * (nStraws() - 1);
216  double phiHalfWidth = 0.5 * m_descriptor->strawPitch() * nStraws();
217  double rMin = m_descriptor->innerRadius();
218  double rMax = rMin + m_descriptor->strawLength();
219 
220  // The transform of the endcap is a translation in z for no
221  // misalignement. For the -ve endcap there is also a 180deg rotation
222  // around the y axis. getAbsoluteTransform() will also include the
223  // misalignment.
224  //
225  // To get the transform of the element we have to first rotate
226  // around z to the phi center of the element. We want the local z
227  // to point in the same direction for both endcaps (approximately
228  // global z axis). For the negative endcap we therefore have to
229  // rotate 180 CLHEP::deg around the Y axis.
230 
231  // We need to rotate to phi center before we apply the
232  // misalignment. However, in the negative endcap the the phi
233  // location is inverted (due to 180 rotation around y axis). This is
234  // taken care of by the extra 180 CLHEP::deg rotation around Y that we do
235  // to get the z axis pointing in the correct direction.
236  auto transform =
237  m_code.isPosZ()
238  ? Amg::Transform3D((getMaterialGeom()->getAbsoluteTransform() *
239  GeoTrf::RotateZ3D(phiCenter)))
240  : Amg::Transform3D((getMaterialGeom()->getAbsoluteTransform() *
241  GeoTrf::RotateY3D(180 * CLHEP::deg) *
242  GeoTrf::RotateZ3D(phiCenter)));
243 
244  // create the igredients and the cache
245  auto center = Amg::Vector3D(transform.translation());
246  auto bounds = std::make_unique<Trk::DiscBounds>(rMin, rMax, phiHalfWidth);
247  auto normal = Amg::Vector3D(transform.rotation().col(2));
248 
249  return {transform, center, normal, std::move(bounds)};
250 }

◆ defTransform()

const GeoTrf::Transform3D& InDetDD::TRT_BaseElement::defTransform ( ) const
inherited

Get Default Transform (of module in barrel, layer in endcap) from GeoModel before alignment corrections.

◆ deleteCache()

void InDetDD::TRT_BaseElement::deleteCache ( )
privateinherited

Helper method for cache dealing.

Definition at line 200 of file TRT_BaseElement.cxx.

201 {
202  // for all straws
203  for (auto & i : m_strawSurfacesCache) {
204  i.store(nullptr);
205  }
206 }

◆ detectorType()

virtual Trk::DetectorElemType InDetDD::TRT_BaseElement::detectorType ( ) const
finaloverridevirtualinherited

TrkDetElementBase interface detectorTyoe.

Implements Trk::TrkDetElementBase.

◆ detectorTypeString()

std::string Trk::TrkDetElementBase::detectorTypeString ( ) const
inherited

Returns a string of the Detector element type.

Definition at line 10 of file TrkDetElementBase.cxx.

10  {
11  auto type = detectorType();
13  return "SolidState";
15  return "Silicon";
16  else if (type == Trk::DetectorElemType::TRT)
17  return "TRT";
18  else if (type == Trk::DetectorElemType::Csc)
19  return "Csc";
20  else if (type == Trk::DetectorElemType::Mdt)
21  return "Mdt";
22  else if (type == Trk::DetectorElemType::Rpc)
23  return "Rpc";
24  else if (type == Trk::DetectorElemType::Tgc)
25  return "Tgc";
27  return "sTgc";
28  else if (type == Trk::DetectorElemType::MM)
29  return "Mm";
30  return "Unknown";
31 }

◆ elementSurface()

const Trk::Surface & InDetDD::TRT_EndcapElement::elementSurface ( ) const
overrideprivatevirtual

return the surface of the element

Implements InDetDD::TRT_BaseElement.

Definition at line 191 of file TRT_EndcapElement.cxx.

192 {
193  if (not m_surface)
194  m_surface.set(std::make_unique<Trk::DiscSurface>(*this));
195  return *m_surface;
196 }

◆ getAbsoluteTransform()

const HepGeom::Transform3D InDetDD::TRT_BaseElement::getAbsoluteTransform ( int  straw) const
inherited

This is an alias to strawTransform(int straw)

Definition at line 42 of file TRT_BaseElement.cxx.

43 {
45 }

◆ getCode()

const TRT_EndcapCode& InDetDD::TRT_EndcapElement::getCode ( ) const

Doomed (??)

◆ getConditionsData()

const TRT_EndcapConditions * InDetDD::TRT_EndcapElement::getConditionsData ( )
static

Returns a pointer to conditions data.

This includes information on dead and noisy wires, as well as wire sags.

Definition at line 76 of file TRT_EndcapElement.cxx.

77 {
78  return nullptr;
79 }

◆ getDescriptor()

const TRT_EndcapDescriptor * InDetDD::TRT_EndcapElement::getDescriptor ( ) const

Returns a pointer to a descriptor, giving common information on module construction.

Definition at line 82 of file TRT_EndcapElement.cxx.

83 {
84  return m_descriptor;
85 }

◆ identify()

virtual Identifier InDetDD::TRT_BaseElement::identify ( ) const
finaloverridevirtualinherited

identifier of this detector element:

Implements Trk::TrkDetElementBase.

◆ identifyHash()

virtual IdentifierHash InDetDD::TRT_BaseElement::identifyHash ( ) const
finaloverridevirtualinherited

identifier hash

Implements Trk::TrkDetElementBase.

◆ invalidate()

void InDetDD::TRT_BaseElement::invalidate ( )
inherited

Invalidate cache.

Definition at line 190 of file TRT_BaseElement.cxx.

191 {
192  // Invalidate the caches
193  // Call and barrel or endcap specific invalidation
194  invalidateOther();
195  // Its enough to delete and zero the caches.
196  deleteCache();
197 }

◆ invalidateOther()

void InDetDD::TRT_BaseElement::invalidateOther ( ) const
inlineinherited

invalidate action on the cache

Definition at line 193 of file TRT_BaseElement.h.

193 {};

◆ nextInZ()

const TRT_EndcapElement* InDetDD::TRT_EndcapElement::nextInZ ( ) const

Next in Z:

◆ normal() [1/2]

virtual const Amg::Vector3D& InDetDD::TRT_BaseElement::normal ( ) const
finaloverridevirtualinherited

Element Surface: normal of a straw layer.

Implements Trk::TrkDetElementBase.

◆ normal() [2/2]

const Amg::Vector3D & InDetDD::TRT_BaseElement::normal ( const Identifier id) const
finaloverridevirtualinherited

Normal of a straw.

(Not very meaningful).

Implements Trk::TrkDetElementBase.

Definition at line 100 of file TRT_BaseElement.cxx.

101 {
102  // Not sure if the normal of the straw is ever used.
103  // nor is there a well defined normal.
104  // This wont be corrected for alignments.
105  // Just return the element normal
106  return normal();
107 }

◆ nStraws()

unsigned int InDetDD::TRT_BaseElement::nStraws ( ) const
inherited

Number of straws in the element.

◆ operator=()

const TRT_EndcapElement& InDetDD::TRT_EndcapElement::operator= ( const TRT_EndcapElement right)
privatedelete

◆ previousInZ()

const TRT_EndcapElement* InDetDD::TRT_EndcapElement::previousInZ ( ) const

Prev in Z:

◆ setNextInZ()

void InDetDD::TRT_EndcapElement::setNextInZ ( const TRT_EndcapElement element)

Set Next in Z.

Definition at line 88 of file TRT_EndcapElement.cxx.

89 {
90  m_nextInZ = element;
91 }

◆ setPreviousInZ()

void InDetDD::TRT_EndcapElement::setPreviousInZ ( const TRT_EndcapElement element)

Set Previous in Z.

Definition at line 94 of file TRT_EndcapElement.cxx.

95 {
96  m_previousInZ = element;
97 }

◆ strawAxis()

Amg::Vector3D InDetDD::TRT_BaseElement::strawAxis ( int  straw) const
inherited

Straw axis.

Always in direction of increasing eta. +ve z direction in barrel (for both +ve and -ve half) Away from beam pipe in -ve z endcap, Towards beam pipe in +ve endcap.

Definition at line 154 of file TRT_BaseElement.cxx.

155 {
156  return (strawTransform(straw).linear() * Amg::Vector3D::UnitZ() *
157  strawDirection());
158 }

◆ strawBounds()

const Trk::SurfaceBounds & InDetDD::TRT_EndcapElement::strawBounds ( ) const
finaloverridevirtual

the straw bounds

Implements InDetDD::TRT_BaseElement.

Definition at line 185 of file TRT_EndcapElement.cxx.

186 {
187  return m_descriptor->strawBounds();
188 }

◆ strawCenter()

const Amg::Vector3D & InDetDD::TRT_BaseElement::strawCenter ( int  straw) const
inherited

Straw Surface: Local -> global transform of the straw via integer.

Definition at line 143 of file TRT_BaseElement.cxx.

144 {
145  if (!m_strawSurfacesCache[straw]) {
147  createSurfaceCache(id);
148  }
149  // forward the transform of the cache
150  return m_strawSurfacesCache[straw]->center();
151 }

◆ strawDirection()

int InDetDD::TRT_EndcapElement::strawDirection ( ) const
finaloverridevirtual

StrawDirection.

+1 if axis is in same direction as local coordinate, -1 otherwise.

Implements InDetDD::TRT_BaseElement.

Definition at line 253 of file TRT_EndcapElement.cxx.

254 {
255  // Return +1 if the straw local axis is in the same direction as increasing
256  // eta direction,
257  // -1 otherwise.
258  // The straw axis by convention goes in the direction away from the readout.
259  // This is towards the beam pipe. For +ve endcap it is what we want. For -ve
260  // endcap it is oppposite.
261  //
262  //
263  return (m_code.isPosZ()) ? +1 : -1;
264 }

◆ strawLength()

const double & InDetDD::TRT_EndcapElement::strawLength ( ) const
overridevirtual

Active straw length.

Implements InDetDD::TRT_BaseElement.

Definition at line 70 of file TRT_EndcapElement.cxx.

71 {
72  return m_descriptor->strawLength();
73 }

◆ strawSurface()

const Trk::StraightLineSurface & InDetDD::TRT_BaseElement::strawSurface ( int  straw) const
inherited

Straw Surface: access to the surface via integer.

Definition at line 121 of file TRT_BaseElement.cxx.

122 {
123  if (!m_strawSurfaces[straw]) {
124  // get the straw identifier to the given straw number and element identifier
126  createSurfaceCache(id);
127  }
128  return *(m_strawSurfaces[straw].get());
129 }

◆ strawTransform() [1/2]

const Amg::Transform3D & InDetDD::TRT_BaseElement::strawTransform ( int  straw) const
inherited

Straw Surface: Local -> global transform of the straw via integer.

Definition at line 132 of file TRT_BaseElement.cxx.

133 {
134  if (!m_strawSurfacesCache[straw]) {
136  createSurfaceCache(id);
137  }
138  // forward the transform of the cache
139  return m_strawSurfacesCache[straw]->transform();
140 }

◆ strawTransform() [2/2]

const Amg::Transform3D & InDetDD::TRT_BaseElement::strawTransform ( unsigned int  straw) const
inherited

Straw transform - fast access in array, in Tracking frame: Amg.

Straw Surface: access to the transform of individual straw in Tracking frame: Amg

Definition at line 89 of file TRT_BaseElement.cxx.

90 {
94  }
95  // forward the transform of the cache
96  return m_strawSurfacesCache[straw]->transform();
97 }

◆ surface() [1/2]

virtual const Trk::Surface& InDetDD::TRT_BaseElement::surface ( ) const
finaloverridevirtualinherited

Element Surface: access to the Surface (straw layer)

Implements Trk::TrkDetElementBase.

◆ surface() [2/2]

const Trk::Surface & InDetDD::TRT_BaseElement::surface ( const Identifier id) const
finaloverridevirtualinherited

Straw Surface: access to the surface via identifier.

Implements Trk::TrkDetElementBase.

Definition at line 48 of file TRT_BaseElement.cxx.

49 {
50  int straw = m_idHelper->straw(id);
51  if (!m_strawSurfaces[straw]) {
53  }
54  return *(m_strawSurfaces[straw]);
55 }

◆ surfaces()

const std::vector< const Trk::Surface * > & InDetDD::TRT_BaseElement::surfaces ( ) const
inherited

Returns the full list of all detection surfaces associated to this detector element.

Definition at line 58 of file TRT_BaseElement.cxx.

59 {
60  if (!m_surfaces.isValid()) {
61  std::vector<const Trk::Surface*> tmp_surfaces;
62  tmp_surfaces.reserve(nStraws());
63  for (unsigned is = 0; is < nStraws(); ++is) {
64  tmp_surfaces.push_back(&strawSurface(is));
65  }
66  m_surfaces.set(tmp_surfaces);
67  }
68  return *(m_surfaces.ptr());
69 }

◆ transform() [1/2]

virtual const Amg::Transform3D& InDetDD::TRT_BaseElement::transform ( ) const
finaloverridevirtualinherited

Element Surface: Get Transform of element in Tracking frame: Amg.

Implements Trk::TrkDetElementBase.

◆ transform() [2/2]

const Amg::Transform3D & InDetDD::TRT_BaseElement::transform ( const Identifier id) const
finaloverridevirtualinherited

Straw Surface: access to the transform of individual straw in Tracking frame: Amg.

Implements Trk::TrkDetElementBase.

Definition at line 78 of file TRT_BaseElement.cxx.

79 {
80  int straw = m_idHelper->straw(id);
83  }
84  // forward the transform of the cache
85  return m_strawSurfacesCache[straw]->transform();
86 }

◆ type()

virtual TRT_BaseElement::Type InDetDD::TRT_EndcapElement::type ( ) const
finaloverridevirtual

Type information:

Implements InDetDD::TRT_BaseElement.

◆ updateAllCaches()

void InDetDD::TRT_BaseElement::updateAllCaches ( )
inherited

Update all caches.

Definition at line 209 of file TRT_BaseElement.cxx.

210 {
211  // delete the caches first
212  deleteCache();
213  // Strawlayer caches
214  if (!m_surfaceCache.isValid()){
216  }
217  // Loop over all straws and request items that get cached.
218  for (unsigned int iStraw = 0; iStraw < nStraws(); iStraw++) {
219  Identifier strawId = m_idHelper->straw_id(identify(), iStraw);
220  createSurfaceCache(strawId);
221  }
222 }

Member Data Documentation

◆ m_code

TRT_EndcapCode InDetDD::TRT_EndcapElement::m_code
private

Definition at line 119 of file TRT_EndcapElement.h.

◆ m_conditions

const TRT_Conditions* InDetDD::TRT_BaseElement::m_conditions =nullptr
protectedinherited

Definition at line 213 of file TRT_BaseElement.h.

◆ m_descriptor

const TRT_EndcapDescriptor* InDetDD::TRT_EndcapElement::m_descriptor
private

Definition at line 120 of file TRT_EndcapElement.h.

◆ m_id

Identifier InDetDD::TRT_BaseElement::m_id
protectedinherited

Definition at line 204 of file TRT_BaseElement.h.

◆ m_idHash

IdentifierHash InDetDD::TRT_BaseElement::m_idHash
protectedinherited

Definition at line 205 of file TRT_BaseElement.h.

◆ m_idHelper

const TRT_ID* InDetDD::TRT_BaseElement::m_idHelper =nullptr
protectedinherited

Definition at line 212 of file TRT_BaseElement.h.

◆ m_nextInZ

const TRT_EndcapElement* InDetDD::TRT_EndcapElement::m_nextInZ
private

Definition at line 121 of file TRT_EndcapElement.h.

◆ m_nstraws

unsigned int InDetDD::TRT_BaseElement::m_nstraws = 0
protectedinherited

Definition at line 211 of file TRT_BaseElement.h.

◆ m_previousInZ

const TRT_EndcapElement* InDetDD::TRT_EndcapElement::m_previousInZ
private

Definition at line 122 of file TRT_EndcapElement.h.

◆ m_strawSurfaces

std::vector<CxxUtils::CachedUniquePtr<Trk::StraightLineSurface> > InDetDD::TRT_BaseElement::m_strawSurfaces {}
protectedinherited

Definition at line 216 of file TRT_BaseElement.h.

◆ m_strawSurfacesCache

std::vector<CxxUtils::CachedUniquePtr<SurfaceCacheBase> > InDetDD::TRT_BaseElement::m_strawSurfacesCache {}
protectedinherited

helper element surface for the cache

Definition at line 217 of file TRT_BaseElement.h.

◆ m_surface

CxxUtils::CachedUniquePtr<Trk::Surface> InDetDD::TRT_BaseElement::m_surface
protectedinherited

Definition at line 214 of file TRT_BaseElement.h.

◆ m_surfaceCache

CxxUtils::CachedValue<SurfaceCache> InDetDD::TRT_BaseElement::m_surfaceCache
protectedinherited

Definition at line 220 of file TRT_BaseElement.h.

◆ m_surfaces

CxxUtils::CachedValue<std::vector<const Trk::Surface*> > InDetDD::TRT_BaseElement::m_surfaces
protectedinherited

Definition at line 219 of file TRT_BaseElement.h.


The documentation for this class was generated from the following files:
beamspotman.r
def r
Definition: beamspotman.py:676
InDetDD::TRT_EndcapCode::getStrawLayerIndex
unsigned int getStrawLayerIndex() const
Definition: TRT_EndcapCode.h:90
TRT_ID::layer_id
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
Definition: TRT_ID.h:500
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
InDetDD::TRT_BaseElement::strawDirection
virtual int strawDirection() const =0
StrawDirection.
TRT::Hit::straw
@ straw
Definition: HitInfo.h:82
CxxUtils::CachedValue::ptr
const T * ptr() const
Return a pointer to the cached value.
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
InDetDD::TRT_EndcapDescriptor::innerRadius
double & innerRadius()
The inner radius:
Definition: TRT_EndcapDescriptor.cxx:49
ParticleGun_SamplingFraction.bec
int bec
Definition: ParticleGun_SamplingFraction.py:89
Trk::DetectorElemType::Tgc
@ Tgc
InDetDD::TRT_BaseElement::deleteCache
void deleteCache()
Helper method for cache dealing.
Definition: TRT_BaseElement.cxx:200
CxxUtils::CachedValue::isValid
bool isValid() const
Test to see if the value is valid.
Trk::DetectorElemType::TRT
@ TRT
InDetDD::TRT_BaseElement::nStraws
unsigned int nStraws() const
Number of straws in the element.
InDetDD::TRT_EndcapElement::m_descriptor
const TRT_EndcapDescriptor * m_descriptor
Definition: TRT_EndcapElement.h:120
InDetDD::TRT_EndcapDescriptor::strawBounds
const Trk::SurfaceBounds & strawBounds() const
Get Bounds.
Definition: TRT_EndcapDescriptor.cxx:54
M_PI
#define M_PI
Definition: ActiveFraction.h:11
deg
#define deg
Definition: SbPolyhedron.cxx:17
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
InDetDD::TRT_EndcapDescriptor::nStraws
unsigned int & nStraws()
The number of straws in a module:
Definition: TRT_EndcapDescriptor.cxx:33
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
Trk::DetectorElemType::Csc
@ Csc
Trk::TrkDetElementBase::detectorType
virtual DetectorElemType detectorType() const =0
Return the Detector element type.
InDetDD::TRT_BaseElement::m_nstraws
unsigned int m_nstraws
Definition: TRT_BaseElement.h:211
Trk::DetectorElemType::Silicon
@ Silicon
InDetDD::TRT_BaseElement::m_strawSurfaces
std::vector< CxxUtils::CachedUniquePtr< Trk::StraightLineSurface > > m_strawSurfaces
Definition: TRT_BaseElement.h:216
InDetDD::TRT_EndcapCode::getWheelIndex
unsigned int getWheelIndex() const
Definition: TRT_EndcapCode.h:84
InDetDD::TRT_EndcapDescriptor::getStrawTransform
const GeoXF::Function * getStrawTransform() const
Get the tranformation field, which we do not own:
TRT_ID::straw
int straw(const Identifier &id) const
Definition: TRT_ID.h:902
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
Trk::DetectorElemType::SolidState
@ SolidState
lumiFormat.i
int i
Definition: lumiFormat.py:92
z
#define z
InDetDD::TRT_EndcapElement::getCode
const TRT_EndcapCode & getCode() const
Doomed (??)
InDetDD::TRT_BaseElement::ENDCAP
@ ENDCAP
Definition: TRT_BaseElement.h:61
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
CLHEP
STD'S.
Definition: IAtRndmGenSvc.h:19
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
dumpNswErrorDb.linear
def linear
Definition: dumpNswErrorDb.py:23
InDetDD::TRT_BaseElement::m_idHelper
const TRT_ID * m_idHelper
Definition: TRT_BaseElement.h:212
InDetDD::TRT_BaseElement::conditions
const TRT_Conditions * conditions() const
Return the TRT_Conditions object associated to this Detector element.
InDetDD::TRT_EndcapElement::m_code
TRT_EndcapCode m_code
Definition: TRT_EndcapElement.h:119
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_EndcapElement::elementSurface
virtual const Trk::Surface & elementSurface() const override
return the surface of the element
Definition: TRT_EndcapElement.cxx:191
InDetDD::TRT_EndcapCode::isPosZ
unsigned int isPosZ() const
Definition: TRT_EndcapCode.h:79
InDetDD::TRT_EndcapElement::m_nextInZ
const TRT_EndcapElement * m_nextInZ
Definition: TRT_EndcapElement.h:121
InDetDD::TRT_BaseElement::m_surfaces
CxxUtils::CachedValue< std::vector< const Trk::Surface * > > m_surfaces
Definition: TRT_BaseElement.h:219
InDetDD::TRT_EndcapDescriptor::startPhi
double & startPhi()
The starting phi (angular!!)
Definition: TRT_EndcapDescriptor.cxx:41
Trk::DetectorElemType::sTgc
@ sTgc
InDetDD::TRT_EndcapDescriptor::getStrawTransformOffset
size_t getStrawTransformOffset() const
Get the offset into the transformation field:
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
InDetDD::TRT_BaseElement::invalidateOther
void invalidateOther() const
invalidate action on the cache
Definition: TRT_BaseElement.h:193
TRTCond::ExpandedIdentifier::STRAW
@ STRAW
Definition: InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h:37
TRTCond::StrawDxContainer
Definition: StrawDxContainer.h:109
CxxUtils::CachedValue::set
void set(const T &val) const
Set the value, assuming it is currently invalid.
TRTCond::StrawDxContainerTemplate::getDx1
float getDx1(const ExpandedIdentifier &id) const
access to unpacked dx
Definition: StrawDxContainer.h:61
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_EndcapCode::getPhiIndex
unsigned int getPhiIndex() const
Definition: TRT_EndcapCode.h:95
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
eflowRec::phiIndex
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition: EtaPhiLUT.cxx:23
InDetDD::TRT_EndcapElement::strawLength
virtual const double & strawLength() const override
Active straw length.
Definition: TRT_EndcapElement.cxx:70
makeTRTBarrelCans.dy
tuple dy
Definition: makeTRTBarrelCans.py:21
InDetDD::TRT_EndcapDescriptor::strawPitch
double & strawPitch()
The straw pitch (angular!!)
Definition: TRT_EndcapDescriptor.cxx:37
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
Trk::DetectorElemType::MM
@ MM
Trk::DetectorElemType::Rpc
@ Rpc
InDetDD::TRT_EndcapElement::calculateLocalStrawTransform
HepGeom::Transform3D calculateLocalStrawTransform(int straw) const
Definition: TRT_EndcapElement.cxx:144
InDetDD::TRT_EndcapDescriptor::strawLength
double & strawLength()
Definition: TRT_EndcapDescriptor.cxx:45
InDetDD::TRT_Conditions::dxContainer
const TRTCond::StrawDxContainer * dxContainer() const
Definition: TRT_Conditions.cxx:14
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
InDetDD::TRT_BaseElement::center
virtual const Amg::Vector3D & center() const override final
Element Surface: center of a straw layer.
Amg::EigenTransformToCLHEP
HepGeom::Transform3D EigenTransformToCLHEP(const Amg::Transform3D &eigenTransf)
Converts an Eigen-based Amg::Transform3D into a CLHEP-based HepGeom::Transform3D.
Definition: CLHEPtoEigenConverter.h:120
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
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
InDetDD::TRT_BaseElement::normal
virtual const Amg::Vector3D & normal() const override final
Element Surface: normal of a straw layer.
TRTCond::ExpandedIdentifier
Identifier for TRT detector elements in the conditions code.
Definition: InnerDetector/InDetConditions/TRT_ConditionsData/TRT_ConditionsData/ExpandedIdentifier.h:30
InDetDD::TRT_EndcapElement::m_previousInZ
const TRT_EndcapElement * m_previousInZ
Definition: TRT_EndcapElement.h:122
TRTCond::StrawDxContainerTemplate::getDx2
float getDx2(const ExpandedIdentifier &id) const
Definition: StrawDxContainer.h:65
Trk::DetectorElemType::Mdt
@ Mdt
InDetDD::TRT_BaseElement::m_surface
CxxUtils::CachedUniquePtr< Trk::Surface > m_surface
Definition: TRT_BaseElement.h:214
python.trfValidateRootFile.rc
rc
Definition: trfValidateRootFile.py:350
InDetDD::TRT_EndcapElement::createSurfaceCacheHelper
SurfaceCache createSurfaceCacheHelper() const
Definition: TRT_EndcapElement.cxx:211
TRT_ID::straw_id
Identifier straw_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Three ways of getting id for a single straw:
Definition: TRT_ID.h:581
InDetDD::TRT_BaseElement::transform
virtual const Amg::Transform3D & transform() const override final
Element Surface: Get Transform of element in Tracking frame: Amg.