FairShip
Loading...
Searching...
No Matches
SHiP::ActsStrawGeometry Class Reference

#include <ActsStrawGeometry.hpp>

Public Member Functions

 ActsStrawGeometry (const TGeoManager &geometry)
const Acts::Surface * surface (int detectorId) const
 The straw surface for a strawtubes detector ID, or nullptr if unknown.
const StrawWire * wire (int detectorId) const
 The wire for a strawtubes detector ID, or nullptr if unknown.
const std::unordered_map< int, StrawWire > & wires () const
std::size_t size () const

Private Attributes

std::unordered_map< int, std::shared_ptr< Acts::Surface > > m_surfaces
std::unordered_map< int, StrawWire > m_wires

Detailed Description

ACTS straw surfaces of the strawtubes spectrometer.

Built from the "straw" volumes of the loaded TGeo geometry, so the surfaces follow the geometry the event was simulated with. Each straw is looked up by its strawtubes detector ID.

Definition at line 38 of file ActsStrawGeometry.hpp.

Constructor & Destructor Documentation

◆ ActsStrawGeometry()

SHiP::ActsStrawGeometry::ActsStrawGeometry ( const TGeoManager & geometry)
explicit

Definition at line 167 of file ActsStrawGeometry.cpp.

167 {
168 const TGeoVolume* top = geometry.GetTopVolume();
169 if (top == nullptr) {
170 throw std::invalid_argument("ActsStrawGeometry: no geometry loaded");
171 }
172 Builder builder{m_surfaces, m_wires, nullptr};
173 builder.visit(*top, TGeoHMatrix());
174 if (m_surfaces.empty()) {
175 throw std::runtime_error("ActsStrawGeometry: no straws in the geometry");
176 }
177}
std::unordered_map< int, std::shared_ptr< Acts::Surface > > m_surfaces
std::unordered_map< int, StrawWire > m_wires

Member Function Documentation

◆ size()

std::size_t SHiP::ActsStrawGeometry::size ( ) const
inline

Definition at line 47 of file ActsStrawGeometry.hpp.

47{ return m_surfaces.size(); }

◆ surface()

const Acts::Surface * SHiP::ActsStrawGeometry::surface ( int detectorId) const

The straw surface for a strawtubes detector ID, or nullptr if unknown.

Definition at line 179 of file ActsStrawGeometry.cpp.

179 {
180 const auto it = m_surfaces.find(detectorId);
181 return it == m_surfaces.end() ? nullptr : it->second.get();
182}

◆ wire()

const StrawWire * SHiP::ActsStrawGeometry::wire ( int detectorId) const

The wire for a strawtubes detector ID, or nullptr if unknown.

Definition at line 184 of file ActsStrawGeometry.cpp.

184 {
185 const auto it = m_wires.find(detectorId);
186 return it == m_wires.end() ? nullptr : &it->second;
187}

◆ wires()

const std::unordered_map< int, StrawWire > & SHiP::ActsStrawGeometry::wires ( ) const
inline

Definition at line 46 of file ActsStrawGeometry.hpp.

46{ return m_wires; }

Member Data Documentation

◆ m_surfaces

std::unordered_map<int, std::shared_ptr<Acts::Surface> > SHiP::ActsStrawGeometry::m_surfaces
private

Definition at line 50 of file ActsStrawGeometry.hpp.

◆ m_wires

std::unordered_map<int, StrawWire> SHiP::ActsStrawGeometry::m_wires
private

Definition at line 51 of file ActsStrawGeometry.hpp.


The documentation for this class was generated from the following files: