CMS 3D CMS Logo

TSinglePedEntry.cc
Go to the documentation of this file.
1 
3 #include <cmath>
4 #include <iostream>
5 
6 TSinglePedEntry::TSinglePedEntry() : m_pedestalSqSum(0), m_pedestalSum(0), m_entries(0) {
7  // std::cout << "[TSinglePedEntry][ctor]" << std::endl ;
8 }
9 
11 
15  m_entries = orig.m_entries;
16 }
17 
21  ++m_entries;
22 }
23 
24 double TSinglePedEntry::average() const {
25  if (!m_entries)
26  return -1;
27  return static_cast<double>(m_pedestalSum) / m_entries;
28 }
29 
30 double TSinglePedEntry::RMS() const {
31  if (!m_entries)
32  return -1;
33  return sqrt(RMSSq());
34 }
35 
36 double TSinglePedEntry::RMSSq() const {
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 }
TSinglePedEntry.h
Transient container for a single entry in pedestal offset studies.
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:32
TSinglePedEntry::m_entries
int m_entries
number of entries
Definition: TSinglePedEntry.h:37
TSinglePedEntry::RMS
double RMS() const
get the RMS of the inserted values
Definition: TSinglePedEntry.cc:30
TSinglePedEntry
Definition: TSinglePedEntry.h:13
TSinglePedEntry::m_pedestalSum
int m_pedestalSum
sum of entries
Definition: TSinglePedEntry.h:35
TSinglePedEntry::~TSinglePedEntry
~TSinglePedEntry()
dtor
Definition: TSinglePedEntry.cc:10
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
EcalCondDBWriter_cfi.pedestal
pedestal
Definition: EcalCondDBWriter_cfi.py:49
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
TSinglePedEntry::TSinglePedEntry
TSinglePedEntry()
ctor
Definition: TSinglePedEntry.cc:6
TSinglePedEntry::RMSSq
double RMSSq() const
get the squared RMS of the inserted values
Definition: TSinglePedEntry.cc:36
TSinglePedEntry::insert
void insert(const int &pedestal)
add a single value
Definition: TSinglePedEntry.cc:18
TSinglePedEntry::average
double average() const
get the average of the inserted values
Definition: TSinglePedEntry.cc:24
TSinglePedEntry::m_pedestalSqSum
int m_pedestalSqSum
squared sum of entries
Definition: TSinglePedEntry.h:33