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
17
namespace
o2
18
{
19
namespace
data_flow
20
{
21
22
struct
SubframeMetadata
{
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
32
int
flpIndex
;
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.
39
constexpr
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
46
struct
TPCTestCluster
{
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
54
struct
TPCTestPayload
{
55
std::vector<TPCTestCluster>
clusters
;
56
};
57
58
// a mockup class to describe some "ITS" payload
59
struct
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
int
x
GLint GLenum GLint x
Definition
glcorearb.h:403
z
GLdouble GLdouble GLdouble z
Definition
glcorearb.h:843
o2::data_flow::timeframeIdFromTimestamp
constexpr uint16_t timeframeIdFromTimestamp(uint64_t timestamp, uint64_t timeFrameDuration)
Definition
SubframeMetadata.h:40
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
BitstreamReader.h:24
o2::data_flow::ITSRawData
Definition
SubframeMetadata.h:59
o2::data_flow::ITSRawData::timeStamp
uint64_t timeStamp
Definition
SubframeMetadata.h:62
o2::data_flow::SubframeMetadata
Definition
SubframeMetadata.h:22
o2::data_flow::SubframeMetadata::duration
uint64_t duration
Definition
SubframeMetadata.h:27
o2::data_flow::SubframeMetadata::flpIndex
int flpIndex
Definition
SubframeMetadata.h:32
o2::data_flow::SubframeMetadata::startTime
uint64_t startTime
Definition
SubframeMetadata.h:26
o2::data_flow::TPCTestCluster
Definition
SubframeMetadata.h:46
o2::data_flow::TPCTestCluster::timeStamp
uint64_t timeStamp
Definition
SubframeMetadata.h:51
o2::data_flow::TPCTestCluster::q
float q
Definition
SubframeMetadata.h:50
o2::data_flow::TPCTestPayload
Definition
SubframeMetadata.h:54
o2::data_flow::TPCTestPayload::clusters
std::vector< TPCTestCluster > clusters
Definition
SubframeMetadata.h:55
DataFormats
Headers
include
Headers
SubframeMetadata.h
Generated on Tue Feb 25 2025 17:02:53 for Project by
1.9.8