18#ifndef CHANNEL_DATA_H_
19#define CHANNEL_DATA_H_
38#include <boost/histogram.hpp>
39#include <boost/histogram/ostream.hpp>
56 using boostHisto = boost::histogram::histogram<std::tuple<boost::histogram::axis::regular<double, boost::use_default, boost::use_default, boost::use_default>, boost::histogram::axis::regular<double, boost::use_default, boost::use_default, boost::use_default>>>;
71 mVecNEntriesInHisto.resize(mNThreads);
72 mHisto.resize(mNThreads);
73 mHistoTime.resize(mNThreads);
74 for (
size_t i = 0;
i < mNThreads; ++
i) {
75 mHisto[
i] = boost::histogram::make_histogram(boost::histogram::axis::regular<>(mNBins, 0., mRange), boost::histogram::axis::regular<>(
NCELLS, -0.5,
NCELLS - 0.5));
76 mHistoTime[
i] = boost::histogram::make_histogram(boost::histogram::axis::regular<>(mNBinsTime, mRangeTimeLow, mRangeTimeHigh), boost::histogram::axis::regular<>(
NCELLS, -0.5,
NCELLS - 0.5));
77 mVecNEntriesInHisto[
i] = 0;
92 void fill(
const gsl::span<const o2::emcal::Cell>
data);
102 mHistoSummed = mHisto[0];
104 mHistoSummed.reset();
106 for (
const auto&
h : mHisto) {
113 void setHisto(boostHisto hist,
int nthr = 0) { mHisto[nthr] = hist; }
118 mHistoTimeSummed = mHistoTime[0];
119 mHistoTimeSummed.reset();
120 for (
const auto&
h : mHistoTime) {
121 mHistoTimeSummed +=
h;
123 return mHistoTimeSummed;
127 void setHistoTime(boostHisto hist,
int nthr = 0) { mHistoTime[nthr] = hist; }
150 mGainCalibFactors = calibFactors;
151 for (
unsigned int i = 0;
i < mArrGainCalibFactors.size(); ++
i) {
154 mApplyGainCalib =
true;
160 size_t mNThreads = 1;
161 std::vector<boostHisto> mHisto;
163 int mNBinsTime = 1000;
164 float mRangeTimeLow = -500;
165 float mRangeTimeHigh = 500;
166 std::vector<boostHisto> mHistoTime;
169 long unsigned int mNEntriesInHisto = 0;
170 std::vector<long unsigned int> mVecNEntriesInHisto;
176 bool mApplyGainCalib =
false;
178 std::array<double, 17664> mArrGainCalibFactors;
179 std::shared_ptr<EMCALCalibExtractor> mCalibExtractor;
Perform the EMCAL bad channel calibration.
Class for time synchronization of RawReader instances.
CCDB container for masked cells in EMCAL.
EMCAL compressed cell information.
~EMCALChannelData()=default
o2::emcal::Geometry * mGeometry
void analyzeSlot()
Peform the calibration and flag the bad channel map Average energy per hit histogram is fitted with a...
void setHistoTime(boostHisto hist, int nthr=0)
Set new calibration histogram with timing info.
void setNEntriesInHisto(long unsigned int n)
void PrintStream(std::ostream &stream) const
Print relevant info for EMCALChannelData on a given stream.
long unsigned int getNEntriesInHisto() const
void addEntriesInHisto(long unsigned int n)
void setNEvents(int nevt)
void merge(EMCALChannelData *prev)
Merge the data of two slots.
void fill(const gsl::span< const o2::emcal::Cell > data)
Fill the container with the cell ID and amplitude.
const boostHisto & getHistoTime()
Get current calibration histogram with time information.
void print()
Print a useful message about the container.
void setHisto(boostHisto hist, int nthr=0)
Set new calibration histogram.
const boostHisto & getHisto()
Get current calibration histogram.
bool hasEnoughData() const
Check if enough stataistics was accumulated to perform calibration.
void setGainCalibFactors(o2::emcal::GainCalibrationFactors *calibFactors)
CCDB container for the gain calibration factors.
float getGainCalibFactors(unsigned short iCell) const
Get the gain calibration factor for a certain cell.
EMCAL geometry definition.
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.
std::ostream & operator<<(std::ostream &stream, const Cell &cell)
Stream operator for EMCAL cell.
boost::histogram::histogram< std::tuple< boost::histogram::axis::regular< double, boost::use_default, boost::use_default, boost::use_default >, boost::histogram::axis::integer<> >, boost::histogram::unlimited_storage< std::allocator< char > > > boostHisto
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...