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)
 
 MultiTrajectory (const ActsTrk::MutableMultiTrajectory &other)
 
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
 
xAOD::TrackStateContainer m_trackStatesIface
 

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

Constructor & Destructor Documentation

◆ MultiTrajectory() [1/2]

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

618  : m_trackStatesAux(trackStates),
619  m_trackParametersAux(trackParameters),
620  m_trackJacobiansAux(trackJacobians),
621  m_trackMeasurementsAux(trackMeasurements),
622  m_trackSurfacesAux(trackSurfaces),
623  m_trackStatesIface (trackStates->size())
624 {
625  m_trackStatesIface.setStore (trackStates.cptr());
626  INSPECTCALL("ctor " << this << " " << m_trackStatesIface.size());
628 }

◆ MultiTrajectory() [2/2]

ActsTrk::MultiTrajectory::MultiTrajectory ( const ActsTrk::MutableMultiTrajectory other)

Definition at line 630 of file MultiTrajectory.cxx.

631  : m_trackStatesAux(other.m_trackStatesAux.get()),
632  m_trackParametersAux(other.m_trackParametersAux.get()),
633  m_trackJacobiansAux(other.m_trackJacobiansAux.get()),
634  m_trackMeasurementsAux(other.m_trackMeasurementsAux.get()),
635  m_trackSurfacesAux(other.m_surfacesBackendAux.get()) {
636  INSPECTCALL("ctor " << this << " " << m_trackStatesAux->size());
638 }

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

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

◆ calibratedCovariance_impl()

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

Definition at line 462 of file MultiTrajectory.h.

462  {
463  xAOD::TrackStateIndexType measIdx = m_trackStatesAux->calibrated[index];
464  return typename ConstTrackStateProxy::template CalibratedCovariance<measdim>{m_trackMeasurementsAux->covMatrix[measIdx].data()};
465  }

◆ calibratedSize_impl()

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

Definition at line 736 of file MultiTrajectory.cxx.

736  {
737  return m_trackStatesAux->measDim[istate];
738 }

◆ component_impl()

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

Definition at line 661 of file MultiTrajectory.cxx.

662  {
663  using namespace Acts::HashedStringLiteral;
664  switch (key) {
665  case "previous"_hash:
666  return &(m_trackStatesAux->previous[istate]);
667  case "next"_hash:
668  return &(m_trackStatesAux->next[istate]);
669  case "chi2"_hash:
670  return &(m_trackStatesAux->chi2[istate]);
671  case "pathLength"_hash:
672  return &(m_trackStatesAux->pathLength[istate]);
673  case "predicted"_hash:
674  return &(m_trackStatesAux->predicted[istate]);
675  case "filtered"_hash:
676  return &(m_trackStatesAux->filtered[istate]);
677  case "smoothed"_hash:
678  return &(m_trackStatesAux->smoothed[istate]);
679  case "jacobian"_hash:
680  return &(m_trackStatesAux->jacobian[istate]);
681  case "projector"_hash: {
682  return &(m_trackMeasurementsAux->projector.at(m_trackStatesAux->calibrated[istate]));
683  }
684  case "calibrated"_hash: {
685  return &(m_trackStatesAux->calibrated[istate]);
686  }
687  case "calibratedCov"_hash: {
688  return &(m_trackStatesAux->calibrated[istate]);
689  }
690  case "measdim"_hash:
691  return &(m_trackStatesAux->measDim[istate]);
692  case "typeFlags"_hash:
693  return &(m_trackStatesAux->typeFlags[istate]);
694  default: {
695  for (auto& d : m_decorations) {
696  if (d.hash == key) {
697  // TODO the dynamic_cast will disappear
698  return d.getter(m_trackStatesAux.cptr(), istate, d.auxid);
699  }
700  }
701  throw std::runtime_error("MultiTrajectory::component_impl no such component " + std::to_string(key));
702  }
703  }
704 }

◆ covariance_impl()

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

Definition at line 442 of file MultiTrajectory.h.

443  {
444  return typename ConstTrackStateProxy::Covariance{m_trackParametersAux->covMatrix[index].data()};
445  }

◆ dynamicKeys_impl()

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

Definition at line 750 of file MultiTrajectory.cxx.

750  {
751  std::vector<Acts::HashedString> keys;
753  keys.push_back(d.hash);
754  }
755  return keys;
756 }

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

