ATLAS Offline Software
Loading...
Searching...
No Matches
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 >>>>>>
7
8TrkEDMTestAlg::TrkEDMTestAlg(const std::string& name, ISvcLocator* pSvcLocator)
9:
10 AthAlgorithm(name, pSvcLocator),
11 m_eventNum(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//--------------------------------------------------------------------------
23= default;
24
25//-----------------------------------------------------------------------
26StatusCode
28{
29 // summary is special (normally want to write it)
33 }
34
35 return AthAlgorithm::initialize();
36}
37
38//-------------------------------------------------------------------------
39StatusCode
41{
42 ++m_eventNum;
43 return runTest();
44}
45
46//---------------------------------------------------------------------------
47
48StatusCode
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.");
60 m_summaryFileOutput <<"Found :"<<objCount<<" \t at "<<SGKey<<", with "<<numberOfObjects<<" total contained objects."<<std::endl;
61 }
62 }
64 if (m_doDetailedChecks) m_summaryFileOutput<<"Detailed tests found : "<<m_numDetailedWarnings<<" problems.";
65 m_summaryFileOutput.close();
66 }
67
68 return StatusCode::SUCCESS;
69}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
std::map< std::string, unsigned int > m_numConstObjsFound
virtual StatusCode runTest()=0
TrkEDMTestAlg(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode initialize()
std::map< std::string, unsigned int > m_numContsFound
bool m_doDetailedChecks
If true, try to examine the PRDs etc in detail and catch any errors.
bool m_dumpSummaryToFile
std::string m_summaryDumpFileName
unsigned int m_eventNum
numbers of event
StatusCode finalize()
StatusCode execute()
unsigned int m_numDetailedWarnings
Count of detailed warning found.
std::ofstream m_summaryFileOutput