FunctionNode Node class for handling MetaVariables in cuts.
More...
#include <CutNodes.h>
|
AVariableManager::VarVariant | evaluate (const Object *p) const override |
| evaluate m_var with p and return the result
|
|
void | print () const override |
| Print node.
|
|
std::string | decompile () const override |
| Decompile Node back to a string.
|
|
void | processMetaVariable () |
| Get MetaVariable from AVariableManager.
|
|
| ~FunctionNode () |
| Destructor.
|
|
|
typedef AVariableManager::Object | Object |
| Template argument dependent Particle type definition.
|
|
typedef AVariableManager::Var | Var |
| Template argument dependent Variable type definition.
|
|
|
| FunctionNode (const std::string &functionName, const std::vector< std::string > &functionArguments) |
| Constructor.
|
|
|
const std::string | m_name |
| Function name of the MetaVariable.
|
|
const std::vector< std::string > | m_arguments |
| vector of string arguments of the MetaVariable
|
|
const Var * | m_var |
| set if there was a valid variable in this cut
|
|
template<class AVariableManager>
class Belle2::FunctionNode< AVariableManager >
FunctionNode Node class for handling MetaVariables in cuts.
Definition at line 1013 of file CutNodes.h.
◆ Object
template<class AVariableManager>
typedef AVariableManager::Object Object |
|
private |
◆ Var
template<class AVariableManager>
typedef AVariableManager::Var Var |
|
private |
Template argument dependent Variable type definition.
Definition at line 1021 of file CutNodes.h.
◆ ~FunctionNode()
template<class AVariableManager>
◆ FunctionNode()
template<class AVariableManager>
FunctionNode |
( |
const std::string & | functionName, |
|
|
const std::vector< std::string > & | functionArguments ) |
|
inlineexplicitprivate |
Constructor.
- Parameters
-
functionName | (const std::string&): function name of the MetaVariable |
functionArguments | (const std::vector<std::string>&): function arguments of the MetaVariable |
Definition at line 1077 of file CutNodes.h.
1077 : m_name{functionName},
1078 m_arguments{functionArguments}
1079 {processMetaVariable();}
◆ decompile()
template<class AVariableManager>
std::string decompile |
( |
| ) |
const |
|
inlineoverridevirtual |
Decompile Node back to a string.
decompile(compile) should give the same result.
Implements AbstractExpressionNode< AVariableManager >.
Definition at line 1044 of file CutNodes.h.
1045 {
1046 std::string fullname = m_name + "(" + boost::algorithm::join(m_arguments, ", ") + ")";
1047 return fullname;
1048 }
◆ evaluate()
template<class AVariableManager>
AVariableManager::VarVariant evaluate |
( |
const Object * | p | ) |
const |
|
inlineoverridevirtual |
◆ print()
template<class AVariableManager>
◆ processMetaVariable()
template<class AVariableManager>
void processMetaVariable |
( |
| ) |
|
|
inline |
Get MetaVariable from AVariableManager.
Definition at line 1053 of file CutNodes.h.
1054 {
1055
1056 AVariableManager& manager = AVariableManager::Instance();
1057 m_var = manager.getVariable(m_name, m_arguments);
1058 if (m_var == nullptr) {
1059 auto fullname = m_name + "(" + boost::algorithm::join(m_arguments, ", ") + ")";
1060
1061 throw std::runtime_error(
1062 "Cut string has an invalid format: Metavariable not found: " + fullname);
1063 }
1064 }
◆ NodeFactory
template<class AVariableManager>
◆ m_arguments
template<class AVariableManager>
const std::vector<std::string> m_arguments |
|
private |
vector of string arguments of the MetaVariable
Definition at line 1081 of file CutNodes.h.
◆ m_name
template<class AVariableManager>
Function name of the MetaVariable.
Definition at line 1080 of file CutNodes.h.
◆ m_var
template<class AVariableManager>
set if there was a valid variable in this cut
Definition at line 1082 of file CutNodes.h.
The documentation for this class was generated from the following file: