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_BarrelElement Class Referencefinal

#include <TRT_BarrelElement.h>

Inheritance diagram for InDetDD::TRT_BarrelElement:
Collaboration diagram for InDetDD::TRT_BarrelElement:

Public Types

enum  Type { BARREL, ENDCAP }
 

Public Member Functions

 TRT_BarrelElement (const GeoVFullPhysVol *volume, const TRT_BarrelDescriptor *descriptor, bool isPositive, unsigned int modIndex, unsigned int phiIndex, unsigned int strawLayIndex, const TRT_ID *idHelper, const TRT_Conditions *conditions)
 Constructor: More...
 
 TRT_BarrelElement (const TRT_BarrelElement &right)
 
virtual ~TRT_BarrelElement ()=default
 Destructor: More...
 
virtual TRT_BaseElement::Type type () const override final
 Type information. More...
 
const TRT_BarrelDescriptorgetDescriptor () const
 Returns a pointer to a descriptor, giving common information on module construction: More...
 
double strawXPos (unsigned int i) const
 Get X Position: DEPRECATED. More...
 
double strawYPos (unsigned int i) const
 Get Y Position: DEPRECATED. More...
 
double strawZPos (unsigned int i) const
 Get Z Position: (active center) DEPRECATED. More...
 
virtual const double & strawLength () const override final
 Get the length of the straws (active length): More...
 
virtual int strawDirection () const override final
 StrawDirection. More...
 
const TRT_BarrelElementnextInPhi () const
 Returns the next-in-phi detector element, or zero if none (forseeing gaps, in other words). More...
 
const TRT_BarrelElementpreviousInPhi () const
 Returns the previous-in-phi detector element, or zero if none (forseeing gaps, in other words). More...
 
const TRT_BarrelElementnextInR () const
 Returns the next-in-R detector element, or zero if none. More...
 
const TRT_BarrelElementpreviousInR () const
 Returns the next-in-R detector element, or zero if none. More...
 
void setNextInPhi (const TRT_BarrelElement *element)
 Sets the next-in-phi detector. More...
 
void setPreviousInPhi (const TRT_BarrelElement *element)
 Sets the previous-in-phi detector. More...
 
void setNextInR (const TRT_BarrelElement *element)
 Sets the next-in-r detector. More...
 
void setPreviousInR (const TRT_BarrelElement *element)
 Sets the previous-in-r detector. More...
 
const TRT_BarrelCodegetCode () const
 Doomed (?): More...
 
virtual const Trk::SurfaceBoundsstrawBounds () const override final
 Surface 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 createSurfaceCache (Identifier id) const
 create the surface & surface cache for the straw 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_BarrelConditions * 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

const TRT_BarrelElementoperator= (const TRT_BarrelElement &right)=delete
 Illegal Operations: More...
 
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 deleteCache ()
 Helper method for cache dealing. More...
 

Private Attributes

TRT_BarrelCode m_code
 
const TRT_BarrelDescriptorm_descriptor
 
const TRT_BarrelElementm_nextInPhi
 
const TRT_BarrelElementm_previousInPhi
 
const TRT_BarrelElementm_nextInR
 
const TRT_BarrelElementm_previousInR
 

Detailed Description

Extended TRT_BaseElement to describe a TRT readout element, this is a planar layer with n ( order of 20 ) straws, in one of the 32 sectors of the TRT barrel.

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_BarrelElement.h.

Member Enumeration Documentation

◆ Type

Enumerator
BARREL 
ENDCAP 

Definition at line 61 of file TRT_BaseElement.h.

61 {BARREL, ENDCAP};

Constructor & Destructor Documentation

◆ TRT_BarrelElement() [1/2]

InDetDD::TRT_BarrelElement::TRT_BarrelElement ( const GeoVFullPhysVol *  volume,
const TRT_BarrelDescriptor descriptor,
bool  isPositive,
unsigned int  modIndex,
unsigned int  phiIndex,
unsigned int  strawLayIndex,
const TRT_ID idHelper,
const TRT_Conditions conditions 
)

