ATLAS Offline Software
Loading...
Searching...
No Matches
EventDecisionAlg.cxx
Go to the documentation of this file.
1
2
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
23EventDecisionAlg::EventDecisionAlg( const std::string& name,
24 ISvcLocator* pSvcLocator ) :
25 ::AthFilterAlgorithm( name, pSvcLocator )
26{
27}
28
29
30// Destructor
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
virtual void setFilterPassed(bool state) const
Set the filter passed flag to the specified state.
AthFilterAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
EventDecisionAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
ServiceHandle< IDecisionSvc > m_decSvc
StringArrayProperty m_streamNames
The names of all output streams to check.
virtual ~EventDecisionAlg()
Destructor:
virtual StatusCode initialize()
Athena algorithm's initalize hook.
virtual StatusCode finalize()
Athena algorithm's finalize hook.
virtual StatusCode execute()
Athena algorithm's execute hook.
-event-from-file