Project
Loading...
Searching...
No Matches
SubframeMetadata.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 SUBFRAMEMETADATA_H
13#define SUBFRAMEMETADATA_H
14
15#include <vector>
16
17namespace o2
18{
19namespace data_flow
20{
21
23 // TODO: replace with timestamp struct
24 // IDEA: not timeframeID because can be calculcated with helper function
25 // QUESTION: isn't the duration set to ~22ms?
26 uint64_t startTime = ~(uint64_t)0;
27 uint64_t duration = ~(uint64_t)0;
28
29 //further meta data to be added
30
31 // putting data specific to FLP origin
33};
34
35// Helper function to derive the timeframe id from the actual timestamp.
36// Timestamp is in nanoseconds. Each Timeframe is ~22ms i.e. 2^17 nanoseconds,
37// so we can get a unique id by dividing by the timeframe period and masking
38// the lower 16 bits. Overlaps will only happen every ~ 22 minutes.
39constexpr uint16_t
40 timeframeIdFromTimestamp(uint64_t timestamp, uint64_t timeFrameDuration)
41{
42 return (timestamp / timeFrameDuration) & 0xffff;
43}
44
45// A Mockup class to describe some TPC-like payload
47 float x = 0.f;
48 float y = 0.f;
49 float z = 1.5f;
50 float q = 0.;
51 uint64_t timeStamp; // the time this thing was digitized/recorded
52};
53
55 std::vector<TPCTestCluster> clusters;
56};
57
58// a mockup class to describe some "ITS" payload
59struct ITSRawData {
60 float x = -1.;
61 float y = 1.;
62 uint64_t timeStamp;
63};
64
65} // namespace data_flow
66} // namespace o2
67
68#endif
GLint GLenum GLint x
Definition glcorearb.h:403
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
constexpr uint16_t timeframeIdFromTimestamp(uint64_t timestamp, uint64_t timeFrameDuration)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::vector< TPCTestCluster > clusters