Project
Loading...
Searching...
No Matches
PadGroupType.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 O2_MCH_MAPPING_PADGROUPTYPE_H
16#define O2_MCH_MAPPING_PADGROUPTYPE_H
17
18#include <vector>
19#include <ostream>
20
21namespace o2
22{
23namespace mch
24{
25namespace mapping
26{
27namespace impl3
28{
29
31 PadGroupType(int nofPadsX, int nofPadsY, std::vector<int> ids);
32
33 int getNofPads() const { return mNofPads; }
34
35 int getNofPadsX() const { return mNofPadsX; }
36
37 int getNofPadsY() const { return mNofPadsY; }
38
39 int fastIndex(int ix, int iy) const { return ix + iy * mNofPadsX; }
40
41 int id(int fastIndex) const;
42
45 int id(int ix, int iy) const { return id(fastIndex(ix, iy)); }
46
47 int iy(int fastIndex) const { return fastIndex / mNofPadsX; }
48
49 int ix(int fastIndex) const { return fastIndex - iy(fastIndex) * mNofPadsX; }
50
51 std::vector<int> fastIndices() const { return mFastIndices; }
52
54 bool hasPadById(int id) const;
55
56 friend std::ostream& operator<<(std::ostream& os, const PadGroupType& type);
57
58 int getIndex(int ix, int iy) const;
59
60 std::vector<int> mFastId;
61 std::vector<int> mFastIndices;
65};
66
68
69} // namespace impl3
70} // namespace mapping
71} // namespace mch
72} // namespace o2
73
74#endif
int32_t i
GLuint * ids
Definition glcorearb.h:647
GLint GLint GLsizei GLint GLenum GLenum type
Definition glcorearb.h:275
GLuint id
Definition glcorearb.h:650
PadGroupType getPadGroupType(int i)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
bool hasPadById(int id) const
Whether pad with given id exists.
int id(int ix, int iy) const
friend std::ostream & operator<<(std::ostream &os, const PadGroupType &type)
std::vector< int > fastIndices() const
int fastIndex(int ix, int iy) const
int getIndex(int ix, int iy) const