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"
17
18namespace o2
19{
20namespace tpc
21{
22
26 // Required to do the lookup
27 constexpr static const o2::header::HeaderType sHeaderType = "TPCSectH";
28 static const uint32_t sVersion = 2;
30
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 {
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
constexpr int MAXSECTOR
Definition Constants.h:28
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
the base header struct Every header type must begin (i.e. derive) with this. Don't use this struct di...
Definition DataHeader.h:351
static constexpr int NSectors
static constexpr const o2::header::HeaderType sHeaderType
static const uint32_t sVersion