CMS 3D CMS Logo

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 <memory>
13 #include <iostream>
14 #include "TFormula.h"
16 
18  // class PerformancePayloadFromTFormula : public PerformancePayload, public PhysicsPerformancePayload {
19 public:
20  static const int InvalidPos;
21 
22  PerformancePayloadFromTFormula(const std::vector<PerformanceResult::ResultType>& r,
23  const std::vector<BinningVariables::BinningVariablesType>& b,
25  : pl(in), results_(r), variables_(b) {
26  initialize();
27  }
28 
30 
31  void initialize() override;
32 
35 
37 
39  const BinningPointByMap&) const override; // gets from the full payload
40 
43  }
44 
45  bool isInPayload(PerformanceResult::ResultType, const BinningPointByMap&) const override;
46 
47  const PhysicsTFormulaPayload& formulaPayload() const { return pl; }
48 
50 
51 protected:
52  virtual std::vector<BinningVariables::BinningVariablesType> myBinning() const { return variables_; }
53 
55  std::vector<BinningVariables::BinningVariablesType>::const_iterator p;
56  p = find(variables_.begin(), variables_.end(), b);
57  if (p == variables_.end())
59  return ((p - variables_.begin()));
60  }
61 
63  std::vector<PerformanceResult::ResultType>::const_iterator p;
64  p = find(results_.begin(), results_.end(), r);
65  if (p == results_.end())
67  return ((p - results_.begin()));
68  }
69 
70  bool isOk(const BinningPointByMap& p) const;
71 
73  //
74  // the variable mapping
75  //
76  std::vector<PerformanceResult::ResultType> results_;
77  std::vector<BinningVariables::BinningVariablesType> variables_;
78  //
79  // the transient part
80  //
81  std::vector<std::shared_ptr<const TFormula> > compiledFormulas_ COND_TRANSIENT;
82 
84 };
85 
86 #endif
PerformancePayloadFromTFormula(const PerformancePayloadFromTFormula &b)
std::vector< BinningVariables::BinningVariablesType > variables_
virtual int resultPos(PerformanceResult::ResultType r) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
Definition: Electron.h:6
void printFormula(PerformanceResult::ResultType res) const
std::vector< std::shared_ptr< const TFormula > > compiledFormulas_
virtual int limitPos(const BinningVariables::BinningVariablesType b) const
virtual std::vector< BinningVariables::BinningVariablesType > myBinning() const
const PhysicsTFormulaPayload & formulaPayload() const
#define COND_TRANSIENT
Definition: Serializable.h:63
bool isInPayload(PerformanceResult::ResultType, const BinningPointByMap &) const override
double b
Definition: hdecay.h:120
#define COND_SERIALIZABLE
Definition: Serializable.h:39
virtual bool isParametrizedInVariable(const BinningVariables::BinningVariablesType p) const
float getResult(PerformanceResult::ResultType, const BinningPointByMap &) const override
PerformancePayloadFromTFormula(const std::vector< PerformanceResult::ResultType > &r, const std::vector< BinningVariables::BinningVariablesType > &b, PhysicsTFormulaPayload &in)
std::vector< PerformanceResult::ResultType > results_
bool isOk(const BinningPointByMap &p) const