ATLAS Offline Software
Trigger
TrigT1
TrigT1CaloCalibConditions
src
L1CaloRampData.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigT1CaloCalibConditions/L1CaloRampData.h
"
6
7
void
L1CaloRampStep::addEvent
(
double
energy
)
8
{
9
++
m_nEntries
;
10
m_w
+=
energy
;
11
m_w2
+= (
energy
*
energy
);
12
}
13
14
double
L1CaloRampStep::mean
()
const
15
{
16
if
(!
m_nEntries
)
return
0.;
17
return
m_w
/
double
(
m_nEntries
);
18
}
19
20
double
L1CaloRampStep::rms
()
const
21
{
22
if
(!
m_nEntries
)
return
1.;
23
if
(
m_nEntries
== 1)
return
1.;
24
double
mean
= this->
mean
();
25
return
std::sqrt((
m_w2
/
double
(
m_nEntries
))) -
mean
;
26
}
27
28
void
L1CaloRampData::addData
(
unsigned
int
step
,
const
std::pair<double, double>& energies)
29
{
30
this->
addData
(step, energies.first, energies.second);
31
}
32
33
void
L1CaloRampData::addData
(
unsigned
int
step
,
double
calorimeter,
double
level1)
34
{
35
if
(
m_rampDataVector
.size() <=
step
) {
36
m_rampDataVector
.resize(
step
+ 1);
37
}
38
39
m_rampDataVector
[
step
].first.addEvent(calorimeter);
40
m_rampDataVector
[
step
].second.addEvent(level1);
41
}
42
43
void
L1CaloRampData::addData
(
unsigned
int
step
,
const
L1CaloRampDataPoint
&
data
)
44
{
45
if
(
m_rampDataVector
.size() <=
step
) {
46
m_rampDataVector
.resize(
step
+ 1);
47
}
48
m_rampDataVector
[
step
] =
data
;
49
}
50
51
void
L1CaloRampData::addData
(
const
std::pair<double, double>& energies) {
52
this->
addData
(energies.first, energies.second);
53
}
54
55
void
L1CaloRampData::addData
(
double
calorimeter,
double
level1) {
56
m_rampDataVector
[
m_iStep
].first.addEvent(calorimeter);
57
m_rampDataVector
[
m_iStep
].second.addEvent(level1);
58
}
59
60
void
L1CaloRampData::setStep
(
unsigned
int
step
) {
61
m_iStep
=
step
;
62
63
if
(
m_rampDataVector
.size() <=
step
) {
64
m_rampDataVector
.resize(
step
+ 1);
65
}
66
}
67
68
void
L1CaloRampData::nextStep
() {
69
++
m_iStep
;
70
if
(
m_rampDataVector
.size() <=
m_iStep
) {
71
m_rampDataVector
.resize(
m_iStep
+ 1);
72
}
73
}
74
75
unsigned
int
L1CaloRampData::getNSteps
()
const
{
76
return
m_rampDataVector
.size();
77
}
78
79
const
L1CaloRampData::L1CaloRampDataPoint
*
L1CaloRampData::getStep
(
unsigned
int
step
)
const
{
80
if
(
m_rampDataVector
.size() <=
step
)
return
0;
81
return
&(
m_rampDataVector
[
step
]);
82
}
83
84
const
L1CaloRampStep
*
L1CaloRampData::getCalo
(
unsigned
int
step
)
const
{
85
if
(
m_rampDataVector
.size() <=
step
)
return
0;
86
return
&(
m_rampDataVector
[
step
].first);
87
}
88
89
const
L1CaloRampStep
*
L1CaloRampData::getLevel1
(
unsigned
int
step
)
const
{
90
if
(
m_rampDataVector
.size() <=
step
)
return
0;
91
return
&(
m_rampDataVector
[
step
].second);
92
}
L1CaloRampStep::rms
double rms() const
Definition:
L1CaloRampData.cxx:20
data
char data[hepevt_bytes_allocation_ATLAS]
Definition:
HepEvt.cxx:11
L1CaloRampData::m_iStep
unsigned int m_iStep
Definition:
L1CaloRampData.h:81
L1CaloRampData.h
L1CaloRampData::nextStep
void nextStep()
Definition:
L1CaloRampData.cxx:68
L1CaloRampStep::m_w2
double m_w2
Definition:
L1CaloRampData.h:30
L1CaloRampStep
Class to store the measured energy per step for either calorimeter or level-1.
Definition:
L1CaloRampData.h:18
L1CaloRampData::getCalo
const L1CaloRampStep * getCalo(unsigned int step) const
Definition:
L1CaloRampData.cxx:84
L1CaloRampData::getStep
const L1CaloRampDataPoint * getStep(unsigned int step) const
Definition:
L1CaloRampData.cxx:79
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition:
ParticleGun_FastCalo_ChargeFlip_Config.py:78
L1CaloRampData::addData
void addData(unsigned int step, const std::pair< double, double > &energy)
Definition:
L1CaloRampData.cxx:28
L1CaloRampData::setStep
void setStep(unsigned int step)
Definition:
L1CaloRampData.cxx:60
L1CaloRampData::getNSteps
unsigned int getNSteps() const
Definition:
L1CaloRampData.cxx:75
xAOD::double
double
Definition:
CompositeParticle_v1.cxx:159
L1CaloRampStep::addEvent
void addEvent(double energy)
Definition:
L1CaloRampData.cxx:7
L1CaloRampData::L1CaloRampDataPoint
std::pair< L1CaloRampStep, L1CaloRampStep > L1CaloRampDataPoint
Definition:
L1CaloRampData.h:45
L1CaloRampData::m_rampDataVector
L1CaloRampDataVector m_rampDataVector
Definition:
L1CaloRampData.h:80
L1CaloRampStep::mean
double mean() const
Definition:
L1CaloRampData.cxx:14
L1CaloRampStep::m_w
double m_w
Definition:
L1CaloRampData.h:29
LArCellBinning.step
step
Definition:
LArCellBinning.py:158
L1CaloRampData::getLevel1
const L1CaloRampStep * getLevel1(unsigned int step) const
Definition:
L1CaloRampData.cxx:89
L1CaloRampStep::m_nEntries
unsigned int m_nEntries
Definition:
L1CaloRampData.h:28
Generated on Fri Jan 10 2025 21:12:42 for ATLAS Offline Software by
1.8.18