Project
Loading...
Searching...
No Matches
RawReaderZDC.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// file RawReaderZDC.h class for RAW data reading
13
14#ifndef ALICEO2_RAWREADERZDC_H_
15#define ALICEO2_RAWREADERZDC_H_
16#include <iostream>
17#include <vector>
18#include <Rtypes.h>
20#include <Framework/Logger.h>
27#include "ZDCBase/Constants.h"
32#include "Framework/Lifetime.h"
33#include <gsl/span>
34
35namespace o2
36{
37namespace zdc
38{
40{
41 const ModuleConfig* mModuleConfig = nullptr; // Trigger/readout configuration object
42 uint32_t mTriggerMask = 0; // Trigger mask from ModuleConfig
43 std::map<InteractionRecord, EventData> mMapData; // Raw data cache
44 EventChData mCh; // Channel data to be decoded
45 std::vector<o2::zdc::BCData> mDigitsBC; // Digitized bunch crossing data
46 std::vector<o2::zdc::ChannelData> mDigitsCh; // Digitized channel data
47 std::vector<o2::zdc::OrbitData> mOrbitData; // Digitized orbit data
48 bool mDumpData = false; // Enable printout of all data
49 int mVerbosity = 0; // Verbosity level
50 uint32_t mEvents[NModules][NChPerModule] = {0}; // Debug words per module
51 uint32_t mDupOK[NModules][NChPerModule] = {0}; // Duplicate channels in bunches where it is expected
52 uint32_t mDupKO[NModules][NChPerModule] = {0}; // Duplicate channels in bunches where it is NOT expected
53
54 public:
55 RawReaderZDC(bool dumpData) : mDumpData(dumpData) {}
56 RawReaderZDC(const RawReaderZDC&) = default;
57
58 RawReaderZDC() = default;
59 ~RawReaderZDC() = default;
60
61 void setModuleConfig(const ModuleConfig* moduleConfig) { mModuleConfig = moduleConfig; };
62 const ModuleConfig* getModuleConfig() { return mModuleConfig; };
63 void setVerbosity(int v)
64 {
65 mVerbosity = v;
66 }
67 int getVerbosity() const { return mVerbosity; }
68 void setTriggerMask();
69
70 void clear();
71
72 // decoding binary data into data blocks
73 int processBinaryData(gsl::span<const uint8_t> payload, int linkID, uint8_t dataFormat); // processing data blocks into digits
74 int processWord(const uint32_t* word);
75 void process(const EventChData& ch);
76
78 {
79 getDigits(mDigitsBC, mDigitsCh, mOrbitData);
80 LOG(info) << "Number of Digits: " << mDigitsBC.size();
81 LOG(info) << "Number of ChannelData: " << mDigitsCh.size();
82 LOG(info) << "Number of OrbitData: " << mOrbitData.size();
83 }
84
85 int getDigits(std::vector<BCData>& digitsBC, std::vector<ChannelData>& digitsCh, std::vector<OrbitData>& orbitData);
86
87 void inspectDup(); // Check duplicate channels in raw data
88
89 static void prepareOutputSpec(std::vector<o2::framework::OutputSpec>& outputSpec)
90 {
91 outputSpec.emplace_back("ZDC", "DIGITSBC", 0, o2::framework::Lifetime::Timeframe);
92 outputSpec.emplace_back("ZDC", "DIGITSCH", 0, o2::framework::Lifetime::Timeframe);
93 outputSpec.emplace_back("ZDC", "DIGITSPD", 0, o2::framework::Lifetime::Timeframe);
94 }
95
102};
103} // namespace zdc
104} // namespace o2
105
106#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.
Definition of the RAW Data Header.
Container class to store NTimeBinsPerBC ADC values of single ZDC channel.
Container of ZDC raw data.
converts digits to raw format
void snapshot(const Output &spec, T const &object)
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
const ModuleConfig * getModuleConfig()
void setVerbosity(int v)
void setModuleConfig(const ModuleConfig *moduleConfig)
int getVerbosity() const
int getDigits(std::vector< BCData > &digitsBC, std::vector< ChannelData > &digitsCh, std::vector< OrbitData > &orbitData)
int processBinaryData(gsl::span< const uint8_t > payload, int linkID, uint8_t dataFormat)
static void prepareOutputSpec(std::vector< o2::framework::OutputSpec > &outputSpec)
int processWord(const uint32_t *word)
RawReaderZDC(const RawReaderZDC &)=default
void makeSnapshot(o2::framework::ProcessingContext &pc)
RawReaderZDC(bool dumpData)
const GLdouble * v
Definition glcorearb.h:832
constexpr o2::header::DataOrigin gDataOriginZDC
Definition DataHeader.h:578
struct o2::upgrades_utils::@463 zdc
structure to keep FT0 information
constexpr int NModules
Definition Constants.h:68
constexpr int NChPerModule
Definition Constants.h:69
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"