Project
Loading...
Searching...
No Matches
CompressedHeader.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
//#include "TRDBase/TRDGeometryBase.h"
13
//#include "DetectorsCommonDataFormats/DetMatrixCache.h"
14
//#include "DetectorsCommonDataFormats/DetID.h"
15
16
#ifndef O2_TRD_COMPRESSEDHEADER_H
17
#define O2_TRD_COMPRESSEDHEADER_H
18
20
// //
21
// TRD Compressed Header //
22
// struct to hold the header for the raw compressed data of tracklet64
23
// when compression happens on the flp
24
// Authors //
25
// Sean Murray (murrays@cern.ch) //
26
//
28
#include "Rtypes.h"
// for ClassDef
29
#include "fairlogger/Logger.h"
30
31
namespace
o2
32
{
33
namespace
trd
34
{
35
/* |63|62|61|60|59|58|57|56|55|54|53|52|51|50|49|48|47|46|45|44|43|42|41|40|39|38|37|36|35|34|33|32|
36
-------------------------------------------------------------------------------------------------
37
Word 0 | Format | time since frame start |
38
-------------------------------------------------------------------------------------------------
39
|31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00|
40
-------------------------------------------------------------------------------------------------
41
Word 0 | length of data block |
42
-------------------------------------------------------------------------------------------------
43
This is chosen to be a 64 bit word as this is essentially a fake tracklet64 posing as a header.
44
This then explains the sizes.
45
Format is 4 bits, we only need 3 formats for now.
46
*/
47
struct
CompressedRawHeader
{
48
union
{
49
uint64_t
word0
;
50
struct
{
51
uint64_t
size
: 32;
// size of curent block, including this header in 64bit words.
52
uint64_t
eventtime
: 28;
// time from beginning of the time frame
53
uint8_t
format
: 4;
// format of data 1=tracklets,2=digits, 3=config.
54
}
__attribute__
((__packed__));
55
uint64_t
word1
;
// stores the information that will end up in the triggerrecord.
56
struct
{
57
uint16_t
bc
: 16;
// bunch crossing coming from rdh
58
uint32_t
orbit
: 32;
// orbit of lhc
59
uint16_t
padding
: 16;
// 0xeeee
60
}
__attribute__
((__packed__));
61
};
62
};
63
//This is simply 64bits of e to mark the end and enable some form of error checking.
64
//this appears at the end of tracklets.
65
//i.e. start pointer + header.size -1 == Compressed Trailer position.
66
struct
CompressedRawTrackletDigitSeperator
{
67
union
{
68
uint64_t
word
;
//0xeeeeeexxxxeeeeeeLL where xxxx is the number of digits to follow, max digits on a link is 15*8*16*21 (links*rob*mcm*adc)
69
//TODO I think is off by a factor of 2 but does not matter, the first 'x' is padded in anycase, so would not save in the hex definition above.
70
struct
{
71
uint32_t
pad2
: 24;
// padding e as a marker
72
uint16_t
digitcount
: 16;
// count of digits to come
73
uint32_t
pad1
: 24;
// padding e as marker
74
}
__attribute__
((__packed__));
75
};
76
};
77
78
/* |31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|12|11|10|09|08|07|06|05|04|03|02|01|00|
79
-------------------------------------------------------------------------------------------------
80
Word | detector | rob | mcm | ???????????? |
81
-------------------------------------------------------------------------------------------------
82
time is supplied by the compressedrawheader of the tracklets which is always there.
83
detector [0-540] 9 bits , rob [0-8] 3 bits , mcm [0-16] 4
84
= 15 bits ... what to do with the other 17 bits ?
85
Word of caution, tracklets word size is 64 bit digit word size is 32.
86
So the raw data has 2 *different* word sizes!
87
TODO ignoring config data of course.
88
digits are padded at end with a digit end marker (32 bits of 0xe) and then padded to 64 bits.
89
i.e. possibly 64 bits of 0xe
90
TODO in real data are the digits sent in zero suppresed?
91
*/
92
93
struct
CompressedRawDigitHeader
{
94
union
{
95
uint64_t
word
;
96
struct
{
97
uint32_t
padding
: 16;
// padding e as a marker
98
uint16_t
mcm
: 4;
// count of digits to come
99
uint16_t
rob
: 3;
// count of digits to come
100
uint32_t
dector
: 9;
// detector number
101
}
__attribute__
((__packed__));
102
};
103
};
104
105
struct
CompressedRawDigitEndMarker
{
106
uint32_t
word
;
// 0xeeeeeeee can be doubled up to pad to 64bit wide data.
107
};
108
109
//For now we ignore config data.
110
//TODO add config data ....
111
//
112
}
//namespace trd
113
}
//namespace o2
114
#endif
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
BitstreamReader.h:24
__attribute__
Definition
RawDataFormat.h:57
o2::trd::CompressedRawDigitEndMarker
Definition
CompressedHeader.h:105
o2::trd::CompressedRawDigitEndMarker::word
uint32_t word
Definition
CompressedHeader.h:106
o2::trd::CompressedRawDigitHeader
Definition
CompressedHeader.h:93
o2::trd::CompressedRawDigitHeader::rob
uint16_t rob
Definition
CompressedHeader.h:99
o2::trd::CompressedRawDigitHeader::padding
uint32_t padding
Definition
CompressedHeader.h:97
o2::trd::CompressedRawDigitHeader::mcm
uint16_t mcm
Definition
CompressedHeader.h:98
o2::trd::CompressedRawDigitHeader::word
uint64_t word
Definition
CompressedHeader.h:95
o2::trd::CompressedRawDigitHeader::dector
uint32_t dector
Definition
CompressedHeader.h:100
o2::trd::CompressedRawDigitHeader::__attribute__
union o2::trd::CompressedRawDigitHeader::@98 __attribute__
o2::trd::CompressedRawHeader
Definition
CompressedHeader.h:47
o2::trd::CompressedRawHeader::eventtime
uint64_t eventtime
Definition
CompressedHeader.h:52
o2::trd::CompressedRawHeader::word1
uint64_t word1
Definition
CompressedHeader.h:55
o2::trd::CompressedRawHeader::bc
uint16_t bc
Definition
CompressedHeader.h:57
o2::trd::CompressedRawHeader::word0
uint64_t word0
Definition
CompressedHeader.h:49
o2::trd::CompressedRawHeader::format
uint8_t format
Definition
CompressedHeader.h:53
o2::trd::CompressedRawHeader::size
uint64_t size
Definition
CompressedHeader.h:51
o2::trd::CompressedRawHeader::orbit
uint32_t orbit
Definition
CompressedHeader.h:58
o2::trd::CompressedRawHeader::padding
uint16_t padding
Definition
CompressedHeader.h:59
o2::trd::CompressedRawTrackletDigitSeperator
Definition
CompressedHeader.h:66
o2::trd::CompressedRawTrackletDigitSeperator::word
uint64_t word
Definition
CompressedHeader.h:68
o2::trd::CompressedRawTrackletDigitSeperator::pad1
uint32_t pad1
Definition
CompressedHeader.h:73
o2::trd::CompressedRawTrackletDigitSeperator::__attribute__
union o2::trd::CompressedRawTrackletDigitSeperator::@96 __attribute__
o2::trd::CompressedRawTrackletDigitSeperator::digitcount
uint16_t digitcount
Definition
CompressedHeader.h:72
o2::trd::CompressedRawTrackletDigitSeperator::pad2
uint32_t pad2
Definition
CompressedHeader.h:71
DataFormats
Detectors
TRD
include
DataFormatsTRD
CompressedHeader.h
Generated on Tue Feb 25 2025 17:02:52 for Project by
1.9.8