CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PerformancePayloadFromBinnedTFormula.h
Go to the documentation of this file.
1 #ifndef PerformancePayloadFromBinnedTFormula_h
2 #define PerformancePayloadFromBinnedTFormula_h
3 
6 
7 #include <algorithm>
8 #include <string>
9 #include <vector>
10 #include "TFormula.h"
11 
13 
15 // class PerformancePayloadFromBinnedTFormula : public PerformancePayload, public PhysicsPerformancePayload {
16  public:
17 
18  static int InvalidPos;
19 
20  PerformancePayloadFromBinnedTFormula(std::vector<PerformanceResult::ResultType> r, std::vector<BinningVariables::BinningVariablesType> b , std::vector<PhysicsTFormulaPayload> in) : pls(in), results_(r), variables_(b) {}
21 
24  compiledFormulas_.clear();
25  }
26 
27  float getResult(PerformanceResult::ResultType,BinningPointByMap) const ; // gets from the full payload
28 
31  }
32 
34 
35  const std::vector<PhysicsTFormulaPayload> & formulaPayloads() const {return pls;}
36 
38 
39 
40  protected:
41 
42  virtual std::vector<BinningVariables::BinningVariablesType> myBinning() const {return variables_;}
43 
45  std::vector<BinningVariables::BinningVariablesType>::const_iterator p;
46  p = find(variables_.begin(), variables_.end(), b);
48  return ((p-variables_.begin()));
49 
50  }
51 
53  std::vector<PerformanceResult::ResultType>::const_iterator p;
54  p = find (results_.begin(), results_.end(), r);
56  return ((p-results_.begin()));
57  }
58 
59 
60  bool isOk(BinningPointByMap p, unsigned int & ) const;
61 
63 
64  void check() const;
65  //
66  // now this is a vector, since we can have different rectangular regions in the same object
67  //
68  std::vector<PhysicsTFormulaPayload> pls;
69  //
70  // the variable mapping
71  //
72  std::vector<PerformanceResult::ResultType> results_;
73  std::vector<BinningVariables::BinningVariablesType> variables_;
74 
75  //
76  // the transient part; now a vector of vector; CHANGE CHECK!!!!!
77  //
78  mutable std::vector<std::vector<TFormula *> > compiledFormulas_;
79 };
80 
81 #endif
82 
float getResult(PerformanceResult::ResultType, BinningPointByMap) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
virtual int resultPos(PerformanceResult::ResultType r) const
const std::vector< PhysicsTFormulaPayload > & formulaPayloads() const
void printFormula(PerformanceResult::ResultType res, BinningPointByMap) const
TFormula * getFormula(PerformanceResult::ResultType, BinningPointByMap) const
virtual bool isParametrizedInVariable(const BinningVariables::BinningVariablesType p) const
std::vector< PerformanceResult::ResultType > results_
virtual std::vector< BinningVariables::BinningVariablesType > myBinning() const
std::vector< BinningVariables::BinningVariablesType > variables_
std::vector< std::vector< TFormula * > > compiledFormulas_
bool isOk(BinningPointByMap p, unsigned int &) const
double b
Definition: hdecay.h:120
PerformancePayloadFromBinnedTFormula(std::vector< PerformanceResult::ResultType > r, std::vector< BinningVariables::BinningVariablesType > b, std::vector< PhysicsTFormulaPayload > in)
virtual int limitPos(const BinningVariables::BinningVariablesType b) const
virtual bool isInPayload(PerformanceResult::ResultType, BinningPointByMap) const