ATLAS Offline Software
EventDecisionAlg.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // EventDecisionAlg.cxx
8 // Implementation file for class EventDecisionAlg
9 // Author: Karsten Koeneke <karsten.koeneke@cern.ch>
11 
12 // EventUtils includes
13 #include "EventDecisionAlg.h"
14 
15 // STL includes
16 
17 // FrameWork includes
18 #include "Gaudi/Property.h"
19 
20 
21 // Constructors
24  ISvcLocator* pSvcLocator ) :
25  ::AthFilterAlgorithm( name, pSvcLocator )
26 {
27 }
28 
29 
30 // Destructor
33 {}
34 
35 
36 
37 // Athena Algorithm's Hooks
40 {
41  ATH_MSG_DEBUG ("Initializing " << name() << "...");
42 
43  // Print out the used configuration
44  ATH_MSG_DEBUG ( " using = " << m_decSvc );
45  ATH_MSG_DEBUG ( " using = " << m_streamNames );
46 
47  // Retrieve the services
48  ATH_CHECK( m_decSvc.retrieve() );
49 
50  ATH_MSG_DEBUG ( "==> done with initialize " << name() << "..." );
51  return StatusCode::SUCCESS;
52 }
53 
54 
55 
57 {
58  ATH_MSG_DEBUG ("Finalizing " << name() << "...");
59 
60  // Release all tools and services
61  ATH_CHECK( m_decSvc.release() );
62 
63  return StatusCode::SUCCESS;
64 }
65 
66 
67 
69 {
70  // Simple status message at the beginning of each event execute,
71  ATH_MSG_DEBUG ( "==> execute " << name() );
72  ATH_MSG_VERBOSE ( "Dumping event store: " << evtStore()->dump() );
73 
74  // Make the pass/fail decision
75  // Ensure that the even passes if no stream name is given
76  bool eventPasses = true;
77  for ( const std::string& streamName : m_streamNames.value() ){
78  // Ensure that the even passes if no stream name is given
79  eventPasses = false;
80  eventPasses = m_decSvc->isEventAccepted(streamName);
81  if (eventPasses){
82  ATH_MSG_DEBUG("Got an event accept from stream name " << streamName);
83  break;
84  }
85  }
86  this->setFilterPassed( eventPasses );
87  ATH_MSG_DEBUG("Event passes/fails: " << eventPasses );
88 
89  return StatusCode::SUCCESS;
90 }
AthFilterAlgorithm::setFilterPassed
virtual void setFilterPassed(bool state) const
Set the filter passed flag to the specified state.
Definition: AthFilterAlgorithm.cxx:99
EventDecisionAlg::execute
virtual StatusCode execute()
Athena algorithm's execute hook.
Definition: EventDecisionAlg.cxx:68
EventDecisionAlg::initialize
virtual StatusCode initialize()
Athena algorithm's initalize hook.
Definition: EventDecisionAlg.cxx:39
EventDecisionAlg::m_decSvc
ServiceHandle< IDecisionSvc > m_decSvc
Definition: EventDecisionAlg.h:56
EventDecisionAlg::~EventDecisionAlg
virtual ~EventDecisionAlg()
Destructor:
Definition: EventDecisionAlg.cxx:32
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
run_Egamma1_LArStrip_Fex.dump
dump
Definition: run_Egamma1_LArStrip_Fex.py:87
EventDecisionAlg.h
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
AthFilterAlgorithm
Definition: AthFilterAlgorithm.h:26
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
EventDecisionAlg::EventDecisionAlg
EventDecisionAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Definition: EventDecisionAlg.cxx:23
WriteHiveWithMetaData.streamName
string streamName
Definition: WriteHiveWithMetaData.py:23
EventDecisionAlg::finalize
virtual StatusCode finalize()
Athena algorithm's finalize hook.
Definition: EventDecisionAlg.cxx:56
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
EventDecisionAlg::m_streamNames
StringArrayProperty m_streamNames
The names of all output streams to check.
Definition: EventDecisionAlg.h:60