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 
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  // first, let's see if it is available at all
47  if (resultPos(res) == PerformancePayloadFromTable::InvalidPos) return false;
48  // now look whther the binning point contains all the info
49  std::vector<BinningVariables::BinningVariablesType> t = myBinning();
50  for (std::vector<BinningVariables::BinningVariablesType>::const_iterator it = t.begin(); it != t.end();++it){
51  if (! point.isKeyAvailable(*it) ) return false;
52  }
53  // then, look if there is a matching row
54  for (int i=0; i< pl.nRows(); i++){
56  if (matches(point,row)){
57  return true;
58  }
59  }
60  return false;
61 }
62 
int i
Definition: DBlmapReader.cc:9
float getResult(PerformanceResult::ResultType, 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)
virtual bool isInPayload(PerformanceResult::ResultType, BinningPointByMap) const
static const float InvalidResult
float value(BinningVariables::BinningVariablesType)
#define TYPELOOKUP_DATA_REG(_dataclass_)
Definition: typelookup.h:97
virtual std::vector< BinningVariables::BinningVariablesType > myBinning() const
bool matches(BinningPointByMap, PhysicsPerformancePayload::Row &) 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