CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Friends
PerformancePayloadFromTable Class Reference

#include <PerformancePayloadFromTable.h>

Inheritance diagram for PerformancePayloadFromTable:
PerformancePayload

Public Member Functions

float getResult (PerformanceResult::ResultType, const BinningPointByMap &) const override
 
bool isInPayload (PerformanceResult::ResultType, const BinningPointByMap &) const override
 
virtual bool isParametrizedInVariable (const BinningVariables::BinningVariablesType p) const
 
const PhysicsPerformancePayloadpayLoad () const
 
 PerformancePayloadFromTable ()
 
 PerformancePayloadFromTable (const std::vector< PerformanceResult::ResultType > &r, const std::vector< BinningVariables::BinningVariablesType > &b, int stride_, const std::vector< float > &table)
 
 ~PerformancePayloadFromTable () override
 
- Public Member Functions inherited from PerformancePayload
virtual void initialize ()
 
 PerformancePayload ()
 
virtual ~PerformancePayload ()
 

Static Public Attributes

static const int InvalidPos = -1
 
- Static Public Attributes inherited from PerformancePayload
static const float InvalidResult = -100.
 

Protected Member Functions

bool matches (const BinningPointByMap &, PhysicsPerformancePayload::Row &) const
 
virtual int maxPos (const BinningVariables::BinningVariablesType b) const
 
virtual int minPos (const BinningVariables::BinningVariablesType b) const
 
virtual std::vector< BinningVariables::BinningVariablesTypemyBinning () const
 
virtual int resultPos (PerformanceResult::ResultType r) const
 

Protected Attributes

std::vector< BinningVariables::BinningVariablesTypebinning_
 
PhysicsPerformancePayload pl
 
std::vector< PerformanceResult::ResultTyperesults_
 

Private Member Functions

template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Friends

class boost::serialization::access
 
template<typename CondSerializationT , typename Enabled >
struct cond::serialization::access
 

Detailed Description

Definition at line 15 of file PerformancePayloadFromTable.h.

Constructor & Destructor Documentation

◆ PerformancePayloadFromTable() [1/2]

PerformancePayloadFromTable::PerformancePayloadFromTable ( const std::vector< PerformanceResult::ResultType > &  r,
const std::vector< BinningVariables::BinningVariablesType > &  b,
int  stride_,
const std::vector< float > &  table 
)
inline

Definition at line 22 of file PerformancePayloadFromTable.h.

26  : pl(stride_, table), results_(r), binning_(b) {}

◆ PerformancePayloadFromTable() [2/2]

PerformancePayloadFromTable::PerformancePayloadFromTable ( )
inline

Definition at line 28 of file PerformancePayloadFromTable.h.

28 {}

◆ ~PerformancePayloadFromTable()

PerformancePayloadFromTable::~PerformancePayloadFromTable ( )
inlineoverride

Definition at line 29 of file PerformancePayloadFromTable.h.

29 {}

Member Function Documentation

◆ getResult()

float PerformancePayloadFromTable::getResult ( PerformanceResult::ResultType  r,
const BinningPointByMap p 
) const
overridevirtual

Implements PerformancePayload.

Definition at line 7 of file PerformancePayloadFromTable.cc.

7  {
8  if (!isInPayload(r, p))
10 
11  // loop on the table rows and search for a match
12  for (int i = 0; i < pl.nRows(); i++) {
14 
15  if (matches(p, row)) {
16  int pos = resultPos(r);
17  return row[pos];
18  }
19  }
21 }

References PhysicsPerformancePayload::getRow(), mps_fire::i, PerformancePayload::InvalidResult, isInPayload(), matches(), PhysicsPerformancePayload::nRows(), AlCaHLTBitMon_ParallelJobs::p, pl, alignCSCRings::r, and resultPos().

◆ isInPayload()

bool PerformancePayloadFromTable::isInPayload ( PerformanceResult::ResultType  res,
const BinningPointByMap _point 
) const
overridevirtual

Implements PerformancePayload.

Definition at line 44 of file PerformancePayloadFromTable.cc.