Constructor:

Definition at line 25 of file TRT_BarrelElement.cxx.

33  : TRT_BaseElement(volume,
34  idHelper->layer_id((isPositive ? 1 : -1),
35  phiIndex,
36  modIndex,
37  strawLayIndex),
38  idHelper,
39  conditions)
40  , m_code(isPositive, modIndex, phiIndex, strawLayIndex)
41  , m_descriptor(descriptor)
42  , m_nextInPhi(nullptr)
43  , m_previousInPhi(nullptr)
44  , m_nextInR(nullptr)
45  , m_previousInR(nullptr)
46 
47 {
49  m_strawSurfaces.resize(m_nstraws);
51 }

◆ TRT_BarrelElement() [2/2]

InDetDD::TRT_BarrelElement::TRT_BarrelElement ( const TRT_BarrelElement right)

Definition at line 53 of file TRT_BarrelElement.cxx.

54  : TRT_BaseElement(right)
55  , m_code(right.m_code)
56  , m_descriptor(right.m_descriptor)
57  , m_nextInPhi(right.m_nextInPhi)
58  , m_previousInPhi(right.m_previousInPhi)
59  , m_nextInR(right.m_nextInR)
60  , m_previousInR(right.m_previousInR)
61 {
62  m_nstraws = right.m_nstraws;
63  m_strawSurfaces.resize(m_nstraws);
65 }

◆ ~TRT_BarrelElement()

virtual InDetDD::TRT_BarrelElement::~TRT_BarrelElement ( )
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_BarrelElement::calculateLocalStrawTransform ( int  straw) const
private

Definition at line 126 of file TRT_BarrelElement.cxx.

127 {
128  const TRTCond::StrawDxContainer* container = conditions()->dxContainer();
130  if(!container) {
131  // std::cout << " TRT_BarrelElement: no local transform found " << std::endl;
132  } else {
133  // important note: dx1 moves the 'negative' wire endpoint end dx2
134  // the 'positive' wire endpoint in the local straw frame. In the
135  // global frame, 'dx1' corresponds to the readout side and 'dx2'
136  // to the wire joint side for both sides of the barrel.
137 
138  int bec = getCode().isPosZ() ? +1 : -1 ;
139  int layer = getCode().getModuleIndex();
140  int phimodule = getCode().getPhiIndex();
141  int strawlayer = getCode().getStrawLayerIndex();
143  (bec,layer,phimodule,strawlayer,straw,TRTCond::ExpandedIdentifier::STRAW);
144  double dx1 = container->getDx1(id);
145  double dx2 = container->getDx2(id);
146  double ang = (dx2-dx1)/strawLength();
147  double dx = (dx2+dx1)/2.;
148  rc = HepGeom::TranslateX3D(dx)*HepGeom::RotateY3D(ang) ;
149  }
150  return rc ;
151 }

◆ calculateStrawTransform()

HepGeom::Transform3D InDetDD::TRT_BarrelElement::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 99 of file TRT_BarrelElement.cxx.

100 {
101  // NB The tranformation to a straw is reconstructed here precisely as
102  // it was ... hopefully... in the factory. One could eliminate this
103  // requirement and make the code a little more robust in this regard but
104  // at the cost of doubling the descriptors. (One descriptor now suffices
105  // for both positive and negative endcaps).
106  //std::cout << "In calculateStrawTransform" << std::endl;
107 
108  const GeoXF::Function *f= m_descriptor->getStrawTransform();
109  if (f) {
110  size_t offsetInto = m_descriptor->getStrawTransformOffset();
111  double zPos = -m_descriptor->strawZPos();
112  double zAng = m_code.isPosZ() ? M_PI : 0;
113  return Amg::EigenTransformToCLHEP(getMaterialGeom()->getAbsoluteTransform()*((*f)(straw+offsetInto)))
114  * HepGeom::RotateY3D(zAng)*HepGeom::TranslateZ3D(zPos)
120  } else {
121  std::cout << "calculateStrawTransform: f is 0 !!!!" << std::endl;
122  return {};
123  }
124 }

