Project
Loading...
Searching...
No Matches
EMCALTempCalibExtractor.h
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
17
18#ifndef EMCALTEMPCALIBEXTRACTOR_H_
19#define EMCALTEMPCALIBEXTRACTOR_H_
20
21#include <algorithm>
22#include <cmath>
23#include <iostream>
25#include "EMCALCalib/ElmbData.h"
27#include "EMCALBase/Geometry.h"
28
29namespace o2
30{
31namespace emcal
32{
33
35{
36
37 public:
40 {
41 LOG(info) << "initialized EMCALTempCalibExtractor";
42 try {
43 // Try to access geometry initialized ountside
46 mGeometry = o2::emcal::Geometry::GetInstanceFromRunNumber(300000); // fallback option
47 }
48 };
51
55 void InitializeFromCCDB(std::string path, uint64_t timestamp);
56
61 float getTemperatureForSM(const unsigned short iSM, o2::emcal::ElmbData* ElmbData) const;
62
66 float getGainCalibFactor(const unsigned short cellID) const;
67
71 void setAcceptedEnergyRange(float low, float high);
72
74 void setUseMedian(const bool tmp) { mUseMedian = tmp; }
75
79 std::vector<unsigned short> getSensorsForSM(const unsigned short iSM) const;
80
81 private:
82 static constexpr unsigned short mNCells = 17664;
83 std::array<float, mNCells> mGainCalibFactors;
84 o2::emcal::Geometry* mGeometry;
85 std::array<float, 2> mAcceptedTempRange = {15., 30.};
86 bool mUseMedian = true;
87};
88
89} // namespace emcal
90
91} // namespace o2
92
93#endif
float getTemperatureForSM(const unsigned short iSM, o2::emcal::ElmbData *ElmbData) const
get average temperature in a supermodule
void setUseMedian(const bool tmp)
set if median (true) or mean (false) should be used for averaging of the temperature in a SM
~EMCALTempCalibExtractor()=default
Destructor.
std::vector< unsigned short > getSensorsForSM(const unsigned short iSM) const
get sensor IDs for a specific supermodule
void setAcceptedEnergyRange(float low, float high)
set temperature range in which sensor ddata is assumed to be good
float getGainCalibFactor(const unsigned short cellID) const
get gain calibration factor depending on the temperature and the slope of the cell
void InitializeFromCCDB(std::string path, uint64_t timestamp)
Initialize temperature data and slope for each cell from the ccdb.
Error handling access to non-initialized geometry.
EMCAL geometry definition.
Definition Geometry.h:42
static Geometry * GetInstanceFromRunNumber(Int_t runNumber, const std::string_view="", const std::string_view mcname="TGeant3", const std::string_view mctitle="")
Instanciate geometry depending on the run number. Mostly used in analysis and MC anchors.
Definition Geometry.cxx:242
static Geometry * GetInstance()
Get geometry instance. It should have been set before.
Definition Geometry.cxx:213
GLsizei const GLchar *const * path
Definition glcorearb.h:3591
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"