ATLAS Offline Software
Loading...
Searching...
No Matches
TrackCollectionProvider.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7namespace Trk {
8
9 //________________________________________________________________________
11 const std::string& name,
12 const IInterface* parent)
13
14 : AthAlgTool(type,name,parent)
15 {
16 declareInterface<ITrackCollectionProvider>(this);
17 }
18
19 //________________________________________________________________________
21 = default;
22
23 //________________________________________________________________________
25 {
26 return StatusCode::SUCCESS;
27 }
28
29 //________________________________________________________________________
31 {
32 return StatusCode::SUCCESS;
33 }
34
35
36 //________________________________________________________________________
38 {
39 ATH_MSG_DEBUG("in TrackCollectionProvider::trackCollection");
40
41 originalTracks=nullptr;
42
43 // check if m_inputCol is a TrackCollection and exists for this event
44 // perhaps this can be done in a much nicer way on the python side ala PyUtils/checkFile.py
45 // do it here for now
47 evtStore()->retrieve(originalTracks,m_inputCol).isFailure() ) {
48
49 originalTracks=nullptr;
50
51 ATH_MSG_DEBUG("input track collection \'"<<m_inputCol<<"\' not found for this event");
52
56 msg(MSG::FATAL)<<"Input track collection \'"<<m_inputCol<<"\' not found in first "
57 <<m_nRetrievalErrors<<" events. Aborting."<<endmsg;
58 msg(MSG::FATAL)<<"Maximum allowed number of events without the track collection "
59 <<"can be changed using the \'MaxRetrievalErrors\' option (-1 for infinite)."
60 <<endmsg;
61 return StatusCode::FAILURE;
62 }
63 }
64 return StatusCode::SUCCESS;
65 }
66 ATH_MSG_DEBUG("found "<<originalTracks->size()<<" tracks");
67
68 // if we're here it means that the track collection m_inputCol exists in the file
69 // (it can be empty) so we change the error cutoff to process the whole file
72
73 return StatusCode::SUCCESS;
74 }
75
76} // end namespace
#define endmsg
#define ATH_MSG_DEBUG(x)
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
ServiceHandle< StoreGateSvc > & evtStore()
MsgStream & msg() const
size_type size() const noexcept
Returns the number of elements in the collection.
int m_nRetrievalErrors
number of retrieval errors at the beginning of the job
TrackCollectionProvider(const std::string &type, const std::string &name, const IInterface *parent)
Gaudi::Property< std::string > m_inputCol
StatusCode trackCollection(const TrackCollection *&tracks)
Gaudi::Property< int > m_maxRetrievalErrors
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:116
Ensure that the ATLAS eigen extensions are properly loaded.