ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
ActsTrk::MultiTrajectory Class Reference

Read only version of MTJ The implementation is separate as the details are significantly different and in addition only const methods are ever needed. More...

#include <MultiTrajectory.h>

Inheritance diagram for ActsTrk::MultiTrajectory:
Collaboration diagram for ActsTrk::MultiTrajectory:

Public Member Functions

 MultiTrajectory (DataLink< xAOD::TrackStateAuxContainer > trackStates, DataLink< xAOD::TrackParametersAuxContainer > trackParameters, DataLink< xAOD::TrackJacobianAuxContainer > trackJacobians, DataLink< xAOD::TrackMeasurementAuxContainer > trackMeasurements, DataLink< xAOD::TrackSurfaceAuxContainer > trackSurfaces)
 
bool has_impl (Acts::HashedString key, ActsTrk::IndexType istate) const
 
std::any component_impl (Acts::HashedString key, ActsTrk::IndexType istate) const
 
bool hasColumn_impl (Acts::HashedString key) const
 
ConstTrackStateProxy::Parameters parameters_impl (ActsTrk::IndexType index) const
 
ConstTrackStateProxy::Covariance covariance_impl (ActsTrk::IndexType index) const
 
ConstTrackStateProxy::Covariance jacobian_impl (ActsTrk::IndexType istate) const
 
template<std::size_t measdim>
ConstTrackStateProxy::template Calibrated< measdim > calibrated_impl (IndexType istate) const
 
template<std::size_t measdim>
ConstTrackStateProxy::template CalibratedCovariance< measdim > calibratedCovariance_impl (IndexType index) const
 
Acts::TrackIndexType size_impl () const
 
ActsTrk::IndexType calibratedSize_impl (ActsTrk::IndexType istate) const
 
Acts::SourceLink getUncalibratedSourceLink_impl (ActsTrk::IndexType istate) const
 
const Acts::Surface * referenceSurface_impl (IndexType) const
 
void fillSurfaces (const Acts::TrackingGeometry *geo, const Acts::GeometryContext &geoContext)
 Fill surfaces either from persistency or from geometry If the surfaces are already there it means that the container is trainsient and this is void operation. More...
 
void moveSurfaces (const ActsTrk::MutableMultiTrajectory *mtj)
 reuse surfaces from MutableMultiTrajectory More...
 
void moveLinks (const ActsTrk::MutableMultiTrajectory *mtj)
 
std::vector< Acts::HashedString > dynamicKeys_impl () const
 

Private Attributes

const DataLink< xAOD::TrackStateAuxContainerm_trackStatesAux
 
const DataLink< xAOD::TrackParametersAuxContainerm_trackParametersAux
 
const DataLink< xAOD::TrackJacobianAuxContainerm_trackJacobiansAux
 
const DataLink< xAOD::TrackMeasurementAuxContainerm_trackMeasurementsAux
 
const DataLink< xAOD::TrackSurfaceAuxContainerm_trackSurfacesAux
 
std::vector< ActsTrk::detail::Decorationm_decorations
 
std::vector< std::optional< Acts::SourceLink > > m_calibratedSourceLinks
 
std::vector< std::optional< Acts::SourceLink > > m_uncalibratedSourceLinks
 
std::vector< StoredSurfacem_surfaces
 

Detailed Description

Read only version of MTJ The implementation is separate as the details are significantly different and in addition only const methods are ever needed.

Definition at line 404 of file MultiTrajectory.h.

Constructor & Destructor Documentation

◆ MultiTrajectory()

ActsTrk::MultiTrajectory::MultiTrajectory ( DataLink< xAOD::TrackStateAuxContainer trackStates,
DataLink< xAOD::TrackParametersAuxContainer trackParameters,
DataLink< xAOD::TrackJacobianAuxContainer trackJacobians,
DataLink< xAOD::TrackMeasurementAuxContainer trackMeasurements,
DataLink< xAOD::TrackSurfaceAuxContainer trackSurfaces 
)

Definition at line 580 of file MultiTrajectory.cxx.

586  : m_trackStatesAux(trackStates),
587  m_trackParametersAux(trackParameters),
588  m_trackJacobiansAux(trackJacobians),
589  m_trackMeasurementsAux(trackMeasurements),
590  m_trackSurfacesAux(trackSurfaces) {
591  INSPECTCALL("ctor " << this << " " << m_trackStatesAux->size());
593 }

