Project
Loading...
Searching...
No Matches
Geometry.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 ALICEO2_CPV_GEOMETRY_H_
13#define ALICEO2_CPV_GEOMETRY_H_
14
15#include <string>
16
17#include <Rtypes.h>
18#include <RStringView.h>
19#include <TMath.h>
20
21namespace o2
22{
23namespace cpv
24{
26{
27 public:
28 static constexpr short kNumberOfCPVPadsPhi = 128;
29 static constexpr short kNumberOfCPVPadsZ = 60;
30 static constexpr short kNCHANNELS = kNumberOfCPVPadsPhi * kNumberOfCPVPadsZ * 3;
31 static constexpr float kCPVPadSizePhi = 1.13;
32 static constexpr float kCPVPadSizeZ = 2.1093;
33 // for hwaddress
34 static constexpr short kNPAD = 48;
35 static constexpr short kNDilogic = 4;
36 static constexpr short kNGas = 5;
37 static constexpr short kNRow = 16;
38 static constexpr short kNMod = 4;
39
49
52 Geometry() = default;
53
57 Geometry(const Geometry& geom);
58
62 ~Geometry() = default;
63
67 Geometry& operator=(const Geometry& rvalue);
68
73 // = 1 are neighbour
74 // = 2 are not neighbour but do not continue searching
75 // =-1 are not neighbour, continue searching, but do not look before d2 next time
76 static short areNeighbours(unsigned short absId1, unsigned short absId2);
77
83 // \param cell: cell in strip number
85 static unsigned short relToAbsId(short moduleNumber, short iphi, short iz);
86 static bool absToRelNumbering(unsigned short absId, short* relId);
87 static short absIdToModule(unsigned short absId);
88 static void absIdToRelPosInModule(unsigned short absId, float& x, float& z);
89 static bool relToAbsNumbering(const short* relId, unsigned short& absId);
90
91 static bool hwaddressToAbsId(short ccId, short dil, short gas, short pad, unsigned short& absId);
92 static bool absIdToHWaddress(unsigned short absId, short& ccId, short& dil, short& gas, short& pad);
93
94 static unsigned short getTotalNPads() { return kNCHANNELS; }
95 static bool IsPadExists(unsigned short absId)
96 {
97 return absId < getTotalNPads();
98 } // TODO: evaluate from real geometry
99
100 // Pad map per 3Gassiplex
101 // Fixed mapping
102 static constexpr short mPadMap[6][8] = {3, 31, 30, 29, 26, 22, 19, 44,
103 8, 1, 0, 28, 24, 20, 18, 42,
104 10, 6, 2, 27, 21, 16, 40, 36,
105 14, 12, 4, 25, 46, 38, 34, 32,
106 15, 13, 5, 23, 45, 37, 35, 33,
107 11, 9, 7, 17, 47, 43, 41, 39};
108 static constexpr short mPadToZ[48] = {1, 1, 2, 0, 3, 4, 2, 5, 1, 5, 2, 5, 3, 4, 3, 4, 2, 5, 1, 0, 1, 2, 0, 4, 1, 3, 0, 2, 1, 0, 0, 0, 3, 4, 3, 4, 2, 4, 3, 5, 2, 5, 1, 5, 0, 4, 3, 5};
109 static constexpr short mPadToPhi[48] = {2, 1, 2, 0, 2, 2, 1, 2, 0, 1, 0, 0, 1, 1, 0, 0, 5, 3, 6, 6, 5, 4, 5, 3, 4, 3, 4, 3, 3, 3, 2, 1, 7, 7, 6, 6, 7, 5, 5, 7, 6, 6, 7, 5, 7, 4, 4, 4};
110
112};
113} // namespace cpv
114} // namespace o2
115#endif
static bool IsPadExists(unsigned short absId)
Definition Geometry.h:95
static constexpr short mPadToPhi[48]
Definition Geometry.h:109
static constexpr short mPadToZ[48]
Definition Geometry.h:108
static constexpr short mPadMap[6][8]
Definition Geometry.h:102
static constexpr short kNCHANNELS
Definition Geometry.h:30
~Geometry()=default
static constexpr short kNumberOfCPVPadsPhi
Definition Geometry.h:28
static constexpr short kNDilogic
Definition Geometry.h:35
Geometry()=default
Default constructor.
static bool absIdToHWaddress(unsigned short absId, short &ccId, short &dil, short &gas, short &pad)
Definition Geometry.cxx:137
static constexpr short kNRow
Definition Geometry.h:37
static short absIdToModule(unsigned short absId)
Definition Geometry.cxx:43
static bool relToAbsNumbering(const short *relId, unsigned short &absId)
Definition Geometry.cxx:99
static constexpr short kNGas
Definition Geometry.h:36
Geometry & operator=(const Geometry &rvalue)
Geometry(const Geometry &geom)
static constexpr float kCPVPadSizePhi
Definition Geometry.h:31
static unsigned short getTotalNPads()
Definition Geometry.h:94
ClassDefNV(Geometry, 1)
static short areNeighbours(unsigned short absId1, unsigned short absId2)
Definition Geometry.cxx:49
static constexpr short kNMod
Definition Geometry.h:38
static void absIdToRelPosInModule(unsigned short absId, float &x, float &z)
Definition Geometry.cxx:89
static bool absToRelNumbering(unsigned short absId, short *relId)
Definition Geometry.cxx:25
static unsigned short relToAbsId(short moduleNumber, short iphi, short iz)
Definition Geometry.cxx:19
static constexpr short kNPAD
Definition Geometry.h:34
static bool hwaddressToAbsId(short ccId, short dil, short gas, short pad, unsigned short &absId)
Definition Geometry.cxx:109
static constexpr float kCPVPadSizeZ
Definition Geometry.h:32
static constexpr short kNumberOfCPVPadsZ
Definition Geometry.h:29
GLint GLenum GLint x
Definition glcorearb.h:403
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...