CMS 3D CMS Logo

PerformancePayloadFromTable.cc
Go to the documentation of this file.
2 
4 
5 #include <iostream>
6 
8  if (!isInPayload(r, p))
10 
11  // loop on the table rows and search for a match
12  for (int i = 0; i < pl.nRows(); i++) {
14 
15  if (matches(p, row)) {
16  int pos = resultPos(r);
17  return row[pos];
18  }
19  }
21 }
22 
24  //
25  // this is the smart function which does not take into account the fields not present
26  //
27 
28  // I can do it via a loop!
29  BinningPointByMap p = _p;
30  std::vector<BinningVariables::BinningVariablesType> t = myBinning();
31 
32  for (std::vector<BinningVariables::BinningVariablesType>::const_iterator it = t.begin(); it != t.end(); ++it) {
33  //
34  // first the binning point map must contain ALL the quantities here
35  //
36  // if (! p.isKeyAvailable(*it) ) return false;
37  float v = p.value(*it);
38  if (!(v >= row[minPos(*it)] && v < row[maxPos(*it)]))
39  return false;
40  }
41  return true;
42 }
43 
45  const BinningPointByMap& _point) const {
46  BinningPointByMap point = _point;
47  // first, let's see if it is available at all
49  return false;
50  // now look whther the binning point contains all the info
51  std::vector<BinningVariables::BinningVariablesType> t = myBinning();
52  for (std::vector<BinningVariables::BinningVariablesType>::const_iterator it = t.begin(); it != t.end(); ++it) {
53  if (!point.isKeyAvailable(*it))
54  return false;
55  }
56  // then, look if there is a matching row
57  for (int i = 0; i < pl.nRows(); i++) {
59  if (matches(point, row)) {
60  return true;
61  }
62  }
63  return false;
64 }
65 
mps_fire.i
i
Definition: mps_fire.py:355
PhysicsPerformancePayload::Row
std::vector< float > Row
Definition: PhysicsPerformancePayload.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
pos
Definition: PixelAliasList.h:18
PerformancePayloadFromTable.h
typelookup.h
findQualityFiles.v
v
Definition: findQualityFiles.py:179
PerformancePayloadFromTable
Definition: PerformancePayloadFromTable.h:15
PerformancePayloadFromTable::matches
bool matches(const BinningPointByMap &, PhysicsPerformancePayload::Row &) const
Definition: PerformancePayloadFromTable.cc:23
PerformancePayloadFromTable::getResult
float getResult(PerformanceResult::ResultType, const BinningPointByMap &) const override
Definition: PerformancePayloadFromTable.cc:7
PerformancePayloadFromTable::pl
PhysicsPerformancePayload pl
Definition: PerformancePayloadFromTable.h:70
PerformancePayloadFromTable::myBinning
virtual std::vector< BinningVariables::BinningVariablesType > myBinning() const
Definition: PerformancePayloadFromTable.h:43
OrderedSet.t
t
Definition: OrderedSet.py:90
PerformanceResult::ResultType
ResultType
Definition: PerformanceResult.h:8
PhysicsPerformancePayload::nRows
int nRows() const
Definition: PhysicsPerformancePayload.cc:5
PerformancePayloadFromTable::minPos
virtual int minPos(const BinningVariables::BinningVariablesType b) const
Definition: PerformancePayloadFromTable.h:45
res
Definition: Electron.h:6
TYPELOOKUP_DATA_REG
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:102
alignCSCRings.r
r
Definition: alignCSCRings.py:93
BinningPointByMap
Definition: BinningPointByMap.h:8
PhysicsPerformancePayload::getRow
Row getRow(int n) const
Definition: PhysicsPerformancePayload.cc:7
PerformancePayloadFromTable::resultPos
virtual int resultPos(PerformanceResult::ResultType r) const
Definition: PerformancePayloadFromTable.h:59
PerformancePayload::InvalidResult
static const float InvalidResult
Definition: PerformancePayload.h:18
PerformancePayloadFromTable::isInPayload
bool isInPayload(PerformanceResult::ResultType, const BinningPointByMap &) const override
Definition: PerformancePayloadFromTable.cc:44
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
PerformancePayloadFromTable::maxPos
virtual int maxPos(const BinningVariables::BinningVariablesType b) const
Definition: PerformancePayloadFromTable.h:52
PerformancePayloadFromTable::InvalidPos
static const int InvalidPos
Definition: PerformancePayloadFromTable.h:18