◆ 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_BarrelElement::createSurfaceCache ( ) const
overrideprivatevirtual

create the cache for the element

Implements InDetDD::TRT_BaseElement.

Definition at line 166 of file TRT_BarrelElement.cxx.

167 {
168  // create the surface cache
169  if (!m_surfaceCache.isValid()) {
171  }
172  // creaete the surface (only if needed, links are still ok even if cache
173  // update)
174  if (!m_surface) {
175  elementSurface();
176  }
177 }

◆ createSurfaceCache() [2/2]

void InDetDD::TRT_BaseElement::createSurfaceCache ( Identifier  id) const
inherited

create the surface & surface cache for the straw

Definition at line 161 of file TRT_BaseElement.cxx.

162 {
163  int straw = m_idHelper->straw(id);
164 
165  // convert neccessary parts to Amg
166  if (!m_strawSurfacesCache[straw]) {
167  // create the surface cache & fill it
169  }
170  // creaete the surface only if needed (the links are still intact)
171  if (!m_strawSurfaces[straw]) {
172  m_strawSurfaces[straw].set(
173  std::make_unique<Trk::StraightLineSurface>(*this, id));
174  }
175 }

◆ createSurfaceCacheHelper()

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

Definition at line 179 of file TRT_BarrelElement.cxx.

179  {
180 
181  // Calculate the surface from the two end straws.
182  int firstStraw = 0;
183  int lastStraw = nStraws() - 1;
184 
185  const Amg::Vector3D& centerFirstStraw =
186  center(m_idHelper->straw_id(identify(), firstStraw));
187  const Amg::Vector3D& centerLastStraw =
188  center(m_idHelper->straw_id(identify(), lastStraw));
189 
190  // Calculate center as the average position of the end straws.
191  auto center = Amg::Vector3D(0.5 * (centerFirstStraw + centerLastStraw));
192 
193  Amg::Vector3D phiAxis = centerLastStraw - centerFirstStraw;
194  double width = phiAxis.mag();
195  phiAxis = phiAxis.normalized();
196  double elementWidth =
197  width + 2 * m_descriptor->innerTubeRadius(); // Add the straw tube radius
198 
199  // Get local z-axis. This is roughly in +ve global z direction (exactly if no
200  // misalignment) We could probably use any straw for this but we average the
201  // first and last straw and renormalize to a unit vector.
202  Amg::Vector3D etaAxis = 0.5 * (strawAxis(firstStraw) + strawAxis(lastStraw));
203  etaAxis = etaAxis.normalized();
204 
205  // Calculate normal. This will point away from the beam line based
206  // on the assumption that the straw numbering goes in the direction
207  // of increasing phi and the straw axis is in +ve z direction.
208  auto normal = Amg::Vector3D(phiAxis.cross(etaAxis)); // phi cross z
209 
210  // Transform from local to global.
211  // local x axis -> phiAxis
212  // local y axis -> etaAxis
213  // local z axis -> cross product of local x and local y
214  // translation -> center
215 
217  rotation.col(0) = phiAxis;
218  rotation.col(1) = etaAxis;
219  rotation.col(2) = normal;
220 
221  // This constructor takes three points in the two coordinate systems.
223 
224  // create the element bounds
225  auto elementBounds = std::make_unique<Trk::RectangleBounds>(
226  0.5 * elementWidth, 0.5 * strawLength());
227 
228  return { transform, center, normal, std::move(elementBounds) };
229 }

◆ 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_BarrelElement::elementSurface ( ) const
overrideprivatevirtual

return the surface of the element

Implements InDetDD::TRT_BaseElement.

