ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
EL::WhiteBoardSvc Class Reference

#include <WhiteBoardSvc.h>

Inheritance diagram for EL::WhiteBoardSvc:
Collaboration diagram for EL::WhiteBoardSvc:

Public Member Functions

void testInvariant () const
 effects: test the invariant of this object guarantee: no-fail More...
 
 WhiteBoardSvc ()
 effects: standard constructor guarantee: strong failures: out of memory I rationale: this constructor has to be public to allow root streaming. More...
 
bool hasVar (const std::string &name) const
 returns: whether we have the given variable guarantee: strong failures: out of memory II More...
 
float getFloat (const std::string &name) const
 returns: the content of the variable, assuming the given type guarantee: strong failures: variable not found failures: variable of wrong type failures: given type not supported postcondition(3): result != 0 More...
 
void getArray (const std::string &name, std::size_t &size, const float *&values) const
 
TObject * getTObject (const std::string &name) const
 
template<class T >
T * retrieve (const std::string &name) const
 returns: the content of the variable, casted to the given type guarantee: strong failures: variable not found failures: variable of wrong type failures: TObject type not supported More...
 
void setFloat (const std::string &name, float value)
 returns: set/create a variable, assuming the given type guarantee: strong failures: given type not supported failures: variable can not be set failures: out of memory II requires(4): TObject != 0 More...
 
void setArray (const std::string &name, const std::vector< float > &value)
 
void setArray (const std::string &name, std::size_t size, const float *values)
 
void setTObject (TObject *object, bool swallow=true)
 
virtual const char * GetName () const
 effects: return the name of this algorithm guarantee: no-fail More...
 
IWorkerwk () const
 description: the worker that is controlling us guarantee: no-fail More...
 
void book (const TH1 &hist)
 book the given histogram More...
 
TH1 * hist (const std::string &name) const
 get the histogram with the given name More...
 
asg::SgTEventevtStore () const
 get the (main) event store for this algorithm More...
 
virtual const std::string & name () const
 
MsgStream & msg () const
 messaging interface More...
 
MsgStream & msg (int level) const
 the message stream for this object, configured for the given level More...
 
bool msgLvl (int lvl) const
 whether we are configured to print messages at the given level More...
 
void setMsgLevel (int level)
 set the message level for the message stream for this object More...
 
MsgStream & msg () const
 messaging interface More...
 
MsgStream & msg (int level) const
 the message stream for this object, configured for the given level More...
 
bool msgLvl (int lvl) const
 whether we are configured to print messages at the given level More...
 
void setMsgLevel (int level)
 set the message level for the message stream for this object More...
 
MsgStream & msg () const
 messaging interface More...
 
MsgStream & msg (int level) const
 the message stream for this object, configured for the given level More...
 
bool msgLvl (int lvl) const
 whether we are configured to print messages at the given level More...
 
void setMsgLevel (int level)
 set the message level for the message stream for this object More...
 
MsgStream & msg () const
 messaging interface More...
 
MsgStream & msg (int level) const
 the message stream for this object, configured for the given level More...
 
bool msgLvl (int lvl) const
 whether we are configured to print messages at the given level More...
 
void setMsgLevel (int level)
 set the message level for the message stream for this object More...
 
MsgStream & msg () const
 messaging interface More...
 
MsgStream & msg (int level) const
 the message stream for this object, configured for the given level More...
 
bool msgLvl (int lvl) const
 whether we are configured to print messages at the given level More...
 
void setMsgLevel (int level)
 set the message level for the message stream for this object More...
 
MsgStream & msg () const
 messaging interface More...
 
MsgStream & msg (int level) const
 the message stream for this object, configured for the given level More...
 
bool msgLvl (int lvl) const
 whether we are configured to print messages at the given level More...
 
void setMsgLevel (int level)
 set the message level for the message stream for this object More...
 
MsgStream & msg () const
 messaging interface More...
 
MsgStream & msg (int level) const
 the message stream for this object, configured for the given level More...
 
