Project
Loading...
Searching...
No Matches
PadROCPos.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
14
15#ifndef ALICEO2_TPC_PADROCPOS_H_
16#define ALICEO2_TPC_PADROCPOS_H_
17
18#include "DataFormatsTPC/Defs.h"
19#include "TPCBase/ROC.h"
20#include "TPCBase/PadPos.h"
21
22namespace o2
23{
24namespace tpc
25{
26
35
37{
38 public:
40 PadROCPos() = default;
41
46 PadROCPos(const int roc, const int rowInROC, const int padInRow) : mROC(roc), mPadPos(PadPos(rowInROC, padInRow)) {}
47
51 PadROCPos(const ROC& roc, const PadPos& padPosition) : mROC(roc), mPadPos(padPosition) {}
52
55 const ROC& getROC() const { return mROC; }
56
59 const Sector getSector() const { return mROC.getSector(); }
60
63 ROC& getROC() { return mROC; }
64
67 RocType getROCType() const { return mROC.rocType(); }
68
71 const PadPos& getPadPos() const { return mPadPos; }
72
75 int getRow() const { return mPadPos.getRow(); }
76
79 int getPad() const { return mPadPos.getPad(); }
80
81 PadPos& getPadPos() { return mPadPos; }
82
85 bool isValid() const { return mPadPos.isValid(); }
86
88 bool operator==(const PadROCPos& other) const { return (mROC == other.mROC) && (mPadPos == other.mPadPos); }
89
91 bool operator<(const PadROCPos& other) const
92 {
93 if (mROC < other.mROC) {
94 return true;
95 }
96 if (mROC == other.mROC && mPadPos < other.mPadPos) {
97 return true;
98 }
99 return false;
100 }
101
102 private:
103 ROC mROC{};
104 PadPos mPadPos{};
105};
106} // namespace tpc
107} // namespace o2
108#endif
uint32_t roc
Definition RawData.h:3
Pad and row inside a ROC.
Definition PadROCPos.h:37
const Sector getSector() const
Definition PadROCPos.h:59
bool operator==(const PadROCPos &other) const
equal operator
Definition PadROCPos.h:88
PadROCPos(const int roc, const int rowInROC, const int padInRow)
Definition PadROCPos.h:46
PadROCPos()=default
default constructor
PadROCPos(const ROC &roc, const PadPos &padPosition)
Definition PadROCPos.h:51
const ROC & getROC() const
Definition PadROCPos.h:55
const PadPos & getPadPos() const
Definition PadROCPos.h:71
bool isValid() const
Definition PadROCPos.h:85
PadPos & getPadPos()
Definition PadROCPos.h:81
int getPad() const
Definition PadROCPos.h:79
RocType getROCType() const
Definition PadROCPos.h:67
int getRow() const
Definition PadROCPos.h:75
bool operator<(const PadROCPos &other) const
smaller operator
Definition PadROCPos.h:91
Sector getSector() const
get sector
Definition ROC.h:105
RocType rocType() const
Definition ROC.h:96
RocType
TPC ROC types.
Definition Defs.h:48
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
VectorOfTObjectPtrs other