| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | Private Attributes | List of all members
HiveTestAlgorithm Class Reference

`#include <GaudiHive/HiveTestAlgorithm.h>`

Inheritance diagram for HiveTestAlgorithm:
[legend]
Collaboration diagram for HiveTestAlgorithm:
[legend]

## Public Member Functions
StatusCode | initialize () override
StatusCode | execute () override
StatusCode | finalize () override
virtual const std::vector< std::string > | get_inputs ()
virtual const std::vector< std::string > | get_outputs ()
| GaudiAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
| Constructor(s) More...
| GaudiAlgorithm (const GaudiAlgorithm &)=delete
| Constructor(s) More...
Public Member Functions inherited from GaudiAlgorithm
StatusCode | initialize () override
| standard initialization method More...
StatusCode | execute () override
| standard execution method More...
StatusCode | finalize () override
| standard finalization method More...
StatusCode | sysExecute (const EventContext &ctx) override
| the generic actions for the execution. More...
void | put (IDataProviderSvc *svc, DataObject *object, const std::string &address, const bool useRootInTES=true) const
| Register a data object or container into Gaudi Event Transient Store. More...
void | put (IDataProviderSvc *svc, std::unique_ptr< DataObject > object, const std::string &address, const bool useRootInTES=true) const
const DataObject * | put (DataObject *object, const std::string &address, const bool useRootInTES=true) const
| Register a data object or container into Gaudi Event Transient Store. More...
const DataObject * | put (std::unique_ptr< DataObject > object, const std::string &address, const bool useRootInTES=true) const
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type | get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Templated access to the data in Gaudi Transient Store. More...
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type | getIfExists (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Templated access to the data in Gaudi Transient Store. More...
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type | get (const std::string &location, const bool useRootInTES=true) const
| Templated access to the data from Gaudi Event Transient Store. More...
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type | getIfExists (const std::string &location, const bool useRootInTES=true) const
| Templated access to the data in Gaudi Transient Store. More...
template<class TYPE >
TYPE * | getDet (IDataProviderSvc *svc, const std::string &location) const
| Templated access to the detector data from the Gaudi Detector Transient Store. More...
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type | getDetIfExists (IDataProviderSvc *svc, const std::string &location) const
| Templated access to the detector data from the Gaudi Detector Transient Store. More...
template<class TYPE >
TYPE * | getDet (const std::string &location) const
| Templated access to the detector data from the Gaudi Detector Transient Store. More...
template<class TYPE >
Gaudi::Utils::GetData< TYPE >::return_type | getDetIfExists (const std::string &location) const
| Templated access to the detector data from the Gaudi Detector Transient Store. More...
template<class TYPE >
bool | exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Check the existence of a data object or container in the Gaudi Transient Event Store. More...
template<class TYPE >
bool | exist (const std::string &location, const bool useRootInTES=true) const
| Check the existence of a data object or container in the Gaudi Transient Event Store. More...
template<class TYPE >
bool | existDet (IDataProviderSvc *svc, const std::string &location) const
| Check the existence of detector objects in the Gaudi Transient Detector Store. More...
template<class TYPE >
bool | existDet (const std::string &location) const
| Check the existence of detector objects in the Gaudi Transient Detector Store. More...
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData< TYPE >::return_type | getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Get the existing data object from Gaudi Event Transient store. More...
template<class TYPE , class TYPE2 >
Gaudi::Utils::GetData< TYPE >::return_type | getOrCreate (const std::string &location, const bool useRootInTES=true) const
| Get the existing data object from Gaudi Event Transient store. More...
| GaudiAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
| Standard constructor. More...
| GaudiAlgorithm (const GaudiAlgorithm &)=delete
GaudiAlgorithm & | operator= (const GaudiAlgorithm &)=delete
SmartIF< INTupleSvc > & | evtColSvc () const
| Access the standard event collection service. More...
Public Member Functions inherited from GaudiCommon< Algorithm >
Gaudi::Utils::GetData< TYPE >::return_type | get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Templated access to the data in Gaudi Transient Store. More...
Gaudi::Utils::GetData< TYPE >::return_type | getIfExists (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Quicker version of the get function which bypasses the check on the retrieved data. More...
bool | exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Check the existence of a data object or container in the Gaudi Transient Event Store. More...
Gaudi::Utils::GetData< TYPE >::return_type | getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const
| Get the existing data object from Gaudi Event Transient store. More...
DataObject * | put (IDataProviderSvc *svc, std::unique_ptr< DataObject > object, const std::string &location, const bool useRootInTES=true) const
| Register a data object or container into Gaudi Event Transient Store. More...
DataObject * | put (IDataProviderSvc *svc, DataObject *object, const std::string &location, const bool useRootInTES=true) const
TOOL * | tool (const std::string &type, const std::string &name, const IInterface *parent=0, bool create=true) const
| Useful method for the easy location of tools. More...
TOOL * | tool (const std::string &type, const IInterface *parent=0, bool create=true) const
| A useful method for the easy location of tools. More...
SmartIF< SERVICE > | svc (const std::string &name, const bool create=true) const
| A useful method for the easy location of services. More...
IUpdateManagerSvc * | updMgrSvc () const
| Short-cut to locate the Update Manager Service. More...
WARN_UNUSED StatusCode | Error (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
| Print the error message and return with the given StatusCode. More...
WARN_UNUSED StatusCode | Warning (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const
| Print the warning message and return with the given StatusCode. More...
WARN_UNUSED StatusCode | Info (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const size_t mx=10) const
| Print the info message and return with the given StatusCode. More...
WARN_UNUSED StatusCode | Print (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const MSG::Level lev=MSG::INFO) const
| Print the message and return with the given StatusCode. More...
void | Assert (const bool ok, const std::string &message="", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
| Assertion - throw exception if the given condition is not fulfilled. More...
void | Assert (const bool ok, const char *message, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
| Assertion - throw exception if the given condition is not fulfilled. More...
void | Exception (const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
| Create and (re)-throw a given GaudiException. More...
void | Exception (const std::string &msg, const std::exception &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
| Create and (re)-throw a given exception. More...
void | Exception (const std::string &msg="no message", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const
| Create and throw an exception with the given message. More...
StatEntity & | counter (const std::string &tag) const
| accessor to certain counter by name More...
StatEntity & | counter (const std::string &tag)
bool | typePrint () const
| Insert the actual C++ type of the algorithm/tool in the messages ? More...
bool | propsPrint () const
| Print properties at initialization ? More...
bool | statPrint () const
| Print statistical counters at finalization ? More...
bool | errorsPrint () const
| Print error counters at finalization ? More...
long | printStat (const MSG::Level level=MSG::ALWAYS) const
| perform the actual printout of statistical counters More...
long | printErrors (const MSG::Level level=MSG::ALWAYS) const
| perform the actual printout of error counters More...
long | printProps (const MSG::Level level=MSG::ALWAYS) const
| perform the actual printout of properties More...
void | registerCondition (const std::string &condition, StatusCode(CallerClass::*mf)()=nullptr)
| register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
void | registerCondition (const std::string &condition, CondType *&condPtrDest, StatusCode(CallerClass::*mf)()=NULL)
| register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
void | registerCondition (char *condition, StatusCode(CallerClass::*mf)()=NULL)
| just to avoid conflicts with the version using a pointer to a template class. More...
void | registerCondition (TargetClass *condition, StatusCode(CallerClass::*mf)()=NULL)
| register the current instance to the UpdateManagerSvc as a consumer for a condition. More...
StatusCode | runUpdate ()
| asks the UpdateManagerSvc to perform an update of the instance (if needed) without waiting the next BeginEvent incident. More...
| GaudiCommon (const std::string &name, ISvcLocator *pSvcLocator)
| Algorithm constructor - the SFINAE constraint below ensures that this is constructor is only defined if PBASE derives from Algorithm. More...
| GaudiCommon (const std::string &type, const std::string &name, const IInterface *ancestor)
| Tool constructor - SFINAE-ed to insure this constructor is only defined if PBASE derives from AlgTool. More...
StatusCode | initialize () override
| standard initialization method More...
StatusCode | finalize () override
| standard finalization method More...
StatusCode | release (const IInterface *interface) const
| Manual forced (and 'safe') release of the active tool or service. More...
const Services & | services () const
| get the list of aquired services More...
const std::string & | context () const
| Returns the "context" string. Used to identify different processing states. More...
Public Member Functions inherited from FixTESPath< BASE >
template<typename U = BASE, typename = std::enable_if_t<std::is_base_of_v<Gaudi::Algorithm, BASE>, U>>
| FixTESPath (const std::string &name, ISvcLocator *pSvcLocator)
| Algorithm constructor - the SFINAE constraint below ensures that this is constructor is only defined if BASE derives from Algorithm. More...
template<typename U = BASE, typename = std::enable_if_t<std::is_base_of_v<AlgTool, BASE>, U>>
| FixTESPath (const std::string &type, const std::string &name, const IInterface *ancestor)
| Tool constructor - SFINAE-ed to insure this constructor is only defined if BASE derives from AlgTool. More...
StatusCode | initialize () override
const std::string & | rootInTES () const
| Returns the "rootInTES" string. More...
std::string | fullTESLocation (std::string_view location, bool useRootInTES) const
| Returns the full correct event location given the rootInTes settings. More...

## Private Attributes
int | m_total = 0
| The total events seen. More...
Gaudi::Property< std::vector< std::string > > | m_inputs {this, "Input", {}, "List of required inputs"}
Gaudi::Property< std::vector< std::string > > | m_outputs {this, "Output", {}, "List of provided outputs"}
std::vector< DataObjectHandle< DataObject > * > | m_inputHandles
std::vector< DataObjectHandle< DataObject > * > | m_outputHandles

## Additional Inherited Members
Protected Types inherited from GaudiCommon< Algorithm >
using | base_class = FixTESPath< Algorithm >
typedef std::map< std::string, StatEntity > | StatisticsOwn
| the actual type of general counters More...
typedef std::map< std::string, std::reference_wrapper< Gaudi::Accumulators::PrintableCounter > > | Statistics
typedef std::map< std::string, unsigned int > | Counter
| the actual type error/warning counter More...
typedef std::vector< IAlgTool * > | AlgTools
| storage for active tools More...
typedef std::vector< SmartIF< IService > > | Services
| storage for active services More...
Protected Member Functions inherited from GaudiCommon< Algorithm >
StatusCode | releaseTool (const IAlgTool *tool) const
| manual forced (and 'safe') release of the tool More...
StatusCode | releaseSvc (const IInterface *svc) const
| manual forced (and 'safe') release of the service More...
Protected Attributes inherited from GaudiCommon< Algorithm >
SmartIF< ICounterSummarySvc > | m_counterSummarySvc
| a pointer to the CounterSummarySvc More...
Static Protected Attributes inherited from GaudiCommon< Algorithm >
static const bool | IgnoreRootInTES
| Simple definition to be used with the new useRootInTES argument get<TYPE> and put methods. More...
static const bool | UseRootInTES
| Simple definition to be used with the new useRootInTES argument get<TYPE> and put methods. More...

## Detailed Description

Definition at line 12 of file HiveTestAlgorithm.h.

## Member Function Documentation

## ◆ execute()

StatusCode HiveTestAlgorithm::execute | ( |  | ) |
| override

Definition at line 49 of file HiveTestAlgorithm.cpp.

49 {
50 ++m_total;
51 int evt = Gaudi::Hive::currentContext().evt();
52
53 info() << ":HiveTestAlgorithm::getting inputs... " << evt << endmsg;
54
55 for ( auto& handle : m_inputHandles ) {
56 auto obj = dynamic_cast<MyObject*>( handle->get() );
57 if ( !obj ) {
58 fatal() << "Unable to dcast inputHandles object" << endmsg;
59 return StatusCode::FAILURE;
60 }
61 info() << "Got data with value " << obj->getData() << endmsg;
62 }
63
64 info() << ":HiveTestAlgorithm::registering outputs... " << evt << endmsg;
65
66 for ( auto& outputHandle : m_outputHandles ) { outputHandle->put( new MyObject( 1000 + evt ) ); }
67
68 return StatusCode::SUCCESS;
69 }
HiveTestAlgorithm::m_outputHandles
std::vector< DataObjectHandle< DataObject > * > m_outputHandles
Definition: HiveTestAlgorithm.h:45
EventContext::evt
ContextEvt_t evt() const
Definition: EventContext.h:40
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
MyObject
Definition: HiveTestAlgorithm.cpp:11
Gaudi::Hive::currentContext
GAUDI_API const EventContext & currentContext()
Definition: ThreadLocalContext.cpp:20
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
HiveTestAlgorithm::m_inputHandles
std::vector< DataObjectHandle< DataObject > * > m_inputHandles
Definition: HiveTestAlgorithm.h:44
HiveTestAlgorithm::m_total
int m_total
The total events seen.
Definition: HiveTestAlgorithm.h:39
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
IOTest.evt
evt
Definition: IOTest.py:94

## ◆ finalize()

StatusCode HiveTestAlgorithm::finalize | ( |  | ) |
| override

Definition at line 71 of file HiveTestAlgorithm.cpp.

71 {
72 info() << name() << ":HiveTestAlgorithm::finalize - total events: " << m_total << endmsg;
73 MyObject::dump();
74 return StatusCode::SUCCESS;
75 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
MyObject::dump
static void dump()
Definition: HiveTestAlgorithm.cpp:21
HiveTestAlgorithm::m_total
int m_total
The total events seen.
Definition: HiveTestAlgorithm.h:39
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ GaudiAlgorithm() [1/2]

GaudiAlgorithm::GaudiAlgorithm

Constructor(s)

Definition at line 35 of file GaudiAlgorithm.cpp.

36 : GaudiCommon<Algorithm>( name, pSvcLocator ) {
37 setProperty( "RegisterForContextService", true ).ignore();
38 }
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
setProperty
bool PyHelper() setProperty(IInterface *p, char *name, char *value)
Definition: Bootstrap.cpp:233
GaudiCommon< Algorithm >

## ◆ GaudiAlgorithm() [2/2]

GaudiAlgorithm::GaudiAlgorithm
| delete

Constructor(s)

## ◆ get_inputs()

const std::vector< std::string > HiveTestAlgorithm::get_inputs | ( |  | ) |
| virtual

Definition at line 77 of file HiveTestAlgorithm.cpp.

77 { return m_inputs; }
HiveTestAlgorithm::m_inputs
Gaudi::Property< std::vector< std::string > > m_inputs
Definition: HiveTestAlgorithm.h:41

## ◆ get_outputs()

const std::vector< std::string > HiveTestAlgorithm::get_outputs | ( |  | ) |
| virtual

Definition at line 79 of file HiveTestAlgorithm.cpp.

79 { return m_outputs; }
HiveTestAlgorithm::m_outputs
Gaudi::Property< std::vector< std::string > > m_outputs
Definition: HiveTestAlgorithm.h:42

## ◆ initialize()

StatusCode HiveTestAlgorithm::initialize | ( |  | ) |
| override

Definition at line 27 of file HiveTestAlgorithm.cpp.

27 {
28 info() << ":HiveTestAlgorithm::initialize " << endmsg;
29
30 int i = 0;
31 for ( auto k : m_inputs ) {
32 debug() << "adding input key " << k << endmsg;
33 m_inputHandles.push_back( new DataObjectHandle<DataObject>( k, Gaudi::DataHandle::Reader, this ) );
34 declareProperty( "dummy_in_" + std::to_string( i ), *( m_inputHandles.back() ) );
35 i++;
36 }
37
38 i = 0;
39 for ( auto k : m_outputs ) {
40 debug() << "adding output key " << k << endmsg;
41 m_outputHandles.push_back( new DataObjectHandle<DataObject>( k, Gaudi::DataHandle::Writer, this ) );
42 declareProperty( "dummy_out_" + std::to_string( i ), *( m_outputHandles.back() ) );
43 i++;
44 }
45
46 return StatusCode::SUCCESS;
47 }
HiveTestAlgorithm::m_inputs
Gaudi::Property< std::vector< std::string > > m_inputs
Definition: HiveTestAlgorithm.h:41
HiveTestAlgorithm::m_outputHandles
std::vector< DataObjectHandle< DataObject > * > m_outputHandles
Definition: HiveTestAlgorithm.h:45
HiveTestAlgorithm::m_outputs
Gaudi::Property< std::vector< std::string > > m_outputs
Definition: HiveTestAlgorithm.h:42
std::to_string
T to_string(T... args)
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
Gaudi::DataHandle::Reader
Definition: DataHandle.h:29
DataObjectHandle< DataObject >
std::vector::push_back
T push_back(T... args)
std::vector::back
T back(T... args)
Gaudi::DataHandle::Writer
Definition: DataHandle.h:29
HiveTestAlgorithm::m_inputHandles
std::vector< DataObjectHandle< DataObject > * > m_inputHandles
Definition: HiveTestAlgorithm.h:44
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## Member Data Documentation

## ◆ m_inputHandles

std::vector<DataObjectHandle<DataObject>*> HiveTestAlgorithm::m_inputHandles
| private

Definition at line 44 of file HiveTestAlgorithm.h.

## ◆ m_inputs

Gaudi::Property<std::vector<std::string> > HiveTestAlgorithm::m_inputs {this, "Input", {}, "List of required inputs"}
| private

Definition at line 41 of file HiveTestAlgorithm.h.

## ◆ m_outputHandles

std::vector<DataObjectHandle<DataObject>*> HiveTestAlgorithm::m_outputHandles
| private

Definition at line 45 of file HiveTestAlgorithm.h.

## ◆ m_outputs

Gaudi::Property<std::vector<std::string> > HiveTestAlgorithm::m_outputs {this, "Output", {}, "List of provided outputs"}
| private

Definition at line 42 of file HiveTestAlgorithm.h.

## ◆ m_total

int HiveTestAlgorithm::m_total = 0
| private

The total events seen.

Definition at line 39 of file HiveTestAlgorithm.h.

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

- GaudiHive/GaudiHive/HiveTestAlgorithm.h
- GaudiHive/src/HiveTestAlgorithm.cpp