bool msgLvl (int lvl) const
 whether we are configured to print messages at the given level More...
 
void setMsgLevel (int level)
 set the message level for the message stream for this object More...
 
MsgStream & msg () const
 messaging interface More...
 
MsgStream & msg (int level) const
 the message stream for this object, configured for the given level More...
 
bool msgLvl (int lvl) const
 whether we are configured to print messages at the given level More...
 
void setMsgLevel (int level)
 set the message level for the message stream for this object More...
 
MsgStream & msg () const
 messaging interface More...
 
MsgStream & msg (int level) const
 the message stream for this object, configured for the given level More...
 
bool msgLvl (int lvl) const
 whether we are configured to print messages at the given level More...
 
void setMsgLevel (int level)
 set the message level for the message stream for this object More...
 
MsgStream & msg () const
 messaging interface More...
 
MsgStream & msg (int level) const
 the message stream for this object, configured for the given level More...
 
bool msgLvl (int lvl) const
 whether we are configured to print messages at the given level More...
 
void setMsgLevel (int level)
 set the message level for the message stream for this object More...
 
MsgStream & msg () const
 messaging interface More...
 
MsgStream & msg (int level) const
 the message stream for this object, configured for the given level More...
 
bool msgLvl (int lvl) const
 whether we are configured to print messages at the given level More...
 
void setMsgLevel (int level)
 set the message level for the message stream for this object More...
 
MsgStream & msg () const
 messaging interface More...
 
MsgStream & msg (int level) const
 the message stream for this object, configured for the given level More...
 
bool msgLvl (int lvl) const
 whether we are configured to print messages at the given level More...
 
void setMsgLevel (int level)
 set the message level for the message stream for this object More...
 
MsgStream & msg () const
 messaging interface More...
 
MsgStream & msg (int level) const
 the message stream for this object, configured for the given level More...
 
bool msgLvl (int lvl) const
 whether we are configured to print messages at the given level More...
 
void setMsgLevel (int level)
 set the message level for the message stream for this object More...
 
MsgStream & msg () const
 messaging interface More...
 
MsgStream & msg (int level) const
 the message stream for this object, configured for the given level More...
 
bool msgLvl (int lvl) const
 whether we are configured to print messages at the given level More...
 
void setMsgLevel (int level)
 set the message level for the message stream for this object More...
 

Private Member Functions

virtual bool doHasVar (const std::string &name) const
 returns: whether we have the given variable guarantee: strong failures: out of memory II rationale: the virtual part of WhiteBoardSvc::hasVar More...
 
virtual float doGetFloat (const std::string &name) const
 returns: the content of the variable, assuming the given type guarantee: strong failures: variable not found failures: variable of wrong type failures: given type not supported postcondition(4): result != 0 description: the virtual part of the getters More...
 
virtual void doGetArray (const std::string &name, std::size_t &size, const float *&values) const
 
virtual TObject * doGetTObject (const std::string &name) const
 
virtual void doSetFloat (const std::string &name, float value)
 returns: set/create a variable, assuming the given type guarantee: strong failures: given type not supported failures: variable can not be set failures: out of memory II requires(3): TObject != 0 description: the virtual part of the setters More...
 
virtual void doSetArray (const std::string &name, std::size_t size, const float *values)
 
virtual void doSetTObject (TObject *object, bool swallow)
 
 ClassDef (WhiteBoardSvc, 1)
 
virtual StatusCode setupJob (Job &job)
 effects: give the algorithm a chance to intialize the job with anything this algorithm needs. More...
 
virtual StatusCode fileExecute ()
 effects: do all the processing that needs to be done once per file More...
 
virtual StatusCode endOfFile ()
 effects: do the post-processing for each input file guarantee: basic failures: algorithm dependent rationale: this is mainly used for specialized services that need to save partial results for each input file More...
 
virtual StatusCode changeInput (bool firstFile)
 effects: do all changes to work with a new input file, e.g. More...
 
