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 413 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 574 of file MultiTrajectory.cxx.

580  : m_trackStatesAux(trackStates),
581  m_trackParametersAux(trackParameters),
582  m_trackJacobiansAux(trackJacobians),
583  m_trackMeasurementsAux(trackMeasurements),
584  m_trackSurfacesAux(trackSurfaces) {
585  INSPECTCALL("ctor " << this << " " << m_trackStatesAux->size());
587 }

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 448 of file MultiTrajectory.h.

448  {
449  xAOD::TrackStateIndexType measIdx = m_trackStatesAux->calibrated[istate];
450  return typename ConstTrackStateProxy::template Calibrated<measdim>{m_trackMeasurementsAux->meas[measIdx].data()};
451  }

◆ calibratedCovariance_impl()

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

Definition at line 455 of file MultiTrajectory.h.

455  {
456  xAOD::TrackStateIndexType measIdx = m_trackStatesAux->calibrated[index];
457  return typename ConstTrackStateProxy::template CalibratedCovariance<measdim>{m_trackMeasurementsAux->covMatrix[measIdx].data()};
458  }

◆ calibratedSize_impl()

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

Definition at line 686 of file MultiTrajectory.cxx.

686  {
687  return m_trackStatesAux->measDim[istate];
688 }

◆ component_impl()

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

Definition at line 611 of file MultiTrajectory.cxx.

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

◆ covariance_impl()

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

Definition at line 435 of file MultiTrajectory.h.

436  {
437  return typename ConstTrackStateProxy::Covariance{m_trackParametersAux->covMatrix[index].data()};
438  }

◆ dynamicKeys_impl()

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

Definition at line 478 of file MultiTrajectory.h.

478  {
479  // @TODO: This currently does not do anything useful
480  return {};
481  }

◆ 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 700 of file MultiTrajectory.cxx.

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

◆ getUncalibratedSourceLink_impl()

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

Definition at line 747 of file MultiTrajectory.cxx.

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

◆ has_impl()

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

Definition at line 589 of file MultiTrajectory.cxx.

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

◆ hasColumn_impl()

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

Definition at line 656 of file MultiTrajectory.cxx.

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

◆ jacobian_impl()

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

Definition at line 440 of file MultiTrajectory.h.

441  {
442  xAOD::TrackStateIndexType jacIdx = m_trackStatesAux->jacobian[istate];
443  return typename ConstTrackStateProxy::Covariance{m_trackJacobiansAux->jac[jacIdx].data()};
444  }

◆ moveLinks()

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

Definition at line 695 of file MultiTrajectory.cxx.

695  {
698 }

◆ moveSurfaces()

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

reuse surfaces from MutableMultiTrajectory

Definition at line 690 of file MultiTrajectory.cxx.

690  {
691  m_surfaces = std::move(mtj->m_surfaces);
692 }

◆ parameters_impl()

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

Definition at line 430 of file MultiTrajectory.h.

431  {
432  return typename ConstTrackStateProxy::Parameters{m_trackParametersAux->params[index].data()};
433  }

◆ referenceSurface_impl()

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

Definition at line 722 of file MultiTrajectory.cxx.

722  {
723  INSPECTCALL( this << " " << istate << " " << m_trackStatesAux->size() << " " << m_surfaces.size() << " surf ptr " << toSurfacePtr(m_surfaces[istate]));
724  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");
725  return toSurfacePtr(m_surfaces[istate]);
726 }

◆ size_impl()

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

Definition at line 459 of file MultiTrajectory.h.

459 { return m_trackStatesAux->size(); }

Member Data Documentation

◆ m_calibratedSourceLinks

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

Definition at line 492 of file MultiTrajectory.h.

◆ m_decorations

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

Definition at line 489 of file MultiTrajectory.h.

◆ m_surfaces

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

Definition at line 498 of file MultiTrajectory.h.

◆ m_trackJacobiansAux

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

Definition at line 486 of file MultiTrajectory.h.

◆ m_trackMeasurementsAux

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

Definition at line 487 of file MultiTrajectory.h.

◆ m_trackParametersAux

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

Definition at line 485 of file MultiTrajectory.h.

◆ m_trackStatesAux

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

Definition at line 484 of file MultiTrajectory.h.

◆ m_trackSurfacesAux

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

Definition at line 488 of file MultiTrajectory.h.

◆ m_uncalibratedSourceLinks

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

Definition at line 496 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:498
ActsTrk::MutableMultiTrajectory::m_surfaces
std::vector< StoredSurface > m_surfaces
Definition: MultiTrajectory.h:401
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:487
ActsTrk::MutableMultiTrajectory::m_calibratedSourceLinks
std::vector< std::optional< Acts::SourceLink > > m_calibratedSourceLinks
Definition: MultiTrajectory.h:398
ActsTrk::MultiTrajectory::m_calibratedSourceLinks
std::vector< std::optional< Acts::SourceLink > > m_calibratedSourceLinks
Definition: MultiTrajectory.h:492
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:376
ActsTrk::MultiTrajectory::m_uncalibratedSourceLinks
std::vector< std::optional< Acts::SourceLink > > m_uncalibratedSourceLinks
Definition: MultiTrajectory.h:496
ActsTrk::IndexType
std::uint32_t IndexType
Definition: Decoration.h:14
ActsTrk::MultiTrajectory::m_trackSurfacesAux
const DataLink< xAOD::TrackSurfaceAuxContainer > m_trackSurfacesAux
Definition: MultiTrajectory.h:488
lumiFormat.i
int i
Definition: lumiFormat.py:85
ActsTrk::MutableMultiTrajectory::m_uncalibratedSourceLinks
std::vector< std::optional< Acts::SourceLink > > m_uncalibratedSourceLinks
Definition: MultiTrajectory.h:399
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:485
ActsTrk::MultiTrajectory::m_decorations
std::vector< ActsTrk::detail::Decoration > m_decorations
Definition: MultiTrajectory.h:489
ActsTrk::MultiTrajectory::m_trackStatesAux
const DataLink< xAOD::TrackStateAuxContainer > m_trackStatesAux
Definition: MultiTrajectory.h:484
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:486
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37