ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
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. More...
 
virtual ~PlotsDefinitionSvc ()=default
 Destructor. More...
 
virtual StatusCode initialize () override
 initialize More...
 
virtual StatusCode finalize () override
 finalize More...
 
virtual const IDTPM::SinglePlotDefinitiondefinition (const std::string &identifier) const override
 Get the plot definition. More...
 
StatusCode update (const IDTPM::SinglePlotDefinition &def)
 Update the map with a new entry. More...
 

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 }

◆ ~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 }

◆ 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 
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 }

◆ 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 }

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.


The documentation for this class was generated from the following files:
get_generator_info.result
result
Definition: get_generator_info.py:21
IDTPM::SinglePlotDefinition
Definition: SinglePlotDefinition.h:25
PlotsDefinitionSvc::update
StatusCode update(const IDTPM::SinglePlotDefinition &def)
Update the map with a new entry.
Definition: PlotsDefinitionSvc.cxx:84
plotBeamSpotVert.plotDef
dictionary plotDef
Definition: plotBeamSpotVert.py:55
xAOD::identifier
identifier
Definition: UncalibratedMeasurement_v1.cxx:15
IDTPM::SinglePlotDefinition::identifier
const std::string & identifier() const
Definition: SinglePlotDefinition.h:81
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
PlotsDefinitionSvc::m_nullDef
IDTPM::SinglePlotDefinition m_nullDef
Definition: PlotsDefinitionSvc.h:57
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
PlotsDefinitionSvc::m_plotsDefReadTool
ToolHandle< IDTPM::IPlotsDefReadTool > m_plotsDefReadTool
Definition: PlotsDefinitionSvc.h:59
PlotsDefinitionSvc::m_plotsDefMap
plotsDefMap_t m_plotsDefMap
Definition: PlotsDefinitionSvc.h:55