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
14
15namespace o2
16{
17namespace emcal
18{
19
20void 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
29float 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
Error handling for invalid index in calibration request.
void insertVal(unsigned int cellID, float E_min, float E_max, float scale)
float getScaleVal(unsigned int cellID, float E) const
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...