Definition at line 158 of file TRT_BarrelElement.cxx.

159 {
160  if (not m_surface) {
161  m_surface.set(std::make_unique<Trk::PlaneSurface>(*this));
162  }
163  return *m_surface;
164 }

◆ 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_BarrelCode& InDetDD::TRT_BarrelElement::getCode ( ) const

Doomed (?):

◆ getConditionsData()

const TRT_BarrelConditions * InDetDD::TRT_BarrelElement::getConditionsData ( )
static

Returns a pointer to conditions data.

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

Definition at line 67 of file TRT_BarrelElement.cxx.

68 {
69  return nullptr;
70 }

◆ getDescriptor()

const TRT_BarrelDescriptor * InDetDD::TRT_BarrelElement::getDescriptor ( ) const

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

Definition at line 72 of file TRT_BarrelElement.cxx.

73 {
74  return m_descriptor;
75 }

◆ 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 {};

◆ nextInPhi()

const TRT_BarrelElement* InDetDD::TRT_BarrelElement::nextInPhi ( ) const

Returns the next-in-phi detector element, or zero if none (forseeing gaps, in other words).

◆ nextInR()

const TRT_BarrelElement* InDetDD::TRT_BarrelElement::nextInR ( ) const

Returns the next-in-R detector element, or zero if none.

◆ 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_BarrelElement& InDetDD::TRT_BarrelElement::operator= ( const TRT_BarrelElement right)
privatedelete

Illegal Operations:

◆ previousInPhi()

const TRT_BarrelElement* InDetDD::TRT_BarrelElement::previousInPhi ( ) const

Returns the previous-in-phi detector element, or zero if none (forseeing gaps, in other words).

◆ previousInR()

const TRT_BarrelElement* InDetDD::TRT_BarrelElement::previousInR ( ) const

Returns the next-in-R detector element, or zero if none.

◆ setNextInPhi()

void InDetDD::TRT_BarrelElement::setNextInPhi ( const TRT_BarrelElement element)

Sets the next-in-phi detector.

Definition at line 77 of file TRT_BarrelElement.cxx.

78 {
79  m_nextInPhi=element;
80 }

◆ setNextInR()

void InDetDD::TRT_BarrelElement::setNextInR ( const TRT_BarrelElement element)

Sets the next-in-r detector.

Definition at line 87 of file TRT_BarrelElement.cxx.

88 {
89  m_nextInR=element;
90 }

◆ setPreviousInPhi()

void InDetDD::TRT_BarrelElement::setPreviousInPhi ( const TRT_BarrelElement element)

Sets the previous-in-phi detector.

Definition at line 82 of file TRT_BarrelElement.cxx.

83 {
84  m_previousInPhi=element;
85 }

◆ setPreviousInR()

void InDetDD::TRT_BarrelElement::setPreviousInR ( const TRT_BarrelElement element)

Sets the previous-in-r detector.

Definition at line 92 of file TRT_BarrelElement.cxx.

93 {
94  m_previousInR=element;
95 }

◆ 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_BarrelElement::strawBounds ( ) const
finaloverridevirtual

Surface bounds.

Implements InDetDD::TRT_BaseElement.

Definition at line 153 of file TRT_BarrelElement.cxx.

154 {
155  return m_descriptor->strawBounds();
156 }

◆ 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_BarrelElement::strawDirection ( ) const
finaloverridevirtual

StrawDirection.

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

Implements InDetDD::TRT_BaseElement.

Definition at line 231 of file TRT_BarrelElement.cxx.

232 {
233  // Return +1 if the straw local axis is in the same direction as the z axis, -1 otherwise.
234  // The straw axis by convention goes in the direction away from the readout.
235  // So for -ve endcap this is the positive z direction (we return +1) and in the
236  // +ve endcap its in the -ve z direction (we return -1).
237  //
238  return !(m_code.isPosZ()) ? +1 : -1;
239 }

