 |
ATLAS Offline Software
|
Go to the documentation of this file.
14 ISvcLocator *pSvcLocator)
29 return StatusCode::SUCCESS;
41 ATH_CHECK( pixelMsosHandle.
record(std::make_unique<xAOD::TrackStateValidationContainer>(),
42 std::make_unique<xAOD::TrackStateValidationAuxContainer>()) );
46 ATH_CHECK( stripMsosHandle.
record(std::make_unique<xAOD::TrackStateValidationContainer>(),
47 std::make_unique<xAOD::TrackStateValidationAuxContainer>()) );
55 std::vector< ElementLink< xAOD::TrackStateValidationContainer > > > decorator_msos_link(
m_trackMsosLink, ctx );
64 std::optional<ActsTrk::TrackContainer::ConstTrackProxy> optional_track = *trackLink;
65 if ( not optional_track.has_value() ) {
66 ATH_MSG_ERROR(
"Invalid track link for particle " << trackParticle->index());
67 return StatusCode::FAILURE;
69 ActsTrk::TrackContainer::ConstTrackProxy
track = optional_track.value();
71 std::vector< typename ActsTrk::TrackContainer::ConstTrackStateProxy > tsos {};
72 tsos.reserve(
track.nTrackStates() );
76 track.container().trackStateContainer()
77 .visitBackwards(
track.tipIndex(),
79 (
const typename ActsTrk::TrackContainer::ConstTrackStateProxy& state)
81 auto flags = state.typeFlags();
82 if (not flags.test(Acts::TrackStateFlag::MeasurementFlag) and
83 not flags.test(Acts::TrackStateFlag::OutlierFlag) and
84 not flags.test(Acts::TrackStateFlag::HoleFlag)) return;
85 tsos.push_back( state );
88 std::vector< ElementLink< xAOD::TrackStateValidationContainer > > msos {};
89 msos.reserve( tsos.size() );
91 for (
const typename ActsTrk::TrackContainer::ConstTrackStateProxy& state : tsos) {
92 const Acts::Surface& surface = state.referenceSurface();
109 return StatusCode::FAILURE;
114 decorator_msos_link(*trackParticle) = std::move(msos);
117 return StatusCode::SUCCESS;
128 msosLinks.push_back( std::move(elink) );
132 auto flags = state.typeFlags();
133 if (not
flags.test(Acts::TrackStateFlag::HoleFlag) ) {
134 auto sl = state.getUncalibratedSourceLink().template get<ATLASUncalibSourceLink>();
138 if (not decorator_measurement_link.
isAvailable(cluster)) {
139 ATH_MSG_ERROR(
"xAOD Cluster does not have a link to TrackMeasurementValidation element");
140 return StatusCode::FAILURE;
142 const auto&
el = decorator_measurement_link(cluster);
147 measurement->
index() );
148 msosContainer.
back()->setTrackMeasurementValidationLink( std::move(tmvc_el) );
151 if (
flags.test(Acts::TrackStateFlag::HoleFlag)) {
153 }
else if (
flags.test(Acts::TrackStateFlag::OutlierFlag)) {
159 return StatusCode::SUCCESS;
184 throw std::runtime_error(
"Cannot recognize volume id");
const_pointer_type cptr()
Dereference the pointer.
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackParticlesKey
StatusCode storeTrackState(const typename ActsTrk::TrackContainer::ConstTrackStateProxy &state, std::vector< ElementLink< xAOD::TrackStateValidationContainer > > &msosLinks, xAOD::TrackStateValidationContainer &msosContainer) const
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Class describing a TrackStateValidation.
Helper class to provide constant type-safe access to aux data.
bool isValid() const
Test to see if the link can be dereferenced.
An algorithm that can be simultaneously executed in multiple threads.
@ Outlier
This TSoS contains an outlier, that is, it contains a MeasurementBase/RIO_OnTrack which was not used ...
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Class describing a TrackMeasurementValidation.
Handle class for reading a decoration on an object.
@ Hole
A hole on the track - this is defined in the following way.
::StatusCode StatusCode
StatusCode definition for legacy code.
pointer_type ptr()
Dereference the pointer.
Handle class for adding a decoration to an object.
Handle class for adding a decoration to an object.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
SG::WriteHandleKey< xAOD::TrackStateValidationContainer > m_pixelMsosKey
size_t index() const
Return the index of this element within its container.
const T * back() const
Access the last element in the collection as an rvalue.
SG::ReadDecorHandleKey< xAOD::TrackParticleContainer > m_decorator_actsTracks
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ElementLink implementation for ROOT usage.
virtual StatusCode execute(const EventContext &ctx) const override
const xAOD::UncalibratedMeasurement & getUncalibratedMeasurement(const ATLASUncalibSourceLink &source_link)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
xAOD::UncalibMeasType getDetectorType(std::uint64_t volumeId) const
SG::WriteDecorHandleKey< xAOD::TrackParticleContainer > m_trackMsosLink
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
UncalibMeasType
Define the type of the uncalibrated measurement.
Handle class for reading a decoration on an object.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Class describing a TrackParticle.
const SG::AuxVectorData * container() const
Return the container holding this element.
virtual StatusCode initialize() override
@ Measurement
This is a measurement, and will at least contain a Trk::MeasurementBase.
ActsTrackStateOnSurfaceDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::WriteHandleKey< xAOD::TrackStateValidationContainer > m_stripMsosKey