ATLAS Offline Software
PhysicsAnalysis
DerivationFramework
DerivationFrameworkTools
src
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
13
#include "
DerivationFrameworkTools/NTUPStringSkimmingTool.h
"
14
15
#include <vector>
16
#include <string>
17
18
#include "
ExpressionEvaluation/ExpressionParser.h
"
19
#include "
ExpressionEvaluation/SGNTUPProxyLoader.h
"
20
21
namespace
DerivationFramework
{
22
23
NTUPStringSkimmingTool::NTUPStringSkimmingTool
(
const
std::string&
t
,
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
34
StatusCode
NTUPStringSkimmingTool::initialize
()
35
{
36
m_parser
=
new
ExpressionParsing::ExpressionParser
(
new
ExpressionParsing::SGNTUPProxyLoader
(
evtStore
()));
37
m_parser
->
loadExpression
(
m_expression
);
38
return
StatusCode::SUCCESS;
39
}
40
41
StatusCode
NTUPStringSkimmingTool::finalize
()
42
{
43
if
(
m_parser
) {
44
delete
m_parser
;
45
m_parser
=
nullptr
;
46
}
47
return
StatusCode::SUCCESS;
48
}
49
50
bool
NTUPStringSkimmingTool::eventPassesFilter
()
const
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
Generated on Mon Dec 23 2024 21:15:55 for ATLAS Offline Software by
1.8.18