virtual StatusCode initialize ()
 effects: do everything that needs to be done before running the algorithm, e.g. More...
 
virtual StatusCode histInitialize ()
 effects: this is a pre-initialization routine that is called before changeInput is called. More...
 
virtual StatusCode execute ()
 effects: process the next event guarantee: basic failures: algorithm dependent More...
 
virtual StatusCode postExecute ()
 effects: do the post-processing for the event guarantee: basic failures: algorithm dependent rationale: this is mainly used for specialized services that need to get input from subsequent algorithms before filling their event data More...
 
virtual StatusCode finalize ()
 effects: do everything that needs to be done after completing work on this worker guarantee: basic failures: algorithm dependent rationale: currently there is no use foreseen, but this routine is provided regardless More...
 
virtual StatusCode histFinalize ()
 effects: this is a post-initialization routine that is called after finalize has been called. More...
 
virtual bool hasName (const std::string &name) const
 returns: whether this algorithm has the given name guarantee: basic failures: algorithm dependent rationale: this is to allow an algorithm to be known by multiple names. More...
 
void sysSetupJob (Job &job)
 effects: give the algorithm a chance to intialize the job with anything this algorithm needs. More...
 

Private Attributes

IWorkerm_wk
 
asg::SgTEventm_evtStorePtr = nullptr
 the value of evtStore More...
 
asg::SgTEvent m_evtStore
 when configured, the object returned by evtStore More...
 
MsgStream * m_msg = nullptr
 the message stream, if it has been instantiated More...
 
std::string m_msgName
 the algorithm name for which the message stream has been instantiated More...
 
int m_msgLevel = 3
 the message level configured More...
 
std::string m_nameCache
 the cache for name More...
 

Detailed Description

Definition at line 40 of file WhiteBoardSvc.h.

Constructor & Destructor Documentation

◆ WhiteBoardSvc()

EL::WhiteBoardSvc::WhiteBoardSvc ( )

effects: standard constructor guarantee: strong failures: out of memory I rationale: this constructor has to be public to allow root streaming.

normally I would have made it protected to prevent the user from creating an object of base class type.

Member Function Documentation

◆ book()

void EL::Algorithm::book ( const TH1 &  hist)
inherited

book the given histogram

Guarantee
strong
Failures
histogram booking error

◆ changeInput()

virtual StatusCode EL::Algorithm::changeInput ( bool  firstFile)
privatevirtualinherited

effects: do all changes to work with a new input file, e.g.

set new branch addresses. if firstFile is set, this method is called just before init() is called

Warning: If a file is split across multiple jobs this will be called more than once. This only happens for specific batch drivers and/or if it is explicitly configured by the user. With PROOF it could even happen multiple times within the same job, and while PROOF is no longer supported that behavior may come back if support for a similar framework is added in the future. As such, this method should not be used for accounting that relies to be called exactly once per file, take a look at fileExecute() if you want something that is guaranteed to be executed exactly once per input file.

Warning: The execution order of changeInput and fileExecute is currently unspecified.

guarantee: basic failures: algorithm dependent

Reimplemented in EL::DuplicateChecker, EL::UnitTestAlg1, EL::UnitTestAlg, EL::UnitTestAlgXAOD, EL::NTupleSvc, MD::FormulaSvc, and EL::UnitTestSkim.

◆ ClassDef()

EL::WhiteBoardSvc::ClassDef ( WhiteBoardSvc  ,
 
)
private

◆ doGetArray()

virtual void EL::WhiteBoardSvc::doGetArray ( const std::string &  name,
std::size_t &  size,
const float *&  values 
) const
privatevirtual

◆ doGetFloat()

virtual float EL::WhiteBoardSvc::doGetFloat ( const std::string &  name) const
privatevirtual

returns: the content of the variable, assuming the given type guarantee: strong failures: variable not found failures: variable of wrong type failures: given type not supported postcondition(4): result != 0 description: the virtual part of the getters

◆ doGetTObject()

