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 
5 
8 
9 #include <algorithm>
10 #include <string>
11 #include <vector>
12 #include <boost/shared_ptr.hpp>
13 #include <iostream>
14 #include "TFormula.h"
16 
18 // class PerformancePayloadFromTFormula : public PerformancePayload, public PhysicsPerformancePayload {
19  public:
20 
21  static const int InvalidPos;
22 
23  PerformancePayloadFromTFormula(const std::vector<PerformanceResult::ResultType>& r,
24  const std::vector<BinningVariables::BinningVariablesType>& b ,
26  initialize();
27  }
28 
30 
31  void initialize();
32 
34  pl(b.pl),
35  results_(b.results_),
37  compiledFormulas_(b.compiledFormulas_) {}
38 
40  compiledFormulas_.clear();
41  }
42 
43 
44 
45  float getResult(PerformanceResult::ResultType,const BinningPointByMap&) const ; // gets from the full payload
46 
49  }
50 
52 
53  const PhysicsTFormulaPayload & formulaPayload() const {return pl;}
54 
56 
57 
58  protected:
59 
60  virtual std::vector<BinningVariables::BinningVariablesType> myBinning() const {return variables_;}
61 
63  std::vector<BinningVariables::BinningVariablesType>::const_iterator p;
64  p = find(variables_.begin(), variables_.end(), b);
66  return ((p-variables_.begin()));
67 
68  }
69 
71  std::vector<PerformanceResult::ResultType>::const_iterator p;
72  p = find (results_.begin(), results_.end(), r);
74  return ((p-results_.begin()));
75  }
76 
77 
78  bool isOk(const BinningPointByMap& p) const;
79 
81  //
82  // the variable mapping
83  //
84  std::vector<PerformanceResult::ResultType> results_;
85  std::vector<BinningVariables::BinningVariablesType> variables_;
86  //
87  // the transient part
88  //
89  mutable std::vector< boost::shared_ptr<TFormula> > compiledFormulas_ COND_TRANSIENT;
90 
92 };
93 
94 #endif
PerformancePayloadFromTFormula(const PerformancePayloadFromTFormula &b)
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
std::vector< boost::shared_ptr< TFormula > > compiledFormulas_ COND_TRANSIENT
virtual int limitPos(const BinningVariables::BinningVariablesType b) const
virtual bool isParametrizedInVariable(const BinningVariables::BinningVariablesType p) const
virtual bool isInPayload(PerformanceResult::ResultType, const BinningPointByMap &) const
float getResult(PerformanceResult::ResultType, const BinningPointByMap &) const
double b
Definition: hdecay.h:120
bool isOk(const BinningPointByMap &p) const
const PhysicsTFormulaPayload & formulaPayload() const
PerformancePayloadFromTFormula(const std::vector< PerformanceResult::ResultType > &r, const std::vector< BinningVariables::BinningVariablesType > &b, PhysicsTFormulaPayload &in)
void printFormula(PerformanceResult::ResultType res) const
std::vector< PerformanceResult::ResultType > results_
virtual int resultPos(PerformanceResult::ResultType r) const