Project
Loading...
Searching...
No Matches
TempCalibrationParams.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
13
14#include <fairlogger/Logger.h>
15
16#include <TH1.h>
17
18#include <iostream>
19
20using namespace o2::emcal;
21
22void TempCalibrationParams::addTempCalibParam(unsigned short cellID, float Slope, float ParamA0)
23{
24 mTempCalibParamsSlope[cellID] = Slope;
25 mTempCalibParamsA0[cellID] = ParamA0;
26}
27
28float TempCalibrationParams::getTempCalibParamSlope(unsigned short cellID) const
29{
30 return mTempCalibParamsSlope[cellID];
31}
32
33float TempCalibrationParams::getTempCalibParamA0(unsigned short cellID) const
34{
35 return mTempCalibParamsA0[cellID];
36}
37
39{
40
41 auto hist = new TH1F("TempCalibrationParamsSlope", "Temp Calibration Params Slope", 17664, 0, 17664);
42 hist->SetDirectory(nullptr);
43
44 for (std::size_t icell{0}; icell < mTempCalibParamsSlope.size(); ++icell) {
45 hist->SetBinContent(icell + 1, mTempCalibParamsSlope[icell]);
46 }
47
48 return hist;
49}
50
52{
53
54 auto hist = new TH1F("TempCalibrationParamsA0", "Temp Calibration Params A0", 17664, 0, 17664);
55 hist->SetDirectory(nullptr);
56
57 for (std::size_t icell{0}; icell < mTempCalibParamsA0.size(); ++icell) {
58 hist->SetBinContent(icell + 1, mTempCalibParamsA0[icell]);
59 }
60
61 return hist;
62}
63
65{
66 return mTempCalibParamsSlope == other.mTempCalibParamsSlope && mTempCalibParamsA0 == other.mTempCalibParamsA0;
67}
float getTempCalibParamA0(unsigned short cellID) const
Get the temperature calibration coefficient (A0 param) for a certain cell.
TH1 * getHistogramRepresentationSlope() const
Convert the temperature calibration coefficient arrays to histograms.
bool operator==(const TempCalibrationParams &other) const
Comparison of two temperature calibration coefficients.
float getTempCalibParamSlope(unsigned short cellID) const
Get the temperature calibration coefficient (slope) for a certain cell.
VectorOfTObjectPtrs other