virtual TObject* EL::WhiteBoardSvc::doGetTObject ( const std::string &  name) const
privatevirtual

◆ doHasVar()

virtual bool EL::WhiteBoardSvc::doHasVar ( const std::string &  name) const
privatevirtual

returns: whether we have the given variable guarantee: strong failures: out of memory II rationale: the virtual part of WhiteBoardSvc::hasVar

◆ doSetArray()

virtual void EL::WhiteBoardSvc::doSetArray ( const std::string &  name,
std::size_t  size,
const float *  values 
)
privatevirtual

◆ doSetFloat()

virtual void EL::WhiteBoardSvc::doSetFloat ( const std::string &  name,
float  value 
)
privatevirtual

returns: set/create a variable, assuming the given type guarantee: strong failures: given type not supported failures: variable can not be set failures: out of memory II requires(3): TObject != 0 description: the virtual part of the setters

◆ doSetTObject()

virtual void EL::WhiteBoardSvc::doSetTObject ( TObject *  object,
bool  swallow 
)
privatevirtual

◆ endOfFile()

virtual StatusCode EL::Algorithm::endOfFile ( )
privatevirtualinherited

effects: do the post-processing for each input file guarantee: basic failures: algorithm dependent rationale: this is mainly used for specialized services that need to save partial results for each input file

Reimplemented in EL::MetricsSvc.

◆ evtStore()

asg::SgTEvent* EL::Algorithm::evtStore ( ) const
inherited

get the (main) event store for this algorithm

This is mostly to mirror the method of the same name in AthAlgorithm, allowing to make the tutorial instructions more dual-use.

Guarantee
strong
Failures
out of memory I
job not configured for xAODs

◆ execute()

virtual StatusCode EL::Algorithm::execute ( )
privatevirtualinherited

effects: process the next event guarantee: basic failures: algorithm dependent

Reimplemented in EL::DuplicateChecker, EL::UnitTestAlg1, EL::UnitTestAlg, EL::UnitTestAlgXAOD, EL::MetricsSvc, EL::NTupleSvc, EL::AlgSelect, MD::FormulaSvc, MD::AlgHist, MD::AlgCFlow, and EL::UnitTestSkim.

◆ fileExecute()

virtual StatusCode EL::Algorithm::fileExecute ( )
privatevirtualinherited

effects: do all the processing that needs to be done once per file

Warning: The user should not expect this to be called at any particular point in execution. If a file is split between multiple jobs this will be called in only one of these jobs, and not the others. It usually gets called before the first event in a file, but that is not guaranteed and relying on this is a bug. Take a look at changeInput if you want something that is guaranteed to be executed at the beginning of each input file.

Warning: The execution order of changeInput and fileExecute is currently unspecified.

guarantee: basic failures: algorithm dependent rationale: this is to read per-file accounting data, e.g. the list of lumi-blocks processed

Reimplemented in EL::UnitTestAlg1, EL::UnitTestAlg, EL::UnitTestAlgXAOD, and EL::MetricsSvc.

◆ finalize()

virtual StatusCode EL::Algorithm::finalize ( )
privatevirtualinherited

effects: do everything that needs to be done after completing work on this worker guarantee: basic failures: algorithm dependent rationale: currently there is no use foreseen, but this routine is provided regardless

Reimplemented in EL::UnitTestAlg1, EL::UnitTestAlg, and EL::UnitTestAlgXAOD.

◆ getArray()

void EL::WhiteBoardSvc::getArray ( const std::string &  name,
std::size_t &  size,
const float *&  values 
) const

◆ getFloat()

float EL::WhiteBoardSvc::getFloat ( const std::string &  name) const

returns: the content of the variable, assuming the given type guarantee: strong failures: variable not found failures: variable of wrong type failures: given type not supported postcondition(3): result != 0

◆ GetName()

virtual const char* EL::WhiteBoardSvc::GetName ( ) const
virtual

effects: return the name of this algorithm guarantee: no-fail

◆ getTObject()

TObject* EL::WhiteBoardSvc::getTObject ( const std::string &  name) const

