Project
Loading...
Searching...
No Matches
UserLogicChecker.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#ifndef O2_MID_USERLOGICCHECKER_H
17#define O2_MID_USERLOGICCHECKER_H
18
19#include <cstdint>
20#include <string>
21#include <unordered_map>
22#include <gsl/gsl>
25
26namespace o2
27{
28namespace mid
29{
31{
32 public:
33 bool process(gsl::span<const ROBoard> bareData, gsl::span<const ROFRecord> bareRofs, gsl::span<const ROBoard> ulData, gsl::span<const ROFRecord> ulRofs, bool isFull = false);
34
36 std::string getDebugMessage() const { return mDebugMsg; }
37 std::string getSummary() const;
38 void clear();
39
40 private:
41 bool checkAll(gsl::span<const ROBoard> bareData, gsl::span<const ROFRecord> bareRofs, gsl::span<const ROBoard> ulData, gsl::span<const ROFRecord> ulRofs);
42 bool checkBoards(gsl::span<const ROBoard> bareData, gsl::span<const ROFRecord> bareRofs, gsl::span<const ROBoard> ulData, gsl::span<const ROFRecord> ulRofs);
43 void clearBoards();
44 void fillBoards(gsl::span<const ROBoard> data, gsl::span<const ROFRecord> rofRecords, bool isUL);
45 uint32_t getId(const ROBoard& board) const;
46
47 std::unordered_map<uint64_t, std::vector<size_t>> getOrderedIndexes(gsl::span<const ROFRecord> rofRecords) const;
48
49 bool isSame(const o2::mid::ROBoard& loc1, const o2::mid::ROBoard& loc2) const;
50 std::string printIRHex(const o2::InteractionRecord& ir) const;
51
52 std::string mDebugMsg{};
53
54 std::unordered_map<uint32_t, bool> mInsideDataTaking{};
55
56 std::unordered_map<uint32_t, std::array<unsigned long int, 2>> mStatistics{};
57
58 struct boardInfo {
59 InteractionRecord interactionRecord;
60 ROBoard board;
61 };
62
63 std::unordered_map<uint32_t, std::vector<boardInfo>> mBoardsBare;
64 std::unordered_map<uint32_t, std::vector<boardInfo>> mBoardsUL;
65 std::unordered_map<uint32_t, size_t> mLastCheckedBare;
66 std::unordered_map<uint32_t, size_t> mLastCheckedUL;
67};
68} // namespace mid
69} // namespace o2
70
71#endif /* O2_MID_USERLOGICCHECKER_H */
Definition of the MID event record.
Structure to store the readout board information.
std::string getSummary() const
std::string getDebugMessage() const
Gets the debug message.
GLboolean * data
Definition glcorearb.h:298
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
o2::InteractionRecord ir(0, 0)