CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Attributes
PTStatistics Class Reference

#include <PTStatistics.h>

Inheritance diagram for PTStatistics:

Public Member Functions

long double eff (int ptCut)
 
 PTStatistics ()
 
long int sum (const int &ptCut) const
 
long int sum () const
 
long double sumR () const
 
long double sumR (const int &ptCut) const
 
std::string toString ()
 
void update (PTStatistics &otherPtStats)
 

Static Public Attributes

static const std::vector< long double > m_rates = initializeRates()
 

Detailed Description

Definition at line 10 of file PTStatistics.h.

Constructor & Destructor Documentation

◆ PTStatistics()

PTStatistics::PTStatistics ( )

Definition at line 32 of file PTStatistics.cc.

References assign(), and RPCpg::ptBins_s.

32 { this->assign(RPCpg::ptBins_s, 0); }
void assign(const std::vector< float > &vec, float &a, float &b, float &c, float &d)
const unsigned int ptBins_s
Definition: Constants.h:28

Member Function Documentation

◆ eff()

long double PTStatistics::eff ( int  ptCut)

Definition at line 50 of file PTStatistics.cc.

References jetfilter_cfi::ptCut, and sum().

50  { // ptCut=0 -> total rate
51  //int eqOrAbovePtCut = 0;
52  //for(unsigned int i=ptCut;i<this->size();++i) eqOrAbovePtCut += this->at(i);
53  // return double(eqOrAbovePtCut)/this->sum();
54  return double(sum(ptCut)) / this->sum();
55 }
long int sum() const
Definition: PTStatistics.cc:69

◆ sum() [1/2]

long int PTStatistics::sum ( const int &  ptCut) const

Definition at line 57 of file PTStatistics.cc.

References mps_fire::i, and findQualityFiles::size.

57  {
58  //inline int PTStatistics::sum(const int & ptCut) const{
59  //return std::accumulate(this->begin(),this->end(),0);
60  long int eqOrAbovePtCut = 0;
61  unsigned int size = this->size();
62  //for(unsigned int i=ptCut;i<size;++i) eqOrAbovePtCut += this->at(i);
63  for (unsigned int i = ptCut; i < size; ++i)
64  eqOrAbovePtCut += (*this)[i];
65  return eqOrAbovePtCut;
66 }
size
Write out results.

◆ sum() [2/2]

long int PTStatistics::sum ( ) const

Definition at line 69 of file PTStatistics.cc.

References mps_fire::end, and ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it.

Referenced by eff().

69  {
70  //return std::accumulate(this->begin(),this->end(),0);
71  long int eqOrAbovePtCut = 0;
72  //unsigned int size = this->size();
73  //for(unsigned int i=ptCut;i<size;++i) eqOrAbovePtCut += this->at(i);
74  //for(unsigned int i=ptCut;i<size;++i) eqOrAbovePtCut += (*this)[i];
75  PTStatistics::const_iterator it = this->begin();
76  PTStatistics::const_iterator itend = this->end();
77  for (; it != itend; ++it)
78  eqOrAbovePtCut += *it;
79 
80  return eqOrAbovePtCut;
81 }

◆ sumR() [1/2]

long double PTStatistics::sumR ( ) const

Definition at line 93 of file PTStatistics.cc.

References mps_fire::i, m_rates, and findQualityFiles::size.

93  {
94  //return std::accumulate(this->begin(),this->end(),0);
95  long double eqOrAbovePtCut = 0;
96  //unsigned int size = this->size();
97  //for(unsigned int i=ptCut;i<size;++i) eqOrAbovePtCut += this->at(i);
98  //for(unsigned int i=ptCut;i<size;++i) eqOrAbovePtCut += (*this)[i];
99  //PTStatistics::const_iterator it = this->begin();
100  //PTStatistics::const_iterator itend = this->end();
101  //PtCode 0 - muons not found
102  unsigned int size = this->size();
103  for (unsigned int i = 1; i < size; ++i)
104  eqOrAbovePtCut += (*this)[i] * m_rates[i];
105  //for(;it!=itend;++it) eqOrAbovePtCut += *it*m_rates[i];
106 
107  return eqOrAbovePtCut;
108 }
size
Write out results.
static const std::vector< long double > m_rates
Definition: PTStatistics.h:22

◆ sumR() [2/2]

long double PTStatistics::sumR ( const int &  ptCut) const

Definition at line 83 of file PTStatistics.cc.

References mps_fire::i, m_rates, and findQualityFiles::size.

83  {
84  //return std::accumulate(this->begin(),this->end(),0);
85  long double eqOrAbovePtCut = 0;
86  unsigned int size = this->size();
87  //for(unsigned int i=ptCut;i<size;++i) eqOrAbovePtCut += this->at(i);
88  for (unsigned int i = ptCut; i < size; ++i)
89  eqOrAbovePtCut += (*this)[i] * m_rates[i];
90  return eqOrAbovePtCut;
91 }
size
Write out results.
static const std::vector< long double > m_rates
Definition: PTStatistics.h:22

◆ toString()

std::string PTStatistics::toString ( )

Definition at line 40 of file PTStatistics.cc.

References mps_fire::i, findQualityFiles::size, and contentValuesCheck::ss.

40  {
41  std::stringstream ss;
42  ss << "PTStats:";
43  for (unsigned int i = 0; i < this->size(); ++i) {
44  ss << " " << (*this)[i];
45  }
46 
47  return ss.str();
48 }
size
Write out results.

◆ update()

void PTStatistics::update ( PTStatistics otherPtStats)

Definition at line 34 of file PTStatistics.cc.

References mps_fire::i, and findQualityFiles::size.

Referenced by MatrixUtil.Matrix::__setitem__(), MatrixUtil.Steps::__setitem__(), and MatrixUtil.Steps::overwrite().

34  {
35  for (unsigned int i = 0; i < this->size(); ++i) {
36  //this->at(i)+=otherPtStats.at(i);
37  (*this)[i] += otherPtStats[i];
38  }
39 }
size
Write out results.

Member Data Documentation

◆ m_rates

const std::vector< long double > PTStatistics::m_rates = initializeRates()
static

Definition at line 22 of file PTStatistics.h.

Referenced by sumR().