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 12 of file PTStatistics.h.

Constructor & Destructor Documentation

PTStatistics::PTStatistics ( )

Definition at line 34 of file PTStatistics.cc.

References assign(), and RPCpg::ptBins_s.

34  {
35  this->assign(RPCpg::ptBins_s,0);
36 }
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 59 of file PTStatistics.cc.

References sum().

59  { // ptCut=0 -> total rate
60  //int eqOrAbovePtCut = 0;
61  //for(unsigned int i=ptCut;i<this->size();++i) eqOrAbovePtCut += this->at(i);
62  // return double(eqOrAbovePtCut)/this->sum();
63  return double(sum(ptCut))/this->sum();
64 }
long int sum() const
Definition: PTStatistics.cc:78
long int PTStatistics::sum ( const int &  ptCut) const

Definition at line 67 of file PTStatistics.cc.

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

67  {
68 //inline int PTStatistics::sum(const int & ptCut) const{
69  //return std::accumulate(this->begin(),this->end(),0);
70  long int eqOrAbovePtCut = 0;
71  unsigned int size = this->size();
72  //for(unsigned int i=ptCut;i<size;++i) eqOrAbovePtCut += this->at(i);
73  for(unsigned int i=ptCut;i<size;++i) eqOrAbovePtCut += (*this)[i];
74  return eqOrAbovePtCut;
75 }
size
Write out results.
long int PTStatistics::sum ( ) const

Definition at line 78 of file PTStatistics.cc.

References begin, and end.

Referenced by eff().

78  {
79  //return std::accumulate(this->begin(),this->end(),0);
80  long int eqOrAbovePtCut = 0;
81  //unsigned int size = this->size();
82  //for(unsigned int i=ptCut;i<size;++i) eqOrAbovePtCut += this->at(i);
83  //for(unsigned int i=ptCut;i<size;++i) eqOrAbovePtCut += (*this)[i];
84  PTStatistics::const_iterator it = this->begin();
85  PTStatistics::const_iterator itend = this->end();
86  for(;it!=itend;++it) eqOrAbovePtCut += *it;
87 
88  return eqOrAbovePtCut;
89 }
#define end
Definition: vmac.h:39
#define begin
Definition: vmac.h:32
long double PTStatistics::sumR ( ) const

Definition at line 100 of file PTStatistics.cc.

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

100  {
101  //return std::accumulate(this->begin(),this->end(),0);
102  long double eqOrAbovePtCut = 0;
103  //unsigned int size = this->size();
104  //for(unsigned int i=ptCut;i<size;++i) eqOrAbovePtCut += this->at(i);
105  //for(unsigned int i=ptCut;i<size;++i) eqOrAbovePtCut += (*this)[i];
106  //PTStatistics::const_iterator it = this->begin();
107  //PTStatistics::const_iterator itend = this->end();
108  //PtCode 0 - muons not found
109  unsigned int size = this->size();
110  for(unsigned int i=1;i<size;++i) eqOrAbovePtCut += (*this)[i]*m_rates[i];
111  //for(;it!=itend;++it) eqOrAbovePtCut += *it*m_rates[i];
112 
113  return eqOrAbovePtCut;
114 }
size
Write out results.
static const std::vector< long double > m_rates
Definition: PTStatistics.h:25
long double PTStatistics::sumR ( const int &  ptCut) const

Definition at line 91 of file PTStatistics.cc.

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

91  {
92  //return std::accumulate(this->begin(),this->end(),0);
93  long double eqOrAbovePtCut = 0;
94  unsigned int size = this->size();
95  //for(unsigned int i=ptCut;i<size;++i) eqOrAbovePtCut += this->at(i);
96  for(unsigned int i=ptCut;i<size;++i) eqOrAbovePtCut += (*this)[i]*m_rates[i];
97  return eqOrAbovePtCut;
98 }
size
Write out results.
static const std::vector< long double > m_rates
Definition: PTStatistics.h:25
std::string PTStatistics::toString ( )

Definition at line 48 of file PTStatistics.cc.

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

48  {
49 
50  std::stringstream ss;
51  ss << "PTStats:";
52  for (unsigned int i=0; i<this->size();++i){
53  ss << " " << (*this)[i];
54  }
55 
56  return ss.str();
57 }
size
Write out results.
void PTStatistics::update ( PTStatistics otherPtStats)

Definition at line 39 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().

39  {
40 
41  for (unsigned int i=0; i<this->size();++i){
42  //this->at(i)+=otherPtStats.at(i);
43  (*this)[i]+=otherPtStats[i];
44  }
45 
46 
47 }
size
Write out results.

Member Data Documentation

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

Definition at line 25 of file PTStatistics.h.

Referenced by initializeRates(), and sumR().