ATLAS Offline Software
Public Member Functions | List of all members
EvenEventsSelectorTool Class Reference

This class provides an example for reading with a ISelectorTool to veto events on AttributeList. More...

#include <EvenEventsSelectorTool.h>

Inheritance diagram for EvenEventsSelectorTool:
Collaboration diagram for EvenEventsSelectorTool:

Public Member Functions

virtual ~EvenEventsSelectorTool ()
 Destructor. More...
 
virtual StatusCode postInitialize () override
 IAthenaSelectorTool Interface method implementations: More...
 
virtual StatusCode preNext () const override
 
virtual StatusCode postNext () const override
 
virtual StatusCode preFinalize () override
 

Detailed Description

This class provides an example for reading with a ISelectorTool to veto events on AttributeList.

Definition at line 20 of file EvenEventsSelectorTool.h.

Constructor & Destructor Documentation

◆ ~EvenEventsSelectorTool()

EvenEventsSelectorTool::~EvenEventsSelectorTool ( )
virtual

Destructor.

Definition at line 13 of file EvenEventsSelectorTool.cxx.

13  {
14 }

Member Function Documentation

◆ postInitialize()

virtual StatusCode EvenEventsSelectorTool::postInitialize ( )
inlineoverridevirtual

IAthenaSelectorTool Interface method implementations:

Definition at line 29 of file EvenEventsSelectorTool.h.

29 { return StatusCode::SUCCESS; }

◆ postNext()

StatusCode EvenEventsSelectorTool::postNext ( ) const
overridevirtual

Definition at line 17 of file EvenEventsSelectorTool.cxx.

17  {
18  ATH_MSG_INFO("EvenEventsSelectorTool::postNext");
19  StatusCode retc = StatusCode::SUCCESS;
20  const AthenaAttributeList* attrList{nullptr};
21  ATH_MSG_INFO(evtStore()->dump());
22  StatusCode sc = evtStore()->retrieve(attrList,"EventInfoAtts");
23  if (sc.isSuccess()) {
24  ATH_MSG_INFO("Found attribute list");
25  // dump spec
26  coral::AttributeList::const_iterator it = attrList->begin();
27  while (it != attrList->end()) {
28  //ATH_MSG_INFO("Spec element " << it->specification().name());
29  std::ostringstream value;
30  it->toOutputStream(value);
31  ATH_MSG_INFO("Spec element " << value.str());
32  ++it;
33  }
34  // take only even events
35  if ((*attrList)["EventNumber"].data<unsigned long long>()%2!=0) {
36  retc = StatusCode::RECOVERABLE;
37  ATH_MSG_INFO("Rejecting event");
38  }
39  }
40  else {
41  ATH_MSG_INFO("Could not find attribute list");
42  }
43  return retc;
44 }

◆ preFinalize()

virtual StatusCode EvenEventsSelectorTool::preFinalize ( )
inlineoverridevirtual

Definition at line 32 of file EvenEventsSelectorTool.h.

32 { return StatusCode::SUCCESS; }

◆ preNext()

virtual StatusCode EvenEventsSelectorTool::preNext ( ) const
inlineoverridevirtual

Definition at line 30 of file EvenEventsSelectorTool.h.

30 { return StatusCode::SUCCESS; }

The documentation for this class was generated from the following files:
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
skel.it
it
Definition: skel.GENtoEVGEN.py:407
athena.value
value
Definition: athena.py:124
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
run_Egamma1_LArStrip_Fex.dump
dump
Definition: run_Egamma1_LArStrip_Fex.py:87
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
Definition: PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:45