ATLAS Offline Software
Loading...
Searching...
No Matches
TrackCollectionProvider.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 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)
16 {
17
18 declareInterface<ITrackCollectionProvider>(this);
19
20 declareProperty("InputTrkCol", m_inputCol="MooreTracks");
21
22 declareProperty("MaxRetrievalErrors", m_maxRetrievalErrors = 10);
23
24 }
25
26 //________________________________________________________________________
28 = default;
29
30 //________________________________________________________________________
32 {
33 return StatusCode::SUCCESS;
34 }
35
36 //________________________________________________________________________
38 {
39 return StatusCode::SUCCESS;
40 }
41
42
43 //________________________________________________________________________
45 {
46 ATH_MSG_DEBUG("in TrackCollectionProvider::trackCollection");
47
48 originalTracks=nullptr;
49
50 // check if m_inputCol is a TrackCollection and exists for this event
51 // perhaps this can be done in a much nicer way on the python side ala PyUtils/checkFile.py
52 // do it here for now
54 evtStore()->retrieve(originalTracks,m_inputCol).isFailure() ) {
55
56 originalTracks=nullptr;
57
58 ATH_MSG_DEBUG("input track collection \'"<<m_inputCol<<"\' not found for this event");
59
63 msg(MSG::FATAL)<<"Input track collection \'"<<m_inputCol<<"\' not found in first "
64 <<m_nRetrievalErrors<<" events. Aborting."<<endmsg;
65 msg(MSG::FATAL)<<"Maximum allowed number of events without the track collection "
66 <<"can be changed using the \'MaxRetrievalErrors\' option (-1 for infinite)."
67 <<endmsg;
68 return StatusCode::FAILURE;
69 }
70 }
71 return StatusCode::SUCCESS;
72 }
73 ATH_MSG_DEBUG("found "<<originalTracks->size()<<" tracks");
74
75 // if we're here it means that the track collection m_inputCol exists in the file
76 // (it can be empty) so we change the error cutoff to process the whole file
79
80 return StatusCode::SUCCESS;
81 }
82
83} // 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:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
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)
int m_maxRetrievalErrors
maximum allowed number of retrieval errors at the beginning of the job (-1 for infinite)
std::string m_inputCol
Name of input track collection.
StatusCode trackCollection(const TrackCollection *&tracks)
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:114
Ensure that the ATLAS eigen extensions are properly loaded.