759  {
760  if ( not m_surfaces.empty() )
761  return;
762  m_surfaces.resize(m_trackStatesIface.size(), nullptr);
763  for ( IndexType i = 0; i < m_trackStatesIface.size(); i++ ) {
764  auto geoID = m_trackStatesAux->geometryId[i];
765  if ( geoID == InvalidGeoID ) {
766  m_surfaces[i] = nullptr;
767  continue;
768  }
769  if ( geoID != 0 ) {
770  m_surfaces[i] = geo->findSurface(geoID);
771  } else {
772  unsigned int backendIndex = m_trackStatesAux->surfaceIndex[i];
773  std::shared_ptr<const Acts::Surface> surface = decodeSurface( m_trackSurfacesAux, backendIndex, geoContext);
774  m_surfaces[i] = surface; // TODO
775 
776  }
777  }
778 }

◆ getUncalibratedSourceLink_impl()

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

Definition at line 805 of file MultiTrajectory.cxx.

806  {
807  assert(istate < m_trackStatesIface.size());
808  // at the moment when converting Trk::Track to Acts tracks the measurements on track
809  // are not converted to xAOD::UncalibratedMeasurements, and the Acts::SourceLinks
810  // just contain a pointer to the Trk::Measurement. To keep this functionality
811  // SourceLinks are either stored in the m_uncalibratedSourceLinks cache
812  // or taken from the xAOD backend.
813  static const SG::ConstAccessor<const xAOD::UncalibratedMeasurement*> acc{"uncalibratedMeasurement"};
814  if (const xAOD::UncalibratedMeasurement* ptr = acc.withDefault(m_trackStatesIface, istate, nullptr))
815  {
816  return Acts::SourceLink( ptr );
817  }
818  return m_uncalibratedSourceLinks[istate].value();
819 }

◆ has_impl()

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

Definition at line 641 of file MultiTrajectory.cxx.

642  {
643  // const auto& trackStates = *m_trackStates;
644  std::optional<bool> inTrackState = ::has_impl(m_trackStatesAux, key, istate);
645  if (inTrackState.has_value())
646  return inTrackState.value();
647  // TODO remove once EL based source links are in use only
648  using namespace Acts::HashedStringLiteral;
649  if (key == "uncalibratedSourceLink"_hash) {
650  static const SG::ConstAccessor<const xAOD::UncalibratedMeasurement*> acc{"uncalibratedMeasurement"};
651  if (acc.isAvailable (m_trackStatesIface)) {
652  return acc(m_trackStatesIface, istate) != nullptr;
653  }
654  else {
655  return (istate < m_uncalibratedSourceLinks.size() && m_uncalibratedSourceLinks[istate].has_value());
656  }
657  }
658  return false;
659 }

◆ hasColumn_impl()

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

Definition at line 706 of file MultiTrajectory.cxx.

707  {
708  using namespace Acts::HashedStringLiteral;
709  // TODO try using staticVariables set
710  switch (key) {
711  case "previous"_hash:
712  case "next"_hash:
713  case "chi2"_hash:
714  case "pathLength"_hash:
715  case "predicted"_hash:
716  case "filtered"_hash:
717  case "smoothed"_hash:
718  case "jacobian"_hash:
719  case "projector"_hash:
720  case "uncalibratedSourceLink"_hash:
721  case "calibrated"_hash:
722  case "calibratedCov"_hash:
723  case "measdim"_hash:
724  case "typeFlags"_hash:
725  return true;
726  }
727  for (auto& d : m_decorations) {
728  if (d.hash == key) {
729  return true;
730  }
731  }
732  return false;
733 }

◆ jacobian_impl()

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

Definition at line 447 of file MultiTrajectory.h.

448  {
449  xAOD::TrackStateIndexType jacIdx = m_trackStatesAux->jacobian[istate];
450  return typename ConstTrackStateProxy::Covariance{m_trackJacobiansAux->jac[jacIdx].data()};
451  }

◆ moveLinks()

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

Definition at line 745 of file MultiTrajectory.cxx.

745  {
748 }

◆ moveSurfaces()

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

reuse surfaces from MutableMultiTrajectory

Definition at line 740 of file MultiTrajectory.cxx.

740  {
741  m_surfaces = std::move(mtj->m_surfaces);
742 }

◆ parameters_impl()

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

Definition at line 437 of file MultiTrajectory.h.

438  {
439  return typename ConstTrackStateProxy::Parameters{m_trackParametersAux->params[index].data()};
440  }

◆ referenceSurface_impl()

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

Definition at line 781 of file MultiTrajectory.cxx.

781  {
782  INSPECTCALL( this << " " << istate << " " << m_trackStatesIface.size() << " " << m_surfaces.size() << " surf ptr " << toSurfacePtr(m_surfaces[istate]));
783  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");
784  return toSurfacePtr(m_surfaces[istate]);
785 }

◆ size_impl()

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

Definition at line 466 of file MultiTrajectory.h.

466 { return m_trackStatesAux->size(); }

Member Data Documentation

◆ m_calibratedSourceLinks

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

