ATLAS Offline Software
EvenEventsSelectorTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
11 
12 //___________________________________________________________________________
13 EvenEventsSelectorTool::EvenEventsSelectorTool(const std::string& type, const std::string& name, const IInterface* parent) :
15  declareInterface<IAthenaSelectorTool>(this);
16 }
17 //___________________________________________________________________________
19 }
20 
21 //__________________________________________________________________________
23  ATH_MSG_INFO("EvenEventsSelectorTool::postNext");
24  StatusCode retc = StatusCode::SUCCESS;
25  const AthenaAttributeList* attrList{nullptr};
27  StatusCode sc = evtStore()->retrieve(attrList,"EventInfoAtts");
28  if (sc.isSuccess()) {
29  ATH_MSG_INFO("Found attribute list");
30  // dump spec
31  coral::AttributeList::const_iterator it = attrList->begin();
32  while (it != attrList->end()) {
33  //ATH_MSG_INFO("Spec element " << it->specification().name());
34  std::ostringstream value;
35  it->toOutputStream(value);
36  ATH_MSG_INFO("Spec element " << value.str());
37  ++it;
38  }
39  // take only even events
40  if ((*attrList)["EventNumber"].data<unsigned long long>()%2!=0) {
41  retc = StatusCode::RECOVERABLE;
42  ATH_MSG_INFO("Rejecting event");
43  }
44  }
45  else {
46  ATH_MSG_INFO("Could not find attribute list");
47  }
48  return retc;
49 }
50 //__________________________________________________________________________
52  return(StatusCode::SUCCESS);
53 }
54 //__________________________________________________________________________
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
skel.it
it
Definition: skel.GENtoEVGEN.py:396
EvenEventsSelectorTool::postNext
virtual StatusCode postNext() const
Called at the end of next.
Definition: EvenEventsSelectorTool.cxx:22
athena.value
value
Definition: athena.py:124
AthenaAttributeList.h
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
run_Egamma1_LArStrip_Fex.dump
dump
Definition: run_Egamma1_LArStrip_Fex.py:88
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
EvenEventsSelectorTool::~EvenEventsSelectorTool
virtual ~EvenEventsSelectorTool()
Destructor.
Definition: EvenEventsSelectorTool.cxx:18
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EvenEventsSelectorTool::EvenEventsSelectorTool
EvenEventsSelectorTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard Service Constructor.
Definition: EvenEventsSelectorTool.cxx:13
EvenEventsSelectorTool::preNext
virtual StatusCode preNext() const
Called at the beginning of next.
Definition: EvenEventsSelectorTool.cxx:51
test_pyathena.parent
parent
Definition: test_pyathena.py:15
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
EvenEventsSelectorTool.h
This file contains the class definition for the EvenEventsSelectorTool class.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
AthAlgTool
Definition: AthAlgTool.h:26