ATLAS Offline Software
Public Types | Public Member Functions | Public Attributes | Private Attributes | List of all members
Muon::MuonChamberHoleRecoveryTool::RecoveryState Struct Reference
Collaboration diagram for Muon::MuonChamberHoleRecoveryTool::RecoveryState:

Public Types

enum  CopyTarget { CopyTarget::GlobalTrkStates, CopyTarget::ChamberTrkStates }
 Switch indicating whether the track states are copied onto the global cache vector or onto the chamber cache vector. More...
 

Public Member Functions

 RecoveryState (const Trk::Track &trk)
 
Trk::TrackStates::const_iterator begin () const
 
Trk::TrackStates::const_iterator end () const
 
const Trk::TrackStateOnSurfacetsos () const
 
bool nextState ()
 Increments the internal iterator. More...
 
void copyState (CopyTarget target)
 
const Trk::TrackParameterschamberPars () const
 Track parameters of the chamber. More...
 
void finalizeChamber ()
 Sorts the hits accumulated in the current chamber using the first track parameters in that chamber. More...
 
std::unique_ptr< Trk::TrackStatesreleaseStates ()
 Moves the recovered track states on surface onto a Trk::TrackStates to be piped into a new Trk::Track object. More...
 

Public Attributes

std::set< IdentifierlayersOnTrk {}
 List of all measurement layers on track. More...
 
Identifier tsosId {}
 Identifier of the current trackStateOnSurface. More...
 
NewTrackStates chamberStates {}
 Vector of the track states on surface in the current chamber. More...
 

Private Attributes

const Trk::Trackm_trk
 
Trk::TrackStates::const_iterator m_curr_itr {begin()}
 
bool m_nextCalled {false}
 
NewTrackStates m_newStates {}
 
std::set< const Trk::TrackStateOnSurface * > m_copiedStates {}
 

Detailed Description

Definition at line 53 of file MuonChamberHoleRecoveryTool.h.

Member Enumeration Documentation

◆ CopyTarget

Switch indicating whether the track states are copied onto the global cache vector or onto the chamber cache vector.

The chamber cache vector is sorted and moved onto the global

Enumerator
GlobalTrkStates 
ChamberTrkStates 

Definition at line 66 of file MuonChamberHoleRecoveryTool.h.

66  {
67  GlobalTrkStates,
68  ChamberTrkStates
69  };

Constructor & Destructor Documentation

◆ RecoveryState()

Muon::MuonChamberHoleRecoveryTool::RecoveryState::RecoveryState ( const Trk::Track trk)

Definition at line 47 of file MuonChamberHoleRecoveryTool.cxx.

47 : m_trk{trk} {}

Member Function Documentation

◆ begin()

Trk::TrackStates::const_iterator Muon::MuonChamberHoleRecoveryTool::RecoveryState::begin ( ) const

Definition at line 48 of file MuonChamberHoleRecoveryTool.cxx.

48  {
49  return m_trk.trackStateOnSurfaces()->begin();
50  }

◆ chamberPars()

const Trk::TrackParameters * Muon::MuonChamberHoleRecoveryTool::RecoveryState::chamberPars ( ) const

Track parameters of the chamber.

Usually that are the parameters of the first TSOS in the chamberStates vector

Definition at line 70 of file MuonChamberHoleRecoveryTool.cxx.

70  {
71  return chamberStates.empty() ? tsos()->trackParameters() : chamberStates[0]->trackParameters();
72  }

◆ copyState()

void Muon::MuonChamberHoleRecoveryTool::RecoveryState::copyState ( CopyTarget  target)

Definition at line 65 of file MuonChamberHoleRecoveryTool.cxx.

65  {
66  if (!m_copiedStates.insert(tsos()).second) return;
67  if (target == CopyTarget::GlobalTrkStates) m_newStates.emplace_back(tsos()->clone());
68  else chamberStates.emplace_back(tsos()->clone());
69  }

◆ end()

Trk::TrackStates::const_iterator Muon::MuonChamberHoleRecoveryTool::RecoveryState::end ( ) const

Definition at line 51 of file MuonChamberHoleRecoveryTool.cxx.

51  {
52  return m_trk.trackStateOnSurfaces()->end();
53  }

◆ finalizeChamber()

void Muon::MuonChamberHoleRecoveryTool::RecoveryState::finalizeChamber ( )

Sorts the hits accumulated in the current chamber using the first track parameters in that chamber.

The sorted hits are moved onto the final track state vector

Definition at line 73 of file MuonChamberHoleRecoveryTool.cxx.

73  {
74  if (chamberStates.empty()) return;
75  std::stable_sort(chamberStates.begin(), chamberStates.end(), SortTSOSByDistanceToPars(chamberPars()));
76  m_newStates.insert(m_newStates.end(), std::make_move_iterator(chamberStates.begin()),
77  std::make_move_iterator(chamberStates.end()));
78  chamberStates.clear();
79  }

◆ nextState()

bool Muon::MuonChamberHoleRecoveryTool::RecoveryState::nextState ( )

Increments the internal iterator.

Definition at line 57 of file MuonChamberHoleRecoveryTool.cxx.

57  {
58  if (!m_nextCalled) {
59  m_nextCalled = true;
60  return true;
61  }
62  if (m_curr_itr == end()) return false;
63  return (++m_curr_itr) != end();
64  }

◆ releaseStates()

std::unique_ptr< Trk::TrackStates > Muon::MuonChamberHoleRecoveryTool::RecoveryState::releaseStates ( )

Moves the recovered track states on surface onto a Trk::TrackStates to be piped into a new Trk::Track object.

