22#include "EventInfo/EventInfo.h"
27#include "GaudiKernel/ThreadLocalContext.h"
30 ISvcLocator* pSvcLocator)
51 }
catch (
const std::exception& e) {
52 ATH_MSG_ERROR(
"Caught exception from creation of AthenaAttributeList. Message: "
55 return (StatusCode::FAILURE);
61 return StatusCode::SUCCESS;
75 const EventContext& ctx = Gaudi::Hive::currentContext();
76 unsigned int iEvent = ctx.evt() + 1;
80 (*attributes)[
"Run"].setValue(myEventID->run_number());
81 (*attributes)[
"Event"].setValue(myEventID->event_number());
83 (*attributes)[
"IEvent"].setValue(iEvent);
85 (*attributes)[
"MissingET"].setValue(7.0f*iEvent);
86 (*attributes)[
"electronPT"].setValue(5.0f*iEvent);
87 }
catch (
const std::exception& e) {
88 ATH_MSG_ERROR(
"Caught exception from setValue for attributes. Message: "
91 return (StatusCode::FAILURE);
96 coral::AttributeList::const_iterator first = attributes->begin();
97 coral::AttributeList::const_iterator last = attributes->end();
98 for (; first != last; ++first) {
99 std::stringstream
str;
100 (*first).toOutputStream(
str);
102 <<
" type " << (*first).specification().typeName()
110 return StatusCode::SUCCESS;
116 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
Test Algorithm for testing creation of explicit collections, writes an AttributeList to the transient...
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
ServiceHandle< StoreGateSvc > & evtStore()
An AttributeList represents a logical row of attributes in a metadata table.
AthenaAttributeList * m_attributes
Create attr list at intitialize and use each event.
virtual StatusCode execute()
Algorithm execute once per event.
virtual StatusCode initialize()
Algorithm initialize at begin of job.
AthenaPoolTestAttrWriter(const std::string &name, ISvcLocator *pSvcLocator)
Algorithm constructor.
~AthenaPoolTestAttrWriter()
Algorithm destructor.
virtual StatusCode finalize()
Algorithm finalize at end of job.
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
EventID * event_ID()
the unique identification of the event.