ATLAS Offline Software
PhysicsAnalysis
CommonTools
ExpressionEvaluation
src
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
13
#include "
ExpressionEvaluation/TriggerDecisionProxyLoader.h
"
14
#include <set>
15
#include <string>
16
17
namespace
ExpressionParsing
{
18
TriggerDecisionProxyLoader::~TriggerDecisionProxyLoader
()
19
{
20
}
21
22
void
TriggerDecisionProxyLoader::reset
()
23
{
24
}
25
26
IProxyLoader::VariableType
TriggerDecisionProxyLoader::variableTypeFromString
(
const
std::string &
varname
)
const
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
}
ExpressionParsing::TriggerDecisionProxyLoader::variableTypeFromString
virtual IProxyLoader::VariableType variableTypeFromString(const std::string &varname) const
Definition:
TriggerDecisionProxyLoader.cxx:26
TrigCompositeUtils::passed
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
Definition:
TrigCompositeUtilsRoot.cxx:117
find
std::string find(const std::string &s)
return a remapped string
Definition:
hcg.cxx:135
ExpressionParsing::TriggerDecisionProxyLoader::m_trigDec
ToolHandle< Trig::TrigDecisionTool > m_trigDec
Definition:
TriggerDecisionProxyLoader.h:35
ExpressionParsing::TriggerDecisionProxyLoader::loadVecIntVariableFromString
virtual std::vector< int > loadVecIntVariableFromString(const std::string &varname) const
Definition:
TriggerDecisionProxyLoader.cxx:53
ExpressionParsing::IProxyLoader::VariableType
VariableType
Definition:
IProxyLoader.h:21
ExpressionParsing::IProxyLoader::VT_UNK
@ VT_UNK
Definition:
IProxyLoader.h:21
ExpressionParsing::TriggerDecisionProxyLoader::loadIntVariableFromString
virtual int loadIntVariableFromString(const std::string &varname) const
Definition:
TriggerDecisionProxyLoader.cxx:38
ExpressionParsing::TriggerDecisionProxyLoader::loadDoubleVariableFromString
virtual double loadDoubleVariableFromString(const std::string &varname) const
Definition:
TriggerDecisionProxyLoader.cxx:48
ExpressionParsing
Namespace holding all the expression evaluation code.
Definition:
ExpressionParser.h:26
ExpressionParsing::TriggerDecisionProxyLoader::~TriggerDecisionProxyLoader
virtual ~TriggerDecisionProxyLoader()
Definition:
TriggerDecisionProxyLoader.cxx:18
checkCorrelInHIST.prefix
dictionary prefix
Definition:
checkCorrelInHIST.py:391
ExpressionParsing::TriggerDecisionProxyLoader::loadVecDoubleVariableFromString
virtual std::vector< double > loadVecDoubleVariableFromString(const std::string &varname) const
Definition:
TriggerDecisionProxyLoader.cxx:58
TriggerDecisionProxyLoader.h
ExpressionParsing::IProxyLoader::VT_INT
@ VT_INT
Definition:
IProxyLoader.h:21
LArG4AODNtuplePlotter.varname
def varname(hname)
Definition:
LArG4AODNtuplePlotter.py:37
ExpressionParsing::TriggerDecisionProxyLoader::reset
virtual void reset()
Definition:
TriggerDecisionProxyLoader.cxx:22
Generated on Thu Nov 7 2024 21:29:43 for ATLAS Offline Software by
1.8.18