CMS 3D CMS Logo

PerformancePayloadFromBinnedTFormula.h
Go to the documentation of this file.
1 #ifndef PerformancePayloadFromBinnedTFormula_h
2 #define PerformancePayloadFromBinnedTFormula_h
3 
5 
8 
9 #include <algorithm>
10 #include <string>
11 #include <vector>
12 
13 #include "TFormula.h"
14 
16 
18  // class PerformancePayloadFromBinnedTFormula : public PerformancePayload, public PhysicsPerformancePayload {
19 public:
20  static const int InvalidPos;
21 
22  PerformancePayloadFromBinnedTFormula(const std::vector<PerformanceResult::ResultType>& r,
23  const std::vector<BinningVariables::BinningVariablesType>& b,
24  const std::vector<PhysicsTFormulaPayload>& in)
25  : pls(in), results_(r), variables_(b) {
26  initialize();
27  }
28 
29  void initialize() override;
30 
33 
35  const BinningPointByMap&) const override; // gets from the full payload
36 
39  }
40 
41  bool isInPayload(PerformanceResult::ResultType, const BinningPointByMap&) const override;
42 
43  const std::vector<PhysicsTFormulaPayload>& formulaPayloads() const { return pls; }
44 
46 
47 protected:
48  virtual std::vector<BinningVariables::BinningVariablesType> myBinning() const { return variables_; }
49 
51  std::vector<BinningVariables::BinningVariablesType>::const_iterator p;
52  p = find(variables_.begin(), variables_.end(), b);
53  if (p == variables_.end())
55  return ((p - variables_.begin()));
56  }
57 
59  std::vector<PerformanceResult::ResultType>::const_iterator p;
60  p = find(results_.begin(), results_.end(), r);
61  if (p == results_.end())
63  return ((p - results_.begin()));
64  }
65 
66  bool isOk(const BinningPointByMap& p, unsigned int&) const;
67 
68  const std::shared_ptr<TFormula>& getFormula(PerformanceResult::ResultType, const BinningPointByMap&) const;
69 
70  //
71  // now this is a vector, since we can have different rectangular regions in the same object
72  //
73  std::vector<PhysicsTFormulaPayload> pls;
74  //
75  // the variable mapping
76  //
77  std::vector<PerformanceResult::ResultType> results_;
78  std::vector<BinningVariables::BinningVariablesType> variables_;
79 
80  //
81  // the transient part; now a vector of vector; CHANGE CHECK!!!!!
82  //
83 
84  // the compiled functions
85  std::vector<std::vector<std::shared_ptr<TFormula> > > compiledFormulas_ COND_TRANSIENT;
86  ;
87 
89 };
90 
91 #endif
bool isOk(const BinningPointByMap &p, unsigned int &) const
float getResult(PerformanceResult::ResultType, const BinningPointByMap &) const override
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
virtual int resultPos(PerformanceResult::ResultType r) const
Definition: Electron.h:6
const std::vector< PhysicsTFormulaPayload > & formulaPayloads() const
virtual bool isParametrizedInVariable(const BinningVariables::BinningVariablesType p) const
std::vector< PerformanceResult::ResultType > results_
virtual std::vector< BinningVariables::BinningVariablesType > myBinning() const
void printFormula(PerformanceResult::ResultType res, const BinningPointByMap &) const
std::vector< BinningVariables::BinningVariablesType > variables_
#define COND_TRANSIENT
Definition: Serializable.h:62
double b
Definition: hdecay.h:118
#define COND_SERIALIZABLE
Definition: Serializable.h:38
const std::shared_ptr< TFormula > & getFormula(PerformanceResult::ResultType, const BinningPointByMap &) const
std::vector< std::vector< std::shared_ptr< TFormula > > > compiledFormulas_
virtual int limitPos(const BinningVariables::BinningVariablesType b) const
PerformancePayloadFromBinnedTFormula(const std::vector< PerformanceResult::ResultType > &r, const std::vector< BinningVariables::BinningVariablesType > &b, const std::vector< PhysicsTFormulaPayload > &in)
bool isInPayload(PerformanceResult::ResultType, const BinningPointByMap &) const override