Project
Loading...
Searching...
No Matches
GeometryBase.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 O2_TRD_GEOMETRYBASE_H
13#define O2_TRD_GEOMETRYBASE_H
14
15#include "GPUCommonDef.h"
17#include "TRDBase/PadPlane.h"
18
19namespace o2
20{
21namespace trd
22{
24{
25 public:
26 ~GeometryBase() = default;
27
28 GPUd() int isVersion() { return 1; }
29 GPUd() bool isHole(int la, int st, int se) const { return (((se == 13) || (se == 14) || (se == 15)) && (st == 2)); }
30 GPUd() bool isOnBoundary(int det, float y, float z, float eps = 0.5) const;
31
32 GPUd() void setSMstatus(int sm, bool status)
33 {
34 if (status) {
35 mSMStatus |= 0x3ffff & (0x1 << sm);
36 } else {
37 mSMStatus &= ~(0x3ffff & (0x1 << sm));
38 }
39 }
40 GPUd() bool getSMstatus(int sm) const { return (mSMStatus & (0x1 << sm)) != 0; }
41 GPUd() static int getDetectorSec(int det) { return (det % (constants::NLAYER * constants::NSTACK)); }
42 GPUd() static int getDetectorSec(int layer, int stack) { return (layer + stack * constants::NLAYER); }
43 GPUd() static int getDetector(int layer, int stack, int sector) { return (layer + stack * constants::NLAYER + sector * constants::NLAYER * constants::NSTACK); }
44 GPUd() static int getLayer(int det) { return (det % constants::NLAYER); }
45 GPUd() static int getStack(int det) { return ((det % (constants::NLAYER * constants::NSTACK)) / constants::NLAYER); }
46 GPUd() int getStack(float z, int layer) const;
47
48 GPUd() const PadPlane* getPadPlane(int layer, int stack) const { return &mPadPlanes[getDetectorSec(layer, stack)]; }
49 GPUd() const PadPlane* getPadPlane(int det) const { return &mPadPlanes[getDetectorSec(det)]; }
50
51 GPUd() int getRowMax(int layer, int stack, int /*sector*/) const { return getPadPlane(layer, stack)->getNrows(); }
52 GPUd() int getColMax(int layer) const { return getPadPlane(layer, 0)->getNcols(); }
53 GPUd() float getRow0(int layer, int stack, int /*sector*/) const { return getPadPlane(layer, stack)->getRow0(); }
54 GPUd() float getCol0(int layer) const { return getPadPlane(layer, 0)->getCol0(); }
55
56 GPUd() float getRowPos(int layer, int stack, int row) { return mPadPlanes[getDetectorSec(layer, stack)].getRowPos(row); }
57 GPUd() float getRowSize(int layer, int stack, int row) { return mPadPlanes[getDetectorSec(layer, stack)].getRowSize(row); }
58 GPUd() float getRow0(int layer, int stack) { return mPadPlanes[getDetectorSec(layer, stack)].getRow0(); }
59 GPUd() float getRowEnd(int layer, int stack) { return mPadPlanes[getDetectorSec(layer, stack)].getRowEnd(); }
60
61 static constexpr GPUd() int getSector(int det) { return (det / (constants::NLAYER * constants::NSTACK)); }
62 static constexpr GPUd() double getTime0(int layer) { return TIME0[layer]; }
63 static constexpr GPUd() double getXtrdBeg() { return XTRDBEG; }
64 static constexpr GPUd() double getXtrdEnd() { return XTRDEND; }
65 static constexpr GPUd() double getChamberWidth(int layer) { return CWIDTH[layer]; }
66 static constexpr GPUd() double getChamberLength(int layer, int stack) { return CLENGTH[layer][stack]; }
67 static constexpr GPUd() double getAlpha() { return 2.0 * 3.14159265358979324 / constants::NSECTOR; }
68 static constexpr GPUd() double cheight() { return CH; }
69 static constexpr GPUd() double cheightSV() { return CHSV; }
70 static constexpr GPUd() double cspace() { return VSPACE; }
71 static constexpr GPUd() double craHght() { return CRAH; }
72 static constexpr GPUd() double cdrHght() { return CDRH; }
73 static constexpr GPUd() double camHght() { return CAMH; }
74 static constexpr GPUd() double croHght() { return CROH; }
75 static constexpr GPUd() double csvHght() { return CSVH; }
76 static constexpr GPUd() double croWid() { return CROW; }
77 static constexpr GPUd() double anodePos() { return ANODEPOS; }
78 static constexpr GPUd() double myThick() { return RMYTHICK; }
79 static constexpr GPUd() double drThick() { return DRTHICK; }
80 static constexpr GPUd() double amThick() { return AMTHICK; }
81 static constexpr GPUd() double drZpos() { return DRZPOS; }
82 static constexpr GPUd() double rpadW() { return RPADW; }
83 static constexpr GPUd() double cpadW() { return CPADW; }
84 static constexpr GPUd() double cwidcha() { return (SWIDTH2 - SWIDTH1) / SHEIGHT * (CH + VSPACE); }
85 static constexpr GPUd() int MCMmax() { return MCMMAX; }
86 static constexpr GPUd() int MCMrow() { return MCMROW; }
87 static constexpr GPUd() int ROBmaxC0() { return ROBMAXC0; }
88 static constexpr GPUd() int ROBmaxC1() { return ROBMAXC1; }
89 static constexpr GPUd() int ADCmax() { return ADCMAX; }
90 static constexpr GPUd() int TBmax() { return TBMAX; }
91 static constexpr GPUd() int padmax() { return PADMAX; }
92 static constexpr GPUd() int colmax() { return COLMAX; }
93 static constexpr GPUd() int rowmaxC0() { return ROWMAXC0; }
94 static constexpr GPUd() int rowmaxC1() { return ROWMAXC1; }
95
96 protected:
97 GeometryBase() = default;
98
99 static GPUglobalconstexpr() double TLENGTH = 751.0;
100
101 // Parameter of the super module mother volumes
102 static GPUglobalconstexpr() double SHEIGHT = 77.9;
103 static GPUglobalconstexpr() double SWIDTH1 = 94.881;
104 static GPUglobalconstexpr() double SWIDTH2 = 122.353;
105 static GPUglobalconstexpr() double SLENGTH = 702.0;
106
107 // Length of the additional space in front of the supermodule used for services
108 static GPUglobalconstexpr() double FLENGTH = (TLENGTH - SLENGTH) / 2.0;
109
110 static GPUglobalconstexpr() double SMPLTT = 0.2;
111
112 static GPUglobalconstexpr() double VSPACE = 1.784;
113 static GPUglobalconstexpr() double HSPACE = 2.0;
114 static GPUglobalconstexpr() double VROCSM = 1.2;
115
116 static GPUglobalconstexpr() double CRAH = 4.8;
117 static GPUglobalconstexpr() double CDRH = 3.0;
118 static GPUglobalconstexpr() double CAMH = 0.7;
119 static GPUglobalconstexpr() double CROH = 2.316;
120 static GPUglobalconstexpr() double CROW = 0.9;
121 static GPUglobalconstexpr() double CSVH = VSPACE - 0.742;
122 static GPUglobalconstexpr() double CH = CRAH + CDRH + CAMH + CROH;
123 static GPUglobalconstexpr() double CHSV = CH + CSVH;
124
125 // Distance of anode wire plane relative to middle of alignable volume
126 static GPUglobalconstexpr() double ANODEPOS = CRAH + CDRH + CAMH / 2.0 - CHSV / 2.0;
127
128 static GPUglobalconstexpr() double CALT = 0.4;
129 static GPUglobalconstexpr() double CCLST = 0.21;
130 static GPUglobalconstexpr() double CCLFT = 1.0;
131 static GPUglobalconstexpr() double CGLT = 0.25;
132 static GPUglobalconstexpr() double CCUTA = 1.0;
133 static GPUglobalconstexpr() double CCUTB = 0.8;
134 static GPUglobalconstexpr() double CAUT = 1.5;
135 static GPUglobalconstexpr() double CALW = 2.5;
136 static GPUglobalconstexpr() double CALH = 0.4;
137 static GPUglobalconstexpr() double CALWMOD = 0.4;
138 static GPUglobalconstexpr() double CALHMOD = 2.5;
139 static GPUglobalconstexpr() double CWSW = 1.2;
140 static GPUglobalconstexpr() double CWSH = 0.3;
141
142 static GPUglobalconstexpr() double CPADW = 0.0;
143 static GPUglobalconstexpr() double RPADW = 1.0;
144
145 //
146 // Thickness of the the material layers
147 //
148 static GPUglobalconstexpr() double DRTHICK = CDRH;
149 static GPUglobalconstexpr() double AMTHICK = CAMH;
150 static GPUglobalconstexpr() double XETHICK = DRTHICK + AMTHICK;
151 static GPUglobalconstexpr() double WRTHICK = 0.00011;
152
153 static GPUglobalconstexpr() double RMYTHICK = 0.0015;
154 static GPUglobalconstexpr() double RCBTHICK = 0.0055;
155 static GPUglobalconstexpr() double RGLTHICK = 0.0065;
156 static GPUglobalconstexpr() double RRHTHICK = 0.8;
157 static GPUglobalconstexpr() double RFBTHICK = CRAH - 2.0 * (RMYTHICK + RCBTHICK + RRHTHICK);
158
159 static GPUglobalconstexpr() double PPDTHICK = 0.0025;
160 static GPUglobalconstexpr() double PPPTHICK = 0.0356;
161 static GPUglobalconstexpr() double PGLTHICK = 0.1428;
162 static GPUglobalconstexpr() double PCBTHICK = 0.019;
163 static GPUglobalconstexpr() double PPCTHICK = 0.0486;
164 static GPUglobalconstexpr() double PRBTHICK = 0.0057;
165 static GPUglobalconstexpr() double PELTHICK = 0.0029;
166 static GPUglobalconstexpr() double PHCTHICK = CROH - PPDTHICK - PPPTHICK - PGLTHICK - PCBTHICK * 2.0 - PPCTHICK - PRBTHICK - PELTHICK;
167
168 //
169 // Position of the material layers
170 //
171 static GPUglobalconstexpr() double DRZPOS = 2.4;
172 static GPUglobalconstexpr() double AMZPOS = 0.0;
173 static GPUglobalconstexpr() double WRZPOSA = 0.0;
174 static GPUglobalconstexpr() double WRZPOSB = -AMTHICK / 2.0 + 0.001;
175 static GPUglobalconstexpr() double CALZPOS = 0.3;
176
177 static GPUglobalconstexpr() int MCMMAX = 16;
178 static GPUglobalconstexpr() int MCMROW = 4;
179 static GPUglobalconstexpr() int ROBMAXC0 = 6;
180 static GPUglobalconstexpr() int ROBMAXC1 = 8;
181 static GPUglobalconstexpr() int ADCMAX = 21;
182 static GPUglobalconstexpr() int TBMAX = 60;
183 static GPUglobalconstexpr() int PADMAX = 18;
184 static GPUglobalconstexpr() int COLMAX = 144;
185 static GPUglobalconstexpr() int ROWMAXC0 = 12;
186 static GPUglobalconstexpr() int ROWMAXC1 = 16;
187
188 static GPUglobalconstexpr() double TIME0BASE = 300.65;
189 // Time-position of pad 0
190 static GPUglobalconstexpr() double TIME0[6] = {TIME0BASE + 0 * (CH + VSPACE),
191 TIME0BASE + 1 * (CH + VSPACE),
192 TIME0BASE + 2 * (CH + VSPACE),
193 TIME0BASE + 3 * (CH + VSPACE),
194 TIME0BASE + 4 * (CH + VSPACE),
195 TIME0BASE + 5 * (CH + VSPACE)};
196
197 static GPUglobalconstexpr() double XTRDBEG = 288.43;
198 static GPUglobalconstexpr() double XTRDEND = 366.33;
199
200 // The outer width of the chambers
201 static GPUglobalconstexpr() double CWIDTH[constants::NLAYER] = {90.4, 94.8, 99.3, 103.7, 108.1, 112.6};
202
203 // The outer lengths of the chambers
204 // Includes the spacings between the chambers!
205 static GPUglobalconstexpr() double CLENGTH[constants::NLAYER][constants::NSTACK] = {
206 {124.0, 124.0, 110.0, 124.0, 124.0},
207 {124.0, 124.0, 110.0, 124.0, 124.0},
208 {131.0, 131.0, 110.0, 131.0, 131.0},
209 {138.0, 138.0, 110.0, 138.0, 138.0},
210 {145.0, 145.0, 110.0, 145.0, 145.0},
211 {147.0, 147.0, 110.0, 147.0, 147.0}};
212
213 PadPlane mPadPlanes[constants::NLAYER * constants::NSTACK];
214
215 int mSMStatus = 0x3ffff;
216
218};
219} // end namespace trd
220} // end namespace o2
221#endif
Global TRD definitions and constants.
static constexpr GPUd() double craHght()
static constexpr GPUd() int padmax()
static constexpr GPUd() int rowmaxC1()
static constexpr GPUd() double cspace()
static constexpr GPUd() double getAlpha()
GPUd() int getColMax(int layer) const
static constexpr GPUd() double cwidcha()
static constexpr GPUd() double cdrHght()
static constexpr GPUd() int getSector(int det)
GPUd() float getRowPos(int layer
static constexpr GPUd() int colmax()
static constexpr GPUd() double getXtrdBeg()
static constexpr GPUd() double croHght()
GPUd() int isVersion()
GPUd() float getRowEnd(int layer
static constexpr GPUd() double amThick()
static constexpr GPUd() double getTime0(int layer)
GPUd() float getRow0(int layer
static constexpr GPUd() int MCMmax()
static constexpr GPUd() double csvHght()
static constexpr GPUd() double cheight()
GPUd() float getRowSize(int layer
static constexpr GPUd() double cpadW()
static constexpr GPUd() double anodePos()
static constexpr GPUd() double rpadW()
static constexpr GPUd() double getXtrdEnd()
static constexpr GPUd() double croWid()
static constexpr GPUd() double getChamberLength(int layer
static constexpr GPUd() double camHght()
static constexpr GPUd() int rowmaxC0()
float float float eps
GPUd() const PadPlane *getPadPlane(int det) const
PadPlane mPadPlanes[constants::NLAYER *constants::NSTACK]
static GPUglobalconstexpr() double XTRDBEG
X-coordinate in tracking system of begin of TRD mother volume.
ClassDefNV(GeometryBase, 1)
static GPUglobalconstexpr() double CLENGTH[constants
static constexpr GPUd() int ROBmaxC0()
static constexpr GPUd() double getChamberWidth(int layer)
static GPUglobalconstexpr() double TLENGTH
Total length of the TRD mother volume.
static constexpr GPUd() double drThick()
static constexpr GPUd() double cheightSV()
static constexpr GPUd() int MCMrow()
static constexpr GPUd() int ROBmaxC1()
static constexpr GPUd() int TBmax()
static constexpr GPUd() double drZpos()
static constexpr GPUd() int ADCmax()
GPUd() float getCol0(int layer) const
static constexpr GPUd() double myThick()
GLint y
Definition glcorearb.h:270
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...