Project
Loading...
Searching...
No Matches
ROFFinder.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
16
17#ifndef O2_MCH_ROFFINDER_H_
18#define O2_MCH_ROFFINDER_H_
19
20#include <cassert>
21#include <cstdint>
22#include <unordered_map>
23#include <vector>
24
25#include <gsl/span>
26
30
31namespace o2
32{
33namespace mch
34{
35namespace raw
36{
37
39{
40 public:
42 using RawDigitId = size_t;
43 using RawDigitIdVector = std::vector<RawDigitId>;
44
45 ROFFinder(const DataDecoder::RawDigitVector& digits, uint32_t firstTForbit);
47
48 void process(bool dummyROFs = false);
49
51
52 std::optional<DataDecoder::RawDigit> getOrderedDigit(int i);
53 RawDigitIdVector getOrderedDigits() { return mOrderedDigits; }
54 std::vector<o2::mch::ROFRecord> getROFRecords() { return mOutputROFs; }
55
56 char* saveDigitsToBuffer(size_t& bufSize);
57 char* saveROFRsToBuffer(size_t& bufSize);
58
59 bool isRofTimeMonotonic();
61 void dumpOutputDigits();
62 void dumpOutputROFs();
63
64 private:
65 void sortDigits();
66 void storeROF();
67
68 const DataDecoder::RawDigitVector& mInputDigits;
69 uint32_t mFirstTForbit;
70
71 int mFirstIdx{-1};
72 int mEntries{0};
74
75 RawDigitIdVector mOrderedDigits;
76 std::vector<o2::mch::ROFRecord> mOutputROFs{};
77};
78
79} // namespace raw
80} // namespace mch
81} // namespace o2
82
83#endif // O2_MCH_ROFFINDERSIMPLE_H_
Definition of the decoder for the MCH data.
int32_t i
Definition of the MCH ROFrame record.
std::vector< RawDigit > RawDigitVector
std::vector< o2::mch::ROFRecord > getROFRecords()
Definition ROFFinder.h:54
std::optional< DataDecoder::RawDigit > getOrderedDigit(int i)
std::vector< RawDigitId > RawDigitIdVector
Definition ROFFinder.h:43
char * saveROFRsToBuffer(size_t &bufSize)
char * saveDigitsToBuffer(size_t &bufSize)
o2::InteractionRecord digitTime2IR(const RawDigit &digit)
RawDigitIdVector getOrderedDigits()
Definition ROFFinder.h:53
GLuint GLsizei bufSize
Definition glcorearb.h:790
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< Digit > digits