ATLAS Offline Software
Public Types | 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 Types

typedef std::unordered_map< std::string, IDTPM::SinglePlotDefinitionplotsDefMap_t
 typedef for map definition More...
 

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...
 
virtual void print () const
 Print the state of the service. More...
 
template<typename T >
void declareServiceInterface ()
 add the given interface to the list of interfaces More...
 
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvi)
 query interface for gaudi More...
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 
 DeclareInterfaceID (IPlotsDefinitionSvc, 1, 0)
 Creates the InterfaceID and interfaceID() method. More...
 

Private Attributes

plotsDefMap_t m_plotsDefMap
 
IDTPM::SinglePlotDefinition m_nullDef
 
ToolHandle< IDTPM::IPlotsDefReadToolm_plotsDefReadTool
 
std::string m_anaTag
 
std::vector< std::pair< const InterfaceID &(*)(), void *(*)(AsgService *)> > m_interfaces
 list of interfaces we have More...
 

Detailed Description

Athena include(s)

Gaudi include(s) Local include(s)

Definition at line 29 of file PlotsDefinitionSvc.h.

Member Typedef Documentation

◆ plotsDefMap_t

typedef std::unordered_map< std::string, IDTPM::SinglePlotDefinition > IPlotsDefinitionSvc::plotsDefMap_t
inherited

typedef for map definition

Definition at line 36 of file IPlotsDefinitionSvc.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  AsgService( name, pSvcLocator ),
22 {
23  declareServiceInterface< IPlotsDefinitionSvc >();
24 }

◆ ~PlotsDefinitionSvc()

virtual PlotsDefinitionSvc::~PlotsDefinitionSvc ( )
virtualdefault

Destructor.

Member Function Documentation

◆ DeclareInterfaceID()

IPlotsDefinitionSvc::DeclareInterfaceID ( IPlotsDefinitionSvc  ,
,
 
)
inherited

Creates the InterfaceID and interfaceID() method.

◆ declareServiceInterface()

template<typename T >
void asg::AsgService::declareServiceInterface
inherited

add the given interface to the list of interfaces

Definition at line 76 of file AsgService.h.

77  {
78 #ifndef XAOD_STANDALONE
79  m_interfaces.emplace_back (T::interfaceID, [] (AsgService *self) -> void* {return dynamic_cast<T*>(self);});
80 #endif
81  }

◆ definition()

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

Get the plot definition.


— definition —

Implements IPlotsDefinitionSvc.

Definition at line 74 of file PlotsDefinitionSvc.cxx.

76 {
77  plotsDefMap_t::const_iterator map_it = m_plotsDefMap.find( identifier );
78  if( map_it != m_plotsDefMap.end() ) return map_it->second;
79  return m_nullDef; // null plot definition
80 }

◆ finalize()

StatusCode PlotsDefinitionSvc::finalize ( )
overridevirtual

finalize


— finalize —

Reimplemented from asg::AsgService.

Definition at line 65 of file PlotsDefinitionSvc.cxx.

65  {
66  ATH_MSG_DEBUG( "Finalized " << name() );
67  return StatusCode::SUCCESS;
68 }

◆ initialize()

StatusCode PlotsDefinitionSvc::initialize ( )
overridevirtual

initialize


— initialize —

Updating plots definition map

Checking validity of plots definitions

Reimplemented from asg::AsgService.

Definition at line 30 of file PlotsDefinitionSvc.cxx.

30  {
31 
32  ATH_MSG_DEBUG( "Initialising " << name() );
33 
34  ATH_CHECK( m_plotsDefReadTool.retrieve() );
35 
38  m_plotsDefReadTool->getPlotsDefinitions() ) {
39  ATH_CHECK( update( plotDef ) );
40  }
41 
42  ATH_MSG_DEBUG( "Number of plots being booked = " << m_plotsDefMap.size() );
43 
45  bool allDefsOk( true );
47  for( map_it = m_plotsDefMap.begin(); map_it != m_plotsDefMap.end(); map_it++ ) {
48  if( not map_it->second.isValid() ) {
49  ATH_MSG_WARNING( "Invalid plot definition: " << map_it->second.plotDigest() );
50  allDefsOk = false;
51  }
52  }
53  if( not allDefsOk ) {
54  ATH_MSG_WARNING( "Some plots definitions were bad" );
55  return StatusCode::RECOVERABLE;
56  }
57 
58  return StatusCode::SUCCESS;
59 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Service >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Service >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Service >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ print()