◆ hasName()

virtual bool EL::Algorithm::hasName ( const std::string &  name) const
privatevirtualinherited

returns: whether this algorithm has the given name guarantee: basic failures: algorithm dependent rationale: this is to allow an algorithm to be known by multiple names.

this is needed for NTupleSvc, so that it can be located with and without the output tree name.

Reimplemented in EL::NTupleSvc.

◆ hasVar()

bool EL::WhiteBoardSvc::hasVar ( const std::string &  name) const

returns: whether we have the given variable guarantee: strong failures: out of memory II

◆ hist()

TH1* EL::Algorithm::hist ( const std::string &  name) const
inherited

get the histogram with the given name

Guarantee
strong
Failures
histogram not found

◆ histFinalize()

virtual StatusCode EL::Algorithm::histFinalize ( )
privatevirtualinherited

effects: this is a post-initialization routine that is called after finalize has been called.

guarantee: basic failures: algorithm dependent rationale: unlike finalize(), this method is called all the time, even on empty input files.

Reimplemented in EL::UnitTestAlg1, EL::UnitTestAlg, EL::UnitTestAlgXAOD, and EL::MetricsSvc.

◆ histInitialize()

virtual StatusCode EL::Algorithm::histInitialize ( )
privatevirtualinherited

effects: this is a pre-initialization routine that is called before changeInput is called.

guarantee: basic failures: algorithm dependent rationale: unlike initialize(), this method is called all the time, even on empty input files. so you should create any histograms or n-tuples here that subsequent code expects

Reimplemented in EL::UnitTestAlg1, EL::UnitTestAlg, EL::UnitTestAlgXAOD, EL::MetricsSvc, and EL::VomsProxySvc.

◆ initialize()

virtual StatusCode EL::Algorithm::initialize ( )
privatevirtualinherited

effects: do everything that needs to be done before running the algorithm, e.g.

create output n-tuples and histograms. this method is called only once right after changeInput(true) is called guarantee: basic failures: algorithm dependent rationale: in principle all this work could be done on changeInput(true). However, providing this method should make it easier for the user to set up all his outputs and to do so only once.

Reimplemented in EL::DuplicateChecker, EL::UnitTestAlg1, EL::UnitTestAlg, EL::UnitTestAlgXAOD, EL::NTupleSvc, EL::AlgSelect, MD::AlgHist, MD::AlgCFlow, and EL::UnitTestSkim.

◆ msg() [1/2]

MsgStream& EL::Algorithm::msg ( ) const
inherited

messaging interface

this is the interface to work with the standard messaging macros from AsgTools. Instead of enums I pass ints, so that I can avoid the include dependency (forward declarations are only allowed for enum classes AFAIK).

the standard message stream for this object

Guarantee
strong
Failures
code not compiled with AsgTools support

◆ msg() [2/2]

MsgStream& EL::Algorithm::msg ( int  level) const
inherited

the message stream for this object, configured for the given level

Guarantee
strong
Failures
code not compiled with AsgTools support

◆ msgLvl()

bool EL::Algorithm::msgLvl ( int  lvl) const
inherited

whether we are configured to print messages at the given level

Guarantee
no-fail

◆ name()

virtual const std::string& EL::Algorithm::name ( ) const
virtualinherited

◆ postExecute()

virtual StatusCode EL::Algorithm::postExecute ( )
privatevirtualinherited

effects: do the post-processing for the event guarantee: basic failures: algorithm dependent rationale: this is mainly used for specialized services that need to get input from subsequent algorithms before filling their event data

Reimplemented in EL::NTupleSvc.

◆ retrieve()

template<class T >
T * EL::WhiteBoardSvc::retrieve ( const std::string &  name) const

returns: the content of the variable, casted to the given type guarantee: strong failures: variable not found failures: variable of wrong type failures: TObject type not supported

no invariant used

Definition at line 174 of file WhiteBoardSvc.h.

