CMS 3D CMS Logo

PerformancePayloadFromTable.h
Go to the documentation of this file.
1 #ifndef PerformancePayloadFromTable_h
2 #define PerformancePayloadFromTable_h
3 
5 
8 
9 #include <algorithm>
10 #include <string>
11 #include <vector>
12 
14 
16  // class PerformancePayloadFromTable : public PerformancePayload, public PhysicsPerformancePayload {
17 public:
18  static const int InvalidPos;
19 
20  //PerformancePayloadFromTable(int stride_, std::string columns_,std::vector<float> table) : PerformancePayload(stride_, columns_, table) {}
21 
22  PerformancePayloadFromTable(const std::vector<PerformanceResult::ResultType>& r,
23  const std::vector<BinningVariables::BinningVariablesType>& b,
24  int stride_,
25  const std::vector<float>& table)
26  : pl(stride_, table), results_(r), binning_(b) {}
27 
30 
32  const BinningPointByMap&) const override; // gets from the full payload
33 
36  }
37 
38  bool isInPayload(PerformanceResult::ResultType, const BinningPointByMap&) const override;
39 
40  const PhysicsPerformancePayload& payLoad() const { return pl; }
41 
42 protected:
43  virtual std::vector<BinningVariables::BinningVariablesType> myBinning() const { return binning_; }
44 
45  virtual int minPos(const BinningVariables::BinningVariablesType b) const {
46  std::vector<BinningVariables::BinningVariablesType>::const_iterator p;
47  p = find(binning_.begin(), binning_.end(), b);
48  if (p == binning_.end())
50  return ((p - binning_.begin()) * 2);
51  }
52  virtual int maxPos(const BinningVariables::BinningVariablesType b) const {
53  std::vector<BinningVariables::BinningVariablesType>::const_iterator p;
54  p = find(binning_.begin(), binning_.end(), b);
55  if (p == binning_.end())
57  return ((p - binning_.begin()) * 2 + 1);
58  }
60  // result should be: # of binning variables *2 + position of result
61  std::vector<PerformanceResult::ResultType>::const_iterator p;
62  p = find(results_.begin(), results_.end(), r);
63  if (p == results_.end())
65  return (binning_.size() * 2 + (p - results_.begin()));
66  }
67 
69 
71 
72  std::vector<PerformanceResult::ResultType> results_;
73  std::vector<BinningVariables::BinningVariablesType> binning_;
74 
76 };
77 
78 #endif
PerformancePayloadFromTable::results_
std::vector< PerformanceResult::ResultType > results_
Definition: PerformancePayloadFromTable.h:72
PhysicsPerformancePayload::Row
std::vector< float > Row
Definition: PhysicsPerformancePayload.h:19
PerformancePayloadFromTable::~PerformancePayloadFromTable
~PerformancePayloadFromTable() override
Definition: PerformancePayloadFromTable.h:29
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
PerformancePayload.h
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
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::isParametrizedInVariable
virtual bool isParametrizedInVariable(const BinningVariables::BinningVariablesType p) const
Definition: PerformancePayloadFromTable.h:34
BinningPointByMap.h
PerformancePayloadFromTable::pl
PhysicsPerformancePayload pl
Definition: PerformancePayloadFromTable.h:70
PhysicsPerformancePayload
Definition: PhysicsPerformancePayload.h:13
PerformancePayloadFromTable::myBinning
virtual std::vector< BinningVariables::BinningVariablesType > myBinning() const
Definition: PerformancePayloadFromTable.h:43
PerformancePayload
Definition: PerformancePayload.h:14
b
double b
Definition: hdecay.h:118
PerformanceResult::ResultType
ResultType
Definition: PerformanceResult.h:8
Serializable.h
PerformancePayloadFromTable::minPos
virtual int minPos(const BinningVariables::BinningVariablesType b) const
Definition: PerformancePayloadFromTable.h:45
PerformancePayloadFromTable::PerformancePayloadFromTable
PerformancePayloadFromTable(const std::vector< PerformanceResult::ResultType > &r, const std::vector< BinningVariables::BinningVariablesType > &b, int stride_, const std::vector< float > &table)
Definition: PerformancePayloadFromTable.h:22
alignCSCRings.r
r
Definition: alignCSCRings.py:93
BinningPointByMap
Definition: BinningPointByMap.h:8
PerformancePayloadFromTable::PerformancePayloadFromTable
PerformancePayloadFromTable()
Definition: PerformancePayloadFromTable.h:28
PhysicsPerformancePayload.h
PerformancePayloadFromTable::binning_
std::vector< BinningVariables::BinningVariablesType > binning_
Definition: PerformancePayloadFromTable.h:73
PerformancePayloadFromTable::resultPos
virtual int resultPos(PerformanceResult::ResultType r) const
Definition: PerformancePayloadFromTable.h:59
PerformancePayloadFromTable::isInPayload
bool isInPayload(PerformanceResult::ResultType, const BinningPointByMap &) const override
Definition: PerformancePayloadFromTable.cc:44
PerformancePayloadFromTable::payLoad
const PhysicsPerformancePayload & payLoad() const
Definition: PerformancePayloadFromTable.h:40
TableParser.table
table
Definition: TableParser.py:111
PerformancePayloadFromTable::maxPos
virtual int maxPos(const BinningVariables::BinningVariablesType b) const
Definition: PerformancePayloadFromTable.h:52
PerformancePayloadFromTable::InvalidPos
static const int InvalidPos
Definition: PerformancePayloadFromTable.h:18
BinningVariables::BinningVariablesType
BinningVariablesType
Definition: BinningVariables.h:10