94 std::unique_ptr<Trk::PRDtoTrackMap> prd_to_track_map(!
m_assoTool.empty()
96 : std::unique_ptr<Trk::PRDtoTrackMap>());
98 std::unique_ptr<TrackCollection> outputTrackCollection = std::make_unique<TrackCollection>();
99 std::unique_ptr<TrackCollection> skippedTrackCollection = std::make_unique<TrackCollection>();
103 std::vector<std::unique_ptr<Trk::Track> > tmp_track_collection;
107 const std::map< HepMC::ConstGenParticlePtr, PRD_TruthTrajectory >& truthTraj =
110 ATH_MSG_VERBOSE(
"PRD_TruthTrajectoryBuilder delivered " << truthTraj.size() <<
" PRD truth trajectories, starting track creation.");
112 auto ttIter = truthTraj.begin();
113 auto ttIterE = truthTraj.end();
114 for ( ; ttIter != ttIterE; ++ttIter){
120 for ( ; prdTTSelIter != prdTTSelIterE &&
passed; ++prdTTSelIter ){
121 if (!(*prdTTSelIter)->pass((*ttIter).second)){
122 ATH_MSG_VERBOSE(
"PRD truth trajectory did not pass the selection cuts. Skipping ... ");
132 ATH_MSG_VERBOSE(
"Track creation for PRD truth trajectory with size " << (*ttIter).second.prds.size() <<
" failed. Skipping ...");
135 ATH_MSG_VERBOSE(
"Track creation for PRD truth trajectory with size " << (*ttIter).second.prds.size() <<
" successful.");
154 ATH_MSG_VERBOSE(
"Track created and pushed into the output track collection.");
155 if (prd_to_track_map &&
m_assoTool->addPRDs(*prd_to_track_map, *truthTrack).isFailure()) {
158 tmp_track_collection.push_back(std::move(truthTrack));
160 ATH_MSG_VERBOSE(
"Track did not pass the track selection. Putting it into skipped track collection.");
161 skippedTrackCollection->push_back(truthTrack.release());
167 outputTrackCollection->reserve(tmp_track_collection.size());
168 for (std::unique_ptr<Trk::Track> &track : tmp_track_collection) {
171 outputTrackCollection->push_back(std::move(track));
175 outputTrackCollection->reserve(tmp_track_collection.size());
176 for (std::unique_ptr<Trk::Track> &track : tmp_track_collection) {
177 outputTrackCollection->push_back(std::move(track));
183 ATH_CHECK(outputTrackCollectionHandle.
record(std::move(outputTrackCollection)));
187 ATH_CHECK(skippedTrackCollectionHandle.
record(std::move(skippedTrackCollection)));
192 return StatusCode::SUCCESS;