176  {
178  T *const result = dynamic_cast<T*>(getTObject (name));
179  RCU_ASSERT2_SOFT (result != 0, "object not of correct type");
180  return result;
181  }

◆ setArray() [1/2]

void EL::WhiteBoardSvc::setArray ( const std::string &  name,
const std::vector< float > &  value 
)

◆ setArray() [2/2]

void EL::WhiteBoardSvc::setArray ( const std::string &  name,
std::size_t  size,
const float *  values 
)

◆ setFloat()

void EL::WhiteBoardSvc::setFloat ( const std::string &  name,
float  value 
)

returns: set/create a variable, assuming the given type guarantee: strong failures: given type not supported failures: variable can not be set failures: out of memory II requires(4): TObject != 0

◆ setMsgLevel()

void EL::Algorithm::setMsgLevel ( int  level)
inherited

set the message level for the message stream for this object

Guarantee
no-fail

◆ setTObject()

void EL::WhiteBoardSvc::setTObject ( TObject *  object,
bool  swallow = true 
)

◆ setupJob()

virtual StatusCode EL::Algorithm::setupJob ( Job job)
privatevirtualinherited

effects: give the algorithm a chance to intialize the job with anything this algorithm needs.

this method is automatically called before the algorithm is actually added to the job. guarantee: basic failures: algorithm dependent rationale: this is currently used to give algorithms a chance to register their output datasets, but can also be used for other stuff.

Reimplemented in EL::DuplicateChecker, EL::UnitTestAlg1, EL::UnitTestAlg, EL::UnitTestAlgXAOD, EL::VomsProxySvc, EL::NTupleSvc, EL::AlgSelect, MD::AlgHist, and MD::AlgCFlow.

◆ sysSetupJob()

void EL::Algorithm::sysSetupJob ( Job job)
privateinherited

effects: give the algorithm a chance to intialize the job with anything this algorithm needs.

this method is automatically called before the algorithm is actually added to the job. guarantee: basic failures: algorithm dependent rationale: this is currently used to give algorithms a chance to register their output datasets, but can also be used for other stuff.

◆ testInvariant()

void EL::WhiteBoardSvc::testInvariant ( ) const

effects: test the invariant of this object guarantee: no-fail

◆ wk()

IWorker* EL::Algorithm::wk ( ) const
inherited

description: the worker that is controlling us guarantee: no-fail

Member Data Documentation

◆ m_evtStore

asg::SgTEvent EL::Algorithm::m_evtStore
mutableprivateinherited

when configured, the object returned by evtStore

Definition at line 329 of file Algorithm.h.

◆ m_evtStorePtr

asg::SgTEvent* EL::Algorithm::m_evtStorePtr = nullptr
mutableprivateinherited

the value of evtStore

Definition at line 325 of file Algorithm.h.

◆ m_msg

MsgStream* EL::Algorithm::m_msg = nullptr
mutableprivateinherited

the message stream, if it has been instantiated

Definition at line 333 of file Algorithm.h.

◆ m_msgLevel

int EL::Algorithm::m_msgLevel = 3
privateinherited

the message level configured

Definition at line 342 of file Algorithm.h.

◆ m_msgName

std::string EL::Algorithm::m_msgName
mutableprivateinherited

the algorithm name for which the message stream has been instantiated

Definition at line 338 of file Algorithm.h.

◆ m_nameCache

std::string EL::Algorithm::m_nameCache
mutableprivateinherited

the cache for name

Definition at line 346 of file Algorithm.h.

◆ m_wk

IWorker* EL::Algorithm::m_wk
privateinherited

Definition at line 321 of file Algorithm.h.


The documentation for this class was generated from the following file:
get_generator_info.result
result
Definition: get_generator_info.py:21
EL::WhiteBoardSvc::getTObject
TObject * getTObject(const std::string &name) const
RCU_ASSERT2_SOFT
#define RCU_ASSERT2_SOFT(x, y)
Definition: Assert.h:169
EL::Algorithm::name
virtual const std::string & name() const
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35