45  {
46  BinningPointByMap point = _point;
47  // first, let's see if it is available at all
49  return false;
50  // now look whther the binning point contains all the info
51  std::vector<BinningVariables::BinningVariablesType> t = myBinning();
52  for (std::vector<BinningVariables::BinningVariablesType>::const_iterator it = t.begin(); it != t.end(); ++it) {
53  if (!point.isKeyAvailable(*it))
54  return false;
55  }
56  // then, look if there is a matching row
57  for (int i = 0; i < pl.nRows(); i++) {
59  if (matches(point, row)) {
60  return true;
61  }
62  }
63  return false;
64 }

References PhysicsPerformancePayload::getRow(), mps_fire::i, InvalidPos, matches(), myBinning(), PhysicsPerformancePayload::nRows(), pl, point, resultPos(), and submitPVValidationJobs::t.

Referenced by getResult().

◆ isParametrizedInVariable()

virtual bool PerformancePayloadFromTable::isParametrizedInVariable ( const BinningVariables::BinningVariablesType  p) const
inlinevirtual

Definition at line 34 of file PerformancePayloadFromTable.h.

34  {
36  }

References InvalidPos, minPos(), and AlCaHLTBitMon_ParallelJobs::p.

◆ matches()

bool PerformancePayloadFromTable::matches ( const BinningPointByMap _p,
PhysicsPerformancePayload::Row row 
) const
protected

Definition at line 23 of file PerformancePayloadFromTable.cc.

23  {
24  //
25  // this is the smart function which does not take into account the fields not present
26  //
27 
28  // I can do it via a loop!
29  BinningPointByMap p = _p;
30  std::vector<BinningVariables::BinningVariablesType> t = myBinning();
31 
32  for (std::vector<BinningVariables::BinningVariablesType>::const_iterator it = t.begin(); it != t.end(); ++it) {
33  //
34  // first the binning point map must contain ALL the quantities here
35  //
36  // if (! p.isKeyAvailable(*it) ) return false;
37  float v = p.value(*it);
38  if (!(v >= row[minPos(*it)] && v < row[maxPos(*it)]))
39  return false;
40  }
41  return true;
42 }

References maxPos(), minPos(), myBinning(), AlCaHLTBitMon_ParallelJobs::p, submitPVValidationJobs::t, and findQualityFiles::v.

Referenced by getResult(), and isInPayload().

◆ maxPos()

virtual int PerformancePayloadFromTable::maxPos ( const BinningVariables::BinningVariablesType  b) const
inlineprotectedvirtual

Definition at line 52 of file PerformancePayloadFromTable.h.

52  {
53  std::vector<BinningVariables::BinningVariablesType>::const_iterator p;
54  p = find(binning_.begin(), binning_.end(), b);
55  if (p == binning_.end())
57  return ((p - binning_.begin()) * 2 + 1);
58  }

References b, binning_, spr::find(), InvalidPos, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by matches().

◆ minPos()

virtual int PerformancePayloadFromTable::minPos ( const BinningVariables::BinningVariablesType  b) const
inlineprotectedvirtual

Definition at line 45 of file PerformancePayloadFromTable.h.

45  {
46  std::vector<BinningVariables::BinningVariablesType>::const_iterator p;
47  p = find(binning_.begin(), binning_.end(), b);
48  if (p == binning_.end())
50  return ((p - binning_.begin()) * 2);
51  }

References b, binning_, spr::find(), InvalidPos, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by isParametrizedInVariable(), and matches().

◆ myBinning()

virtual std::vector<BinningVariables::BinningVariablesType> PerformancePayloadFromTable::myBinning ( ) const
inlineprotectedvirtual

Definition at line 43 of file PerformancePayloadFromTable.h.

43 { return binning_; }

References binning_.

Referenced by isInPayload(), and matches().

◆ payLoad()

const PhysicsPerformancePayload& PerformancePayloadFromTable::payLoad ( ) const
inline

Definition at line 40 of file PerformancePayloadFromTable.h.

40 { return pl; }

References pl.

◆ resultPos()

virtual int PerformancePayloadFromTable::resultPos ( PerformanceResult::ResultType  r) const
inlineprotectedvirtual

Definition at line 59 of file PerformancePayloadFromTable.h.

