#include <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.
: m_pedestalSqSum (0), m_pedestalSum (0), m_entries (0) { // std::cout << "[TSinglePedEntry][ctor]" << std::endl ; }
TSinglePedEntry::TSinglePedEntry | ( | const TSinglePedEntry & | orig | ) |
copy ctor
Definition at line 19 of file TSinglePedEntry.cc.
References m_entries, m_pedestalSqSum, and m_pedestalSum.
{ m_pedestalSqSum = orig.m_pedestalSqSum ; m_pedestalSum = orig.m_pedestalSum ; m_entries = orig.m_entries ; }
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().
{ if (!m_entries) return -1; return static_cast<double>(m_pedestalSum) / m_entries ; }
void TSinglePedEntry::insert | ( | const int & | pedestal | ) |
add a single value
Definition at line 27 of file TSinglePedEntry.cc.
References m_entries, m_pedestalSqSum, and m_pedestalSum.
Referenced by TPedValues::insert().
{ m_pedestalSqSum += pedestal * pedestal ; m_pedestalSum += pedestal ; ++m_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().
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, and convertSQLitetoXML_cfg::output.
Referenced by RMS().
{ /* std::cout << "[TSinglePedEntry][minchia] " << m_pedestalSum << "\t" << m_pedestalSum << "\t" << m_entries << std::endl ; // FIXME */ if (!m_entries) return -1; double num = 1./static_cast<double>(m_entries) ; double output = m_pedestalSqSum * num - m_pedestalSum * num * m_pedestalSum * num ; return output ; }
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().