#include <CalibCalorimetry/EcalPedestalOffsets/interface/TSinglePedEntry.h>
Public Member Functions | |
double | average () const |
get the average of the inserted values | |
void | insert (const int &pedestal) |
add a single value | |
double | RMS () const |
get the RMS of the inserted values | |
double | RMSSq () const |
get the squared RMS of the inserted values | |
TSinglePedEntry (const TSinglePedEntry &orig) | |
copy ctor | |
TSinglePedEntry () | |
ctor | |
~TSinglePedEntry () | |
dtor | |
Private Attributes | |
int | m_entries |
number of entries | |
int | m_pedestalSqSum |
squared sum of entries | |
int | m_pedestalSum |
sum of entries |
Definition at line 13 of file TSinglePedEntry.h.
TSinglePedEntry::TSinglePedEntry | ( | ) |
ctor
Definition at line 6 of file TSinglePedEntry.cc.
00006 : 00007 m_pedestalSqSum (0), 00008 m_pedestalSum (0), 00009 m_entries (0) 00010 { 00011 // std::cout << "[TSinglePedEntry][ctor]" << std::endl ; 00012 }
TSinglePedEntry::TSinglePedEntry | ( | const TSinglePedEntry & | orig | ) |
copy ctor
Definition at line 19 of file TSinglePedEntry.cc.
References m_entries, m_pedestalSqSum, and m_pedestalSum.
00020 { 00021 m_pedestalSqSum = orig.m_pedestalSqSum ; 00022 m_pedestalSum = orig.m_pedestalSum ; 00023 m_entries = orig.m_entries ; 00024 }
TSinglePedEntry::~TSinglePedEntry | ( | ) |
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 TPedValues::checkEntries(), TPedValues::makePlots(), and TPedValues::terminate().
00036 { 00037 if (!m_entries) return -1; 00038 return static_cast<double>(m_pedestalSum) / m_entries ; 00039 }
add a single value
Definition at line 27 of file TSinglePedEntry.cc.
References m_entries, m_pedestalSqSum, and m_pedestalSum.
Referenced by TPedValues::insert().
00028 { 00029 m_pedestalSqSum += pedestal * pedestal ; 00030 m_pedestalSum += pedestal ; 00031 ++m_entries ; 00032 }
double TSinglePedEntry::RMS | ( | ) | const |
get the RMS of the inserted values
Definition at line 42 of file TSinglePedEntry.cc.
References m_entries, RMSSq(), and funct::sqrt().
Referenced by TPedValues::makePlots().
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, funct::num(), and output().
Referenced by RMS().
00049 { 00050 /* 00051 std::cout << "[TSinglePedEntry][minchia] " << m_pedestalSum 00052 << "\t" << m_pedestalSum 00053 << "\t" << m_entries << std::endl ; // FIXME 00054 */ 00055 if (!m_entries) return -1; 00056 double num = 1./static_cast<double>(m_entries) ; 00057 double output = m_pedestalSqSum * num - m_pedestalSum * num * m_pedestalSum * num ; 00058 return output ; 00059 }
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().