Project
Loading...
Searching...
No Matches
DigitRawEncoder.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 O2_MCH_RAW_ENCODER_DIGIT_RAW_ENCODER_H
13#define O2_MCH_RAW_ENCODER_DIGIT_RAW_ENCODER_H
14
21#include <cstdint>
22#include <functional>
23#include <gsl/span>
24#include <set>
25#include <string>
26
29namespace o2::mch::raw
30{
31
32enum class OutputSplit : int {
33 None, // no splitting, i.e. one file for all
34 PerLink, // one file per link
35 PerCruEndpoint // one file per CRU endpoint
36};
37
39 std::string outputDir = "."; // directory where the raw data files will be written
40 bool chargeSumMode = true; // whether to encode only charge sum or all samples (usually true)
41 OutputSplit splitMode = OutputSplit::PerLink; // how to organize raw output file(s)
42 bool userLogic = true; // whether or not to use user logic (usually true)
43 int userLogicVersion = 1; // UL version (only relevant if userLogic=true)
44 bool noEmptyHBF = false; // disable writing of empty HBFs (for debug)
45 bool noGRP = false; // do not try to read GRP information (for debug or unit tests)
46 bool dummyElecMap = false; // use dummy electronic mapping (for debug only, temporary)
47 bool writeHB = true; // write Heatbeat headers at start of time frame
48 int rawFileWriterVerbosity = 0; // verbosity of the RawFileWriter
49 int rdhVersion = 6; // RDH version to use
50};
51
53{
54 public:
56
57 void addHeartbeats(std::set<DsElecId> dsElecIds, uint32_t orbit);
58
59 void encodeDigits(gsl::span<o2::mch::Digit> digits, uint32_t orbit, uint16_t bc);
60
61 void writeConfig();
62
63 private:
65 o2::raw::RawFileWriter mRawFileWriter;
66 Solar2LinkInfo mSolar2LinkInfo;
67 std::set<LinkInfo> mLinks;
68 std::unique_ptr<PayloadEncoder> mPayloadEncoder;
69 DigitPayloadEncoder mDigitPayloadEncoder;
70};
71
72} // namespace o2::mch::raw
73#endif
uint64_t orbit
Definition RawEventData.h:6
uint64_t bc
Definition RawEventData.h:5
Utility class to write detectors data to (multiple) raw data file(s) respecting CRU format.
void encodeDigits(gsl::span< o2::mch::Digit > digits, uint32_t orbit, uint16_t bc)
void addHeartbeats(std::set< DsElecId > dsElecIds, uint32_t orbit)
std::function< std::optional< LinkInfo >(uint16_t)> Solar2LinkInfo
Marks an empty item in the context.
std::vector< Digit > digits