Project
Loading...
Searching...
No Matches
GainCalibrationFactors.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
15#include <fairlogger/Logger.h>
16
17#include <TH1.h>
18
19#include <iostream>
20
21using namespace o2::emcal;
22
23void GainCalibrationFactors::addGainCalibFactor(unsigned short iCell, float gainFactor)
24{
25 if (iCell >= mGainCalibFactors.size()) {
27 }
28 mGainCalibFactors[iCell] = gainFactor;
29}
30
31float GainCalibrationFactors::getGainCalibFactors(unsigned short iCell) const
32{
33 if (iCell >= mGainCalibFactors.size()) {
35 }
36 return mGainCalibFactors[iCell];
37}
38
40{
41 auto hist = new TH1F("GainCalibrationFactors", "GainCalibrationFactors", 17664, 0, 17664);
42 hist->SetDirectory(nullptr);
43
44 for (std::size_t icell{0}; icell < mGainCalibFactors.size(); ++icell) {
45 hist->SetBinContent(icell + 1, mGainCalibFactors[icell]);
46 }
47
48 return hist;
49}
50
52{
53 return mGainCalibFactors == other.mGainCalibFactors;
54}
Error handling for invalid index in calibration request.
CCDB container for the gain calibration factors.
TH1 * getHistogramRepresentation() const
Convert the gain calibration factors to a histogram.
float getGainCalibFactors(unsigned short iCell) const
Get the gain calibration factor for a certain cell.
bool operator==(const GainCalibrationFactors &other) const
Comparison of two gain calibration factors containers.
void addGainCalibFactor(unsigned short iCell, float gainFactor)
Add gain calibration factors to the container.
VectorOfTObjectPtrs other