ATLAS Offline Software
ExpressionParserUserWithTrigSupport.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 /* Dear emacs, this is -*-c++-*- */
5 #ifndef _ExpressionParserUserWithTrigSupport_H_
6 #define _ExpressionParserUserWithTrigSupport_H_
7 
8 #include "ExpressionParserUser.h"
13 
14 template <class T_Base, unsigned short const NUM_PARSER=1>
16 {
17 public:
18  template <typename...Args>
20  : ExpressionParserUserBase<T_Base,NUM_PARSER>(args...),
21  m_trigDecisionTool("Trig::TrigDecisionTool/TrigDecisionTool")
22  {
23  this->declareProperty("TrigDecisionTool", m_trigDecisionTool,"");
24  }
26  return this->_initializeParser(selection_string,
27  [this](ExpressionParsing::MultipleProxyLoader &proxy_loaders) -> StatusCode {
28  // initialise TDT explicitly, needed for the tool to properly work with trigger decisions in AthAnalysisBase (until fixed)
29  if( !this->m_trigDecisionTool.empty() ) {
30  StatusCode sc = this->m_trigDecisionTool.retrieve();
31  if (sc.isFailure()) return sc;
32  proxy_loaders.push_back(new ExpressionParsing::TriggerDecisionProxyLoader(this->m_trigDecisionTool));
33  }
34  else {
35  this->m_trigDecisionTool.disable();
36  }
37  return StatusCode::SUCCESS;
38  },
39  [this](ExpressionParsing::MultipleProxyLoader &proxy_loaders) -> StatusCode {
40  proxy_loaders.push_back(new ExpressionParsing::SGNTUPProxyLoader(this->evtStore()));
41  return StatusCode::SUCCESS;
42  });
43  }
44 protected:
46  ToolHandle<Trig::TrigDecisionTool> m_trigDecisionTool;
47 };
48 #endif
ExpressionParsing::SelectionArg
typename std::conditional< NUM_PARSER==1, std::string, std::vector< std::string > >::type SelectionArg
type to be used for expression string(s) for a single or multiple expression parsers
Definition: ExpressionParserUser.h:66
ExpressionParserUser.h
TrigDecisionTool.h
Args
Definition: test_lwtnn_fastgraph.cxx:12
ExpressionParserUserBase< T_Base, 1 >::_initializeParser
StatusCode _initializeParser(const ExpressionParsing::SelectionArg< NUM_PARSER > &selection_string, ExpressionParsing::AppendLoaderFunc pre_xaod_loader=ExpressionParsing::NoLoaderFunc, ExpressionParsing::AppendLoaderFunc post_xaod_loader=ExpressionParsing::NoLoaderFunc)
ExpressionParserUserWithTrigSupport::initializeParser
StatusCode initializeParser(ExpressionParsing::SelectionArg< NUM_PARSER > selection_string)
Definition: ExpressionParserUserWithTrigSupport.h:25
ExpressionParsing::SGNTUPProxyLoader
Definition: SGNTUPProxyLoader.h:23
SGNTUPProxyLoader.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ExpressionParserUserWithTrigSupport::ExpressionParserUserWithTrigSupport
ExpressionParserUserWithTrigSupport(Args...args)
Definition: ExpressionParserUserWithTrigSupport.h:19
ExpressionParserUserBase
Definition: ExpressionParserUser.h:74
TriggerDecisionProxyLoader.h
ExpressionParsing::MultipleProxyLoader::push_back
void push_back(IProxyLoader *proxyLoader)
Definition: MultipleProxyLoader.cxx:30
ExpressionParserUserWithTrigSupport::m_trigDecisionTool
ToolHandle< Trig::TrigDecisionTool > m_trigDecisionTool
The trigger decision tool.
Definition: ExpressionParserUserWithTrigSupport.h:46
MultipleProxyLoader.h
ExpressionParserUserWithTrigSupport
Definition: ExpressionParserUserWithTrigSupport.h:16
python.CaloScaleNoiseConfig.args
args
Definition: CaloScaleNoiseConfig.py:80
ExpressionParsing::MultipleProxyLoader
Definition: MultipleProxyLoader.h:24