6 #include "Acts/EventData/TrackStateType.hpp"
14 ISvcLocator* pSvcLocator)
26 return StatusCode::SUCCESS;
37 ATH_MSG_DEBUG(
" \\__ Number of retrieved tracks: " << tracks->size());
44 inputPrdMap = inputPrdMapHandle.
cptr();
45 ATH_MSG_DEBUG(
" \\__ Number of already used measurement from previous passes: " << inputPrdMap->
size());
50 if (inputPrdMap ==
nullptr) {
51 ATH_CHECK( outputPrdMapHandle.
record( std::make_unique< ActsTrk::PrepRawDataAssociation >() ) );
53 ATH_CHECK( outputPrdMapHandle.
record( std::make_unique< ActsTrk::PrepRawDataAssociation >( *inputPrdMap ) ) );
58 enum class RecordStatus :
int {UNKNOWN=0, SUCCESS, NOSOURCELINK, NULLSOURCELINK, ALREADYSTORED};
59 std::size_t nMeasurements = 0
ul;
62 for (std::size_t
i(0
ul);
i<tracks->size(); ++
i) {
63 tracks->trackStateContainer().visitBackwards(tracks->getTrack(
i).tipIndex(),
64 [&prdMap, &nMeasurements, &
status]
65 (
const typename ActsTrk::TrackStateBackend::ConstTrackStateProxy state) ->
bool
68 if (not state.typeFlags().test(Acts::TrackStateFlag::MeasurementFlag)) return true;
71 if ( not state.hasUncalibratedSourceLink() ) {
72 status = RecordStatus::NOSOURCELINK;
78 status = RecordStatus::NULLSOURCELINK;
85 status = RecordStatus::ALREADYSTORED;
88 status = RecordStatus::SUCCESS;
91 if (
status == RecordStatus::SUCCESS)
continue;
94 case RecordStatus::NOSOURCELINK:
95 {
ATH_MSG_ERROR(
"There was a problem when storing the Prd collections");
97 return StatusCode::FAILURE;
98 case RecordStatus::NULLSOURCELINK:
99 {
ATH_MSG_ERROR(
"There was a problem when storing the Prd collections");
101 return StatusCode::FAILURE;
102 case RecordStatus::ALREADYSTORED:
105 {
ATH_MSG_WARNING(
"There was a problem when storing the Prd collections");
109 {
ATH_MSG_WARNING(
"There was a problem when storing the Prd collections");
115 ATH_MSG_DEBUG(
"Number of used measurements: " << prdMap->size() <<
" from " << tracks->size() <<
" tracks");
116 ATH_MSG_DEBUG(
" \\__ Found a total of " << nMeasurements <<
" measurements");
118 return StatusCode::SUCCESS;