ATLAS Offline Software
NTUPStringSkimmingTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 // NTUPStringSkimmingTool.cxx, (c) ATLAS Detector software
8 // Author: Thomas Gillam (thomas.gillam@cern.ch)
9 // Based on the Integrated Simulation Framework
10 //
11 // Use of ExpressionParsing to analyse a more complex string
12 
14 
15 #include <vector>
16 #include <string>
17 
20 
21 namespace DerivationFramework {
22 
24  const std::string& n,
25  const IInterface* p) :
26  AthAlgTool(t,n,p),
27  m_expression("true"),
28  m_parser(nullptr)
29  {
30  declareInterface<DerivationFramework::ISkimmingTool>(this);
31  declareProperty("expression", m_expression);
32  }
33 
35  {
38  return StatusCode::SUCCESS;
39  }
40 
42  {
43  if (m_parser) {
44  delete m_parser;
45  m_parser = nullptr;
46  }
47  return StatusCode::SUCCESS;
48  }
49 
51  {
52  return m_parser->evaluateAsBool();
53  return true;
54  }
55 
56 }
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
DerivationFramework::NTUPStringSkimmingTool::finalize
StatusCode finalize()
Definition: NTUPStringSkimmingTool.cxx:41
NTUPStringSkimmingTool.h
DerivationFramework::NTUPStringSkimmingTool::initialize
StatusCode initialize()
Definition: NTUPStringSkimmingTool.cxx:34
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ExpressionParsing::ExpressionParser::loadExpression
bool loadExpression(const std::string &expression)
Definition: ExpressionParser.cxx:61
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ExpressionParsing::SGNTUPProxyLoader
Definition: SGNTUPProxyLoader.h:23
SGNTUPProxyLoader.h
beamspotman.n
n
Definition: beamspotman.py:731
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
DerivationFramework::NTUPStringSkimmingTool::m_parser
ExpressionParsing::ExpressionParser * m_parser
Definition: NTUPStringSkimmingTool.h:33
DerivationFramework::NTUPStringSkimmingTool::eventPassesFilter
virtual bool eventPassesFilter() const
Check that the current event passes this filter.
Definition: NTUPStringSkimmingTool.cxx:50
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
ExpressionParsing::ExpressionParser::evaluateAsBool
bool evaluateAsBool() const
Definition: ExpressionParser.cxx:104
DerivationFramework::NTUPStringSkimmingTool::NTUPStringSkimmingTool
NTUPStringSkimmingTool(const std::string &t, const std::string &n, const IInterface *p)
Definition: NTUPStringSkimmingTool.cxx:23
DerivationFramework::NTUPStringSkimmingTool::m_expression
std::string m_expression
Definition: NTUPStringSkimmingTool.h:32
ExpressionParser.h
AthAlgTool
Definition: AthAlgTool.h:26
ExpressionParsing::ExpressionParser
Definition: ExpressionParser.h:30