Member Function Documentation

◆ calibrated_impl()

template<std::size_t measdim>
ConstTrackStateProxy::template Calibrated<measdim> ActsTrk::MultiTrajectory::calibrated_impl ( IndexType  istate) const
inline

Definition at line 439 of file MultiTrajectory.h.

439  {
440  xAOD::TrackStateIndexType measIdx = m_trackStatesAux->calibrated[istate];
441  return typename ConstTrackStateProxy::template Calibrated<measdim>{m_trackMeasurementsAux->meas[measIdx].data()};
442  }

◆ calibratedCovariance_impl()

template<std::size_t measdim>
ConstTrackStateProxy::template CalibratedCovariance<measdim> ActsTrk::MultiTrajectory::calibratedCovariance_impl ( IndexType  index) const
inline

Definition at line 446 of file MultiTrajectory.h.

446  {
447  xAOD::TrackStateIndexType measIdx = m_trackStatesAux->calibrated[index];
448  return typename ConstTrackStateProxy::template CalibratedCovariance<measdim>{m_trackMeasurementsAux->covMatrix[measIdx].data()};
449  }

◆ calibratedSize_impl()

ActsTrk::IndexType ActsTrk::MultiTrajectory::calibratedSize_impl ( ActsTrk::IndexType  istate) const

Definition at line 689 of file MultiTrajectory.cxx.

689  {
690  return m_trackStatesAux->measDim[istate];
691 }

◆ component_impl()

std::any ActsTrk::MultiTrajectory::component_impl ( Acts::HashedString  key,
ActsTrk::IndexType  istate 
) const

Definition at line 617 of file MultiTrajectory.cxx.

618  {
619  using namespace Acts::HashedStringLiteral;
620  switch (key) {
621  case "previous"_hash:
622  return &(m_trackStatesAux->previous[istate]);
623  case "chi2"_hash:
624  return &(m_trackStatesAux->chi2[istate]);
625  case "pathLength"_hash:
626  return &(m_trackStatesAux->pathLength[istate]);
627  case "predicted"_hash:
628  return &(m_trackStatesAux->predicted[istate]);
629  case "filtered"_hash:
630  return &(m_trackStatesAux->filtered[istate]);
631  case "smoothed"_hash:
632  return &(m_trackStatesAux->smoothed[istate]);
633  case "jacobian"_hash:
634  return &(m_trackStatesAux->jacobian[istate]);
635  case "projector"_hash: {
636  return &(m_trackMeasurementsAux->projector.at(m_trackStatesAux->calibrated[istate]));
637  }
638  case "calibrated"_hash: {
639  return &(m_trackStatesAux->calibrated[istate]);
640  }
641  case "calibratedCov"_hash: {
642  return &(m_trackStatesAux->calibrated[istate]);
643  }
644  case "measdim"_hash:
645  return &(m_trackStatesAux->measDim[istate]);
646  case "typeFlags"_hash:
647  return &(m_trackStatesAux->typeFlags[istate]);
648  default: {
649  for (auto& d : m_decorations) {
650  if (d.hash == key) {
651  // TODO the dynamic_cast will disappear
652  return d.getter(m_trackStatesAux.cptr(), istate, d.auxid);
653  }
654  }
655  throw std::runtime_error("MultiTrajectory::component_impl no such component " + std::to_string(key));
656  }
657  }
658 }

◆ covariance_impl()

ConstTrackStateProxy::Covariance ActsTrk::MultiTrajectory::covariance_impl ( ActsTrk::IndexType  index) const
inline

Definition at line 426 of file MultiTrajectory.h.

427  {
428  return typename ConstTrackStateProxy::Covariance{m_trackParametersAux->covMatrix[index].data()};
429  }

◆ dynamicKeys_impl()

std::vector<Acts::HashedString> ActsTrk::MultiTrajectory::dynamicKeys_impl ( ) const
inline

Definition at line 469 of file MultiTrajectory.h.

469  {
470  // @TODO: This currently does not do anything useful
471  return {};
472  }

◆ fillSurfaces()

void ActsTrk::MultiTrajectory::fillSurfaces ( const Acts::TrackingGeometry *  geo,
const Acts::GeometryContext &  geoContext 
)

