ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
TrkValidation
TrkValAlgs
src
TrkEDMTestAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
//<<<<<< INCLUDES >>>>>>
6
#include "
TrkValAlgs/TrkEDMTestAlg.h
"
7
8
TrkEDMTestAlg::TrkEDMTestAlg
(
const
std::string& name, ISvcLocator* pSvcLocator)
9
:
10
AthAlgorithm
(name, pSvcLocator),
11
m_eventNum
(0),
12
m_numDetailedWarnings
(0)
13
{
14
declareProperty
(
"DoDumpSummaryToFile"
,
m_dumpSummaryToFile
=
true
);
15
declareProperty
(
"SummaryDumpFileName"
,
m_summaryDumpFileName
=
"TrkEDMTestAlg.summary.log"
);
16
declareProperty
(
"DoDumpToFile"
,
m_dumpToFile
=
true
);
17
declareProperty
(
"DoDumpToMsgStream"
,
m_dumpToMsg
=
false
);
18
declareProperty
(
"DoDetailedChecks"
,
m_doDetailedChecks
=
false
);
19
}
20
21
//--------------------------------------------------------------------------
22
TrkEDMTestAlg::~TrkEDMTestAlg
(
void
)
23
=
default
;
24
25
//-----------------------------------------------------------------------
26
StatusCode
27
TrkEDMTestAlg::initialize
()
28
{
29
// summary is special (normally want to write it)
30
if
(
m_dumpSummaryToFile
) {
31
m_summaryFileOutput
.open(
m_summaryDumpFileName
.c_str());
32
ATH_MSG_VERBOSE
(
"SUM dump="
<<
m_summaryDumpFileName
);
33
}
34
35
return
AthAlgorithm::initialize();
36
}
37
38
//-------------------------------------------------------------------------
39
StatusCode
40
TrkEDMTestAlg::execute
(
const
EventContext&
/*ctx*/
)
41
{
42
++
m_eventNum
;
43
return
runTest
();
44
}
45
46
//---------------------------------------------------------------------------
47
48
StatusCode
49
TrkEDMTestAlg::finalize
()
50
{
51
ATH_MSG_INFO
(
"Number of events processed = "
<<
m_eventNum
);
52
if
(
m_numDetailedWarnings
>0)
ATH_MSG_ERROR
(
" Found "
<<
m_numDetailedWarnings
<<
" problems! Please check log for more details."
);
53
54
if
(
m_dumpSummaryToFile
)
m_summaryFileOutput
<<
"Summary"
<<std::endl<<
"-------"
<<std::endl;
55
56
for
(
const
auto
& [SGKey, objCount] :
m_numContsFound
) {
57
const
int
numberOfObjects =
m_numConstObjsFound
[SGKey];
58
ATH_MSG_INFO
(
"Found :"
<<objCount<<
" \t at "
<<SGKey<<
", with "
<<numberOfObjects<<
" total contained objects."
);
59
if
(
m_dumpSummaryToFile
){
60
m_summaryFileOutput
<<
"Found :"
<<objCount<<
" \t at "
<<SGKey<<
", with "
<<numberOfObjects<<
" total contained objects."
<<std::endl;
61
}
62
}
63
if
(
m_dumpSummaryToFile
){
64
if
(
m_doDetailedChecks
)
m_summaryFileOutput
<<
"Detailed tests found : "
<<
m_numDetailedWarnings
<<
" problems."
;
65
m_summaryFileOutput
.close();
66
}
67
68
return
StatusCode::SUCCESS;
69
}
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
TrkEDMTestAlg.h
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
TrkEDMTestAlg::execute
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Definition
TrkEDMTestAlg.cxx:40
TrkEDMTestAlg::m_numConstObjsFound
std::map< std::string, unsigned int > m_numConstObjsFound
Definition
TrkEDMTestAlg.h:78
TrkEDMTestAlg::m_dumpToMsg
bool m_dumpToMsg
Definition
TrkEDMTestAlg.h:64
TrkEDMTestAlg::~TrkEDMTestAlg
~TrkEDMTestAlg()
TrkEDMTestAlg::m_dumpToFile
bool m_dumpToFile
Definition
TrkEDMTestAlg.h:65
TrkEDMTestAlg::runTest
virtual StatusCode runTest()=0
TrkEDMTestAlg::TrkEDMTestAlg
TrkEDMTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
TrkEDMTestAlg.cxx:8
TrkEDMTestAlg::initialize
virtual StatusCode initialize() override
Definition
TrkEDMTestAlg.cxx:27
TrkEDMTestAlg::m_numContsFound
std::map< std::string, unsigned int > m_numContsFound
Definition
TrkEDMTestAlg.h:75
TrkEDMTestAlg::finalize
virtual StatusCode finalize() override
Definition
TrkEDMTestAlg.cxx:49
TrkEDMTestAlg::m_doDetailedChecks
bool m_doDetailedChecks
If true, try to examine the PRDs etc in detail and catch any errors.
Definition
TrkEDMTestAlg.h:71
TrkEDMTestAlg::m_dumpSummaryToFile
bool m_dumpSummaryToFile
Definition
TrkEDMTestAlg.h:66
TrkEDMTestAlg::m_summaryDumpFileName
std::string m_summaryDumpFileName
Definition
TrkEDMTestAlg.h:68
TrkEDMTestAlg::m_eventNum
unsigned int m_eventNum
numbers of event
Definition
TrkEDMTestAlg.h:62
TrkEDMTestAlg::m_numDetailedWarnings
unsigned int m_numDetailedWarnings
Count of detailed warning found.
Definition
TrkEDMTestAlg.h:72
TrkEDMTestAlg::m_summaryFileOutput
std::ofstream m_summaryFileOutput
Definition
TrkEDMTestAlg.h:69
Generated on
for ATLAS Offline Software by
1.17.0