CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PerformancePayloadFromTable.cc
Go to the documentation of this file.
2 
4 
5 #include <iostream>
6 
7 
9 
11 
12  // loop on the table rows and search for a match
13  for (int i=0; i< pl.nRows(); i++){
15 
16  if (matches(p,row)){
17  int pos = resultPos(r);
18  return row[pos];
19  }
20  }
22 }
23 
25  //
26  // this is the smart function which does not take into account the fields not present
27  //
28 
29  // I can do it via a loop!
30  BinningPointByMap p = _p;
31  std::vector<BinningVariables::BinningVariablesType> t = myBinning();
32 
33 
34  for (std::vector<BinningVariables::BinningVariablesType>::const_iterator it = t.begin(); it != t.end();++it){
35  //
36  // first the binning point map must contain ALL the quantities here
37  //
38  // if (! p.isKeyAvailable(*it) ) return false;
39  float v = p.value(*it);
40  if (!(v >= row[minPos(*it)] && v < row[maxPos(*it)])) return false;
41  }
42  return true;
43 }
44 
46  BinningPointByMap point = _point;
47  // first, let's see if it is available at all
48  if (resultPos(res) == PerformancePayloadFromTable::InvalidPos) return false;
49  // now look whther the binning point contains all the info
50  std::vector<BinningVariables::BinningVariablesType> t = myBinning();
51  for (std::vector<BinningVariables::BinningVariablesType>::const_iterator it = t.begin(); it != t.end();++it){
52  if (! point.isKeyAvailable(*it) ) return false;
53  }
54  // then, look if there is a matching row
55  for (int i=0; i< pl.nRows(); i++){
57  if (matches(point,row)){
58  return true;
59  }
60  }
61  return false;
62 }
63 
int i
Definition: DBlmapReader.cc:9
float getResult(PerformanceResult::ResultType, const BinningPointByMap &) const
virtual int maxPos(const BinningVariables::BinningVariablesType b) const
virtual int resultPos(PerformanceResult::ResultType r) const
virtual int minPos(const BinningVariables::BinningVariablesType b) const
bool isKeyAvailable(BinningVariables::BinningVariablesType)
static const float InvalidResult
float value(BinningVariables::BinningVariablesType)
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:96
virtual std::vector< BinningVariables::BinningVariablesType > myBinning() const
virtual bool isInPayload(PerformanceResult::ResultType, const BinningPointByMap &) const
*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
bool matches(const BinningPointByMap &, PhysicsPerformancePayload::Row &) const