Fill surfaces either from persistency or from geometry If the surfaces are already there it means that the container is trainsient and this is void operation.

Definition at line 703 of file MultiTrajectory.cxx.

703  {
704  if ( not m_surfaces.empty() )
705  return;
706  m_surfaces.resize(m_trackStatesAux->size(), nullptr);
707  for ( IndexType i = 0; i < m_trackStatesAux->size(); i++ ) {
708  auto geoID = m_trackStatesAux->geometryId[i];
709  if ( geoID == InvalidGeoID ) {
710  m_surfaces[i] = nullptr;
711  continue;
712  }
713  if ( geoID != 0 ) {
714  m_surfaces[i] = geo->findSurface(geoID);
715  } else {
716  unsigned int backendIndex = m_trackStatesAux->surfaceIndex[i];
717  std::shared_ptr<const Acts::Surface> surface = decodeSurface( m_trackSurfacesAux, backendIndex, geoContext);
718  m_surfaces[i] = surface; // TODO
719 
720  }
721  }
722 }

◆ getUncalibratedSourceLink_impl()

Acts::SourceLink ActsTrk::MultiTrajectory::getUncalibratedSourceLink_impl ( ActsTrk::IndexType  istate) const

Definition at line 750 of file MultiTrajectory.cxx.

751  {
752  assert(istate < m_trackStatesAux->size());
753  // at the moment when converting Trk::Track to Acts tracks the measurements on track
754  // are not converted to xAOD::UncalibratedMeasurements, and the Acts::SourceLinks
755  // just contain a pointer to the Trk::Measurement. To keep this functionality
756  // SourceLinks are either stored in the m_uncalibratedSourceLinks cache
757  // or taken from the xAOD backend.
758  static const SG::Accessor<const xAOD::UncalibratedMeasurement*> acc{"uncalibratedMeasurement"};
759  if (m_trackStatesAux->getAuxIDs().test(acc.auxid())){
760  return Acts::SourceLink( getElement(*m_trackStatesAux, acc, istate) );
761  }
762  else {
763  return m_uncalibratedSourceLinks[istate].value();
764  }
765 }

◆ has_impl()

bool ActsTrk::MultiTrajectory::has_impl ( Acts::HashedString  key,
ActsTrk::IndexType  istate 
) const

Definition at line 595 of file MultiTrajectory.cxx.

596  {
597  // const auto& trackStates = *m_trackStates;
598  std::optional<bool> inTrackState =
599  ActsTrk::details::has_impl(m_trackStatesAux, key, istate);
600  if (inTrackState.has_value())
601  return inTrackState.value();
602  // TODO remove once EL based source links are in use only
603  using namespace Acts::HashedStringLiteral;
604  if (key == "uncalibratedSourceLink"_hash) {
605  static const SG::Accessor<const xAOD::UncalibratedMeasurement*> acc{"uncalibratedMeasurement"};
606  bool has_auxid= m_trackStatesAux->getAuxIDs().test(acc.auxid());
607  if (has_auxid) {
608  return getElement( *m_trackStatesAux, acc, istate) != nullptr;
609  }
610  else {
611  return (istate < m_uncalibratedSourceLinks.size() && m_uncalibratedSourceLinks[istate].has_value());
612  }
613  }
614  return false;
615 }

◆ hasColumn_impl()

bool ActsTrk::MultiTrajectory::hasColumn_impl ( Acts::HashedString  key) const

Definition at line 660 of file MultiTrajectory.cxx.

661  {
662  using namespace Acts::HashedStringLiteral;
663  // TODO try using staticVariables set
664  switch (key) {
665  case "previous"_hash:
666  case "chi2"_hash:
667  case "pathLength"_hash:
668  case "predicted"_hash:
669  case "filtered"_hash:
670  case "smoothed"_hash:
671  case "jacobian"_hash:
672  case "projector"_hash:
673  case "uncalibratedSourceLink"_hash:
674  case "calibrated"_hash:
675  case "calibratedCov"_hash:
676  case "measdim"_hash:
677  case "typeFlags"_hash:
678  return true;
679  }
680  for (auto& d : m_decorations) {
681  if (d.hash == key) {
682  return true;
683  }
684  }
685  return false;
686 }

