1 #ifndef RecoEgamma_EgammaTools_MVAVariableManager_H
2 #define RecoEgamma_EgammaTools_MVAVariableManager_H
11 template <
class ParticleType>
14 template <
class IndexMap>
17 std::ifstream
file(variableDefinitionFileEdm.
fullPath());
25 if (
name.find(
"#") != std::string::npos) {
38 std::map<std::string, int>::iterator it =
indexMap_.find(
name);
55 if (varInfo.auxIndex >= 0)
56 value = auxVariables[varInfo.auxIndex];
60 if (varInfo.hasLowerClip &&
value < varInfo.lowerClipValue) {
61 value = varInfo.lowerClipValue;
63 if (varInfo.hasUpperClip &&
value > varInfo.upperClipValue) {
64 value = varInfo.upperClipValue;
78 template <
class IndexMap>
83 IndexMap
const &indexMap) {
84 bool hasLowerClip = lowerClip.find(
"None") == std::string::npos;
85 bool hasUpperClip = upperClip.find(
"None") == std::string::npos;
86 bool isAuxiliary =
formula.find(
"Rho") != std::string::npos;
87 float lowerClipValue = hasLowerClip ? (
float)::atof(lowerClip.c_str()) : 0.;
88 float upperClipValue = hasUpperClip ? (
float)::atof(upperClip.c_str()) : 0.;
99 int auxIndex = isAuxiliary ? indexMap.at(
formula) : -1;
101 MVAVariableInfo varInfo{
102 .hasLowerClip = hasLowerClip,
103 .hasUpperClip = hasUpperClip,
104 .lowerClipValue = lowerClipValue,
105 .upperClipValue = upperClipValue,
106 .auxIndex = auxIndex,
118 std::vector<ThreadSafeFunctor<StringObjectFunction<ParticleType>>>
functions_;