ATLAS Offline Software
Loading...
Searching...
No Matches
TriggerDecisionProxyLoader.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6// TriggerDecisionProxyLoader.cxx, (c) ATLAS Detector software
8// Author: Thomas Gillam (thomas.gillam@cern.ch)
9// James Catmore (james.catmore@cern.ch)
10// ExpressionParsing library
12
14#include <set>
15#include <string>
16
17namespace ExpressionParsing {
21
25
27 {
28 static const std::set<std::string> knownPrefixes{"L1", "L2", "EF", "HLT"};
29
30 std::size_t location = varname.find('_');
31 if (location == std::string::npos) return VT_UNK;
32 std::string prefix(varname.begin(), varname.begin()+location);
33
34 if (std::find(knownPrefixes.begin(), knownPrefixes.end(), prefix) != knownPrefixes.end()) return VT_INT;
35 else return VT_UNK;
36 }
37
38 int TriggerDecisionProxyLoader::loadIntVariableFromString(const std::string &varname) const
39 {
40 bool passed(false);
41 if ( varname == "" ) return(0); // no name => ?
42 // trigger decision
43 passed = m_trigDec->isPassed(varname);
44 if (passed) return(1);
45 else return(0);
46 }
47
48 double TriggerDecisionProxyLoader::loadDoubleVariableFromString(const std::string &varname) const
49 {
50 throw std::runtime_error("Trigger decision can't be a double: check " + varname);
51 }
52
53 std::vector<int> TriggerDecisionProxyLoader::loadVecIntVariableFromString(const std::string &varname) const
54 {
55 throw std::runtime_error("Trigger decision can't be vector<int>: check " + varname);
56 }
57
58 std::vector<double> TriggerDecisionProxyLoader::loadVecDoubleVariableFromString(const std::string &varname) const
59 {
60 throw std::runtime_error("Trigger decision can't be vector<double>: check " + varname);
61 }
62}
bool passed(DecisionID id, const DecisionIDContainer &)
checks if required decision ID is in the set of IDs in the container
virtual std::vector< int > loadVecIntVariableFromString(const std::string &varname) const
virtual int loadIntVariableFromString(const std::string &varname) const
virtual std::vector< double > loadVecDoubleVariableFromString(const std::string &varname) const
virtual double loadDoubleVariableFromString(const std::string &varname) const
virtual IProxyLoader::VariableType variableTypeFromString(const std::string &varname) const
Namespace holding all the expression evaluation code.