#include <PerformancePayloadFromBinnedTFormula.h>
Definition at line 14 of file PerformancePayloadFromBinnedTFormula.h.
PerformancePayloadFromBinnedTFormula::PerformancePayloadFromBinnedTFormula | ( | std::vector< PerformanceResult::ResultType > | r, |
std::vector< BinningVariables::BinningVariablesType > | b, | ||
std::vector< PhysicsTFormulaPayload > | in | ||
) | [inline] |
Definition at line 20 of file PerformancePayloadFromBinnedTFormula.h.
PerformancePayloadFromBinnedTFormula::PerformancePayloadFromBinnedTFormula | ( | ) | [inline] |
Definition at line 22 of file PerformancePayloadFromBinnedTFormula.h.
{}
virtual PerformancePayloadFromBinnedTFormula::~PerformancePayloadFromBinnedTFormula | ( | ) | [inline, virtual] |
Definition at line 23 of file PerformancePayloadFromBinnedTFormula.h.
References compiledFormulas_.
{ compiledFormulas_.clear(); }
void PerformancePayloadFromBinnedTFormula::check | ( | ) | const [protected] |
Definition at line 87 of file PerformancePayloadFromBinnedTFormula.cc.
References PhysicsTFormulaPayload::formulas(), i, findQualityFiles::size, lumiQTWidget::t, groupFilesInBlocks::temp, tmp, and groupFilesInBlocks::tt.
{ if (pls.size()== compiledFormulas_.size()) return; // // otherwise, compile! // compiledFormulas_.clear(); for (unsigned int t=0; t< pls.size(); ++t){ std::vector <TFormula *> temp; for (unsigned int i=0; i< (pls[t].formulas()).size(); ++i){ PhysicsTFormulaPayload tmp = pls[t]; TFormula* tt = new TFormula("rr",((tmp.formulas())[i]).c_str()); //FIXME: "rr" should be unique! tt->Compile(); temp.push_back(tt); } compiledFormulas_.push_back(temp); } }
const std::vector<PhysicsTFormulaPayload>& PerformancePayloadFromBinnedTFormula::formulaPayloads | ( | ) | const [inline] |
Definition at line 35 of file PerformancePayloadFromBinnedTFormula.h.
References pls.
Referenced by PhysicsPerformanceDBWriterTFormula_fromfile_WPandPL::beginJob().
{return pls;}
TFormula * PerformancePayloadFromBinnedTFormula::getFormula | ( | PerformanceResult::ResultType | r, |
BinningPointByMap | p | ||
) | const [protected] |
Definition at line 9 of file PerformancePayloadFromBinnedTFormula.cc.
References NULL, and convertSQLiteXML::ok.
{ // // chooses the correct rectangular region // if (! isInPayload(r,p)) return NULL; unsigned int region; bool ok = isOk(p,region); if (ok == false) return NULL; return compiledFormulas_[region][resultPos(r)]; }
float PerformancePayloadFromBinnedTFormula::getResult | ( | PerformanceResult::ResultType | r, |
BinningPointByMap | p | ||
) | const [virtual] |
Implements PerformancePayload.
Definition at line 22 of file PerformancePayloadFromBinnedTFormula.cc.
References CastorDataFrameFilter_impl::check(), EcalElecEmulExample_cfg::formula, i, PerformancePayload::InvalidResult, lumiQTWidget::t, BinningPointByMap::value(), and makeHLTPrescaleTable::values.
{ check(); // // which formula to use? // if (! isInPayload(r,p)) return PerformancePayload::InvalidResult; // nice, what to do here??? // TFormula * formula = compiledFormulas_[resultPos(r)]; // TFormula * formula = getFormula(r,p); // 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 PerformancePayloadFromBinnedTFormula::isInPayload | ( | PerformanceResult::ResultType | res, |
BinningPointByMap | point | ||
) | const [virtual] |
Implements PerformancePayload.
Definition at line 77 of file PerformancePayloadFromBinnedTFormula.cc.
References CastorDataFrameFilter_impl::check(), and InvalidPos.
{ check(); // first, let's see if it is available at all if (resultPos(res) == PerformancePayloadFromBinnedTFormula::InvalidPos) return false; unsigned int whocares; if ( ! isOk(point,whocares)) return false; return true; }
bool PerformancePayloadFromBinnedTFormula::isOk | ( | BinningPointByMap | p, |
unsigned int & | whichone | ||
) | const [protected] |
Definition at line 50 of file PerformancePayloadFromBinnedTFormula.cc.
References BinningPointByMap::isKeyAvailable(), pos, query::result, lumiQTWidget::t, v, and BinningPointByMap::value().
{ // // change: look on whether a single rectangularr region matches // for (unsigned int ti=0; ti< pls.size(); ++ti){ bool result = true; std::vector<BinningVariables::BinningVariablesType> t = myBinning(); for (std::vector<BinningVariables::BinningVariablesType>::const_iterator it = t.begin(); it != t.end();++it){ // // now looking into a single payload // if (! p.isKeyAvailable(*it)) return false; float v = p.value(*it); int pos = limitPos(*it); std::pair<float, float> limits = (pls[ti].limits())[pos]; if (v<limits.first || v>limits.second) result= false; } if (result == true) { whichone = ti; return true; } } whichone = 9999; return false; }
virtual bool PerformancePayloadFromBinnedTFormula::isParametrizedInVariable | ( | const BinningVariables::BinningVariablesType | p | ) | const [inline, virtual] |
Definition at line 29 of file PerformancePayloadFromBinnedTFormula.h.
References InvalidPos, and limitPos().
{ return (limitPos(p) != PerformancePayloadFromBinnedTFormula::InvalidPos); }
virtual int PerformancePayloadFromBinnedTFormula::limitPos | ( | const BinningVariables::BinningVariablesType | b | ) | const [inline, protected, virtual] |
Definition at line 44 of file PerformancePayloadFromBinnedTFormula.h.
References b, spr::find(), InvalidPos, AlCaHLTBitMon_ParallelJobs::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 PerformancePayloadFromBinnedTFormula::InvalidPos; return ((p-variables_.begin())); }
virtual std::vector<BinningVariables::BinningVariablesType> PerformancePayloadFromBinnedTFormula::myBinning | ( | ) | const [inline, protected, virtual] |
Definition at line 42 of file PerformancePayloadFromBinnedTFormula.h.
References variables_.
{return variables_;}
void PerformancePayloadFromBinnedTFormula::printFormula | ( | PerformanceResult::ResultType | res, |
BinningPointByMap | point | ||
) | const |
Definition at line 108 of file PerformancePayloadFromBinnedTFormula.cc.
References CastorDataFrameFilter_impl::check(), gather_cfg::cout, EcalElecEmulExample_cfg::formula, InvalidPos, pos, and lumiQTWidget::t.
{ check(); // // which formula to use? // if (resultPos(res) == PerformancePayloadFromBinnedTFormula::InvalidPos) { cout << "Warning: result not available!" << endl; } // nice, what to do here??? TFormula * formula = getFormula(res, point); unsigned int whichone; isOk(point,whichone); 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 = (pls[whichone].limits())[pos]; cout << " Variable: " << *it << " with limits: " << "from: " << limits.first << " to: " << limits.second << endl; } }
virtual int PerformancePayloadFromBinnedTFormula::resultPos | ( | PerformanceResult::ResultType | r | ) | const [inline, protected, virtual] |
Definition at line 52 of file PerformancePayloadFromBinnedTFormula.h.
References spr::find(), InvalidPos, AlCaHLTBitMon_ParallelJobs::p, alignCSCRings::r, and results_.
std::vector<std::vector<TFormula *> > PerformancePayloadFromBinnedTFormula::compiledFormulas_ [mutable, protected] |
Definition at line 78 of file PerformancePayloadFromBinnedTFormula.h.
Referenced by ~PerformancePayloadFromBinnedTFormula().
int PerformancePayloadFromBinnedTFormula::InvalidPos = -1 [static] |
Definition at line 18 of file PerformancePayloadFromBinnedTFormula.h.
Referenced by isInPayload(), isParametrizedInVariable(), limitPos(), printFormula(), and resultPos().
std::vector<PhysicsTFormulaPayload> PerformancePayloadFromBinnedTFormula::pls [protected] |
Definition at line 68 of file PerformancePayloadFromBinnedTFormula.h.
Referenced by formulaPayloads().
std::vector<PerformanceResult::ResultType> PerformancePayloadFromBinnedTFormula::results_ [protected] |
Definition at line 72 of file PerformancePayloadFromBinnedTFormula.h.
Referenced by resultPos().
std::vector<BinningVariables::BinningVariablesType> PerformancePayloadFromBinnedTFormula::variables_ [protected] |
Definition at line 73 of file PerformancePayloadFromBinnedTFormula.h.
Referenced by limitPos(), and myBinning().