Project
Loading...
Searching...
No Matches
EMCALChannelScaleFactors.cxx
Go to the documentation of this file.
1
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3
// All rights not expressly granted are reserved.
4
//
5
// This software is distributed under the terms of the GNU General Public
6
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7
//
8
// In applying this license CERN does not waive the privileges and immunities
9
// granted to it by virtue of its status as an Intergovernmental Organization
10
// or submit itself to any jurisdiction.
11
12
#include "
EMCALCalib/CalibContainerErrors.h
"
13
#include "
EMCALCalib/EMCALChannelScaleFactors.h
"
14
15
namespace
o2
16
{
17
namespace
emcal
18
{
19
20
void
EMCALChannelScaleFactors::insertVal
(
unsigned
int
cellID,
float
E_min,
float
E_max,
float
scale)
21
{
22
if
(cellID >= NCells || cellID < 0) {
23
throw
CalibContainerIndexException
(cellID);
24
}
else
{
25
ScaleFactors.at(cellID)[
EnergyIntervals
(E_min, E_max)] = scale;
26
}
27
}
28
29
float
EMCALChannelScaleFactors::getScaleVal
(
unsigned
int
cellID,
float
E)
const
30
{
31
if
(cellID >= NCells || cellID < 0) {
32
throw
CalibContainerIndexException
(cellID);
33
}
else
{
34
for
(
const
auto
& [energy, scale] : ScaleFactors[cellID]) {
35
if
(energy.isInInterval(E)) {
36
return
scale;
37
}
38
}
39
throw
InvalidEnergyIntervalException
(E, cellID);
40
}
41
}
42
}
// namespace emcal
43
}
// namespace o2
CalibContainerErrors.h
EMCALChannelScaleFactors.h
o2::emcal::CalibContainerIndexException
Error handling for invalid index in calibration request.
Definition
CalibContainerErrors.h:30
o2::emcal::EMCALChannelScaleFactors::insertVal
void insertVal(unsigned int cellID, float E_min, float E_max, float scale)
Definition
EMCALChannelScaleFactors.cxx:20
o2::emcal::EMCALChannelScaleFactors::getScaleVal
float getScaleVal(unsigned int cellID, float E) const
Definition
EMCALChannelScaleFactors.cxx:29
o2::emcal::EnergyIntervals
Definition
EMCALChannelScaleFactors.h:57
o2::emcal::InvalidEnergyIntervalException
Definition
EMCALChannelScaleFactors.h:31
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
BitstreamReader.h:24
Detectors
EMCAL
calib
src
EMCALChannelScaleFactors.cxx
Generated on Tue Feb 25 2025 22:50:37 for Project by
1.9.8