Definition at line 80 of file MuonChamberHoleRecoveryTool.cxx.

80  {
82  std::unique_ptr<Trk::TrackStates> outVec = std::make_unique<Trk::TrackStates>();
83  for (std::unique_ptr<const Trk::TrackStateOnSurface>& tsos : m_newStates){
84  outVec->push_back(std::move(tsos));
85  }
86  return outVec;
87  }

◆ tsos()

const Trk::TrackStateOnSurface * Muon::MuonChamberHoleRecoveryTool::RecoveryState::tsos ( ) const

Definition at line 54 of file MuonChamberHoleRecoveryTool.cxx.

54  {
55  return m_curr_itr != end() ? (*m_curr_itr) : nullptr;
56  }

Member Data Documentation

◆ chamberStates

NewTrackStates Muon::MuonChamberHoleRecoveryTool::RecoveryState::chamberStates {}

Vector of the track states on surface in the current chamber.

Definition at line 78 of file MuonChamberHoleRecoveryTool.h.

◆ layersOnTrk

std::set<Identifier> Muon::MuonChamberHoleRecoveryTool::RecoveryState::layersOnTrk {}

List of all measurement layers on track.

Definition at line 73 of file MuonChamberHoleRecoveryTool.h.

◆ m_copiedStates

std::set<const Trk::TrackStateOnSurface*> Muon::MuonChamberHoleRecoveryTool::RecoveryState::m_copiedStates {}
private

Definition at line 97 of file MuonChamberHoleRecoveryTool.h.

◆ m_curr_itr

Trk::TrackStates::const_iterator Muon::MuonChamberHoleRecoveryTool::RecoveryState::m_curr_itr {begin()}
private

Definition at line 93 of file MuonChamberHoleRecoveryTool.h.

◆ m_newStates

NewTrackStates Muon::MuonChamberHoleRecoveryTool::RecoveryState::m_newStates {}
private

Definition at line 96 of file MuonChamberHoleRecoveryTool.h.

◆ m_nextCalled

bool Muon::MuonChamberHoleRecoveryTool::RecoveryState::m_nextCalled {false}
private

Definition at line 94 of file MuonChamberHoleRecoveryTool.h.

◆ m_trk

const Trk::Track& Muon::MuonChamberHoleRecoveryTool::RecoveryState::m_trk
private

Definition at line 92 of file MuonChamberHoleRecoveryTool.h.

◆ tsosId

Identifier Muon::MuonChamberHoleRecoveryTool::RecoveryState::tsosId {}

Identifier of the current trackStateOnSurface.

Definition at line 75 of file MuonChamberHoleRecoveryTool.h.


The documentation for this struct was generated from the following files:
Trk::TrackStateOnSurface::trackParameters
const TrackParameters * trackParameters() const
return ptr to trackparameters const overload
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
Muon::MuonChamberHoleRecoveryTool::RecoveryState::m_trk
const Trk::Track & m_trk
Definition: MuonChamberHoleRecoveryTool.h:92
Muon::MuonChamberHoleRecoveryTool::RecoveryState::finalizeChamber
void finalizeChamber()
Sorts the hits accumulated in the current chamber using the first track parameters in that chamber.
Definition: MuonChamberHoleRecoveryTool.cxx:73
Trk::Track::trackStateOnSurfaces
const Trk::TrackStates * trackStateOnSurfaces() const
return a pointer to a const DataVector of const TrackStateOnSurfaces.
python.Utilities.clone
clone
Definition: Utilities.py:134
std::stable_sort
void stable_sort(std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, std::reverse_iterator< DataModel_detail::iterator< DVL > > end, Compare comp)
Specialization of stable_sort for DataVector/List.
Definition: DVL_algorithms.h:711
Muon::MuonChamberHoleRecoveryTool::RecoveryState::m_newStates
NewTrackStates m_newStates
Definition: MuonChamberHoleRecoveryTool.h:96
Muon::MuonChamberHoleRecoveryTool::RecoveryState::tsos
const Trk::TrackStateOnSurface * tsos() const
Definition: MuonChamberHoleRecoveryTool.cxx:54
Muon::MuonChamberHoleRecoveryTool::RecoveryState::chamberPars
const Trk::TrackParameters * chamberPars() const
Track parameters of the chamber.
Definition: MuonChamberHoleRecoveryTool.cxx:70
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
Muon::MuonChamberHoleRecoveryTool::RecoveryState::end
Trk::TrackStates::const_iterator end() const
Definition: MuonChamberHoleRecoveryTool.cxx:51
Muon::MuonChamberHoleRecoveryTool::RecoveryState::m_curr_itr
Trk::TrackStates::const_iterator m_curr_itr
Definition: MuonChamberHoleRecoveryTool.h:93
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Muon::MuonChamberHoleRecoveryTool::RecoveryState::m_nextCalled
bool m_nextCalled
Definition: MuonChamberHoleRecoveryTool.h:94
Muon::MuonChamberHoleRecoveryTool::RecoveryState::CopyTarget::GlobalTrkStates
@ GlobalTrkStates
COOLRates.target
target
Definition: COOLRates.py:1106
Muon::MuonChamberHoleRecoveryTool::RecoveryState::chamberStates
NewTrackStates chamberStates
Vector of the track states on surface in the current chamber.
Definition: MuonChamberHoleRecoveryTool.h:78
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Muon::MuonChamberHoleRecoveryTool::RecoveryState::m_copiedStates
std::set< const Trk::TrackStateOnSurface * > m_copiedStates
Definition: MuonChamberHoleRecoveryTool.h:97