ATLAS Offline Software
CutTool.cxx
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2021 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  m_cut("")
33 {
34  declareInterface< DerivationFramework::ISkimmingTool >(this);
35 
36  declareProperty("Cut", m_cut="", "The cut expression" );
37 }
38 
39 // Destructor
42 {}
43 
44 
45 
46 // Athena algtool's Hooks
49 {
50  ATH_MSG_DEBUG ("Initializing " << name() << "...");
51 
52  if (!m_cut.value().empty()) {
53  ATH_CHECK( initializeParser(m_cut.value()) );
54  }
55 
56  return StatusCode::SUCCESS;
57 }
58 
59 
60 
62 {
63  ATH_MSG_DEBUG ("Finalizing " << name() << "...");
64 
66  return StatusCode::SUCCESS;
67 }
68 
69 
70 
71 // Implement the method from the ISkimmingTool interface
73 {
74  ATH_MSG_DEBUG ( "==> eventPassesFilter() " << name() );
75  ATH_MSG_VERBOSE ( "Dumping event store: " << evtStore()->dump() );
76 
77  return (m_parser ? m_parser->evaluateAsBool() : true);
78 }
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:72
StackElement.h
CutTool::m_cut
StringProperty m_cut
The cut string.
Definition: CutTool.h:58
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
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:48
CutTool::~CutTool
virtual ~CutTool()
Destructor:
Definition: CutTool.cxx:41
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
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:61
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ExpressionParserUserWithTrigSupport
Definition: ExpressionParserUserWithTrigSupport.h:16
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
CutTool.h
AthAlgTool
Definition: AthAlgTool.h:26
FourMomUtils::dump
std::ostream & dump(std::ostream &out, const I4MomIter iBeg, const I4MomIter iEnd)
Helper to stream out a range of I4Momentum objects.
Definition: P4Dumper.h:24