◆ strawLength()

virtual const double& InDetDD::TRT_BarrelElement::strawLength ( ) const
finaloverridevirtual

Get the length of the straws (active length):

Implements InDetDD::TRT_BaseElement.

◆ 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 }

◆ strawXPos()

double InDetDD::TRT_BarrelElement::strawXPos ( unsigned int  i) const
inline

Get X Position: DEPRECATED.

Please use starwCenter(i).x()

◆ strawYPos()

double InDetDD::TRT_BarrelElement::strawYPos ( unsigned int  i) const
inline

Get Y Position: DEPRECATED.

Please use starwCenter(i).y()

◆ strawZPos()

double InDetDD::TRT_BarrelElement::strawZPos ( unsigned int  i) const
inline

Get Z Position: (active center) DEPRECATED.

Please use starwCenter(i).z()

◆ 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_BarrelElement::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_BarrelCode InDetDD::TRT_BarrelElement::m_code
private

Definition at line 137 of file TRT_BarrelElement.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_BarrelDescriptor* InDetDD::TRT_BarrelElement::m_descriptor
private

Definition at line 138 of file TRT_BarrelElement.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_nextInPhi

const TRT_BarrelElement* InDetDD::TRT_BarrelElement::m_nextInPhi
private

Definition at line 139 of file TRT_BarrelElement.h.

◆ m_nextInR

const TRT_BarrelElement* InDetDD::TRT_BarrelElement::m_nextInR
private

Definition at line 141 of file TRT_BarrelElement.h.

◆ m_nstraws

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

Definition at line 211 of file TRT_BaseElement.h.

◆ m_previousInPhi

const TRT_BarrelElement* InDetDD::TRT_BarrelElement::m_previousInPhi
private

Definition at line 140 of file TRT_BarrelElement.h.

◆ m_previousInR

const TRT_BarrelElement* InDetDD::TRT_BarrelElement::m_previousInR
private

