ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetValidation
InDetTrackPerfMon
src
PlotsDefinitionSvc.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
10
12
#include "
PlotsDefinitionSvc.h
"
13
14
18
IDTPM::PlotsDefinitionSvc::PlotsDefinitionSvc
(
19
const
std::string& name, ISvcLocator* pSvcLocator ) :
20
base_class( name, pSvcLocator ),
21
m_plotsDefMap
{},
m_nullDef
()
22
{
23
}
24
25
29
StatusCode
IDTPM::PlotsDefinitionSvc::initialize
() {
30
31
ATH_MSG_DEBUG
(
"Initialising "
<< name() );
32
33
ATH_CHECK
(
m_plotsDefReadTool
.retrieve() );
34
36
for
(
const
IDTPM::SinglePlotDefinition
& plotDef :
37
m_plotsDefReadTool
->getPlotsDefinitions() ) {
38
ATH_CHECK
(
update
( plotDef ) );
39
}
40
41
ATH_MSG_DEBUG
(
"Number of plots being booked = "
<<
m_plotsDefMap
.size() );
42
44
bool
allDefsOk(
true
);
45
for
(
const
auto
& p :
m_plotsDefMap
) {
46
if
( not p.second.isValid() ) {
47
ATH_MSG_WARNING
(
"Invalid plot definition: "
<< p.second.plotDigest() );
48
allDefsOk =
false
;
49
}
50
}
51
if
( not allDefsOk ) {
52
ATH_MSG_WARNING
(
"Some plots definitions were bad"
);
53
return
StatusCode::RECOVERABLE;
54
}
55
56
return
StatusCode::SUCCESS;
57
}
58
59
63
StatusCode
IDTPM::PlotsDefinitionSvc::finalize
() {
64
ATH_MSG_DEBUG
(
"Finalized "
<< name() );
65
return
StatusCode::SUCCESS;
66
}
67
68
72
const
IDTPM::SinglePlotDefinition
&
IDTPM::PlotsDefinitionSvc::definition
(
73
const
std::string& identifier )
const
74
{
75
plotsDefMap_t::const_iterator map_it =
m_plotsDefMap
.find( identifier );
76
if
( map_it !=
m_plotsDefMap
.end() )
return
map_it->second;
77
return
m_nullDef
;
// null plot definition
78
}
79
80
84
StatusCode
IDTPM::PlotsDefinitionSvc::update
(
85
const
IDTPM::SinglePlotDefinition
& def )
86
{
87
ATH_MSG_DEBUG
(
"Adding new plot definition: "
<< def.
identifier
() );
88
89
std::pair< plotsDefMap_t::iterator, bool > result =
90
m_plotsDefMap
.insert( plotsDefMap_t::value_type( def.
identifier
(), def ) );
91
92
if
( not result.second ) {
93
ATH_MSG_DEBUG
(
"Plot definition is already in map. Not added"
);
94
}
95
96
return
StatusCode::SUCCESS;
97
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition
AthMsgStreamMacros.h:32
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
PlotsDefinitionSvc.h
Service interface to hold (and propagate) the definition of the monitoring plots in this package (bas...
IDTPM::PlotsDefinitionSvc::m_plotsDefReadTool
ToolHandle< IDTPM::IPlotsDefReadTool > m_plotsDefReadTool
Definition
PlotsDefinitionSvc.h:60
IDTPM::PlotsDefinitionSvc::PlotsDefinitionSvc
PlotsDefinitionSvc(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
PlotsDefinitionSvc.cxx:18
IDTPM::PlotsDefinitionSvc::initialize
virtual StatusCode initialize() override
initialize
Definition
PlotsDefinitionSvc.cxx:29
IDTPM::PlotsDefinitionSvc::m_plotsDefMap
plotsDefMap_t m_plotsDefMap
Definition
PlotsDefinitionSvc.h:56
IDTPM::PlotsDefinitionSvc::update
StatusCode update(const IDTPM::SinglePlotDefinition &def)
Update the map with a new entry.
Definition
PlotsDefinitionSvc.cxx:84
IDTPM::PlotsDefinitionSvc::finalize
virtual StatusCode finalize() override
finalize
Definition
PlotsDefinitionSvc.cxx:63
IDTPM::PlotsDefinitionSvc::m_nullDef
IDTPM::SinglePlotDefinition m_nullDef
Definition
PlotsDefinitionSvc.h:58
IDTPM::PlotsDefinitionSvc::definition
virtual const IDTPM::SinglePlotDefinition & definition(const std::string &identifier) const override
Get the plot definition.
Definition
PlotsDefinitionSvc.cxx:72
IDTPM::SinglePlotDefinition
Definition
SinglePlotDefinition.h:25
IDTPM::SinglePlotDefinition::identifier
const std::string & identifier() const
Definition
SinglePlotDefinition.h:87
Generated on
for ATLAS Offline Software by
1.17.0