CMS 3D CMS Logo

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...
 
TSinglePedEntryoperator= (const TSinglePedEntry &orig)=default
 assignment op 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() [1/2]

TSinglePedEntry::TSinglePedEntry ( )

ctor

Definition at line 6 of file TSinglePedEntry.cc.

7  // std::cout << "[TSinglePedEntry][ctor]" << std::endl ;
8 }
int m_pedestalSqSum
squared sum of entries
int m_entries
number of entries
int m_pedestalSum
sum of entries

◆ TSinglePedEntry() [2/2]

TSinglePedEntry::TSinglePedEntry ( const TSinglePedEntry orig)

copy ctor

Definition at line 12 of file TSinglePedEntry.cc.

References m_entries, m_pedestalSqSum, and m_pedestalSum.

12  {
15  m_entries = orig.m_entries;
16 }
int m_pedestalSqSum
squared sum of entries
int m_entries
number of entries
int m_pedestalSum
sum of entries

◆ ~TSinglePedEntry()

TSinglePedEntry::~TSinglePedEntry ( )

dtor

Definition at line 10 of file TSinglePedEntry.cc.

10 {}

Member Function Documentation

◆ average()

double TSinglePedEntry::average ( ) const

get the average of the inserted values

Definition at line 24 of file TSinglePedEntry.cc.

References m_entries, and m_pedestalSum.

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

24  {
25  if (!m_entries)
26  return -1;
27  return static_cast<double>(m_pedestalSum) / m_entries;
28 }
int m_entries
number of entries
int m_pedestalSum
sum of entries

◆ insert()

void TSinglePedEntry::insert ( const int &  pedestal)

add a single value

Definition at line 18 of file TSinglePedEntry.cc.

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

Referenced by SequenceTypes.Schedule::_replaceIfHeldDirectly(), and TPedValues::insert().

18  {
21  ++m_entries;
22 }
int m_pedestalSqSum
squared sum of entries
int m_entries
number of entries
int m_pedestalSum
sum of entries

◆ operator=()

TSinglePedEntry& TSinglePedEntry::operator= ( const TSinglePedEntry orig)
default

assignment op

◆ RMS()

double TSinglePedEntry::RMS ( ) const

get the RMS of the inserted values

Definition at line 30 of file TSinglePedEntry.cc.

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

Referenced by TPedValues::makePlots().

30  {
31  if (!m_entries)
32  return -1;
33  return sqrt(RMSSq());
34 }
double RMSSq() const
get the squared RMS of the inserted values
T sqrt(T t)
Definition: SSEVec.h:23
int m_entries
number of entries

◆ RMSSq()

double TSinglePedEntry::RMSSq ( ) const

get the squared RMS of the inserted values

Definition at line 36 of file TSinglePedEntry.cc.

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

Referenced by RMS().

36  {
37  /*
38  std::cout << "[TSinglePedEntry][minchia] " << m_pedestalSum
39  << "\t" << m_pedestalSum
40  << "\t" << m_entries << std::endl ; // FIXME
41  */
42  if (!m_entries)
43  return -1;
44  double num = 1. / static_cast<double>(m_entries);
46  return output;
47 }
int m_pedestalSqSum
squared sum of entries
int m_entries
number of entries
Definition: output.py:1
int m_pedestalSum
sum of entries

Member Data Documentation

◆ m_entries

int TSinglePedEntry::m_entries
private

number of entries

Definition at line 39 of file TSinglePedEntry.h.

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

◆ m_pedestalSqSum

int TSinglePedEntry::m_pedestalSqSum
private

squared sum of entries

Definition at line 35 of file TSinglePedEntry.h.

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

◆ m_pedestalSum

int TSinglePedEntry::m_pedestalSum
private

sum of entries

Definition at line 37 of file TSinglePedEntry.h.

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