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
Definition: PerformancePayloadFromTFormula.h:17
PhysicsTFormulaPayload.h
PerformancePayloadFromTFormula::resultPos
virtual int resultPos(PerformanceResult::ResultType r) const
Definition: PerformancePayloadFromTFormula.h:62
PerformancePayload.h
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
PerformancePayloadFromTFormula::initialize
void initialize() override
Definition: PerformancePayloadFromTFormula.cc:10
COND_TRANSIENT
#define COND_TRANSIENT
Definition: Serializable.h:63
PhysicsTFormulaPayload
Definition: PhysicsTFormulaPayload.h:9
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
PerformancePayloadFromTFormula::PerformancePayloadFromTFormula
PerformancePayloadFromTFormula()
Definition: PerformancePayloadFromTFormula.h:29
PerformancePayloadFromTFormula::PerformancePayloadFromTFormula
PerformancePayloadFromTFormula(const PerformancePayloadFromTFormula &b)
Definition: PerformancePayloadFromTFormula.h:33
BinningPointByMap.h
PerformancePayloadFromTFormula::isInPayload
bool isInPayload(PerformanceResult::ResultType, const BinningPointByMap &) const override
Definition: PerformancePayloadFromTFormula.cc:64
PerformancePayload
Definition: PerformancePayload.h:14
b
double b
Definition: hdecay.h:118
PerformanceResult::ResultType
ResultType
Definition: PerformanceResult.h:8
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
PerformancePayloadFromTFormula::getResult
float getResult(PerformanceResult::ResultType, const BinningPointByMap &) const override
Definition: PerformancePayloadFromTFormula.cc:21
PerformancePayloadFromTFormula::printFormula
void printFormula(PerformanceResult::ResultType res) const
Definition: PerformancePayloadFromTFormula.cc:75
recoMuon::in
Definition: RecoMuonEnumerators.h:6
Serializable.h
PerformancePayloadFromTFormula::compiledFormulas_
std::vector< std::shared_ptr< const TFormula > > compiledFormulas_
Definition: PerformancePayloadFromTFormula.h:81
res
Definition: Electron.h:6
alignCSCRings.r
r
Definition: alignCSCRings.py:93
BinningPointByMap
Definition: BinningPointByMap.h:8
PerformancePayloadFromTFormula::myBinning
virtual std::vector< BinningVariables::BinningVariablesType > myBinning() const
Definition: PerformancePayloadFromTFormula.h:52
PerformancePayloadFromTFormula::~PerformancePayloadFromTFormula
~PerformancePayloadFromTFormula() override
Definition: PerformancePayloadFromTFormula.h:36
PerformancePayloadFromTFormula::PerformancePayloadFromTFormula
PerformancePayloadFromTFormula(const std::vector< PerformanceResult::ResultType > &r, const std::vector< BinningVariables::BinningVariablesType > &b, PhysicsTFormulaPayload &in)
Definition: PerformancePayloadFromTFormula.h:22
PerformancePayloadFromTFormula::results_
std::vector< PerformanceResult::ResultType > results_
Definition: PerformancePayloadFromTFormula.h:76
PerformancePayloadFromTFormula::formulaPayload
const PhysicsTFormulaPayload & formulaPayload() const
Definition: PerformancePayloadFromTFormula.h:47
PerformancePayloadFromTFormula::limitPos
virtual int limitPos(const BinningVariables::BinningVariablesType b) const
Definition: PerformancePayloadFromTFormula.h:54
PerformancePayloadFromTFormula::isOk
bool isOk(const BinningPointByMap &p) const
Definition: PerformancePayloadFromTFormula.cc:48
PerformancePayloadFromTFormula::variables_
std::vector< BinningVariables::BinningVariablesType > variables_
Definition: PerformancePayloadFromTFormula.h:77
PerformancePayloadFromTFormula::isParametrizedInVariable
virtual bool isParametrizedInVariable(const BinningVariables::BinningVariablesType p) const
Definition: PerformancePayloadFromTFormula.h:41
BinningVariables::BinningVariablesType
BinningVariablesType
Definition: BinningVariables.h:10
PerformancePayloadFromTFormula::pl
PhysicsTFormulaPayload pl
Definition: PerformancePayloadFromTFormula.h:72
PerformancePayloadFromTFormula::InvalidPos
static const int InvalidPos
Definition: PerformancePayloadFromTFormula.h:20