ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkAlignment
TrkAlignGenTools
src
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
5
#include "
TrkAlignGenTools/TrackCollectionProvider.h
"
6
7
namespace
Trk
{
8
9
//________________________________________________________________________
10
TrackCollectionProvider::TrackCollectionProvider
(
const
std::string&
type
,
11
const
std::string& name,
12
const
IInterface* parent)
13
14
:
AthAlgTool
(
type
,name,parent)
15
{
16
declareInterface<ITrackCollectionProvider>(
this
);
17
}
18
19
//________________________________________________________________________
20
TrackCollectionProvider::~TrackCollectionProvider
()
21
=
default
;
22
23
//________________________________________________________________________
24
StatusCode
TrackCollectionProvider::initialize
()
25
{
26
return
StatusCode::SUCCESS;
27
}
28
29
//________________________________________________________________________
30
StatusCode
TrackCollectionProvider::finalize
()
31
{
32
return
StatusCode::SUCCESS;
33
}
34
35
36
//________________________________________________________________________
37
StatusCode
TrackCollectionProvider::trackCollection
(
const
TrackCollection
*& originalTracks)
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
46
if
( !
evtStore
()->
contains<TrackCollection>
(
m_inputCol
) ||
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
53
if
(
m_maxRetrievalErrors
>=0) {
54
++
m_nRetrievalErrors
;
55
if
(
m_nRetrievalErrors
>=
m_maxRetrievalErrors
) {
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
if
(originalTracks){
67
ATH_MSG_DEBUG
(
"found "
<<originalTracks->
size
()<<
" tracks"
);
68
}
69
// if we're here it means that the track collection m_inputCol exists in the file
70
// (it can be empty) so we change the error cutoff to process the whole file
71
if
(
m_maxRetrievalErrors
>=0)
72
m_maxRetrievalErrors
=-1;
73
74
return
StatusCode::SUCCESS;
75
}
76
77
}
// end namespace
endmsg
#define endmsg
Definition
AnalysisConfig_Ntuple.cxx:54
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
TrackCollectionProvider.h
TrackCollection
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
Definition
TrackCollection.h:19
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
Definition
AthCommonDataStore.h:85
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition
AthCommonMsg.h:24
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
Trk::TrackCollectionProvider::m_nRetrievalErrors
int m_nRetrievalErrors
number of retrieval errors at the beginning of the job
Definition
TrackCollectionProvider.h:40
Trk::TrackCollectionProvider::TrackCollectionProvider
TrackCollectionProvider(const std::string &type, const std::string &name, const IInterface *parent)
Definition
TrackCollectionProvider.cxx:10
Trk::TrackCollectionProvider::~TrackCollectionProvider
virtual ~TrackCollectionProvider()
Trk::TrackCollectionProvider::finalize
StatusCode finalize()
Definition
TrackCollectionProvider.cxx:30
Trk::TrackCollectionProvider::m_inputCol
Gaudi::Property< std::string > m_inputCol
Definition
TrackCollectionProvider.h:37
Trk::TrackCollectionProvider::initialize
StatusCode initialize()
Definition
TrackCollectionProvider.cxx:24
Trk::TrackCollectionProvider::trackCollection
StatusCode trackCollection(const TrackCollection *&tracks)
Definition
TrackCollectionProvider.cxx:37
Trk::TrackCollectionProvider::m_maxRetrievalErrors
Gaudi::Property< int > m_maxRetrievalErrors
Definition
TrackCollectionProvider.h:41
contains
bool contains(const std::string &s, const std::string ®x)
does a string contain the substring
Definition
hcg.cxx:116
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition
FakeTrackBuilder.h:9
type
Generated on
for ATLAS Offline Software by
1.17.0