Project
Loading...
Searching...
No Matches
ELinkDataShaper.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_ELINKDATASHAPER_H
17#define O2_MID_ELINKDATASHAPER_H
18
19#include <cstdint>
20#include <vector>
21#include <functional>
26#include "MIDRaw/ELinkDecoder.h"
27
28namespace o2
29{
30namespace mid
31{
33{
34 public:
35 ELinkDataShaper(bool isDebugMode, bool isLoc, uint8_t uniqueId, const ElectronicsDelay& electronicsDelay);
37 inline void onDone(const ELinkDecoder& decoder, std::vector<ROBoard>& data, std::vector<ROFRecord>& rofs) { std::invoke(mOnDone, this, decoder, data, rofs); }
38
39 void set(uint32_t orbit, uint32_t trigger);
40
41 private:
42 uint8_t mUniqueId = 0;
43 ElectronicsDelay mElectronicsDelay{};
44 uint32_t mRDHOrbit = 0;
45
47 InteractionRecord mExpectedFET;
48 int16_t mLocalToBCSelfTrig = 0;
49 uint16_t mMaxBunches = 0;
50
51 typedef void (ELinkDataShaper::*OnDoneFunction)(const ELinkDecoder&, std::vector<ROBoard>& data, std::vector<ROFRecord>& rofs);
52 OnDoneFunction mOnDone{&ELinkDataShaper::onDoneLoc};
53
54 void onDoneLoc(const ELinkDecoder& decoder, std::vector<ROBoard>& data, std::vector<ROFRecord>& rofs);
55 void onDoneLocDebug(const ELinkDecoder& decoder, std::vector<ROBoard>& data, std::vector<ROFRecord>& rofs);
56 void onDoneReg(const ELinkDecoder&, std::vector<ROBoard>& data, std::vector<ROFRecord>& rofs){};
57 void onDoneRegDebug(const ELinkDecoder& decoder, std::vector<ROBoard>& data, std::vector<ROFRecord>& rofs);
58
59 void addLoc(const ELinkDecoder& decoder, EventType eventType, InteractionRecord ir, std::vector<ROBoard>& data, std::vector<ROFRecord>& rofs);
60 bool checkLoc(const ELinkDecoder& decoder);
61 EventType processCalibrationTrigger(const InteractionRecord& ir);
62 void processHBTrigger(uint16_t localClock, uint8_t triggerWord);
63 EventType processSelfTriggered(InteractionRecord& ir);
64 bool processTrigger(const ELinkDecoder& decoder, EventType& eventType, InteractionRecord& ir);
65};
66} // namespace mid
67} // namespace o2
68
69#endif /* O2_MID_ELINKDATASHAPER_H */
MID e-link decoder.
Delay parameters for MID electronics.
uint64_t orbit
Definition RawEventData.h:6
Definition of the MID event record.
Structure to store the readout board information.
void onDone(const ELinkDecoder &decoder, std::vector< ROBoard > &data, std::vector< ROFRecord > &rofs)
Main function to be executed when decoding is done.
void set(uint32_t orbit, uint32_t trigger)
GLboolean * data
Definition glcorearb.h:298
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Defining DataPointCompositeObject explicitly as copiable.
o2::InteractionRecord ir(0, 0)