ATLAS Offline Software
Loading...
Searching...
No Matches
ExpressionParserUserWithTrigSupport.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4/* Dear emacs, this is -*-c++-*- */
5#ifndef _ExpressionParserUserWithTrigSupport_H_
6#define _ExpressionParserUserWithTrigSupport_H_
7
13
14template <class T_Base, unsigned short const NUM_PARSER=1>
16{
17public:
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(std::make_unique<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(std::make_unique<ExpressionParsing::SGNTUPProxyLoader>(this->evtStore()));
41 return StatusCode::SUCCESS;
42 });
43 }
44protected:
46 ToolHandle<Trig::TrigDecisionTool> m_trigDecisionTool;
47};
48#endif
static Double_t sc
StatusCode _initializeParser(const ExpressionParsing::SelectionArg< NUM_PARSER > &selection_string, ExpressionParsing::AppendLoaderFunc pre_xaod_loader=ExpressionParsing::NoLoaderFunc, ExpressionParsing::AppendLoaderFunc post_xaod_loader=ExpressionParsing::NoLoaderFunc)
ToolHandle< Trig::TrigDecisionTool > m_trigDecisionTool
The trigger decision tool.
StatusCode initializeParser(ExpressionParsing::SelectionArg< NUM_PARSER > selection_string)
IProxyLoader * push_back(std::unique_ptr< IProxyLoader > proxyLoader)
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