ATLAS Offline Software
CutAlg.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 // 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
27 CutAlg::CutAlg( const std::string& name,
28  ISvcLocator* pSvcLocator ) :
30  m_nEventsProcessed(0)
31 {
32 }
33 
34 
35 
36 // Destructor
39 {}
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
54  m_nEventsProcessed = 0 ;
55 
56  if (!m_cut.value().empty()) {
57  ATH_CHECK( initializeParser(m_cut.value()) );
58  }
59 
60  ATH_MSG_DEBUG ( "==> done with initialize " << name() << "..." );
61 
62  return StatusCode::SUCCESS;
63 }
64 
65 
66 
68 {
69  ATH_MSG_DEBUG ("Finalizing " << name() << "...");
70 
71  // Release all tools and services
73  return StatusCode::SUCCESS;
74 }
75 
76 
77 
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 }
CutAlg::m_cut
StringProperty m_cut
The cut string.
Definition: CutAlg.h:56
ExpressionParserUserBase< ::AthFilterAlgorithm, 1 >::finalizeParser
StatusCode finalizeParser()
AthFilterAlgorithm::setFilterPassed
virtual void setFilterPassed(bool state) const
Set the filter passed flag to the specified state.
Definition: AthFilterAlgorithm.cxx:99
StackElement.h
ExpressionParserUserBase< ::AthFilterAlgorithm, 1 >::m_parser
std::conditional< NUM_PARSER==1, std::unique_ptr< ExpressionParsing::ExpressionParser >, std::array< std::unique_ptr< ExpressionParsing::ExpressionParser >, NUM_PARSER > >::type m_parser
Definition: ExpressionParserUser.h:100
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
ExpressionParserUserWithTrigSupport<::AthFilterAlgorithm >::initializeParser
StatusCode initializeParser(ExpressionParsing::SelectionArg< 1 > selection_string)
Definition: ExpressionParserUserWithTrigSupport.h:25
run_Egamma1_LArStrip_Fex.dump
dump
Definition: run_Egamma1_LArStrip_Fex.py:87
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
CutAlg::~CutAlg
virtual ~CutAlg()
Destructor:
Definition: CutAlg.cxx:38
CutAlg::CutAlg
CutAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Definition: CutAlg.cxx:27
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
CutAlg.h
CutAlg::m_nEventsProcessed
unsigned long m_nEventsProcessed
Internal event counter.
Definition: CutAlg.h:59
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ExpressionParserUserWithTrigSupport<::AthFilterAlgorithm >::m_trigDecisionTool
ToolHandle< Trig::TrigDecisionTool > m_trigDecisionTool
The trigger decision tool.
Definition: ExpressionParserUserWithTrigSupport.h:46
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ExpressionParserUserWithTrigSupport
Definition: ExpressionParserUserWithTrigSupport.h:16
CutAlg::execute
virtual StatusCode execute()
Athena algorithm's execute hook.
Definition: CutAlg.cxx:78
CutAlg::finalize
virtual StatusCode finalize()
Athena algorithm's finalize hook.
Definition: CutAlg.cxx:67
CutAlg::initialize
virtual StatusCode initialize()
Athena algorithm's initalize hook.
Definition: CutAlg.cxx:45