Project
Loading...
Searching...
No Matches
RawReaderFT0.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 RawReaderFT0.h class for RAW data reading
13//
14// Artur.Furs
15// afurs@cern.ch
16//
17//Main purpuse is to decode FT0 data blocks and push them to DigitBlockFT0 for proccess
18//TODO: prepare wrappers for containers with digits and combine classes below into one template class?
19#ifndef ALICEO2_FIT_RAWREADERFT0_H_
20#define ALICEO2_FIT_RAWREADERFT0_H_
21#include <iostream>
22#include <vector>
23#include <Rtypes.h>
25
28
32#include <gsl/span>
33
34namespace o2
35{
36namespace ft0
37{
38//Normal TCM mode
39template <bool useTrgInput = false>
41{
42 public:
43 RawReaderFT0(bool dumpData) : mDumpData(dumpData) {}
44 RawReaderFT0(const RawReaderFT0&) = default;
45
46 RawReaderFT0() = default;
47 ~RawReaderFT0() = default;
48 static constexpr bool sUseTrgInput = useTrgInput;
49 void clear()
50 {
51 mVecDigits.clear();
52 if constexpr (sUseTrgInput) {
53 mVecTriggerInput.clear();
54 }
55 mVecChannelData.clear();
56 }
58 {
59 if constexpr (sUseTrgInput) {
61 } else {
63 }
64 LOG(info) << "Number of Digits: " << mVecDigits.size();
65 LOG(info) << "Number of ChannelData: " << mVecChannelData.size();
66 if constexpr (sUseTrgInput) {
67 LOG(info) << "Number of TriggerInput: " << mVecTriggerInput.size();
68 }
69 if (mDumpData) {
71 }
72 }
73 static void prepareOutputSpec(std::vector<o2::framework::OutputSpec>& outputSpec)
74 {
75 outputSpec.emplace_back(o2::header::gDataOriginFT0, "DIGITSBC", 0, o2::framework::Lifetime::Timeframe);
76 outputSpec.emplace_back(o2::header::gDataOriginFT0, "DIGITSCH", 0, o2::framework::Lifetime::Timeframe);
77 if constexpr (sUseTrgInput) {
78 outputSpec.emplace_back(o2::header::gDataOriginFT0, "TRIGGERINPUT", 0, o2::framework::Lifetime::Timeframe);
79 }
80 }
90 std::vector<Digit> mVecDigits;
91 std::vector<DetTrigInput> mVecTriggerInput;
92 std::vector<ChannelData> mVecChannelData;
93};
94
95//Extended TCM mode (additional raw data struct)
96template <bool useTrgInput = false>
98{
99 public:
100 RawReaderFT0ext(bool dumpData) : mDumpData(dumpData) {}
102 static constexpr bool sUseTrgInput = useTrgInput;
103 RawReaderFT0ext() = default;
104 ~RawReaderFT0ext() = default;
105 void clear()
106 {
107 mVecDigits.clear();
108 mVecChannelData.clear();
109 mVecTrgExt.clear();
110 if constexpr (sUseTrgInput) {
111 mVecTriggerInput.clear();
112 }
113 }
115 {
116 if constexpr (sUseTrgInput) {
118 } else {
120 }
121 LOG(info) << "Number of Digits: " << mVecDigits.size();
122 LOG(info) << "Number of ChannelData: " << mVecChannelData.size();
123 LOG(info) << "Number of TriggerExt: " << mVecTrgExt.size();
124 if (mDumpData) {
126 }
127 }
128 static void prepareOutputSpec(std::vector<o2::framework::OutputSpec>& outputSpec)
129 {
130 outputSpec.emplace_back(o2::header::gDataOriginFT0, "DIGITSBC", 0, o2::framework::Lifetime::Timeframe);
131 outputSpec.emplace_back(o2::header::gDataOriginFT0, "DIGITSCH", 0, o2::framework::Lifetime::Timeframe);
132 outputSpec.emplace_back(o2::header::gDataOriginFT0, "DIGITSTRGEXT", 0, o2::framework::Lifetime::Timeframe);
133 if constexpr (sUseTrgInput) {
134 outputSpec.emplace_back(o2::header::gDataOriginFT0, "TRIGGERINPUT", 0, o2::framework::Lifetime::Timeframe);
135 }
136 }
147 std::vector<Digit> mVecDigits;
148 std::vector<ChannelData> mVecChannelData;
149 std::vector<TriggersExt> mVecTrgExt;
150 std::vector<DetTrigInput> mVecTriggerInput;
151};
152
153} // namespace ft0
154} // namespace o2
155
156#endif
Class to describe fired and stored channels for the BC and to refer to channel data.
void snapshot(const Output &spec, T const &object)
DataAllocator & outputs()
The data allocator is used to allocate memory for the output data.
static constexpr bool sUseTrgInput
RawReaderFT0(bool dumpData)
std::vector< DetTrigInput > mVecTriggerInput
static void prepareOutputSpec(std::vector< o2::framework::OutputSpec > &outputSpec)
RawReaderFT0(const RawReaderFT0 &)=default
std::vector< ChannelData > mVecChannelData
void makeSnapshot(o2::framework::ProcessingContext &pc)
std::vector< Digit > mVecDigits
std::vector< DetTrigInput > mVecTriggerInput
RawReaderFT0ext(bool dumpData)
static void prepareOutputSpec(std::vector< o2::framework::OutputSpec > &outputSpec)
static constexpr bool sUseTrgInput
void makeSnapshot(o2::framework::ProcessingContext &pc)
RawReaderFT0ext(const RawReaderFT0ext &)=default
std::vector< ChannelData > mVecChannelData
std::vector< TriggersExt > mVecTrgExt
std::vector< Digit > mVecDigits
constexpr o2::header::DataOrigin gDataOriginFT0
Definition DataHeader.h:566
struct o2::upgrades_utils::@462 ft0
structure to keep V0C information
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
LOG(info)<< "Compressed in "<< sw.CpuTime()<< " s"