ATLAS Offline Software
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
TrackingSurfaceHelper Class Reference

Simple helper class which allows to access the tracking surface associated to a certain (Si-)measurement. More...

#include <TrackingSurfaceHelper.h>

Collaboration diagram for TrackingSurfaceHelper:

Public Member Functions

 TrackingSurfaceHelper ()
 
 TrackingSurfaceHelper (std::array< std::vector< const Acts::Surface * >, s_NMeasTypes > &&acts_surfaces)
 
std::vector< const Acts::Surface * > & actsSurfaces (xAOD::UncalibMeasType type)
 
void setSiDetectorElements (xAOD::UncalibMeasType type, const InDetDD::SiDetectorElementCollection *det_element_collection)
 
const Acts::Surface & associatedActsSurface (const xAOD::UncalibratedMeasurement &measurement) const
 
const Trk::SurfaceassociatedSurface (const xAOD::UncalibratedMeasurement &measurement) const
 

Static Public Attributes

static constexpr unsigned int s_NMeasTypes = 4
 

Private Attributes

std::array< const InDetDD::SiDetectorElementCollection *, s_NMeasTypesm_siDetectorElements {}
 
std::array< std::vector< const Acts::Surface * >, s_NMeasTypesm_actsSurfaces
 

Detailed Description

Simple helper class which allows to access the tracking surface associated to a certain (Si-)measurement.

Definition at line 16 of file TrackingSurfaceHelper.h.

Constructor & Destructor Documentation

◆ TrackingSurfaceHelper() [1/2]

TrackingSurfaceHelper::TrackingSurfaceHelper ( )
inline

Definition at line 20 of file TrackingSurfaceHelper.h.

20 {}

◆ TrackingSurfaceHelper() [2/2]

TrackingSurfaceHelper::TrackingSurfaceHelper ( std::array< std::vector< const Acts::Surface * >, s_NMeasTypes > &&  acts_surfaces)
inline

Definition at line 21 of file TrackingSurfaceHelper.h.

22  : m_actsSurfaces(std::move(acts_surfaces))
23  {}

Member Function Documentation

◆ actsSurfaces()

std::vector< const Acts::Surface *>& TrackingSurfaceHelper::actsSurfaces ( xAOD::UncalibMeasType  type)
inline

Definition at line 25 of file TrackingSurfaceHelper.h.

25  {
26  assert(static_cast<std::size_t>(type) < m_actsSurfaces.size());
27  return m_actsSurfaces[static_cast<std::size_t>(type)];
28  }

◆ associatedActsSurface()

const Acts::Surface& TrackingSurfaceHelper::associatedActsSurface ( const xAOD::UncalibratedMeasurement measurement) const
inline

Definition at line 33 of file TrackingSurfaceHelper.h.

33  {
34  assert(static_cast<std::size_t>(measurement.type()) < m_actsSurfaces.size()
35  && measurement.identifierHash() < m_actsSurfaces[ static_cast<unsigned int>(measurement.type()) ].size() );
36  const Acts::Surface *acts_surface = m_actsSurfaces[ static_cast<unsigned int>(measurement.type()) ].at( measurement.identifierHash() );
37  assert( acts_surface);
38  return *acts_surface;
39  }

◆ associatedSurface()

const Trk::Surface& TrackingSurfaceHelper::associatedSurface ( const xAOD::UncalibratedMeasurement measurement) const
inline

Definition at line 40 of file TrackingSurfaceHelper.h.

40  {
41  // @TODO always do a runtime check ?
42  assert(static_cast<std::size_t>(measurement.type()) < m_siDetectorElements.size()
43  && m_siDetectorElements[ static_cast<unsigned int>(measurement.type()) ]);
45  element = m_siDetectorElements[ static_cast<unsigned int>( measurement.type()) ]
46  ->getDetectorElement(measurement.identifierHash());
47 
48  const Trk::Surface *surface = element ? &(element->surface()) : nullptr;
49  if (!surface) throw std::runtime_error("No associated surface for xAOD::UncalibratedMeasurement");
50  return *surface;
51  }

◆ setSiDetectorElements()

void TrackingSurfaceHelper::setSiDetectorElements ( xAOD::UncalibMeasType  type,
const InDetDD::SiDetectorElementCollection det_element_collection 
)
inline

Definition at line 29 of file TrackingSurfaceHelper.h.

29  {
30  assert(static_cast<std::size_t>(type) < m_siDetectorElements.size() );
31  m_siDetectorElements[static_cast<unsigned int>(type)] = det_element_collection;
32  }

Member Data Documentation

◆ m_actsSurfaces

std::array<std::vector< const Acts::Surface *>, s_NMeasTypes> TrackingSurfaceHelper::m_actsSurfaces
private

Definition at line 54 of file TrackingSurfaceHelper.h.

◆ m_siDetectorElements

std::array<const InDetDD::SiDetectorElementCollection *, s_NMeasTypes> TrackingSurfaceHelper::m_siDetectorElements {}
private

Definition at line 53 of file TrackingSurfaceHelper.h.

◆ s_NMeasTypes

constexpr unsigned int TrackingSurfaceHelper::s_NMeasTypes = 4
staticconstexpr

Definition at line 19 of file TrackingSurfaceHelper.h.


The documentation for this class was generated from the following file:
xAOD::UncalibratedMeasurement_v1::identifierHash
DetectorIDHashType identifierHash() const
Returns the IdentifierHash of the measurement (corresponds to the detector element IdentifierHash)
InDetDD::SolidStateDetectorElementBase::surface
Trk::Surface & surface()
Element Surface.
xAOD::UncalibratedMeasurement_v1::type
virtual xAOD::UncalibMeasType type() const =0
Returns the type of the measurement type as a simple enumeration.
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrackingSurfaceHelper::m_actsSurfaces
std::array< std::vector< const Acts::Surface * >, s_NMeasTypes > m_actsSurfaces
Definition: TrackingSurfaceHelper.h:54
TrackingSurfaceHelper::m_siDetectorElements
std::array< const InDetDD::SiDetectorElementCollection *, s_NMeasTypes > m_siDetectorElements
Definition: TrackingSurfaceHelper.h:53
Trk::Surface
Definition: Tracking/TrkDetDescr/TrkSurfaces/TrkSurfaces/Surface.h:75