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
PerformancePayloadFromBinnedTFormula::formulaPayloads
const std::vector< PhysicsTFormulaPayload > & formulaPayloads() const
Definition: PerformancePayloadFromBinnedTFormula.h:43
PhysicsTFormulaPayload.h
PerformancePayloadFromBinnedTFormula::isParametrizedInVariable
virtual bool isParametrizedInVariable(const BinningVariables::BinningVariablesType p) const
Definition: PerformancePayloadFromBinnedTFormula.h:37
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
PerformancePayloadFromBinnedTFormula::~PerformancePayloadFromBinnedTFormula
~PerformancePayloadFromBinnedTFormula() override
Definition: PerformancePayloadFromBinnedTFormula.h:32
PerformancePayload.h
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
COND_TRANSIENT
#define COND_TRANSIENT
Definition: Serializable.h:63
PerformancePayloadFromBinnedTFormula::results_
std::vector< PerformanceResult::ResultType > results_
Definition: PerformancePayloadFromBinnedTFormula.h:77
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
PerformancePayloadFromBinnedTFormula::compiledFormulas_
std::vector< std::vector< std::shared_ptr< TFormula > > > compiledFormulas_
Definition: PerformancePayloadFromBinnedTFormula.h:85
BinningPointByMap.h
PerformancePayload
Definition: PerformancePayload.h:14
b
double b
Definition: hdecay.h:118
PerformanceResult::ResultType
ResultType
Definition: PerformanceResult.h:8
PerformancePayloadFromBinnedTFormula::InvalidPos
static const int InvalidPos
Definition: PerformancePayloadFromBinnedTFormula.h:20
PerformancePayloadFromBinnedTFormula::variables_
std::vector< BinningVariables::BinningVariablesType > variables_
Definition: PerformancePayloadFromBinnedTFormula.h:78
recoMuon::in
Definition: RecoMuonEnumerators.h:6
PerformancePayloadFromBinnedTFormula::printFormula
void printFormula(PerformanceResult::ResultType res, const BinningPointByMap &) const
Definition: PerformancePayloadFromBinnedTFormula.cc:116
Serializable.h
PerformancePayloadFromBinnedTFormula::initialize
void initialize() override
Definition: PerformancePayloadFromBinnedTFormula.cc:11
PerformancePayloadFromBinnedTFormula::limitPos
virtual int limitPos(const BinningVariables::BinningVariablesType b) const
Definition: PerformancePayloadFromBinnedTFormula.h:50
res
Definition: Electron.h:6
PerformancePayloadFromBinnedTFormula::PerformancePayloadFromBinnedTFormula
PerformancePayloadFromBinnedTFormula(const std::vector< PerformanceResult::ResultType > &r, const std::vector< BinningVariables::BinningVariablesType > &b, const std::vector< PhysicsTFormulaPayload > &in)
Definition: PerformancePayloadFromBinnedTFormula.h:22
PerformancePayloadFromBinnedTFormula
Definition: PerformancePayloadFromBinnedTFormula.h:17
PerformancePayloadFromBinnedTFormula::resultPos
virtual int resultPos(PerformanceResult::ResultType r) const
Definition: PerformancePayloadFromBinnedTFormula.h:58
alignCSCRings.r
r
Definition: alignCSCRings.py:93
BinningPointByMap
Definition: BinningPointByMap.h:8
PerformancePayloadFromBinnedTFormula::pls
std::vector< PhysicsTFormulaPayload > pls
Definition: PerformancePayloadFromBinnedTFormula.h:73
PerformancePayloadFromBinnedTFormula::isOk
bool isOk(const BinningPointByMap &p, unsigned int &) const
Definition: PerformancePayloadFromBinnedTFormula.cc:76
PerformancePayloadFromBinnedTFormula::myBinning
virtual std::vector< BinningVariables::BinningVariablesType > myBinning() const
Definition: PerformancePayloadFromBinnedTFormula.h:48
PerformancePayloadFromBinnedTFormula::getFormula
const std::shared_ptr< TFormula > & getFormula(PerformanceResult::ResultType, const BinningPointByMap &) const
Definition: PerformancePayloadFromBinnedTFormula.cc:25
PerformancePayloadFromBinnedTFormula::getResult
float getResult(PerformanceResult::ResultType, const BinningPointByMap &) const override
Definition: PerformancePayloadFromBinnedTFormula.cc:42
PerformancePayloadFromBinnedTFormula::PerformancePayloadFromBinnedTFormula
PerformancePayloadFromBinnedTFormula()
Definition: PerformancePayloadFromBinnedTFormula.h:31
BinningVariables::BinningVariablesType
BinningVariablesType
Definition: BinningVariables.h:10
PerformancePayloadFromBinnedTFormula::isInPayload
bool isInPayload(PerformanceResult::ResultType, const BinningPointByMap &) const override
Definition: PerformancePayloadFromBinnedTFormula.cc:105