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 ( )

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

long double PTStatistics::eff ( int  ptCut)

Definition at line 50 of file PTStatistics.cc.

References 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
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.
long int PTStatistics::sum ( ) const

Definition at line 69 of file PTStatistics.cc.

References begin, and end.

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 }
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
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
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
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.
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__(), Vispa.Gui.VispaWidget.VispaWidget::autosize(), Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Views.LineDecayView.LineDecayContainer::deselectAllObjects(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::deselectAllWidgets(), Vispa.Gui.VispaWidget.VispaWidget::enableAutosizing(), Vispa.Gui.MenuWidget.MenuWidget::leaveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseMoveEvent(), Vispa.Gui.MenuWidget.MenuWidget::mouseMoveEvent(), Vispa.Views.LineDecayView.LineDecayContainer::mouseMoveEvent(), Vispa.Gui.VispaWidgetOwner.VispaWidgetOwner::mouseReleaseEvent(), Vispa.Views.LineDecayView.LineDecayContainer::objectMoved(), MatrixUtil.Steps::overwrite(), Vispa.Views.LineDecayView.LineDecayContainer::removeObject(), Vispa.Gui.ConnectableWidget.ConnectableWidget::removePorts(), Vispa.Gui.FindDialog.FindDialog::reset(), Vispa.Gui.PortConnection.PointToPointConnection::select(), Vispa.Gui.VispaWidget.VispaWidget::select(), Vispa.Views.LineDecayView.LineDecayContainer::select(), Vispa.Gui.VispaWidget.VispaWidget::setText(), Vispa.Gui.VispaWidget.VispaWidget::setTitle(), Vispa.Gui.ZoomableWidget.ZoomableWidget::setZoom(), Vispa.Views.LineDecayView.LineDecayContainer::setZoom(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().

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

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

Definition at line 22 of file PTStatistics.h.

Referenced by initializeRates(), and sumR().