void asg::AsgService::print ( ) const
virtualinherited

Print the state of the service.

Implements asg::IAsgService.

Definition at line 48 of file AsgService.cxx.

49  {
50  ATH_MSG_INFO( "AsgService " << name() << " @ " << this );
51  return;
52  }

◆ queryInterface()

StatusCode asg::AsgService::queryInterface ( const InterfaceID &  riid,
void **  ppvi 
)
virtualinherited

query interface for gaudi

Definition at line 57 of file AsgService.cxx.

59  {
60  for (const auto& interface : m_interfaces)
61  {
62  if (riid == interface.first())
63  {
64  *ppvi = interface.second (this);
65  addRef();
66  return StatusCode::SUCCESS;
67  }
68  }
69  return AsgServiceBase::queryInterface (riid, ppvi);
70  }

◆ update()

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

Update the map with a new entry.


--— update --—

Definition at line 86 of file PlotsDefinitionSvc.cxx.

88 {
89  ATH_MSG_DEBUG( "Adding new plot definition: " << def.identifier() );
90 
91  std::pair< plotsDefMap_t::iterator, bool > result =
92  m_plotsDefMap.insert( plotsDefMap_t::value_type( def.identifier(), def ) );
93 
94  if( not result.second ) {
95  ATH_MSG_DEBUG( "Plot definition is already in map. Not added" );
96  }
97 
98  return StatusCode::SUCCESS;
99 }

Member Data Documentation

◆ m_anaTag

std::string PlotsDefinitionSvc::m_anaTag
private

Definition at line 63 of file PlotsDefinitionSvc.h.

◆ m_interfaces

std::vector<std::pair<const InterfaceID& (*)(),void *(*)(AsgService*)> > asg::AsgService::m_interfaces
privateinherited

list of interfaces we have

Definition at line 68 of file AsgService.h.

◆ m_nullDef

IDTPM::SinglePlotDefinition PlotsDefinitionSvc::m_nullDef
private

Definition at line 58 of file PlotsDefinitionSvc.h.

◆ m_plotsDefMap

plotsDefMap_t PlotsDefinitionSvc::m_plotsDefMap
private

Definition at line 56 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 60 of file PlotsDefinitionSvc.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
get_generator_info.result
result
Definition: get_generator_info.py:21
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
IDTPM::SinglePlotDefinition
Definition: SinglePlotDefinition.h:24
PlotsDefinitionSvc::update
StatusCode update(const IDTPM::SinglePlotDefinition &def)
Update the map with a new entry.
Definition: PlotsDefinitionSvc.cxx:86
plotBeamSpotVert.plotDef
dictionary plotDef
Definition: plotBeamSpotVert.py:55
xAOD::identifier
identifier
Definition: UncalibratedMeasurement_v1.cxx:15
asg::AsgService::m_interfaces
std::vector< std::pair< const InterfaceID &(*)(), void *(*)(AsgService *)> > m_interfaces
list of interfaces we have
Definition: AsgService.h:68
IDTPM::SinglePlotDefinition::identifier
const std::string & identifier() const
Definition: SinglePlotDefinition.h:68
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:192
PlotsDefinitionSvc::m_nullDef
IDTPM::SinglePlotDefinition m_nullDef
Definition: PlotsDefinitionSvc.h:58
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
asg::AsgService::AsgService
AsgService(const std::string &name, ISvcLocator *pSvcLocator)
Definition: AsgService.cxx:19
PlotsDefinitionSvc::m_plotsDefReadTool
ToolHandle< IDTPM::IPlotsDefReadTool > m_plotsDefReadTool
Definition: PlotsDefinitionSvc.h:60
PlotsDefinitionSvc::m_plotsDefMap
plotsDefMap_t m_plotsDefMap
Definition: PlotsDefinitionSvc.h:56
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35