Definition at line 496 of file MultiTrajectory.h.

◆ m_decorations

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

Definition at line 493 of file MultiTrajectory.h.

◆ m_surfaces

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

Definition at line 502 of file MultiTrajectory.h.

◆ m_trackJacobiansAux

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

Definition at line 490 of file MultiTrajectory.h.

◆ m_trackMeasurementsAux

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

Definition at line 491 of file MultiTrajectory.h.

◆ m_trackParametersAux

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

Definition at line 489 of file MultiTrajectory.h.

◆ m_trackStatesAux

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

Definition at line 488 of file MultiTrajectory.h.

◆ m_trackStatesIface

xAOD::TrackStateContainer ActsTrk::MultiTrajectory::m_trackStatesIface
private

Definition at line 504 of file MultiTrajectory.h.

◆ m_trackSurfacesAux

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

Definition at line 492 of file MultiTrajectory.h.

◆ m_uncalibratedSourceLinks

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

Definition at line 500 of file MultiTrajectory.h.


The documentation for this class was generated from the following files:
ActsTrk::MultiTrajectory::has_impl
bool has_impl(Acts::HashedString key, ActsTrk::IndexType istate) const
Definition: MultiTrajectory.cxx:641
ActsTrk::MultiTrajectory::m_surfaces
std::vector< StoredSurface > m_surfaces
Definition: MultiTrajectory.h:502
ActsTrk::MutableMultiTrajectory::m_surfaces
std::vector< StoredSurface > m_surfaces
Definition: MultiTrajectory.h:404
MuonR4::SegmentFit::Parameters
AmgVector(toInt(ParamDefs::nPars)) Parameters
Definition: MuonHoughDefs.h:48
hist_file_dump.d
d
Definition: hist_file_dump.py:143
taskman.template
dictionary template
Definition: taskman.py:317
ActsTrk::MultiTrajectory::m_trackMeasurementsAux
const DataLink< xAOD::TrackMeasurementAuxContainer > m_trackMeasurementsAux
Definition: MultiTrajectory.h:491
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
ActsTrk::MultiTrajectory::m_trackStatesIface
xAOD::TrackStateContainer m_trackStatesIface
Definition: MultiTrajectory.h:504
ActsTrk::MutableMultiTrajectory::m_calibratedSourceLinks
std::vector< std::optional< Acts::SourceLink > > m_calibratedSourceLinks
Definition: MultiTrajectory.h:401
ActsTrk::MultiTrajectory::m_calibratedSourceLinks
std::vector< std::optional< Acts::SourceLink > > m_calibratedSourceLinks
Definition: MultiTrajectory.h:496
ActsTrk::detail::Decoration
Definition: Decoration.h:23
xAOD::AuxContainerBase::size
virtual size_t size() const override
Get the size of the container.
Definition: AuxContainerBase.cxx:432
InvalidGeoID
constexpr uint64_t InvalidGeoID
Definition: MultiTrajectory.cxx:12
ActsTrk::MutableMultiTrajectory::s_staticVariables
static const std::set< std::string > s_staticVariables
Definition: MultiTrajectory.h:379
ActsTrk::MultiTrajectory::m_uncalibratedSourceLinks
std::vector< std::optional< Acts::SourceLink > > m_uncalibratedSourceLinks
Definition: MultiTrajectory.h:500
ActsTrk::IndexType
std::uint32_t IndexType
Definition: Decoration.h:14
xAOD::UncalibratedMeasurement_v1
Definition: UncalibratedMeasurement_v1.h:13
ActsTrk::MultiTrajectory::m_trackSurfacesAux
const DataLink< xAOD::TrackSurfaceAuxContainer > m_trackSurfacesAux
Definition: MultiTrajectory.h:492
lumiFormat.i
int i
Definition: lumiFormat.py:85
ActsTrk::MutableMultiTrajectory::m_uncalibratedSourceLinks
std::vector< std::optional< Acts::SourceLink > > m_uncalibratedSourceLinks
Definition: MultiTrajectory.h:402
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:489
ActsTrk::MultiTrajectory::m_decorations
std::vector< ActsTrk::detail::Decoration > m_decorations
Definition: MultiTrajectory.h:493
ActsTrk::MultiTrajectory::m_trackStatesAux
const DataLink< xAOD::TrackStateAuxContainer > m_trackStatesAux
Definition: MultiTrajectory.h:488
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
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
LArCellConditions.geo
bool geo
Definition: LArCellConditions.py:46
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
ActsTrk::MultiTrajectory::m_trackJacobiansAux
const DataLink< xAOD::TrackJacobianAuxContainer > m_trackJacobiansAux
Definition: MultiTrajectory.h:490
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37