CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
TSinglePedEntry Class Reference

#include <TSinglePedEntry.h>

Public Member Functions

double average () const
 get the average of the inserted values More...
 
void insert (const int &pedestal)
 add a single value More...
 
double RMS () const
 get the RMS of the inserted values More...
 
double RMSSq () const
 get the squared RMS of the inserted values More...
 
 TSinglePedEntry ()
 ctor More...
 
 TSinglePedEntry (const TSinglePedEntry &orig)
 copy ctor More...
 
 ~TSinglePedEntry ()
 dtor More...
 

Private Attributes

int m_entries
 number of entries More...
 
int m_pedestalSqSum
 squared sum of entries More...
 
int m_pedestalSum
 sum of entries More...
 

Detailed Description

Definition at line 13 of file TSinglePedEntry.h.

Constructor & Destructor Documentation

TSinglePedEntry::TSinglePedEntry ( )

ctor

Definition at line 6 of file TSinglePedEntry.cc.

6  :
7  m_pedestalSqSum (0),
8  m_pedestalSum (0),
9  m_entries (0)
10 {
11 // std::cout << "[TSinglePedEntry][ctor]" << std::endl ;
12 }
int m_pedestalSqSum
squared sum of entries
int m_entries
number of entries
int m_pedestalSum
sum of entries
TSinglePedEntry::TSinglePedEntry ( const TSinglePedEntry orig)

copy ctor

Definition at line 19 of file TSinglePedEntry.cc.

References m_entries, m_pedestalSqSum, and m_pedestalSum.

20 {
23  m_entries = orig.m_entries ;
24 }
int m_pedestalSqSum
squared sum of entries
int m_entries
number of entries
int m_pedestalSum
sum of entries
TSinglePedEntry::~TSinglePedEntry ( )

dtor

Definition at line 15 of file TSinglePedEntry.cc.

16 {}

Member Function Documentation

double TSinglePedEntry::average ( ) const

get the average of the inserted values

Definition at line 35 of file TSinglePedEntry.cc.

References m_entries, and m_pedestalSum.

Referenced by average.Average::__str__(), TPedValues::checkEntries(), TPedValues::makePlots(), and TPedValues::terminate().

36 {
37  if (!m_entries) return -1;
38  return static_cast<double>(m_pedestalSum) / m_entries ;
39 }
int m_entries
number of entries
int m_pedestalSum
sum of entries
void TSinglePedEntry::insert ( const int &  pedestal)

add a single value

Definition at line 27 of file TSinglePedEntry.cc.

References m_entries, m_pedestalSqSum, m_pedestalSum, and EcalCondDBWriter_cfi::pedestal.

Referenced by BeautifulSoup.PageElement::_invert(), and TPedValues::insert().

28 {
31  ++m_entries ;
32 }
int m_pedestalSqSum
squared sum of entries
int m_entries
number of entries
int m_pedestalSum
sum of entries
double TSinglePedEntry::RMS ( ) const

get the RMS of the inserted values

Definition at line 42 of file TSinglePedEntry.cc.

References m_entries, RMSSq(), and mathSSE::sqrt().

Referenced by TPedValues::makePlots().

43 {
44  if (!m_entries) return -1;
45  return sqrt (RMSSq ()) ;
46 }
T sqrt(T t)
Definition: SSEVec.h:48
int m_entries
number of entries
double RMSSq() const
get the squared RMS of the inserted values
double TSinglePedEntry::RMSSq ( ) const

get the squared RMS of the inserted values

Definition at line 48 of file TSinglePedEntry.cc.

References m_entries, m_pedestalSqSum, m_pedestalSum, pileupDistInMC::num, and convertSQLitetoXML_cfg::output.

Referenced by RMS().

49 {
50 /*
51  std::cout << "[TSinglePedEntry][minchia] " << m_pedestalSum
52  << "\t" << m_pedestalSum
53  << "\t" << m_entries << std::endl ; // FIXME
54 */
55  if (!m_entries) return -1;
56  double num = 1./static_cast<double>(m_entries) ;
57  double output = m_pedestalSqSum * num - m_pedestalSum * num * m_pedestalSum * num ;
58  return output ;
59 }
int m_pedestalSqSum
squared sum of entries
int m_entries
number of entries
int m_pedestalSum
sum of entries

Member Data Documentation

int TSinglePedEntry::m_entries
private

number of entries

Definition at line 40 of file TSinglePedEntry.h.

Referenced by average(), insert(), RMS(), RMSSq(), and TSinglePedEntry().

int TSinglePedEntry::m_pedestalSqSum
private

squared sum of entries

Definition at line 36 of file TSinglePedEntry.h.

Referenced by insert(), RMSSq(), and TSinglePedEntry().

int TSinglePedEntry::m_pedestalSum
private

sum of entries

Definition at line 38 of file TSinglePedEntry.h.

Referenced by average(), insert(), RMSSq(), and TSinglePedEntry().