ATLAS Offline Software
Loading...
Searching...
No Matches
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.
virtual StatusCode postInitialize () override
 IAthenaSelectorTool Interface method implementations:
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}
#define ATH_MSG_INFO(x)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
static Double_t sc
::StatusCode StatusCode
StatusCode definition for legacy code.
std::ostream & dump(std::ostream &out, const I4MomIter iBeg, const I4MomIter iEnd)
Helper to stream out a range of I4Momentum objects.
Definition P4Dumper.h:24

◆ 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: