Project
Loading...
Searching...
No Matches
PadPos.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
16
24
25#ifndef AliceO2_TPC_PadPos_H
26#define AliceO2_TPC_PadPos_H
27
28#include "GPUCommonDef.h"
29
30namespace o2
31{
32namespace tpc
33{
34class PadPos
35{
36 public:
38 PadPos() = default;
39
43 GPUdi() PadPos(const unsigned char row, const unsigned char pad) : mRow(row), mPad(pad) {}
44
47 GPUdi() unsigned char getRow() const { return mRow; }
48
51 GPUdi() unsigned char getPad() const { return mPad; }
52
55 GPUdi() void setRow(const unsigned char row) { mRow = row; }
56
59 GPUdi() void setPad(const unsigned char pad) { mPad = pad; }
60
63 GPUdi() void addRowOffset(const unsigned char rowOffset) { mRow += rowOffset; }
64
68 GPUdi() void set(const unsigned char row, const unsigned char pad)
69 {
70 mRow = row;
72 }
73
76 GPUdi() bool isValid() const { return !(mRow == 255 && mPad == 255); }
77
79 GPUdi() bool operator==(const PadPos& other) const { return (mRow == other.mRow) && (mPad == other.mPad); }
80
82 GPUdi() bool operator!=(const PadPos& other) const { return (mRow != other.mRow) || (mPad != other.mPad); }
83
85 GPUdi() bool operator<(const PadPos& other) const
86 {
87 if (mRow < other.mRow) {
88 return true;
89 }
90 if (mRow == other.mRow && mPad < other.mPad) {
91 return true;
92 }
93 return false;
94 }
95
96 private:
97 unsigned char mRow{0};
98 unsigned char mPad{0};
99};
100} // namespace tpc
101} // namespace o2
102
103#endif
GPUdi() void addRowOffset(const unsigned char rowOffset)
Definition PadPos.h:63
GPUdi() bool operator
equal operator
GPUdi() unsigned char getPad() const
Definition PadPos.h:51
GPUdi() void set(const unsigned char row
GPUdi() PadPos(const unsigned char row
GPUdi() void setRow(const unsigned char row)
Definition PadPos.h:55
GPUdi() bool isValid() const
Definition PadPos.h:76
PadPos()=default
default constructor
GPUdi() void setPad(const unsigned char pad)
Definition PadPos.h:59
const unsigned char pad
Definition PadPos.h:43
GPUdi() unsigned char getRow() const
Definition PadPos.h:47
typedef void(APIENTRYP PFNGLCULLFACEPROC)(GLenum mode)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
VectorOfTObjectPtrs other
std::vector< int > row