18#ifndef EMCAL_TIME_DATA_H_
19#define EMCAL_TIME_DATA_H_
34#include <boost/histogram.hpp>
35#include <boost/histogram/ostream.hpp>
36#include <boost/format.hpp>
39#include <boost/histogram.hpp>
49 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>>>;
58 mTimeHisto.resize(mNThreads);
59 mVecNEntriesInHisto.resize(mNThreads);
60 for (
size_t i = 0;
i < mNThreads; ++
i) {
62 mVecNEntriesInHisto[
i] = 0;
64 LOG(
debug) <<
"initialize time histogram with " <<
NCELLS <<
" cells";
70 void fill(
const gsl::span<const o2::emcal::Cell>
data);
99 mHistoSummed = mTimeHisto[0];
101 mHistoSummed.reset();
103 for (
const auto&
h : mTimeHisto) {
113 mGainCalibFactors = calibFactors;
114 mApplyGainCalib =
true;
127 unsigned int mNThreads = 1;
128 std::vector<boostHisto> mTimeHisto;
131 long unsigned int mNEntriesInHisto = 0;
132 std::vector<long unsigned int> mVecNEntriesInHisto;
133 bool mApplyGainCalib =
false;
Utils and constants for calibration and related workflows.
Class for time synchronization of RawReader instances.
static const EMCALCalibParams & Instance()
EMCAL compressed cell information.
void setNEntriesInHisto(long unsigned int n)
Set the number of entries in histogram.
void setHisto(boostHisto hist)
Set new calibration histogram.
long unsigned int getNEntriesInHisto() const
Get the number of entries in histogram.
void print()
Print a useful message about the container.
void PrintStream(std::ostream &stream) const
print stream
void addNEntriesInHisto(long unsigned int n)
Add the number of entries in histogram.
int getNEvents() const
Get number of events currently available for calibration.
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 > > > boostHisto
void setNEvents(int nevt)
Set number of events available for calibration.
void setGainCalibFactors(o2::emcal::GainCalibrationFactors *calibFactors)
Set gain calibration factors applied to the cell energy before filling the histograms.
~EMCALTimeCalibData()=default
o2::emcal::Geometry * mGeometry
void fill(const gsl::span< const o2::emcal::Cell > data)
Fill the container with the cell ID and amplitude and time information.
void merge(EMCALTimeCalibData *prev)
Merge the data of two slots.
void AddEvents(int nevt)
Add number of events available for calibration.
const boostHisto & getHisto()
Get current histogram.
bool hasEnoughData() const
Check if enough data for calibration has been accumulated.
o2::emcal::TimeCalibrationParams process()
Actual function where calibration is done. Has to be called in has enough data when enough data is th...
CCDB container for the gain calibration factors.
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.
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 ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"