ATLAS Offline Software
Loading...
Searching...
No Matches
CutAlg.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// CutAlg.cxx
8// Implementation file for class CutAlg
9// Author: Karsten Koeneke <karsten.koeneke@cern.ch>
11
12// EventUtils includes
13#include "CutAlg.h"
14
15// STL includes
16
17// FrameWork includes
18#include "Gaudi/Property.h"
20
22// Public methods:
24
25// Constructors
27CutAlg::CutAlg( const std::string& name,
28 ISvcLocator* pSvcLocator ) :
31{
32}
33
34
35
36// Destructor
40
41
42
43// Athena Algorithm's Hooks
46{
47 ATH_MSG_DEBUG ("Initializing " << name() << "...");
48
49 // Print out the used configuration
50 ATH_MSG_DEBUG ( " using = " << m_trigDecisionTool );
51 ATH_MSG_DEBUG ( " using = " << m_cut );
52
53 // Initialize the counters to zero
55
56 if (!m_cut.value().empty()) {
58 }
59
60 ATH_MSG_DEBUG ( "==> done with initialize " << name() << "..." );
61
62 return StatusCode::SUCCESS;
63}
64
65
66
67StatusCode CutAlg::finalize()
68{
69 ATH_MSG_DEBUG ("Finalizing " << name() << "...");
70
71 // Release all tools and services
73 return StatusCode::SUCCESS;
74}
75
76
77
78StatusCode CutAlg::execute()
79{
80 // Increase the event counter
82
83 // Simple status message at the beginning of each event execute,
84 ATH_MSG_DEBUG ( "==> execute " << name() << " on " << m_nEventsProcessed << ". event..." );
85 ATH_MSG_VERBOSE ( "Dumping event store: " << evtStore()->dump() );
86
87 // Make the pass/fail decision
88 bool eventPasses = true;
89 if (m_parser) eventPasses = m_parser->evaluateAsBool();
90 this->setFilterPassed( eventPasses );
91 ATH_MSG_DEBUG("Event passes/fails: " << eventPasses );
92
93 return StatusCode::SUCCESS;
94}
#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:
virtual StatusCode finalize()
Athena algorithm's finalize hook.
Definition CutAlg.cxx:67
StringProperty m_cut
The cut string.
Definition CutAlg.h:56
virtual ~CutAlg()
Destructor:
Definition CutAlg.cxx:38
virtual StatusCode execute()
Athena algorithm's execute hook.
Definition CutAlg.cxx:78
CutAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Definition CutAlg.cxx:27
virtual StatusCode initialize()
Athena algorithm's initalize hook.
Definition CutAlg.cxx:45
unsigned long m_nEventsProcessed
Internal event counter.
Definition CutAlg.h:59
std::conditional< 1==1, std::unique_ptr< ExpressionParsing::ExpressionParser >, std::array< std::unique_ptr< ExpressionParsing::ExpressionParser >, 1 > >::type m_parser
StatusCode initializeParser(ExpressionParsing::SelectionArg< 1 > selection_string)
-event-from-file