59  {
60  // result should be: # of binning variables *2 + position of result
61  std::vector<PerformanceResult::ResultType>::const_iterator p;
62  p = find(results_.begin(), results_.end(), r);
63  if (p == results_.end())
65  return (binning_.size() * 2 + (p - results_.begin()));
66  }

References binning_, spr::find(), InvalidPos, AlCaHLTBitMon_ParallelJobs::p, alignCSCRings::r, and results_.

Referenced by getResult(), and isInPayload().

◆ serialize()

template<class Archive >
void PerformancePayloadFromTable::serialize ( Archive &  ar,
const unsigned int  version 
)
private

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Definition at line 75 of file PerformancePayloadFromTable.h.

◆ cond::serialization::access

template<typename CondSerializationT , typename Enabled >
friend struct cond::serialization::access
friend

Definition at line 75 of file PerformancePayloadFromTable.h.

Member Data Documentation

◆ binning_

std::vector<BinningVariables::BinningVariablesType> PerformancePayloadFromTable::binning_
protected

Definition at line 73 of file PerformancePayloadFromTable.h.

Referenced by maxPos(), minPos(), myBinning(), and resultPos().

◆ InvalidPos

const int PerformancePayloadFromTable::InvalidPos = -1
static

◆ pl

PhysicsPerformancePayload PerformancePayloadFromTable::pl
protected

Definition at line 70 of file PerformancePayloadFromTable.h.

Referenced by getResult(), isInPayload(), and payLoad().

◆ results_

std::vector<PerformanceResult::ResultType> PerformancePayloadFromTable::results_
protected

Definition at line 72 of file PerformancePayloadFromTable.h.

Referenced by resultPos().

PerformancePayloadFromTable::results_
std::vector< PerformanceResult::ResultType > results_
Definition: PerformancePayloadFromTable.h:72
mps_fire.i
i
Definition: mps_fire.py:428
PhysicsPerformancePayload::Row
std::vector< float > Row
Definition: PhysicsPerformancePayload.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
pos
Definition: PixelAliasList.h:18
findQualityFiles.v
v
Definition: findQualityFiles.py:179
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
PerformancePayloadFromTable::matches
bool matches(const BinningPointByMap &, PhysicsPerformancePayload::Row &) const
Definition: PerformancePayloadFromTable.cc:23
PerformancePayloadFromTable::pl
PhysicsPerformancePayload pl
Definition: PerformancePayloadFromTable.h:70
PerformancePayloadFromTable::myBinning
virtual std::vector< BinningVariables::BinningVariablesType > myBinning() const
Definition: PerformancePayloadFromTable.h:43
b
double b
Definition: hdecay.h:118
PhysicsPerformancePayload::nRows
int nRows() const
Definition: PhysicsPerformancePayload.cc:5
PerformancePayloadFromTable::minPos
virtual int minPos(const BinningVariables::BinningVariablesType b) const
Definition: PerformancePayloadFromTable.h:45
res
Definition: Electron.h:6
alignCSCRings.r
r
Definition: alignCSCRings.py:93
BinningPointByMap
Definition: BinningPointByMap.h:8
PhysicsPerformancePayload::getRow
Row getRow(int n) const
Definition: PhysicsPerformancePayload.cc:7
PerformancePayloadFromTable::binning_
std::vector< BinningVariables::BinningVariablesType > binning_
Definition: PerformancePayloadFromTable.h:73
PerformancePayloadFromTable::resultPos
virtual int resultPos(PerformanceResult::ResultType r) const
Definition: PerformancePayloadFromTable.h:59
PerformancePayload::InvalidResult
static const float InvalidResult
Definition: PerformancePayload.h:18
PerformancePayloadFromTable::isInPayload
bool isInPayload(PerformanceResult::ResultType, const BinningPointByMap &) const override
Definition: PerformancePayloadFromTable.cc:44
TableParser.table
table
Definition: TableParser.py:111
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
PerformancePayloadFromTable::maxPos
virtual int maxPos(const BinningVariables::BinningVariablesType b) const
Definition: PerformancePayloadFromTable.h:52
PerformancePayloadFromTable::InvalidPos
static const int InvalidPos
Definition: PerformancePayloadFromTable.h:18