Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 (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 415 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 616 of file MultiTrajectory.cxx.

622  : m_trackStatesAux(trackStates),
623  m_trackParametersAux(trackParameters),
624  m_trackJacobiansAux(trackJacobians),
625  m_trackMeasurementsAux(trackMeasurements),
626  m_trackSurfacesAux(trackSurfaces),
627  m_trackStatesIface (trackStates->size()) {
628  m_trackStatesIface.setStore (trackStates.cptr());
629  INSPECTCALL("ctor from backends" << this << " " << m_trackStatesIface.size());
631 }

◆ MultiTrajectory() [2/2]

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

Definition at line 633 of file MultiTrajectory.cxx.

634  : m_trackStatesAux(other.m_trackStatesAux.get()),
635  m_trackParametersAux(other.m_trackParametersAux.get()),
636  m_trackJacobiansAux(other.m_trackJacobiansAux.get()),
637  m_trackMeasurementsAux(other.m_trackMeasurementsAux.get()),
638  m_trackSurfacesAux(other.m_surfacesBackendAux.get()),
639  m_surfaces(other.m_surfaces) {
640  other.trim();
641  INSPECTCALL("ctor from MutableMTJ" << this << " " << m_trackStatesAux->size());
643 }

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

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

◆ calibratedCovariance_impl()

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

Definition at line 459 of file MultiTrajectory.h.

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

◆ calibratedSize_impl()

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

Definition at line 741 of file MultiTrajectory.cxx.

741  {
742  return m_trackStatesAux->measDim[istate];
743 }

◆ component_impl()

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

Definition at line 666 of file MultiTrajectory.cxx.

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

◆ covariance_impl()

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

Definition at line 439 of file MultiTrajectory.h.

440  {
441  return typename ConstTrackStateProxy::Covariance{m_trackParametersAux->covMatrix[index].data()};
442  }

◆ dynamicKeys_impl()

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

Definition at line 755 of file MultiTrajectory.cxx.

755  {
756  std::vector<Acts::HashedString> keys;
758  keys.push_back(d.hash);
759  }
760  return keys;
761 }

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

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

◆ getUncalibratedSourceLink_impl()

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

Definition at line 810 of file MultiTrajectory.cxx.

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

◆ has_impl()

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

Definition at line 646 of file MultiTrajectory.cxx.

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

◆ hasColumn_impl()

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

Definition at line 711 of file MultiTrajectory.cxx.

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

◆ jacobian_impl()

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

Definition at line 444 of file MultiTrajectory.h.

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

◆ moveLinks()

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

Definition at line 750 of file MultiTrajectory.cxx.

750  {
753 }

◆ moveSurfaces()

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

reuse surfaces from MutableMultiTrajectory

Definition at line 745 of file MultiTrajectory.cxx.

745  {
746  m_surfaces = std::move(mtj->m_surfaces);
747 }

◆ parameters_impl()

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

Definition at line 434 of file MultiTrajectory.h.

435  {
436  return typename ConstTrackStateProxy::Parameters{m_trackParametersAux->params[index].data()};
437  }

◆ referenceSurface_impl()

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

Definition at line 786 of file MultiTrajectory.cxx.

786  {
787  INSPECTCALL( this << " " << istate << " " << m_trackStatesIface.size() << " " << m_surfaces.size() << " surf ptr " << toSurfacePtr(m_surfaces[istate]));
788  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");
789  return toSurfacePtr(m_surfaces[istate]);
790 }

◆ size_impl()

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

Definition at line 463 of file MultiTrajectory.h.

463 { return m_trackStatesAux->size(); }

Member Data Documentation

◆ m_calibratedSourceLinks

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

Definition at line 493 of file MultiTrajectory.h.

◆ m_decorations

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

Definition at line 490 of file MultiTrajectory.h.

◆ m_surfaces

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

Definition at line 499 of file MultiTrajectory.h.

◆ m_trackJacobiansAux

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

Definition at line 487 of file MultiTrajectory.h.

◆ m_trackMeasurementsAux

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

Definition at line 488 of file MultiTrajectory.h.

◆ m_trackParametersAux

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

Definition at line 486 of file MultiTrajectory.h.

◆ m_trackStatesAux

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

Definition at line 485 of file MultiTrajectory.h.

◆ m_trackStatesIface

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

Definition at line 501 of file MultiTrajectory.h.

◆ m_trackSurfacesAux

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

Definition at line 489 of file MultiTrajectory.h.

◆ m_uncalibratedSourceLinks

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

Definition at line 497 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:646
ActsTrk::MultiTrajectory::m_surfaces
std::vector< StoredSurface > m_surfaces
Definition: MultiTrajectory.h:499
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
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:488
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:501
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:493
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:13
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:497
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:489
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:32
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
ActsTrk::MultiTrajectory::m_trackParametersAux
const DataLink< xAOD::TrackParametersAuxContainer > m_trackParametersAux
Definition: MultiTrajectory.h:486
ActsTrk::MultiTrajectory::m_decorations
std::vector< ActsTrk::detail::Decoration > m_decorations
Definition: MultiTrajectory.h:490
ActsTrk::MultiTrajectory::m_trackStatesAux
const DataLink< xAOD::TrackStateAuxContainer > m_trackStatesAux
Definition: MultiTrajectory.h:485
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:21
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:487
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37