◆ jacobian_impl()

ConstTrackStateProxy::Covariance ActsTrk::MultiTrajectory::jacobian_impl ( ActsTrk::IndexType  istate) const
inline

Definition at line 431 of file MultiTrajectory.h.

432  {
433  xAOD::TrackStateIndexType jacIdx = m_trackStatesAux->jacobian[istate];
434  return typename ConstTrackStateProxy::Covariance{m_trackJacobiansAux->jac[jacIdx].data()};
435  }

◆ moveLinks()

void ActsTrk::MultiTrajectory::moveLinks ( const ActsTrk::MutableMultiTrajectory mtj)

Definition at line 698 of file MultiTrajectory.cxx.

698  {
701 }

◆ moveSurfaces()

void ActsTrk::MultiTrajectory::moveSurfaces ( const ActsTrk::MutableMultiTrajectory mtj)

reuse surfaces from MutableMultiTrajectory

Definition at line 693 of file MultiTrajectory.cxx.

693  {
694  m_surfaces = std::move(mtj->m_surfaces);
695 }

◆ parameters_impl()

ConstTrackStateProxy::Parameters ActsTrk::MultiTrajectory::parameters_impl ( ActsTrk::IndexType  index) const
inline

Definition at line 421 of file MultiTrajectory.h.

422  {
423  return typename ConstTrackStateProxy::Parameters{m_trackParametersAux->params[index].data()};
424  }

◆ referenceSurface_impl()

const Acts::Surface * ActsTrk::MultiTrajectory::referenceSurface_impl ( IndexType  istate) const

Definition at line 725 of file MultiTrajectory.cxx.

725  {
726  INSPECTCALL( this << " " << istate << " " << m_trackStatesAux->size() << " " << m_surfaces.size() << " surf ptr " << toSurfacePtr(m_surfaces[istate]));
727  if ( istate >= m_surfaces.size() ) throw std::out_of_range("MultiTrajectory index " + std::to_string(istate) + " out of range " + std::to_string(m_surfaces.size()) + " when accessing reference surface");
728  return toSurfacePtr(m_surfaces[istate]);
729 }

◆ size_impl()

Acts::TrackIndexType ActsTrk::MultiTrajectory::size_impl ( ) const
inline

Definition at line 450 of file MultiTrajectory.h.

450 { return m_trackStatesAux->size(); }

Member Data Documentation

◆ m_calibratedSourceLinks

std::vector<std::optional<Acts::SourceLink> > ActsTrk::MultiTrajectory::m_calibratedSourceLinks
private

Definition at line 483 of file MultiTrajectory.h.

◆ m_decorations

std::vector<ActsTrk::detail::Decoration> ActsTrk::MultiTrajectory::m_decorations
private

Definition at line 480 of file MultiTrajectory.h.

◆ m_surfaces

std::vector<StoredSurface> ActsTrk::MultiTrajectory::m_surfaces
private

Definition at line 489 of file MultiTrajectory.h.

◆ m_trackJacobiansAux

const DataLink<xAOD::TrackJacobianAuxContainer> ActsTrk::MultiTrajectory::m_trackJacobiansAux
private

Definition at line 477 of file MultiTrajectory.h.

◆ m_trackMeasurementsAux

const DataLink<xAOD::TrackMeasurementAuxContainer> ActsTrk::MultiTrajectory::m_trackMeasurementsAux
private

Definition at line 478 of file MultiTrajectory.h.

◆ m_trackParametersAux

const DataLink<xAOD::TrackParametersAuxContainer> ActsTrk::MultiTrajectory::m_trackParametersAux
private

Definition at line 476 of file MultiTrajectory.h.

◆ m_trackStatesAux

const DataLink<xAOD::TrackStateAuxContainer> ActsTrk::MultiTrajectory::m_trackStatesAux
private

Definition at line 475 of file MultiTrajectory.h.

◆ m_trackSurfacesAux

const DataLink<xAOD::TrackSurfaceAuxContainer> ActsTrk::MultiTrajectory::m_trackSurfacesAux
private

Definition at line 479 of file MultiTrajectory.h.

◆ m_uncalibratedSourceLinks

std::vector<std::optional<Acts::SourceLink> > ActsTrk::MultiTrajectory::m_uncalibratedSourceLinks
private

