14#include <TDirectory.h>
24 for (int32_t is = 0; is <
NChannels; is++) {
35 LOG(fatal) <<
"Mixing waveform with different configurations mN = " <<
mN <<
" != " <<
other.mN;
39 LOG(fatal) <<
"Mixing waveform with different configurations mPeak = " <<
mPeak <<
" != " <<
other.mPeak;
48 for (int32_t is = 0; is <
NChannels; is++) {
52 LOG(info) << __func__;
60 if (
other.mEntries > 0) {
62#ifdef O2_ZDC_WAVEFORMCALIB_DEBUG
63 printf(
"WaveformCalibChData::+= mFirstValid %5d -> %5d\n",
mFirstValid,
other.mFirstValid);
68#ifdef O2_ZDC_WAVEFORMCALIB_DEBUG
69 printf(
"WaveformCalibChData::+= mLastValid %5d -> %5d\n",
mLastValid,
other.mLastValid);
87 LOGF(info,
"WaveformCalibData::setCreationTime %llu", ctime);
95 LOGF(error,
"WaveformCalibData::getEntries channel index %d is out of range", is);
98 return mWave[is].getEntries();
110 LOGF(error,
"WaveformCalibData::getFirstValid channel index %d is out of range", is);
113 return mWave[is].getFirstValid();
125 LOGF(error,
"WaveformCalibData::getLastValid channel index %d is out of range", is);
128 return mWave[is].getLastValid();
139 if (
n > 0 &&
n <=
NBT) {
145 LOG(warn) <<
"WaveformCalibData " << __func__ <<
" wrong stored b.c. setting " <<
n <<
" not in range [1:" <<
NBT <<
"]";
151 if (
n > 0 &&
n <=
NBT) {
155 LOG(warn) <<
"WaveformCalibChData " << __func__ <<
" wrong stored b.c. setting " <<
n <<
" not in range [1:" <<
NBT <<
"]";
162 TDirectory* cwd = gDirectory;
163 TFile*
f =
new TFile(fn.data(),
"recreate");
165 LOG(error) <<
"Cannot create file: " << fn;
168 for (int32_t is = 0; is <
NChannels; is++) {
169 if (
mWave[is].mEntries > 0) {
170 TString
n = TString::Format(
"h%d", is);
172 int nbx =
mWave[is].mLastValid -
mWave[is].mFirstValid + 1;
176 for (
int ibx = 0; ibx < nbx; ibx++) {
177 h.SetBinContent(ibx + 1,
mWave[is].mData[
mWave[is].mFirstValid + ibx]);
179 h.SetEntries(
mWave[is].mEntries);
180 h.Write(
"", TObject::kOverwrite);
182 LOG(warn) <<
"WaveformCalibData " << __func__ <<
" waveform for ch " << is <<
" has too few entries: " <<
mWave[is].mEntries;
193 TDirectory* cwd = gDirectory;
194 TFile*
f =
new TFile(fn.data(),
"recreate");
196 LOG(error) <<
"Cannot create file: " << fn;
199 f->WriteObjectAny((
void*)
this, o2::zdc::WaveformCalibData::Class(),
"WaveformCalibData");
212 for (int32_t is = 0; is <
NChannels; is++) {
222 for (int32_t is = 0; is <
NChannels; is++) {
232 for (
int iw = 0; iw <
NW; iw++) {
Class for time synchronization of RawReader instances.
constexpr int NTimeBinsPerBC
constexpr std::string_view ChannelNames[]
VectorOfTObjectPtrs other
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"