Project
Loading...
Searching...
No Matches
WaveformCalibQueue.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
12#ifndef ZDC_WAVEFORMCALIB_QUEUE_H
13#define ZDC_WAVEFORMCALIB_QUEUE_H
14
16#include "ZDCBase/Constants.h"
24#include <deque>
25
29
30namespace o2
31{
32namespace zdc
33{
34
36 WaveformCalibQueue() = default;
41
42 int mFirst = 0; // First bunch of waveform w.r.t. bunch of signal peak
43 int mLast = 0; // Last bunch of waveform w.r.t. bunch of signal peak
44 int mPk = 0; // Bunch position of peak w.r.t. first bunch
45 int mN = 1; // Number of bunches in waveform
46 int mPeak = 0; // Peak position (interpolated samples) w.r.t. first point
47 int mNP = 0; // Number of interpolated points in waveform
50 int mVerbosity = 0;
51
52 const WaveformCalibConfig* mCfg = nullptr;
53
54 static int peak(int pk)
55 {
56 return NIS * pk + NIS / 2;
57 }
58
59 void configure(const WaveformCalibConfig* cfg);
60
61 std::deque<int32_t> mEntry; // Position of event
62 std::deque<o2::InteractionRecord> mIR; // IR of event
63 std::deque<bool> mHasInfos[NChannels]; // Channel has info messages
64 std::deque<uint32_t> mNTDC[NTDCChannels]; // Number of TDCs in event
65 std::deque<float> mTDCA[NTDCChannels]; // Peak amplitude
66 std::deque<float> mTDCP[NTDCChannels]; // Peak position
67 std::deque<int32_t> mFirstW; // Position of first waveform in event
68 std::deque<int32_t> mNW; // Number of waveforms in event
69
70 void clear()
71 {
72#ifdef O2_ZDC_WAVEFORMCALIB_DEBUG
73 LOG(info) << "WaveformCalibConfig::" << __func__;
74#endif
75 mIR.clear();
76 mEntry.clear();
77 for (int isig = 0; isig < NChannels; isig++) {
78 mHasInfos[isig].clear();
79 }
80 for (int itdc = 0; itdc < NTDCChannels; itdc++) {
81 mNTDC[itdc].clear();
82 mTDCA[itdc].clear();
83 mTDCP[itdc].clear();
84 }
85 mFirstW.clear();
86 mNW.clear();
87 }
88
89 void pop()
90 {
91 mIR.pop_front();
92 mEntry.pop_front();
93 for (int isig = 0; isig < NChannels; isig++) {
94 mHasInfos[isig].pop_front();
95 }
96 for (int itdc = 0; itdc < NTDCChannels; itdc++) {
97 mNTDC[itdc].pop_front();
98 mTDCA[itdc].pop_front();
99 mTDCP[itdc].pop_front();
100 }
101 mFirstW.pop_front();
102 mNW.pop_front();
103#ifdef O2_ZDC_WAVEFORMCALIB_DEBUG
104 LOG(info) << "WaveformCalibConfig::" << __func__ << " remaining: " << mNW.size();
105#endif
106 }
107
108 uint32_t append(RecEventFlat& ev);
109 void appendEv(RecEventFlat& ev);
110 int hasData(int isig, const gsl::span<const o2::zdc::ZDCWaveform>& wave);
111 int addData(int isig, const gsl::span<const o2::zdc::ZDCWaveform>& wave, WaveformCalibData& data);
112 void print();
113 void printConf();
114};
115
116} // namespace zdc
117} // namespace o2
118
119#endif
Class to describe fired triggered and/or stored channels for the BC and to refer to channel data.
Class to describe pedestal data accumulated over the orbit.
Class to decode the reconstructed ZDC event (single BC with signal in one of detectors)
Class to describe reconstructed ZDC event (single BC with signal in one of detectors)
Configuration of ZDC Tower intercalibration procedure.
Waveform calibration intermediate data.
Container class to store NTimeBinsPerBC ADC values of single ZDC channel.
GLboolean * data
Definition glcorearb.h:298
struct o2::upgrades_utils::@463 zdc
structure to keep FT0 information
constexpr int NTDCChannels
Definition Constants.h:90
constexpr int NChannels
Definition Constants.h:65
constexpr int NIS
Definition Constants.h:97
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
const WaveformCalibConfig * mCfg
int addData(int isig, const gsl::span< const o2::zdc::ZDCWaveform > &wave, WaveformCalibData &data)
std::deque< int32_t > mFirstW
std::deque< float > mTDCP[NTDCChannels]
int mTimeHigh[NChannels]
Cut on position difference low.
void appendEv(RecEventFlat &ev)
int mVerbosity
Cut on position difference high.
std::deque< o2::InteractionRecord > mIR
std::deque< uint32_t > mNTDC[NTDCChannels]
WaveformCalibQueue(WaveformCalibConfig *cfg)
uint32_t append(RecEventFlat &ev)
std::deque< float > mTDCA[NTDCChannels]
std::deque< bool > mHasInfos[NChannels]
int hasData(int isig, const gsl::span< const o2::zdc::ZDCWaveform > &wave)
std::deque< int32_t > mEntry
void configure(const WaveformCalibConfig *cfg)
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"