CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
19  static const int InvalidPos;
20 
21  //PerformancePayloadFromTable(int stride_, std::string columns_,std::vector<float> table) : PerformancePayload(stride_, columns_, table) {}
22 
23  PerformancePayloadFromTable(const std::vector<PerformanceResult::ResultType>& r, const std::vector<BinningVariables::BinningVariablesType>& b , int stride_,const std::vector<float>& table) :
24  pl(stride_, table),
25  results_(r), binning_(b) {}
26 
29 
30  float getResult(PerformanceResult::ResultType,const BinningPointByMap&) const ; // gets from the full payload
31 
34  }
35 
37 
38 const PhysicsPerformancePayload & payLoad() const {return pl;}
39 
40  protected:
41 
42  virtual std::vector<BinningVariables::BinningVariablesType> myBinning() const {return binning_;}
43 
44  virtual int minPos(const BinningVariables::BinningVariablesType b) const {
45  std::vector<BinningVariables::BinningVariablesType>::const_iterator p;
46  p = find(binning_.begin(), binning_.end(), b);
48  return ((p-binning_.begin())*2);
49  }
50  virtual int maxPos(const BinningVariables::BinningVariablesType b) const {
51  std::vector<BinningVariables::BinningVariablesType>::const_iterator p;
52  p = find(binning_.begin(), binning_.end(), b);
54  return ((p-binning_.begin())*2+1);
55 
56  }
58  // result should be: # of binning variables *2 + position of result
59  std::vector<PerformanceResult::ResultType>::const_iterator p;
60  p = find (results_.begin(), results_.end(), r);
61  if ( p == results_.end()) return PerformancePayloadFromTable::InvalidPos;
62  return (binning_.size()*2+(p-results_.begin()));
63 
64  }
65 
67 
69 
70  std::vector<PerformanceResult::ResultType> results_;
71  std::vector<BinningVariables::BinningVariablesType> binning_;
72 
73 
75 };
76 
77 #endif
78 
float getResult(PerformanceResult::ResultType, const BinningPointByMap &) const
virtual int maxPos(const BinningVariables::BinningVariablesType b) const
const PhysicsPerformancePayload & payLoad() const
virtual int resultPos(PerformanceResult::ResultType r) const
virtual int minPos(const BinningVariables::BinningVariablesType b) const
virtual bool isParametrizedInVariable(const BinningVariables::BinningVariablesType p) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< BinningVariables::BinningVariablesType > binning_
std::vector< PerformanceResult::ResultType > results_
double b
Definition: hdecay.h:120
virtual std::vector< BinningVariables::BinningVariablesType > myBinning() const
#define COND_SERIALIZABLE
Definition: Serializable.h:37
PerformancePayloadFromTable(const std::vector< PerformanceResult::ResultType > &r, const std::vector< BinningVariables::BinningVariablesType > &b, int stride_, const std::vector< float > &table)
virtual bool isInPayload(PerformanceResult::ResultType, const BinningPointByMap &) const
bool matches(const BinningPointByMap &, PhysicsPerformancePayload::Row &) const