ATLAS Offline Software
Loading...
Searching...
No Matches
L1CaloRampData.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 L1CALORAMPDATA_H
6#define L1CALORAMPDATA_H
7
8#include <vector>
9#include <utility>
10#include <cmath>
11
18{
19 public:
20 L1CaloRampStep() : m_nEntries(0) , m_w(0.), m_w2(0.) {}
21 virtual ~L1CaloRampStep() {}
22
23 void addEvent(double energy);
24 double mean() const;
25 double rms() const;
26
27 private:
28 unsigned int m_nEntries;
29 double m_w;
30 double m_w2;
31};
32
33
41class L1CaloRampData final
42{
43 public:
44 // first L1CaloRampStep is calorimeter data, second is level-1 trigger data
45 typedef std::pair<L1CaloRampStep, L1CaloRampStep> L1CaloRampDataPoint;
46
48 ~L1CaloRampData() = default;
49
50 // adds calorimeter and level-1 trigger energiy to energy step i
51 void addData(unsigned int step, const std::pair<double, double>& energy);
52 void addData(unsigned int step, double calorimeter, double level1);
53 void addData(unsigned int step, const L1CaloRampDataPoint& data);
54
55 // adds calorimeter and level-1 trigger energy to the current energy step
56 void addData(const std::pair<double, double>& l1calo);
57 void addData(double calorimeter, double level1);
58
59 // sets the current energy step
60 void setStep(unsigned int step);
61
62 // moves to the next energy step
63 void nextStep();
64
65 // returns the total number of energy steps
66 unsigned int getNSteps() const;
67
68 // returns the data of step i
69 const L1CaloRampDataPoint* getStep(unsigned int step) const;
70
71 // returns the calorimeter data of step i
72 const L1CaloRampStep* getCalo(unsigned int step) const;
73
74 // return the level-1 trigger data of step i
75 const L1CaloRampStep* getLevel1(unsigned int step) const;
76
77 private:
78 typedef std::vector<L1CaloRampDataPoint> L1CaloRampDataVector;
79
81 unsigned int m_iStep;
82};
83
84#endif //L1CALORAMPDATA_H
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
unsigned int getNSteps() const
unsigned int m_iStep
std::pair< L1CaloRampStep, L1CaloRampStep > L1CaloRampDataPoint
void setStep(unsigned int step)
const L1CaloRampStep * getLevel1(unsigned int step) const
std::vector< L1CaloRampDataPoint > L1CaloRampDataVector
const L1CaloRampStep * getCalo(unsigned int step) const
void addData(unsigned int step, const std::pair< double, double > &energy)
L1CaloRampDataVector m_rampDataVector
~L1CaloRampData()=default
const L1CaloRampDataPoint * getStep(unsigned int step) const
Class to store the measured energy per step for either calorimeter or level-1.
void addEvent(double energy)
double rms() const
virtual ~L1CaloRampStep()
unsigned int m_nEntries
double mean() const