Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:20

0001 // -*- C++ -*-
0002 //
0003 // Package:     CommonTools/Utils
0004 // Class  :     reco::formula::VariableEvaluator
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:  Christopher Jones
0010 //         Created:  Wed, 23 Sep 2015 18:06:29 GMT
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
0016 #include "formulaVariableEvaluator.h"
0017 
0018 namespace reco {
0019   namespace formula {
0020     double VariableEvaluator::evaluate(double const* iVariables, double const* /*iParameters*/) const {
0021       return iVariables[m_index];
0022     }
0023 
0024     std::vector<std::string> VariableEvaluator::abstractSyntaxTree() const {
0025       return std::vector<std::string>{1, std::string("var[") + std::to_string(m_index) + "]"};
0026     }
0027   }  // namespace formula
0028 }  // namespace reco