CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PerformancePayloadFromTFormula.h
Go to the documentation of this file.
1 #ifndef PerformancePayloadFromTFormula_h
2 #define PerformancePayloadFromTFormula_h
3 
6 
7 #include <algorithm>
8 #include <string>
9 #include <vector>
10 #include "TFormula.h"
11 
13 
15 // class PerformancePayloadFromTFormula : public PerformancePayload, public PhysicsPerformancePayload {
16  public:
17 
18  static int InvalidPos;
19 
20  PerformancePayloadFromTFormula(std::vector<PerformanceResult::ResultType> r, std::vector<BinningVariables::BinningVariablesType> b , PhysicsTFormulaPayload& in) : pl(in), results_(r), variables_(b) {}
21 
24  for (unsigned int i=0; i< compiledFormulas_.size(); ++i){
25  delete compiledFormulas_[i];
26  }
27  compiledFormulas_.clear();
28  }
29 
30  float getResult(PerformanceResult::ResultType,BinningPointByMap) const ; // gets from the full payload
31 
34  }
35 
37 
38  const PhysicsTFormulaPayload & formulaPayload() const {return pl;}
39 
41 
42 
43  protected:
44 
45  virtual std::vector<BinningVariables::BinningVariablesType> myBinning() const {return variables_;}
46 
48  std::vector<BinningVariables::BinningVariablesType>::const_iterator p;
49  p = find(variables_.begin(), variables_.end(), b);
51  return ((p-variables_.begin()));
52 
53  }
54 
56  std::vector<PerformanceResult::ResultType>::const_iterator p;
57  p = find (results_.begin(), results_.end(), r);
59  return ((p-results_.begin()));
60  }
61 
62 
63  bool isOk(BinningPointByMap p) const;
64 
65  void check() const;
66 
68  //
69  // the variable mapping
70  //
71  std::vector<PerformanceResult::ResultType> results_;
72  std::vector<BinningVariables::BinningVariablesType> variables_;
73  //
74  // the transient part
75  //
76  mutable std::vector<TFormula *> compiledFormulas_;
77 };
78 
79 #endif
bool isOk(BinningPointByMap p) const
float getResult(PerformanceResult::ResultType, BinningPointByMap) const
int i
Definition: DBlmapReader.cc:9
std::vector< BinningVariables::BinningVariablesType > variables_
virtual std::vector< BinningVariables::BinningVariablesType > myBinning() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
virtual int limitPos(const BinningVariables::BinningVariablesType b) const
virtual bool isParametrizedInVariable(const BinningVariables::BinningVariablesType p) const
PerformancePayloadFromTFormula(std::vector< PerformanceResult::ResultType > r, std::vector< BinningVariables::BinningVariablesType > b, PhysicsTFormulaPayload &in)
double b
Definition: hdecay.h:120
const PhysicsTFormulaPayload & formulaPayload() const
virtual bool isInPayload(PerformanceResult::ResultType, BinningPointByMap) const
void printFormula(PerformanceResult::ResultType res) const
std::vector< PerformanceResult::ResultType > results_
virtual int resultPos(PerformanceResult::ResultType r) const