#include <PerformancePayloadFromTable.h>
Definition at line 13 of file PerformancePayloadFromTable.h.
PerformancePayloadFromTable::PerformancePayloadFromTable | ( | std::vector< PerformanceResult::ResultType > | r, |
std::vector< BinningVariables::BinningVariablesType > | b, | ||
int | stride_, | ||
std::vector< float > | table | ||
) | [inline] |
PerformancePayloadFromTable::PerformancePayloadFromTable | ( | ) | [inline] |
Definition at line 25 of file PerformancePayloadFromTable.h.
{}
virtual PerformancePayloadFromTable::~PerformancePayloadFromTable | ( | ) | [inline, virtual] |
Definition at line 26 of file PerformancePayloadFromTable.h.
{}
float PerformancePayloadFromTable::getResult | ( | PerformanceResult::ResultType | r, |
BinningPointByMap | p | ||
) | const [virtual] |
Implements PerformancePayload.
Definition at line 8 of file PerformancePayloadFromTable.cc.
References PhysicsPerformancePayload::getRow(), i, PerformancePayload::InvalidResult, isInPayload(), matches(), PhysicsPerformancePayload::nRows(), pl, pos, and resultPos().
{ if (! isInPayload(r,p)) return PerformancePayload::InvalidResult; // loop on the table rows and search for a match for (int i=0; i< pl.nRows(); i++){ PhysicsPerformancePayload::Row row = pl.getRow(i); if (matches(p,row)){ int pos = resultPos(r); return row[pos]; } } return PerformancePayload::InvalidResult; }
bool PerformancePayloadFromTable::isInPayload | ( | PerformanceResult::ResultType | res, |
BinningPointByMap | point | ||
) | const [virtual] |
Implements PerformancePayload.
Definition at line 45 of file PerformancePayloadFromTable.cc.
References PhysicsPerformancePayload::getRow(), i, InvalidPos, BinningPointByMap::isKeyAvailable(), matches(), myBinning(), PhysicsPerformancePayload::nRows(), pl, resultPos(), and matplotRender::t.
Referenced by getResult().
{ // first, let's see if it is available at all if (resultPos(res) == PerformancePayloadFromTable::InvalidPos) return false; // now look whther the binning point contains all the info std::vector<BinningVariables::BinningVariablesType> t = myBinning(); for (std::vector<BinningVariables::BinningVariablesType>::const_iterator it = t.begin(); it != t.end();++it){ if (! point.isKeyAvailable(*it) ) return false; } // then, look if there is a matching row for (int i=0; i< pl.nRows(); i++){ PhysicsPerformancePayload::Row row = pl.getRow(i); if (matches(point,row)){ return true; } } return false; }
virtual bool PerformancePayloadFromTable::isParametrizedInVariable | ( | const BinningVariables::BinningVariablesType | p | ) | const [inline, virtual] |
Definition at line 30 of file PerformancePayloadFromTable.h.
References InvalidPos, and minPos().
{ return (minPos(p) != PerformancePayloadFromTable::InvalidPos); }
bool PerformancePayloadFromTable::matches | ( | BinningPointByMap | p, |
PhysicsPerformancePayload::Row & | row | ||
) | const [protected] |
Definition at line 24 of file PerformancePayloadFromTable.cc.
References maxPos(), minPos(), myBinning(), matplotRender::t, v, and BinningPointByMap::value().
Referenced by getResult(), and isInPayload().
{ // // this is the smart function which does not take into account the fields not present // // I can do it via a loop! std::vector<BinningVariables::BinningVariablesType> t = myBinning(); for (std::vector<BinningVariables::BinningVariablesType>::const_iterator it = t.begin(); it != t.end();++it){ // // first the binning point map must contain ALL the quantities here // // if (! p.isKeyAvailable(*it) ) return false; float v = p.value(*it); if (!(v >= row[minPos(*it)] && v < row[maxPos(*it)])) return false; } return true; }
virtual int PerformancePayloadFromTable::maxPos | ( | const BinningVariables::BinningVariablesType | b | ) | const [inline, protected, virtual] |
Definition at line 48 of file PerformancePayloadFromTable.h.
References b, binning_, spr::find(), InvalidPos, and AlCaHLTBitMon_ParallelJobs::p.
Referenced by matches().
virtual int PerformancePayloadFromTable::minPos | ( | const BinningVariables::BinningVariablesType | b | ) | const [inline, protected, virtual] |
Definition at line 42 of file PerformancePayloadFromTable.h.
References b, binning_, spr::find(), InvalidPos, and AlCaHLTBitMon_ParallelJobs::p.
Referenced by isParametrizedInVariable(), and matches().
virtual std::vector<BinningVariables::BinningVariablesType> PerformancePayloadFromTable::myBinning | ( | ) | const [inline, protected, virtual] |
Definition at line 40 of file PerformancePayloadFromTable.h.
References binning_.
Referenced by isInPayload(), and matches().
{return binning_;}
const PhysicsPerformancePayload& PerformancePayloadFromTable::payLoad | ( | ) | const [inline] |
virtual int PerformancePayloadFromTable::resultPos | ( | PerformanceResult::ResultType | r | ) | const [inline, protected, virtual] |
Definition at line 55 of file PerformancePayloadFromTable.h.
References binning_, spr::find(), InvalidPos, AlCaHLTBitMon_ParallelJobs::p, csvReporter::r, and results_.
Referenced by getResult(), and isInPayload().
{ // result should be: # of binning variables *2 + position of result std::vector<PerformanceResult::ResultType>::const_iterator p; p = find (results_.begin(), results_.end(), r); if ( p == results_.end()) return PerformancePayloadFromTable::InvalidPos; return (binning_.size()*2+(p-results_.begin())); }
std::vector<BinningVariables::BinningVariablesType> PerformancePayloadFromTable::binning_ [protected] |
Definition at line 69 of file PerformancePayloadFromTable.h.
Referenced by maxPos(), minPos(), myBinning(), and resultPos().
int PerformancePayloadFromTable::InvalidPos = -1 [static] |
Definition at line 17 of file PerformancePayloadFromTable.h.
Referenced by isInPayload(), isParametrizedInVariable(), maxPos(), minPos(), and resultPos().
Definition at line 66 of file PerformancePayloadFromTable.h.
Referenced by getResult(), isInPayload(), and payLoad().
std::vector<PerformanceResult::ResultType> PerformancePayloadFromTable::results_ [protected] |
Definition at line 68 of file PerformancePayloadFromTable.h.
Referenced by resultPos().