Definition at line 487 of file MultiTrajectory.h.


The documentation for this class was generated from the following files:
ActsTrk::MultiTrajectory::m_surfaces
std::vector< StoredSurface > m_surfaces
Definition: MultiTrajectory.h:489
ActsTrk::MutableMultiTrajectory::m_surfaces
std::vector< StoredSurface > m_surfaces
Definition: MultiTrajectory.h:392
MuonR4::SegmentFit::Parameters
AmgVector(toInt(ParamDefs::nPars)) Parameters
Definition: MuonHoughDefs.h:48
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
hist_file_dump.d
d
Definition: hist_file_dump.py:137
taskman.template
dictionary template
Definition: taskman.py:317
ActsTrk::MultiTrajectory::m_trackMeasurementsAux
const DataLink< xAOD::TrackMeasurementAuxContainer > m_trackMeasurementsAux
Definition: MultiTrajectory.h:478
ActsTrk::MutableMultiTrajectory::m_calibratedSourceLinks
std::vector< std::optional< Acts::SourceLink > > m_calibratedSourceLinks
Definition: MultiTrajectory.h:389
ActsTrk::MultiTrajectory::m_calibratedSourceLinks
std::vector< std::optional< Acts::SourceLink > > m_calibratedSourceLinks
Definition: MultiTrajectory.h:483
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
InvalidGeoID
constexpr uint64_t InvalidGeoID
Definition: MultiTrajectory.cxx:12
ActsTrk::MutableMultiTrajectory::s_staticVariables
static const std::set< std::string > s_staticVariables
Definition: MultiTrajectory.h:367
ActsTrk::MultiTrajectory::m_uncalibratedSourceLinks
std::vector< std::optional< Acts::SourceLink > > m_uncalibratedSourceLinks
Definition: MultiTrajectory.h:487
ActsTrk::IndexType
std::uint32_t IndexType
Definition: Decoration.h:13
ActsTrk::MultiTrajectory::m_trackSurfacesAux
const DataLink< xAOD::TrackSurfaceAuxContainer > m_trackSurfacesAux
Definition: MultiTrajectory.h:479
lumiFormat.i
int i
Definition: lumiFormat.py:85
ActsTrk::MutableMultiTrajectory::m_uncalibratedSourceLinks
std::vector< std::optional< Acts::SourceLink > > m_uncalibratedSourceLinks
Definition: MultiTrajectory.h:390
INSPECTCALL
#define INSPECTCALL(_INFO)
Definition: MultiTrajectory.h:35
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
ActsTrk::MultiTrajectory::m_trackParametersAux
const DataLink< xAOD::TrackParametersAuxContainer > m_trackParametersAux
Definition: MultiTrajectory.h:476
ActsTrk::MultiTrajectory::m_decorations
std::vector< ActsTrk::detail::Decoration > m_decorations
Definition: MultiTrajectory.h:480
ActsTrk::MultiTrajectory::m_trackStatesAux
const DataLink< xAOD::TrackStateAuxContainer > m_trackStatesAux
Definition: MultiTrajectory.h:475
xAOD::TrackStateIndexType
uint32_t TrackStateIndexType
Definition: TrackState_v1.h:15
ActsTrk::detail::restoreDecorations
std::vector< Decoration > restoreDecorations(const SG::IConstAuxStore *container, const std::set< std::string > &staticVariables)
Definition: Decoration.cxx:9
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
ActsTrk::decodeSurface
std::shared_ptr< const Acts::Surface > decodeSurface(const xAOD::TrackSurface *backend, const Acts::GeometryContext &geoContext)
Creates transient Acts Surface objects given a surface backend implementation should be exact mirror ...
Definition: SurfaceEncoding.cxx:143
DeMoScan.index
string index
Definition: DeMoScan.py:364
MuonR4::SegmentFit::Covariance
AmgSymMatrix(toInt(ParamDefs::nPars)) Covariance
Definition: MuonHoughDefs.h:49
LArCellConditions.geo
bool geo
Definition: LArCellConditions.py:46
ActsTrk::MultiTrajectory::m_trackJacobiansAux
const DataLink< xAOD::TrackJacobianAuxContainer > m_trackJacobiansAux
Definition: MultiTrajectory.h:477
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37