Definition at line 142 of file TRT_BarrelElement.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:
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
InDetDD::TRT_BarrelElement::m_nextInPhi
const TRT_BarrelElement * m_nextInPhi
Definition: TRT_BarrelElement.h:139
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.
ParticleGun_SamplingFraction.bec
int bec
Definition: ParticleGun_SamplingFraction.py:89
Trk::DetectorElemType::Tgc
@ Tgc
InDetDD::TRT_BarrelDescriptor::getStrawTransformOffset
size_t getStrawTransformOffset() const
Get the offset into the transformation field:
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_BaseElement::strawAxis
Amg::Vector3D strawAxis(int straw) const
Straw axis.
Definition: TRT_BaseElement.cxx:154
InDetDD::TRT_BarrelElement::m_nextInR
const TRT_BarrelElement * m_nextInR
Definition: TRT_BarrelElement.h:141
M_PI
#define M_PI
Definition: ActiveFraction.h:11
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_BarrelElement::m_descriptor
const TRT_BarrelDescriptor * m_descriptor
Definition: TRT_BarrelElement.h:138
InDetDD::TRT_BarrelDescriptor::innerTubeRadius
double innerTubeRadius() const
Get inner tube radius of the straw.
InDetDD::TRT_BarrelDescriptor::strawZPos
const double & strawZPos() const
Position of center of active region.
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
InDetDD::TRT_BaseElement::createSurfaceCacheHelper
std::unique_ptr< SurfaceCacheBase > createSurfaceCacheHelper(int straw) const
Definition: TRT_BaseElement.cxx:178
InDetDD::TRT_BarrelElement::m_previousInPhi
const TRT_BarrelElement * m_previousInPhi
Definition: TRT_BarrelElement.h:140
Trk::DetectorElemType::Silicon
@ Silicon
InDetDD::TRT_BaseElement::m_strawSurfaces
std::vector< CxxUtils::CachedUniquePtr< Trk::StraightLineSurface > > m_strawSurfaces
Definition: TRT_BaseElement.h:216
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
InDetDD::TRT_BarrelElement::createSurfaceCacheHelper
SurfaceCache createSurfaceCacheHelper() const
Definition: TRT_BarrelElement.cxx:179
Trk::DetectorElemType::SolidState
@ SolidState
lumiFormat.i
int i
Definition: lumiFormat.py:85
InDetDD::TRT_BaseElement::ENDCAP
@ ENDCAP
Definition: TRT_BaseElement.h:61
InDetDD::TRT_BarrelElement::strawLength
virtual const double & strawLength() const override final
Get the length of the straws (active length):
xAOD::rotation
rotation
Definition: TrackSurface_v1.cxx:15
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
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_BarrelCode::getStrawLayerIndex
unsigned int getStrawLayerIndex() const
Definition: TRT_BarrelCode.h:98
InDetDD::TRT_BarrelDescriptor::getStrawTransform
const GeoXF::Function * getStrawTransform() const
Get the tranformation field, which we do not own: Does not include the z shift which is different for...
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_BarrelElement::m_previousInR
const TRT_BarrelElement * m_previousInR
Definition: TRT_BarrelElement.h:142
InDetDD::TRT_BaseElement::identify
virtual Identifier identify() const override final
identifier of this detector element:
hist_file_dump.f
f
Definition: hist_file_dump.py:135
InDetDD::TRT_BarrelElement::calculateLocalStrawTransform
HepGeom::Transform3D calculateLocalStrawTransform(int straw) const
Definition: TRT_BarrelElement.cxx:126
InDetDD::TRT_BarrelCode::isPosZ
unsigned int isPosZ() const
Definition: TRT_BarrelCode.h:83
InDetDD::TRT_BarrelElement::getCode
const TRT_BarrelCode & getCode() const
Doomed (?):
InDetDD::TRT_BaseElement::m_surfaces
CxxUtils::CachedValue< std::vector< const Trk::Surface * > > m_surfaces
Definition: TRT_BaseElement.h:219
InDetDD::TRT_BarrelDescriptor::strawBounds
const Trk::SurfaceBounds & strawBounds() const
Get Bounds.
Definition: TRT_BarrelDescriptor.cxx:39
InDetDD::TRT_BarrelCode::getModuleIndex
unsigned int getModuleIndex() const
Definition: TRT_BarrelCode.h:88
Trk::DetectorElemType::sTgc
@ sTgc
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
eflowRec::phiIndex
unsigned int phiIndex(float phi, float binsize)
calculate phi index for a given phi
Definition: EtaPhiLUT.cxx:23
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
Base_Fragment.width
width
Definition: Sherpa_i/share/common/Base_Fragment.py:59
Trk::DetectorElemType::Rpc
@ Rpc
InDetDD::TRT_BarrelElement::m_code
TRT_BarrelCode m_code
Definition: TRT_BarrelElement.h:137
InDetDD::TRT_BarrelElement::elementSurface
virtual const Trk::Surface & elementSurface() const override
return the surface of the element
Definition: TRT_BarrelElement.cxx:158
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition: GeoPrimitives.h:49
InDetDD::TRT_Conditions::dxContainer
const TRTCond::StrawDxContainer * dxContainer() const
Definition: TRT_Conditions.cxx:14
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
makeTRTBarrelCans.dx
tuple dx
Definition: makeTRTBarrelCans.py:20
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
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
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_BarrelCode::getPhiIndex
unsigned int getPhiIndex() const
Definition: TRT_BarrelCode.h:93
TRTCond::StrawDxContainerTemplate::getDx2
float getDx2(const ExpandedIdentifier &id) const
Definition: StrawDxContainer.h:65
InDetDD::TRT_BarrelDescriptor::nStraws
unsigned int nStraws() const
Get the number of straws:
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:355
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.
Identifier
Definition: IdentifierFieldParser.cxx:14