Project
Loading...
Searching...
No Matches
PixelChip.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#ifndef ALICEO2_FOCAL_PIXELCHIP_H
12#define ALICEO2_FOCAL_PIXELCHIP_H
13
14#include <cstdint>
15#include <iosfwd>
16#include <vector>
17#include "Rtypes.h"
19
20namespace o2::focal
21{
22
23struct PixelChip {
24 static constexpr uint16_t DATAFRAME = 0x1 << 0;
25 static constexpr uint16_t EMPTYFRAME = 0x1 << 1;
26 static constexpr uint16_t BUSY_ON = 0x1 << 2;
27 static constexpr uint16_t BUSY_OFF = 0x1 << 3;
28
29 uint8_t mFeeID;
30 uint8_t mLaneID;
31 uint8_t mChipID;
32 uint16_t mStatusCode;
33 std::vector<PixelHit> mHits;
34
35 bool operator==(const PixelChip& other) const { return mChipID == other.mChipID && mLaneID == other.mLaneID && mFeeID == other.mFeeID; }
36 bool operator<(const PixelChip& other) const
37 {
38 if (mFeeID < other.mFeeID) {
39 return true;
40 } else if (mFeeID == other.mFeeID) {
41 if (mLaneID < other.mLaneID) {
42 return true;
43 } else if ((mLaneID == other.mLaneID) && (mChipID < other.mChipID)) {
44 return true;
45 } else {
46 return false;
47 }
48 } else {
49 return false;
50 }
51 }
52
54 {
56 }
57
59 {
61 }
62
63 void setBusyOn()
64 {
66 }
67
69 {
71 }
72
74 {
76 }
77
79 {
80 mStatusCode &= ~(BUSY_ON);
81 }
82
84 {
85 mStatusCode &= ~(BUSY_ON);
86 }
87
88 bool isDataframe() const
89 {
90 return mStatusCode & DATAFRAME;
91 }
92
93 bool isEmptyframe() const
94 {
95 return mStatusCode & EMPTYFRAME;
96 }
97
98 bool isBusyOn() const
99 {
100 return mStatusCode & BUSY_ON;
101 }
102
103 bool isBusyOff() const
104 {
105 return mStatusCode & BUSY_OFF;
106 }
107
109};
110
111std::ostream& operator<<(std::ostream& stream, const PixelChip& chip);
112} // namespace o2::focal
113#endif // QC_MODULE_FOCAL_PIXELCHIP_H
GLuint GLuint stream
Definition glcorearb.h:1806
std::ostream & operator<<(std::ostream &in, const IndexExceptionEvent &error)
static constexpr uint16_t DATAFRAME
Definition PixelChip.h:24
std::vector< PixelHit > mHits
Definition PixelChip.h:33
bool isEmptyframe() const
Definition PixelChip.h:93
bool isDataframe() const
Definition PixelChip.h:88
static constexpr uint16_t BUSY_ON
Definition PixelChip.h:26
static constexpr uint16_t EMPTYFRAME
Definition PixelChip.h:25
ClassDefNV(PixelChip, 1)
bool operator==(const PixelChip &other) const
Definition PixelChip.h:35
bool isBusyOn() const
Definition PixelChip.h:98
static constexpr uint16_t BUSY_OFF
Definition PixelChip.h:27
bool isBusyOff() const
Definition PixelChip.h:103
bool operator<(const PixelChip &other) const
Definition PixelChip.h:36
VectorOfTObjectPtrs other