ATLAS Offline Software
Loading...
Searching...
No Matches
L1CaloRampCumul.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGT1CALOCALIBCONDITIONS_L1CALORAMPCUMUL_H
6#define TRIGT1CALOCALIBCONDITIONS_L1CALORAMPCUMUL_H
7
9
10#include <map>
11#include <cmath>
12
19
20class L1CaloRampCumul final
21{
22public:
25 ~L1CaloRampCumul() = default;
26
27 void addEvent(double step, int energy);
28
29private:
30
31 class RampStep {
32 public:
34 m_iStep(0.0),
35 m_nEntrie(0),
36 m_w(0),
37 m_w2(0)
38 {
39 };
40 RampStep(double step):
42 m_nEntrie(0),
43 m_w(0),
44 m_w2(0)
45 {
46 };
47 void addEvent(int energy) {
48 ++m_nEntrie;
49 m_w += energy;
50 m_w2 += energy*energy;
51 };
52 double step() {return m_iStep; };
53 double mean() {
54 if(m_nEntrie==0) {
55 return 0;
56 } else {
57 return (double)m_w/((double)m_nEntrie);
58 }
59 };
60 double rms() {
61 if(m_nEntrie==0) {
62 return 0;
63 } else {
64 double mean = this->mean();
65 return std::sqrt( (double)m_w2/((double)m_nEntrie) - mean*mean );
66 }
67 };
68
69 private:
70 double m_iStep;
72 int m_w;
73 int m_w2;
74 };
75
76 std::map<double, RampStep> m_mapRampSteps;
77
78};
79
80#endif
81
void addEvent(double step, int energy)
std::map< double, RampStep > m_mapRampSteps
~L1CaloRampCumul()=default
Transient class defining ramps runplan objects defined by the online framework and retrieved from COO...