ATLAS Offline Software
CutTool.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 // CutTool.cxx
8 // Implementation file for class CutTool
9 // Author: Karsten Koeneke <karsten.koeneke@cern.ch>
11 
12 // EventUtils includes
13 #include "CutTool.h"
14 
15 // STL includes
16 #include <vector>
17 #include <string>
18 
19 // FrameWork includes
21 
23 // Public methods:
25 
26 // Constructors
28 CutTool::CutTool( const std::string& type,
29  const std::string& name,
30  const IInterface* parent ) :
32 {
33  declareInterface< DerivationFramework::ISkimmingTool >(this);
34 }
35 
36 // Destructor
39 {}
40 
41 
42 
43 // Athena algtool's Hooks
46 {
47  ATH_MSG_DEBUG ("Initializing " << name() << "...");
48 
49  if (!m_cut.value().empty()) {
50  ATH_CHECK( initializeParser(m_cut.value()) );
51  }
52 
53  return StatusCode::SUCCESS;
54 }
55 
56 
57 
59 {
60  ATH_MSG_DEBUG ("Finalizing " << name() << "...");
61 
63  return StatusCode::SUCCESS;
64 }
65 
66 
67 
68 // Implement the method from the ISkimmingTool interface
70 {
71  ATH_MSG_DEBUG ( "==> eventPassesFilter() " << name() );
72  ATH_MSG_VERBOSE ( "Dumping event store: " << evtStore()->dump() );
73 
74  return (m_parser ? m_parser->evaluateAsBool() : true);
75 }
CutTool::CutTool
CutTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition: CutTool.cxx:28
ExpressionParserUserBase< ::AthAlgTool, 1 >::finalizeParser
StatusCode finalizeParser()
CutTool::eventPassesFilter
virtual bool eventPassesFilter() const final override
Implement the method from the ISkimmingTool interface.
Definition: CutTool.cxx:69
StackElement.h
CutTool::m_cut
StringProperty m_cut
The cut string.
Definition: CutTool.h:58
ExpressionParserUserBase< ::AthAlgTool, 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
CutTool::initialize
virtual StatusCode initialize() override
Athena algtool's initialize.
Definition: CutTool.cxx:45
CutTool::~CutTool
virtual ~CutTool()
Destructor:
Definition: CutTool.cxx:38
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
ExpressionParserUserWithTrigSupport<::AthAlgTool >::initializeParser
StatusCode initializeParser(ExpressionParsing::SelectionArg< 1 > selection_string)
Definition: ExpressionParserUserWithTrigSupport.h:25
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
run_Egamma1_LArStrip_Fex.dump
dump
Definition: run_Egamma1_LArStrip_Fex.py:87
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
CutTool::finalize
virtual StatusCode finalize() override
Athena algtool's finalize.
Definition: CutTool.cxx:58
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ExpressionParserUserWithTrigSupport
Definition: ExpressionParserUserWithTrigSupport.h:16
CutTool.h
AthAlgTool
Definition: AthAlgTool.h:26