ATLAS Offline Software
Loading...
Searching...
No Matches
PlotsDefinitionSvc Class Reference

Athena include(s) More...

#include <PlotsDefinitionSvc.h>

Inheritance diagram for PlotsDefinitionSvc:
Collaboration diagram for PlotsDefinitionSvc:

Public Member Functions

 PlotsDefinitionSvc (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor.
virtual ~PlotsDefinitionSvc ()=default
 Destructor.
virtual StatusCode initialize () override
 initialize
virtual StatusCode finalize () override
 finalize
virtual const IDTPM::SinglePlotDefinitiondefinition (const std::string &identifier) const override
 Get the plot definition.
StatusCode update (const IDTPM::SinglePlotDefinition &def)
 Update the map with a new entry.

Private Attributes

plotsDefMap_t m_plotsDefMap
IDTPM::SinglePlotDefinition m_nullDef
ToolHandle< IDTPM::IPlotsDefReadToolm_plotsDefReadTool
std::string m_anaTag

Detailed Description

Athena include(s)

Gaudi include(s) Local include(s)

Definition at line 29 of file PlotsDefinitionSvc.h.

Constructor & Destructor Documentation

◆ PlotsDefinitionSvc()

PlotsDefinitionSvc::PlotsDefinitionSvc ( const std::string & name,
ISvcLocator * pSvcLocator )

Constructor.

Local include(s)


— Constructor —

Definition at line 18 of file PlotsDefinitionSvc.cxx.

19 :
20 base_class( name, pSvcLocator ),
22{
23}
IDTPM::SinglePlotDefinition m_nullDef
plotsDefMap_t m_plotsDefMap

◆ ~PlotsDefinitionSvc()

virtual PlotsDefinitionSvc::~PlotsDefinitionSvc ( )
virtualdefault

Destructor.

Member Function Documentation

◆ definition()

const IDTPM::SinglePlotDefinition & PlotsDefinitionSvc::definition ( const std::string & identifier) const
overridevirtual

Get the plot definition.


— definition —

Definition at line 72 of file PlotsDefinitionSvc.cxx.

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}

◆ finalize()

StatusCode PlotsDefinitionSvc::finalize ( )
overridevirtual

finalize


— finalize —

Definition at line 63 of file PlotsDefinitionSvc.cxx.

63 {
64 ATH_MSG_DEBUG( "Finalized " << name() );
65 return StatusCode::SUCCESS;
66}
#define ATH_MSG_DEBUG(x)

◆ initialize()

StatusCode PlotsDefinitionSvc::initialize ( )
overridevirtual

initialize


— initialize —

Updating plots definition map

Checking validity of plots definitions

Definition at line 29 of file PlotsDefinitionSvc.cxx.

29 {
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
ToolHandle< IDTPM::IPlotsDefReadTool > m_plotsDefReadTool
StatusCode update(const IDTPM::SinglePlotDefinition &def)
Update the map with a new entry.

◆ update()

StatusCode PlotsDefinitionSvc::update ( const IDTPM::SinglePlotDefinition & def)

Update the map with a new entry.


--— update --—

Definition at line 84 of file PlotsDefinitionSvc.cxx.

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}
const std::string & identifier() const

Member Data Documentation

◆ m_anaTag

std::string PlotsDefinitionSvc::m_anaTag
private

Definition at line 62 of file PlotsDefinitionSvc.h.

◆ m_nullDef

IDTPM::SinglePlotDefinition PlotsDefinitionSvc::m_nullDef
private

Definition at line 57 of file PlotsDefinitionSvc.h.

◆ m_plotsDefMap

plotsDefMap_t PlotsDefinitionSvc::m_plotsDefMap
private

Definition at line 55 of file PlotsDefinitionSvc.h.

◆ m_plotsDefReadTool

ToolHandle< IDTPM::IPlotsDefReadTool > PlotsDefinitionSvc::m_plotsDefReadTool
private
Initial value:
{
this, "PlotsDefReadTool", "IDTPM::InDetTrackPerfMon/IPlotsDefReadTool", "Tool to read plots definitions from parsed list of strings" }

Definition at line 59 of file PlotsDefinitionSvc.h.

59 {
60 this, "PlotsDefReadTool", "IDTPM::InDetTrackPerfMon/IPlotsDefReadTool", "Tool to read plots definitions from parsed list of strings" };

The documentation for this class was generated from the following files: