Project
Loading...
Searching...
No Matches
TPCSectorHeader.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 O2_TPCSECTORHEADER_H
13
#define O2_TPCSECTORHEADER_H
14
15
#include "
Headers/DataHeader.h
"
16
#include "
DataFormatsTPC/Constants.h
"
17
18
namespace
o2
19
{
20
namespace
tpc
21
{
22
25
struct
TPCSectorHeader
:
public
o2::header::BaseHeader
{
26
// Required to do the lookup
27
constexpr
static
const
o2::header::HeaderType
sHeaderType
=
"TPCSectH"
;
28
static
const
uint32_t
sVersion
= 2;
29
static
constexpr
int
NSectors
=
o2::tpc::constants::MAXSECTOR
;
30
31
TPCSectorHeader
(
int
s)
32
:
BaseHeader
(sizeof(
TPCSectorHeader
),
sHeaderType
,
o2
::header::gSerializationMethodNone,
sVersion
),
sectorBits
(((uint64_t)0x1) << s)
33
{
34
}
35
36
int
sector
()
const
37
{
38
for
(
int
s = 0; s <
NSectors
; s++) {
39
if
((
sectorBits
>> s) == 0x1) {
40
return
s;
41
}
42
}
43
if
(
sectorBits
!= 0) {
44
return
NSectors
;
45
}
46
return
-1;
47
}
48
49
uint64_t
sectorBits
;
50
union
{
51
uint64_t
activeSectorsFlags
= 0;
52
struct
{
53
uint64_t
activeSectors
:
NSectors
;
54
uint64_t
unused
: 12;
55
uint64_t
flags
: 16;
56
};
57
};
58
};
59
}
// namespace tpc
60
}
// namespace o2
61
62
#endif
// O2_TPCSECTORHEADER_H
Constants.h
DataHeader.h
o2::tpc::constants::MAXSECTOR
constexpr int MAXSECTOR
Definition
Constants.h:28
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
BitstreamReader.h:24
o2::header::BaseHeader
the base header struct Every header type must begin (i.e. derive) with this. Don't use this struct di...
Definition
DataHeader.h:351
o2::header::Descriptor< gSizeHeaderDescriptionString >
o2::tpc::TPCSectorHeader
Definition
TPCSectorHeader.h:25
o2::tpc::TPCSectorHeader::NSectors
static constexpr int NSectors
Definition
TPCSectorHeader.h:29
o2::tpc::TPCSectorHeader::sectorBits
uint64_t sectorBits
Definition
TPCSectorHeader.h:49
o2::tpc::TPCSectorHeader::TPCSectorHeader
TPCSectorHeader(int s)
Definition
TPCSectorHeader.h:31
o2::tpc::TPCSectorHeader::unused
uint64_t unused
Definition
TPCSectorHeader.h:54
o2::tpc::TPCSectorHeader::activeSectorsFlags
uint64_t activeSectorsFlags
Definition
TPCSectorHeader.h:51
o2::tpc::TPCSectorHeader::flags
uint64_t flags
Definition
TPCSectorHeader.h:55
o2::tpc::TPCSectorHeader::sector
int sector() const
Definition
TPCSectorHeader.h:36
o2::tpc::TPCSectorHeader::activeSectors
uint64_t activeSectors
Definition
TPCSectorHeader.h:53
o2::tpc::TPCSectorHeader::sHeaderType
static constexpr const o2::header::HeaderType sHeaderType
Definition
TPCSectorHeader.h:27
o2::tpc::TPCSectorHeader::sVersion
static const uint32_t sVersion
Definition
TPCSectorHeader.h:28
DataFormats
Detectors
TPC
include
DataFormatsTPC
TPCSectorHeader.h
Generated on Tue Feb 25 2025 23:16:11 for Project by
1.9.8