#include <PerformancePayloadFromTFormula.h>
Definition at line 14 of file PerformancePayloadFromTFormula.h.
PerformancePayloadFromTFormula::PerformancePayloadFromTFormula | ( | std::vector< PerformanceResult::ResultType > | r, |
std::vector< BinningVariables::BinningVariablesType > | b, | ||
PhysicsTFormulaPayload & | in | ||
) | [inline] |
Definition at line 20 of file PerformancePayloadFromTFormula.h.
: pl(in), results_(r), variables_(b) {}
PerformancePayloadFromTFormula::PerformancePayloadFromTFormula | ( | ) | [inline] |
Definition at line 22 of file PerformancePayloadFromTFormula.h.
{}
virtual PerformancePayloadFromTFormula::~PerformancePayloadFromTFormula | ( | ) | [inline, virtual] |
Definition at line 23 of file PerformancePayloadFromTFormula.h.
References compiledFormulas_, and i.
{ for (unsigned int i=0; i< compiledFormulas_.size(); ++i){ delete compiledFormulas_[i]; } compiledFormulas_.clear(); }
void PerformancePayloadFromTFormula::check | ( | ) | const [protected] |
Definition at line 57 of file PerformancePayloadFromTFormula.cc.
References i, and matplotRender::t.
const PhysicsTFormulaPayload& PerformancePayloadFromTFormula::formulaPayload | ( | ) | const [inline] |
float PerformancePayloadFromTFormula::getResult | ( | PerformanceResult::ResultType | r, |
BinningPointByMap | p | ||
) | const [virtual] |
Implements PerformancePayload.
Definition at line 8 of file PerformancePayloadFromTFormula.cc.
References CastorDataFrameFilter_impl::check(), EcalElecEmulExample_cfg::formula, i, PerformancePayload::InvalidResult, matplotRender::t, BinningPointByMap::value(), and makeHLTPrescaleTable::values.
Referenced by PFEnergyCalibration::aBarrel(), PFEnergyCalibration::aEndcap(), PFEnergyCalibration::aEtaBarrel(), PFEnergyCalibration::aEtaEndcap(), PFEnergyCalibration::bBarrel(), PFEnergyCalibration::bEndcap(), PFEnergyCalibration::bEtaBarrel(), PFEnergyCalibration::bEtaEndcap(), PFEnergyCalibration::cBarrel(), and PFEnergyCalibration::cEndcap().
{ check(); // // which formula to use? // if (! isInPayload(r,p)) return PerformancePayload::InvalidResult; // nice, what to do here??? TFormula * formula = compiledFormulas_[resultPos(r)]; // // prepare the vector to pass, order counts!!! // std::vector<BinningVariables::BinningVariablesType> t = myBinning(); // sorry, TFormulas just work up to dimension==4 Double_t values[4]; int i=0; for (std::vector<BinningVariables::BinningVariablesType>::const_iterator it = t.begin(); it != t.end();++it, ++i){ values[i] = p.value(*it); } // // i need a non const version #$%^ return formula->EvalPar(values); }
bool PerformancePayloadFromTFormula::isInPayload | ( | PerformanceResult::ResultType | res, |
BinningPointByMap | point | ||
) | const [virtual] |
Implements PerformancePayload.
Definition at line 47 of file PerformancePayloadFromTFormula.cc.
References CastorDataFrameFilter_impl::check(), and InvalidPos.
{ check(); // first, let's see if it is available at all if (resultPos(res) == PerformancePayloadFromTFormula::InvalidPos) return false; if ( ! isOk(point)) return false; return true; }
bool PerformancePayloadFromTFormula::isOk | ( | BinningPointByMap | p | ) | const [protected] |
Definition at line 33 of file PerformancePayloadFromTFormula.cc.
References BinningPointByMap::isKeyAvailable(), pos, matplotRender::t, v, and BinningPointByMap::value().
{ std::vector<BinningVariables::BinningVariablesType> t = myBinning(); for (std::vector<BinningVariables::BinningVariablesType>::const_iterator it = t.begin(); it != t.end();++it){ if (! p.isKeyAvailable(*it)) return false; float v = p.value(*it); int pos = limitPos(*it); std::pair<float, float> limits = (pl.limits())[pos]; if (v<limits.first || v>limits.second) return false; } return true; }
virtual bool PerformancePayloadFromTFormula::isParametrizedInVariable | ( | const BinningVariables::BinningVariablesType | p | ) | const [inline, virtual] |
Definition at line 32 of file PerformancePayloadFromTFormula.h.
References InvalidPos, and limitPos().
{ return (limitPos(p) != PerformancePayloadFromTFormula::InvalidPos); }
virtual int PerformancePayloadFromTFormula::limitPos | ( | const BinningVariables::BinningVariablesType | b | ) | const [inline, protected, virtual] |
Definition at line 47 of file PerformancePayloadFromTFormula.h.
References b, spr::find(), InvalidPos, L1TEmulatorMonitor_cff::p, and variables_.
Referenced by isParametrizedInVariable().
{ std::vector<BinningVariables::BinningVariablesType>::const_iterator p; p = find(variables_.begin(), variables_.end(), b); if (p == variables_.end()) return PerformancePayloadFromTFormula::InvalidPos; return ((p-variables_.begin())); }
virtual std::vector<BinningVariables::BinningVariablesType> PerformancePayloadFromTFormula::myBinning | ( | ) | const [inline, protected, virtual] |
Definition at line 45 of file PerformancePayloadFromTFormula.h.
References variables_.
{return variables_;}
void PerformancePayloadFromTFormula::printFormula | ( | PerformanceResult::ResultType | res | ) | const |
Definition at line 69 of file PerformancePayloadFromTFormula.cc.
References CastorDataFrameFilter_impl::check(), gather_cfg::cout, EcalElecEmulExample_cfg::formula, InvalidPos, pos, and matplotRender::t.
Referenced by operator<<().
{ check(); // // which formula to use? // if (resultPos(res) == PerformancePayloadFromTFormula::InvalidPos) { cout << "Warning: result not available!" << endl; } // nice, what to do here??? TFormula * formula = compiledFormulas_[resultPos(res)]; cout << "-- Formula: " << formula->GetExpFormula("p") << endl; // prepare the vector to pass, order counts!!! // std::vector<BinningVariables::BinningVariablesType> t = myBinning(); for (std::vector<BinningVariables::BinningVariablesType>::const_iterator it = t.begin(); it != t.end();++it){ int pos = limitPos(*it); std::pair<float, float> limits = (pl.limits())[pos]; cout << " Variable: " << *it << " with limits: " << "from: " << limits.first << " to: " << limits.second << endl; } }
virtual int PerformancePayloadFromTFormula::resultPos | ( | PerformanceResult::ResultType | r | ) | const [inline, protected, virtual] |
Definition at line 55 of file PerformancePayloadFromTFormula.h.
References spr::find(), InvalidPos, L1TEmulatorMonitor_cff::p, csvReporter::r, and results_.
std::vector<TFormula *> PerformancePayloadFromTFormula::compiledFormulas_ [mutable, protected] |
Definition at line 76 of file PerformancePayloadFromTFormula.h.
Referenced by ~PerformancePayloadFromTFormula().
int PerformancePayloadFromTFormula::InvalidPos = -1 [static] |
Definition at line 18 of file PerformancePayloadFromTFormula.h.
Referenced by isInPayload(), isParametrizedInVariable(), limitPos(), printFormula(), and resultPos().
Definition at line 67 of file PerformancePayloadFromTFormula.h.
Referenced by formulaPayload().
std::vector<PerformanceResult::ResultType> PerformancePayloadFromTFormula::results_ [protected] |
Definition at line 71 of file PerformancePayloadFromTFormula.h.
Referenced by resultPos().
std::vector<BinningVariables::BinningVariablesType> PerformancePayloadFromTFormula::variables_ [protected] |
Definition at line 72 of file PerformancePayloadFromTFormula.h.
Referenced by limitPos(), and myBinning().