Project
Loading...
Searching...
No Matches
TRKLayer.cxx
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
13
14#include "Framework/Logger.h"
15
17#include "TRKBase/Specs.h"
19#include <TGeoBBox.h>
20#include <TGeoCompositeShape.h>
21#include <TGeoTube.h>
22#include <TGeoVolume.h>
23#include <TMath.h>
24
25#include <algorithm>
26#include <cassert>
27#include <cmath>
28#include <string>
29#include <utility>
30
31namespace o2
32{
33namespace trk
34{
35TRKCylindricalLayer::TRKCylindricalLayer(int layerNumber, std::string layerName, float rInn, float length, float thickOrX2X0, MatBudgetParamMode mode)
36 : mLayerNumber(layerNumber), mLayerName(layerName), mInnerRadius(rInn), mLength(length)
37{
39 mChipThickness = thickOrX2X0;
40 mX2X0 = thickOrX2X0 / Si_X0;
41 mOuterRadius = rInn + thickOrX2X0;
42 } else if (mode == MatBudgetParamMode::X2X0) {
43 mX2X0 = thickOrX2X0;
44 mChipThickness = thickOrX2X0 * Si_X0;
45 mOuterRadius = rInn + thickOrX2X0 * Si_X0;
46 }
47
48 LOGP(info, "Creating layer: id: {} rInner: {} rOuter: {} zLength: {} x2X0: {}", mLayerNumber, mInnerRadius, mOuterRadius, mLength, mX2X0);
49}
50
52{
53 TGeoMedium* medSi = gGeoManager->GetMedium("TRK_SILICON$");
55 TGeoShape* sensor = new TGeoTube(mInnerRadius, mInnerRadius + sSensorThickness, mLength / 2);
56 TGeoVolume* sensVol = new TGeoVolume(sensName.c_str(), sensor, medSi);
57 sensVol->SetLineColor(kYellow);
58
59 return sensVol;
60};
61
63{
64 TGeoMedium* medSi = gGeoManager->GetMedium("TRK_SILICON$");
66 TGeoShape* metalStack = new TGeoTube(mInnerRadius + sSensorThickness, mInnerRadius + mChipThickness, mLength / 2);
67 TGeoVolume* metalVol = new TGeoVolume(metalName.c_str(), metalStack, medSi);
68 metalVol->SetLineColor(kGray);
69
70 return metalVol;
71};
72
73void TRKCylindricalLayer::createLayer(TGeoVolume* motherVolume)
74{
75 TGeoMedium* medAir = gGeoManager->GetMedium("TRK_AIR$");
76 TGeoTube* layer = new TGeoTube(mInnerRadius, mInnerRadius + mChipThickness, mLength / 2);
77 TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
78 layerVol->SetLineColor(kYellow);
79
80 TGeoVolume* sensVol = createSensor();
81 LOGP(debug, "Inserting {} in {} ", sensVol->GetName(), layerVol->GetName());
82 layerVol->AddNode(sensVol, 1, nullptr);
83
84 TGeoVolume* metalVol = createMetalStack();
85 LOGP(debug, "Inserting {} in {} ", metalVol->GetName(), layerVol->GetName());
86 layerVol->AddNode(metalVol, 1, nullptr);
87
88 LOGP(debug, "Inserting {} in {} ", layerVol->GetName(), motherVolume->GetName());
89 motherVolume->AddNode(layerVol, 1, nullptr);
90}
91
93
94TRKSegmentedLayer::TRKSegmentedLayer(int layerNumber, std::string layerName, float rInn, float tiltAngle, int numberOfStaves, int numberOfModules, float thickOrX2X0, MatBudgetParamMode mode)
95 : TRKCylindricalLayer(layerNumber, layerName, rInn, numberOfModules * sModuleLength, thickOrX2X0, mode), mTiltAngle(tiltAngle), mNumberOfStaves(numberOfStaves), mNumberOfModules(numberOfModules)
96{
97 assert(numberOfStaves % 2 == 0 && "Error: numberOfStaves must be even!");
98}
99
101{
102 TGeoMedium* medSi = gGeoManager->GetMedium("TRK_SILICON$");
104 TGeoShape* sensor = new TGeoBBox((sChipWidth - sDeadzoneWidth) / 2, sSensorThickness / 2, sChipLength / 2);
105 TGeoVolume* sensVol = new TGeoVolume(sensName.c_str(), sensor, medSi);
106 sensVol->SetLineColor(kYellow);
107
108 return sensVol;
109}
110
112{
113 TGeoMedium* medSi = gGeoManager->GetMedium("TRK_SILICON$");
115 TGeoShape* deadzone = new TGeoBBox(sDeadzoneWidth / 2, sSensorThickness / 2, sChipLength / 2);
116 TGeoVolume* deadVol = new TGeoVolume(deadName.c_str(), deadzone, medSi);
117 deadVol->SetLineColor(kGray);
118
119 return deadVol;
120}
121
123{
124 TGeoMedium* medSi = gGeoManager->GetMedium("TRK_SILICON$");
126 TGeoShape* metalStack = new TGeoBBox(sChipWidth / 2, (mChipThickness - sSensorThickness) / 2, sChipLength / 2);
127 TGeoVolume* metalVol = new TGeoVolume(metalName.c_str(), metalStack, medSi);
128 metalVol->SetLineColor(kGray);
129
130 return metalVol;
131}
132
134{
135 TGeoMedium* medSi = gGeoManager->GetMedium("TRK_SILICON$");
137 TGeoShape* chip = new TGeoBBox(sChipWidth / 2, mChipThickness / 2, sChipLength / 2);
138 TGeoVolume* chipVol = new TGeoVolume(chipName.c_str(), chip, medSi);
139 chipVol->SetLineColor(kYellow);
140
141 TGeoVolume* sensVol = createSensor();
142 TGeoVolume* deadVol = createDeadzone();
143 TGeoVolume* metalVol = createMetalStack();
144 TGeoCombiTrans* transSens = new TGeoCombiTrans();
145 TGeoCombiTrans* transDead = new TGeoCombiTrans();
146 TGeoCombiTrans* transMetal = new TGeoCombiTrans();
147
148 const double sensY = mIsFlipped ? -(mChipThickness - sSensorThickness) / 2 : (mChipThickness - sSensorThickness) / 2;
149 const double metalY = mIsFlipped ? sSensorThickness / 2 : -sSensorThickness / 2;
150 transSens->SetTranslation(-sDeadzoneWidth / 2, sensY, 0);
151 transDead->SetTranslation((sChipWidth - sDeadzoneWidth) / 2, sensY, 0);
152 transMetal->SetTranslation(0, metalY, 0);
153
154 chipVol->AddNode(sensVol, 1, transSens);
155 chipVol->AddNode(deadVol, 1, transDead);
156 chipVol->AddNode(metalVol, 1, transMetal);
157
158 return chipVol;
159}
160
162{
163 TGeoMedium* medSi = gGeoManager->GetMedium("TRK_SILICON$");
165 TGeoShape* module = new TGeoBBox(sModuleWidth / 2, mChipThickness / 2, sModuleLength / 2);
166 TGeoVolume* moduleVol = new TGeoVolume(moduleName.c_str(), module, medSi);
167 moduleVol->SetLineColor(kYellow);
168
169 for (int iChip = 0; iChip < sHalfNumberOfChips; iChip++) {
170 TGeoVolume* chipVolLeft = createChip();
173 TGeoCombiTrans* transLeft = new TGeoCombiTrans();
174 transLeft->SetTranslation(xLeft, 0, zLeft);
175 TGeoRotation* rot = new TGeoRotation();
176 rot->RotateY(180);
177 transLeft->SetRotation(rot);
178 LOGP(debug, "Inserting {} in {} ", chipVolLeft->GetName(), moduleVol->GetName());
179 moduleVol->AddNode(chipVolLeft, iChip * 2, transLeft);
180
181 TGeoVolume* chipVolRight = createChip();
184 TGeoCombiTrans* transRight = new TGeoCombiTrans();
185 transRight->SetTranslation(xRight, 0, zRight);
186 LOGP(debug, "Inserting {} in {} ", chipVolRight->GetName(), moduleVol->GetName());
187 moduleVol->AddNode(chipVolRight, iChip * 2 + 1, transRight);
188 }
189
190 return moduleVol;
191}
192
193std::pair<float, float> TRKSegmentedLayer::getBoundingRadii(double staveWidth) const
194{
195 const float avgRadius = 0.5 * (mInnerRadius + mOuterRadius);
196 const float staveSizeX = staveWidth;
197 const float staveSizeY = mOuterRadius - mInnerRadius;
198
199 /*const float deltaForTilt = 0.5 * (std::sin(TMath::DegToRad() * mTiltAngle) * staveSizeX + std::cos(TMath::DegToRad() * mTiltAngle) * staveSizeY);
200
201 float radiusMin = std::sqrt(avgRadius * avgRadius + 0.25 * staveSizeX * staveSizeX + 0.25 * staveSizeY * staveSizeY - avgRadius * 2. * deltaForTilt);
202 float radiusMax = std::sqrt(avgRadius * avgRadius + 0.25 * staveSizeX * staveSizeX + 0.25 * staveSizeY * staveSizeY + avgRadius * 2. * deltaForTilt);*/
203
204 const double alpha = TMath::DegToRad() * std::abs(mTiltAngle);
205
206 // The maximum distance from the center is always the outer top corner
207 double u_max = avgRadius * std::sin(alpha) + staveSizeX / 2.0;
208 double v_max = avgRadius * std::cos(alpha) + staveSizeY / 2.0;
209 double radiusMax = std::sqrt(u_max * u_max + v_max * v_max);
210
211 // The perpendicular distance from the center to the line where the inner face lies
212 double perpDistance = avgRadius * std::cos(alpha) - staveSizeY / 2.0;
213
214 // The projection of the center along the width of the stave
215 double projDistance = avgRadius * std::sin(alpha);
216
217 double radiusMin;
218 if (projDistance <= staveSizeX / 2.0) {
219 // The center projects directly inside the flat face.
220 // The closest point is on the face itself, not on the corner
221 radiusMin = perpDistance;
222 } else {
223 // The center projects outside the face. The closest point is the inner corner
224 double u_min = projDistance - staveSizeX / 2.0;
225 radiusMin = std::sqrt(u_min * u_min + perpDistance * perpDistance);
226 }
227
228 // Add a 0.5 mm safety margin to prevent false-positive overlaps in ROOT's geometry checker caused by floating-point inaccuracies
229 const float precisionMargin = 0.05f;
230
231 return {radiusMin - precisionMargin, radiusMax + precisionMargin};
232}
233
235
236TRKMLLayer::TRKMLLayer(int layerNumber, std::string layerName, float rInn, float staggerOffset, float tiltAngle, int numberOfStaves, int numberOfModules, float thickOrX2X0, MatBudgetParamMode mode, int rInnRow, float phiOffset)
237 : TRKSegmentedLayer(layerNumber, layerName, rInn, tiltAngle, numberOfStaves, numberOfModules, thickOrX2X0, mode), mStaggerOffset(staggerOffset), mRInnRow(rInnRow), mPhiOffset(phiOffset)
238{
239 if (mPhiOffset != 0.f) {
240 LOGP(info, "Layer {}: staves rotated by {} deg about the beam axis (phiOffset)", mLayerNumber, mPhiOffset);
241 }
242 if (mLayerNumber == sFlippedLayerNumber) {
243 mOuterRadius = rInn;
245 mIsFlipped = true;
246 mStaggerOffset = -staggerOffset;
247 LOGP(info, "Layer {} is flipped: sensor and metal stack positions are switched", mLayerNumber);
248 }
249 if (mRInnRow != 0 && mRInnRow != 1) {
250 LOGP(fatal, "Layer {}: rInnRow = {}, use 0 (even staves at rInn) or 1 (odd staves at rInn)", mLayerNumber, mRInnRow);
251 }
252 if (mRInnRow != 0) {
253 if (mLayerNumber == 3 || mLayerNumber == 4) {
254 // even staves (stave 0) go to the shifted row: inside the rInn row in the flipped layer, outside
255 // otherwise (stagOffset >= 0; a negative stagOffset is not handled by getBoundingRadii)
256 LOGP(info, "Layer {} (staggered): even staves in the {} row (rInnRow = {})", mLayerNumber, mIsFlipped ? "inner" : "outer", mRInnRow);
257 } else {
258 LOGP(info, "Layer {} is not staggered: rInnRow = {} has no effect", mLayerNumber, mRInnRow);
259 }
260 }
261}
262
264{
265 // Assembly (not a solid box) so the end-of-stave card can extend past the module envelope.
267 TGeoVolume* staveVol = new TGeoVolumeAssembly(staveName.c_str());
268 staveVol->SetLineColor(kYellow);
269
270 for (int iModule = 0; iModule < mNumberOfModules; iModule++) {
271 TGeoVolume* moduleVol = createModule();
272 double zPos = -0.5 * mNumberOfModules * sModuleLength + (iModule + 0.5) * sModuleLength;
273 TGeoCombiTrans* trans = new TGeoCombiTrans();
274 trans->SetTranslation(0, 0, zPos);
275 LOGP(debug, "Inserting {} in {} ", moduleVol->GetName(), staveVol->GetName());
276 staveVol->AddNode(moduleVol, iModule, trans);
277 }
278
279 // End-of-stave card on the A-side (+z) only, just past the stave end and in front of the
280 // TRK_MIDBARCONN_DISK. Local frame: x = phi (width), y = radial (thickness), z = length.
281 TGeoCombiTrans* tCard = new TGeoCombiTrans();
282 tCard->SetTranslation(0, 0, mLength / 2 + constants::ML::eosCard::zGap + constants::ML::eosCard::length / 2);
283 staveVol->AddNode(createEndOfStaveCard(), 0, tCard);
284
285 return staveVol;
286}
287
288TGeoVolume* TRKMLLayer::createEndOfStaveCard()
289{
290 // FR4 board carrying evenly spaced copper planes; same construction as the OT card, with its
291 // own constants::ML::eosCard dimensions and a configurable copper thickness (TRKBase.mlEosCardCuThickness),
292 // which displaces FR4 inside the fixed envelope and sets the card x/X0.
293 TGeoMedium* medFR4 = gGeoManager->GetMedium("TRK_FR4$");
294 TGeoMedium* medCu = gGeoManager->GetMedium("TRK_COPPER$");
295 const std::string name = GeometryTGeo::getTRKStavePattern() + std::to_string(mLayerNumber) + "_EOSCard";
296
298 TGeoVolume* cardVol = new TGeoVolume(name.c_str(), board, medFR4);
299 cardVol->SetLineColor(kGreen + 3);
300
301 const double cuThickness = TRKBaseParam::Instance().mlEosCardCuThickness;
302 const int nPlanes = constants::ML::eosCard::nCopperLayers;
303 if (cuThickness * nPlanes >= constants::ML::eosCard::thickness) {
304 LOGP(fatal, "TRKBase.mlEosCardCuThickness = {} cm x {} planes does not fit in the {} cm ML end-of-stave card",
305 cuThickness, nPlanes, constants::ML::eosCard::thickness);
306 }
307 TGeoShape* plane = new TGeoBBox(constants::ML::eosCard::width / 2, cuThickness / 2, constants::ML::eosCard::length / 2);
308 TGeoVolume* planeVol = new TGeoVolume((name + "_Cu").c_str(), plane, medCu);
309 planeVol->SetLineColor(kOrange + 7);
310
311 // Evenly spaced, the outermost two flush with the board surfaces.
312 const double span = constants::ML::eosCard::thickness - cuThickness;
313 for (int iPlane = 0; iPlane < nPlanes; iPlane++) {
314 const double y = (nPlanes > 1) ? -span / 2 + iPlane * span / (nPlanes - 1) : 0.;
315 cardVol->AddNode(planeVol, iPlane, new TGeoTranslation(0, y, 0));
316 }
317
318 return cardVol;
319}
320
321void TRKMLLayer::createLayer(TGeoVolume* motherVolume)
322{
323 // Retrieve exact bounding boundaries and create the logical container volume
324 auto [rMin, rMax] = getBoundingRadii(sStaveWidth);
325
326 TGeoMedium* medAir = gGeoManager->GetMedium("TRK_AIR$");
327 // TGeoTube* layer = new TGeoTube(mInnerRadius - 0.333 * sLogicalVolumeThickness, mInnerRadius + 0.667 * sLogicalVolumeThickness, mLength / 2);
328 // Extend the z half-length so the A-side end-of-stave card (past mLength/2) stays inside the layer.
330 TGeoTube* layer = new TGeoTube(rMin, rMax, halfLengthZ);
331 TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
332 layerVol->SetLineColor(kYellow);
333
334 // Compute the number of staves
335 // int nStaves = (int)std::ceil(mInnerRadius * 2 * TMath::Pi() / sStaveWidth);
336 // nStaves += nStaves % 2; // Require an even number of staves
337
338 // Nominal average radii used as placement barycenters for the staves
339 const double avgRadiusInner = 0.5 * (mInnerRadius + mOuterRadius);
340 const double avgRadiusOuter = avgRadiusInner + mStaggerOffset;
341
342 // Compute the size of the overlap region
343 double theta = 2. * TMath::Pi() / mNumberOfStaves;
344 double theta1 = std::atan(sStaveWidth / 2 / mInnerRadius);
345 double st = std::sin(theta);
346 double ct = std::cos(theta);
347 double theta2 = std::atan((mInnerRadius * st - sStaveWidth / 2 * ct) / (mInnerRadius * ct + sStaveWidth / 2 * st));
348 double overlap = (theta1 - theta2) * mInnerRadius;
349 LOGP(info, "Creating a layer with {} staves and {} mm overlap", mNumberOfStaves, overlap * 10);
350
351 for (int iStave = 0; iStave < mNumberOfStaves; iStave++) {
352 TGeoVolume* staveVol = createStave();
353 TGeoCombiTrans* trans = new TGeoCombiTrans();
354 // If the number of staves is a multiple of 4, rotate by half a stave to avoid having the first one exactly on the x;
355 // mPhiOffset rotates the whole layer (position and orientation of every stave) about the beam axis
356 double phi = ((mNumberOfStaves % 4 == 0) ? theta * (iStave + 0.5) : theta * iStave) + mPhiOffset * TMath::DegToRad();
357 double phiDeg = phi * TMath::RadToDeg();
358 TGeoRotation* rot = new TGeoRotation("rot", phiDeg + 90 + mTiltAngle, 0, 0);
359 trans->SetRotation(rot);
360 // float trueRadius = (mLayerNumber == 3 || mLayerNumber == 4) ? (iStave % 2 == 0 ? mInnerRadius : mInnerRadius + mStaggerOffset) : mInnerRadius;
361 float trueRadius = (mLayerNumber == 3 || mLayerNumber == 4) ? (iStave % 2 == mRInnRow ? avgRadiusInner : avgRadiusOuter) : avgRadiusInner;
362 trans->SetTranslation(trueRadius * std::cos(phi), trueRadius * std::sin(phi), 0);
363 LOGP(debug, "Inserting {} in {} ", staveVol->GetName(), layerVol->GetName());
364 layerVol->AddNode(staveVol, iStave, trans);
365 }
366
367 LOGP(debug, "Inserting {} in {} ", layerVol->GetName(), motherVolume->GetName());
368 motherVolume->AddNode(layerVol, 1, nullptr);
369}
370
371std::pair<float, float> TRKMLLayer::getBoundingRadii(double staveWidth) const
372{
373 // Get the baseline RMin from the base class
374 auto [defaultRadiusMin, defaultRadiusMax] = TRKSegmentedLayer::getBoundingRadii(staveWidth);
375
376 // If we are not in the staggered layers, return the baseline values
377 if (mLayerNumber != 3 && mLayerNumber != 4) {
378 return {defaultRadiusMin, defaultRadiusMax};
379 }
380
381 /*// For staggered layers, we must recalculate RMax based on the outer shifted row
382 const float avgRadiusInner = 0.5 * (mInnerRadius + mOuterRadius);
383 const float avgRadiusOuter = avgRadiusInner + mStaggerOffset;
384
385 const float staveSizeX = staveWidth;
386 const float staveSizeY = mOuterRadius - mInnerRadius;
387
388 const float deltaForTiltOuter = 0.5 * (std::sin(TMath::DegToRad() * mTiltAngle) * staveSizeX + std::cos(TMath::DegToRad() * mTiltAngle) * staveSizeY);
389
390 const float radiusMax = std::sqrt(avgRadiusOuter * avgRadiusOuter + 0.25 * staveSizeX * staveSizeX + 0.25 * staveSizeY * staveSizeY + avgRadiusOuter * 2. * deltaForTiltOuter);*/
391
392 const float avgRadiusInner = 0.5 * (mInnerRadius + mOuterRadius);
393 const float avgRadiusStaggered = avgRadiusInner + mStaggerOffset;
394
395 const float staveSizeX = staveWidth;
396 const float staveSizeY = mOuterRadius - mInnerRadius;
397 const float alpha = TMath::DegToRad() * std::abs(mTiltAngle);
398
399 const float precisionMargin = 0.05f;
400
401 // If the layer is NOT flipped (e.g., Layer 4), the stagger goes outwards
402 // Therefore, we must recalculate only the maximum radius based on the outer shifted row
403 if (!mIsFlipped) {
404 float u_max = avgRadiusStaggered * std::sin(alpha) + staveSizeX / 2.0;
405 float v_max = avgRadiusStaggered * std::cos(alpha) + staveSizeY / 2.0;
406 float radiusMax = std::sqrt(u_max * u_max + v_max * v_max);
407
408 return {defaultRadiusMin, radiusMax + precisionMargin};
409 }
410 // If the layer IS flipped (e.g., Layer 3), the stagger goes inwards
411 // Therefore, we must recalculate only the minimum radius based on the inner shifted row
412 else {
413 double perpDistance = avgRadiusStaggered * std::cos(alpha) - staveSizeY / 2.0;
414 double projDistance = avgRadiusStaggered * std::sin(alpha);
415 double newRadiusMin;
416
417 if (projDistance <= staveSizeX / 2.0) {
418 newRadiusMin = perpDistance;
419 } else {
420 double u_min = projDistance - staveSizeX / 2.0;
421 newRadiusMin = std::sqrt(u_min * u_min + perpDistance * perpDistance);
422 }
423
424 return {newRadiusMin - precisionMargin, defaultRadiusMax};
425 }
426}
427
429
430TRKOTLayer::TRKOTLayer(int layerNumber, std::string layerName, float rInn, float tiltAngle, int numberOfStaves, int numberOfModules, float thickOrX2X0, MatBudgetParamMode mode)
431 : TRKSegmentedLayer(layerNumber, layerName, rInn, tiltAngle, numberOfStaves, numberOfModules, thickOrX2X0, mode)
432{
433}
434
436{
437 TGeoMedium* medSi = gGeoManager->GetMedium("TRK_SILICON$");
439 float lengthHalfBarrel = mLength / 2;
440 TGeoShape* halfStave = new TGeoBBox(sHalfStaveWidth / 2, mChipThickness / 2, lengthHalfBarrel / 2);
441 TGeoVolume* halfStaveVol = new TGeoVolume(halfStaveName.c_str(), halfStave, medSi);
442 halfStaveVol->SetLineColor(kYellow);
443
444 int nModulesPerHalfBarrel = mNumberOfModules / 2;
445 for (int iModule = 0; iModule < nModulesPerHalfBarrel; iModule++) {
446 double zPos = -0.5 * nModulesPerHalfBarrel * sModuleLength + (iModule + 0.5) * sModuleLength;
447 TGeoCombiTrans* trans = new TGeoCombiTrans();
448 trans->SetTranslation(0, 0, zPos);
449 halfStaveVol->AddNode(createModule(), iModule, trans);
450 }
451
452 return halfStaveVol;
453}
454
456{
458 TGeoVolume* staveVol = new TGeoVolumeAssembly(staveName.c_str());
459
460 TGeoCombiTrans* transLeft = new TGeoCombiTrans();
461 transLeft->SetTranslation(-(sHalfStaveWidth - sInStaveOverlap) / 2, 0, 0);
462 staveVol->AddNode(createHalfStave(), 0, transLeft);
463
464 TGeoCombiTrans* transRight = new TGeoCombiTrans();
465 transRight->SetTranslation((sHalfStaveWidth - sInStaveOverlap) / 2, 0.2, 0);
466 staveVol->AddNode(createHalfStave(), 1, transRight);
467
468 return staveVol;
469}
470
471void TRKOTLayer::createLayer(TGeoVolume* motherVolume)
472{
473 auto [rMin, rMax] = getBoundingRadii(sStaveWidth);
474
475 TGeoMedium* medAir = gGeoManager->GetMedium("TRK_AIR$");
476 TGeoTube* layer = new TGeoTube(rMin, rMax, (mLength + sGapBetweenOuterTrackerBarrelHalves) / 2);
477 TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
478 layerVol->SetLineColor(kYellow);
479
480 int nStavesHalfBarrel = (int)std::ceil(mInnerRadius * 2 * TMath::Pi() / sStaveWidth);
481 nStavesHalfBarrel += nStavesHalfBarrel % 2;
482
483 const double avgRadius = 0.5 * (mInnerRadius + mOuterRadius);
484 const double theta = 2. * TMath::Pi() / nStavesHalfBarrel;
485 const float lengthHalfBarrel = mLength / 2;
486 const int nStaves = nStavesHalfBarrel * 2;
487 LOGP(info, "Creating OT layer {} with two half-barrels of {} staves each", mLayerNumber, nStavesHalfBarrel);
488
489 for (int iStave = 0; iStave < nStaves; iStave++) {
490 int whichHalfBarrel = iStave / nStavesHalfBarrel;
491 double phi = theta * iStave;
492 TGeoRotation* rot = new TGeoRotation("rot");
493 if (whichHalfBarrel == 1) {
494 rot->RotateY(180.);
495 }
496 rot->RotateZ(phi * TMath::RadToDeg() + 90 + (whichHalfBarrel == 0 ? +1 : -1) * mTiltAngle);
497 double zPos = (whichHalfBarrel == 0 ? -1 : 1) * (0.5 * lengthHalfBarrel + sGapBetweenOuterTrackerBarrelHalves / 2);
498 TGeoCombiTrans* trans = new TGeoCombiTrans();
499 trans->SetRotation(rot);
500 trans->SetTranslation(avgRadius * std::cos(phi), avgRadius * std::sin(phi), zPos);
501 layerVol->AddNode(createStave(), iStave, trans);
502 }
503
504 motherVolume->AddNode(layerVol, 1, nullptr);
505}
506
507std::pair<float, float> TRKOTLayer::getBoundingRadii(double staveWidth) const
508{
509 auto [radiusMin, radiusMax] = TRKSegmentedLayer::getBoundingRadii(staveWidth);
510 return {radiusMin - 0.201f, radiusMax};
511}
512
514
515TRKOTLayerRealistic::TRKOTLayerRealistic(int layerNumber, std::string layerName, float rInn, float tiltAngle, int numberOfStaves, int numberOfModules, float thickOrX2X0, MatBudgetParamMode mode)
516 : TRKSegmentedLayer(layerNumber, layerName, rInn, tiltAngle, numberOfStaves, numberOfModules, thickOrX2X0, mode)
517{
518 // Outermost layer is flipped: cooling pipe and support rings on the inner side.
520 mIsFlipped = true;
521 }
522}
523
525{
526 TGeoMedium* medSi = gGeoManager->GetMedium("TRK_SILICON$");
528 TGeoShape* chip = new TGeoBBox(sChipWidth / 2, constants::OT::sensorThickness / 2, sChipLength / 2);
529 TGeoVolume* chipVol = new TGeoVolume(chipName.c_str(), chip, medSi);
530 chipVol->SetLineColor(kYellow);
531
532 // Active sensor and passive read-out edge tile the chip width.
533 chipVol->AddNode(createSensor(), 1, new TGeoTranslation(-sDeadzoneWidth / 2, 0, 0));
534 chipVol->AddNode(createDeadzone(), 1, new TGeoTranslation((sChipWidth - sDeadzoneWidth) / 2, 0, 0));
535 return chipVol;
536}
537
538TGeoVolume* TRKOTLayerRealistic::createFPC()
539{
540 TGeoMedium* med = gGeoManager->GetMedium("TRK_FPC$");
542 TGeoVolume* vol = new TGeoVolume((GeometryTGeo::getTRKModulePattern() + std::to_string(mLayerNumber) + "_FPC").c_str(), shape, med);
543 vol->SetLineColor(kOrange);
544 return vol;
545}
546
547TGeoVolume* TRKOTLayerRealistic::createColdPlate()
548{
549 TGeoMedium* med = gGeoManager->GetMedium("TRK_CARBONFIBER$");
551 TGeoVolume* vol = new TGeoVolume((GeometryTGeo::getTRKModulePattern() + std::to_string(mLayerNumber) + "_ColdPlate").c_str(), shape, med);
552 vol->SetLineColor(kGray + 2);
553 return vol;
554}
555
556double TRKOTLayerRealistic::getRowHalfLength() const
557{
558 const int nModulesPerRow = mNumberOfModules / 2;
559 return (nModulesPerRow * constants::OT::fpc::length + (nModulesPerRow - 1) * constants::OT::interModuleGap) / 2;
560}
561
562double TRKOTLayerRealistic::getPipeTrim() const
563{
564 // The mid-rapidity ring sits at the pipe radius, between the z = 0 wall and the pipe.
565 const double wallThickness = TRKBaseParam::Instance().otBarrelWallThickness;
567 return std::max(0., pipeStart - constants::OT::barrelHalvesZGap / 2);
568}
569
570TGeoVolume* TRKOTLayerRealistic::createSupportRing(double rMin, double rMax, double phi1, double phi2, int id)
571{
572 // Hollow rectangular-section half-ring, open at the two azimuthal ends.
573 TGeoMedium* med = gGeoManager->GetMedium("TRK_CARBONFIBER$");
575 const double dz = constants::OT::supportRing::zWidth / 2;
576 const std::string base = GeometryTGeo::getTRKLayerPattern() + std::to_string(mLayerNumber) + "_SupportRing" + std::to_string(id);
577 new TGeoTubeSeg((base + "_outsh").c_str(), rMin, rMax, dz, phi1, phi2);
578 new TGeoTubeSeg((base + "_insh").c_str(), rMin + t, rMax - t, dz - t, phi1, phi2);
579 TGeoShape* shape = new TGeoCompositeShape((base + "sh").c_str(), (base + "_outsh-" + base + "_insh").c_str());
580 TGeoVolume* vol = new TGeoVolume(base.c_str(), shape, med);
581 vol->SetLineColor(kGray + 2);
582 return vol;
583}
584
585TGeoVolume* TRKOTLayerRealistic::createCoolingPipe()
586{
587 TGeoMedium* med = gGeoManager->GetMedium("TRK_CARBONFIBER$");
589 getRowHalfLength() - getPipeTrim() / 2);
590 TGeoVolume* vol = new TGeoVolume((GeometryTGeo::getTRKStavePattern() + std::to_string(mLayerNumber) + "_CoolingPipe").c_str(), tube, med);
591 vol->SetLineColor(kBlue + 2);
592 return vol;
593}
594
595TGeoVolume* TRKOTLayerRealistic::createEndOfStaveCard()
596{
597 TGeoMedium* medFR4 = gGeoManager->GetMedium("TRK_FR4$");
598 TGeoMedium* medCu = gGeoManager->GetMedium("TRK_COPPER$");
599 const std::string name = GeometryTGeo::getTRKStavePattern() + std::to_string(mLayerNumber) + "_EOSCard";
600
602 TGeoVolume* cardVol = new TGeoVolume(name.c_str(), board, medFR4);
603 cardVol->SetLineColor(kGreen + 3);
604
605 // Copper thickness is configurable: it displaces FR4 inside the fixed board envelope and
606 // is what sets the card material budget, so it is the knob for x/X0 scans.
607 const double cuThickness = TRKBaseParam::Instance().otEosCardCuThickness;
608 const int nPlanes = constants::OT::eosCard::nCopperLayers;
609 if (cuThickness * nPlanes >= constants::OT::eosCard::thickness) {
610 LOGP(fatal, "TRKBase.otEosCardCuThickness = {} cm x {} planes does not fit in the {} cm end-of-stave card",
611 cuThickness, nPlanes, constants::OT::eosCard::thickness);
612 }
613 TGeoShape* plane = new TGeoBBox(constants::OT::eosCard::width / 2, cuThickness / 2, constants::OT::eosCard::length / 2);
614 TGeoVolume* planeVol = new TGeoVolume((name + "_Cu").c_str(), plane, medCu);
615 planeVol->SetLineColor(kOrange + 7);
616
617 // Evenly spaced, the outermost two flush with the board surfaces.
618 const double span = constants::OT::eosCard::thickness - cuThickness;
619 for (int iPlane = 0; iPlane < nPlanes; iPlane++) {
620 const double y = (nPlanes > 1) ? -span / 2 + iPlane * span / (nPlanes - 1) : 0.;
621 cardVol->AddNode(planeVol, iPlane, new TGeoTranslation(0, y, 0));
622 }
623
624 return cardVol;
625}
626
627void TRKOTLayerRealistic::addConnector(TGeoVolume* moduleVol, double rMid)
628{
629 TGeoMedium* med = gGeoManager->GetMedium("TRK_LCPCU$");
630 std::string name = GeometryTGeo::getTRKModulePattern() + std::to_string(mLayerNumber) + "_Connector";
632 TGeoVolume* vol = new TGeoVolume(name.c_str(), shape, med);
633 vol->SetLineColor(kBlue);
634
635 // Centred in phi, inset from the module short edge in z.
637 moduleVol->AddNode(vol, 0, new TGeoTranslation(0, rMid, z));
638}
639
640void TRKOTLayerRealistic::addCapacitors(TGeoVolume* moduleVol, double rMid)
641{
642 TGeoMedium* med = gGeoManager->GetMedium("TRK_BATIO3$");
645 TGeoVolume* vol = new TGeoVolume(name.c_str(), shape, med);
646 vol->SetLineColor(kCyan);
647
650 const double chipX[2] = {-0.5 * pitchX, +0.5 * pitchX};
651 const double chipZ[4] = {-1.5 * pitchZ, -0.5 * pitchZ, +0.5 * pitchZ, +1.5 * pitchZ};
652 const double dX[5] = {-0.80, +0.80, -0.80, +0.80, 0.0}; // per chip: 4 corners + centre [cm]
653 const double dZ[5] = {-0.95, -0.95, +0.95, +0.95, 0.0};
654
655 // Skip capacitors that fall under the connector footprint (+1 mm clearance).
657 const double skipX = constants::OT::connector::width / 2 + constants::OT::capacitor::width / 2 + 0.1;
658 const double skipZ = constants::OT::connector::length / 2 + constants::OT::capacitor::length / 2 + 0.1;
659
660 int capCopy = 0;
661 for (int iZ = 0; iZ < 4; iZ++) {
662 for (int iX = 0; iX < 2; iX++) {
663 for (int iCap = 0; iCap < constants::OT::capacitor::perChip; iCap++) {
664 const double x = chipX[iX] + dX[iCap];
665 const double z = chipZ[iZ] + dZ[iCap];
666 if (std::abs(x) < skipX && std::abs(z - connZ) < skipZ) {
667 continue;
668 }
669 moduleVol->AddNode(vol, capCopy++, new TGeoTranslation(x, rMid, z));
670 }
671 }
672 }
673}
674
675void TRKOTLayerRealistic::addBrackets(TGeoVolume* moduleVol, double rMid)
676{
677 TGeoMedium* med = gGeoManager->GetMedium("TRK_PEEK$");
680 TGeoVolume* vol = new TGeoVolume(name.c_str(), shape, med);
681 vol->SetLineColor(kGreen + 2);
682
684 moduleVol->AddNode(vol, 0, new TGeoTranslation(0, rMid, -z));
685 moduleVol->AddNode(vol, 1, new TGeoTranslation(0, rMid, +z));
686}
687
689{
691 TGeoVolume* moduleVol = new TGeoVolumeAssembly(modName.c_str());
692
693 // Flush component stack about the chip mid-plane (local r = 0).
694 const double chipHalf = constants::OT::sensorThickness / 2;
695 const double fpcMidY = -(chipHalf + constants::OT::fpc::thickness / 2);
696 const double coldPlateMidY = +(chipHalf + constants::OT::coldPlate::thickness / 2);
697 const double connMidY = -(chipHalf + constants::OT::fpc::thickness + constants::OT::connector::thickness / 2);
698 const double capMidY = -(chipHalf + constants::OT::fpc::thickness + constants::OT::capacitor::thickness / 2);
699 const double bracketMidY = +(chipHalf + constants::OT::coldPlate::thickness + constants::OT::bracket::thickness / 2);
700
701 // 8 chips: 2 phi columns x 4 z rows, on a uniform chip+gap pitch.
702 const double pitchX = sChipWidth + constants::OT::interChipGap;
703 const double pitchZ = sChipLength + constants::OT::interChipGap;
704 const double chipX[2] = {-0.5 * pitchX, +0.5 * pitchX};
705 const double chipZ[4] = {-1.5 * pitchZ, -0.5 * pitchZ, +0.5 * pitchZ, +1.5 * pitchZ};
706
707 moduleVol->AddNode(createColdPlate(), 0, new TGeoTranslation(0, coldPlateMidY, 0));
708
709 int chipCopy = 0;
710 for (int iZ = 0; iZ < 4; iZ++) {
711 for (int iX = 0; iX < 2; iX++) {
712 TGeoCombiTrans* trans = new TGeoCombiTrans();
713 trans->SetTranslation(chipX[iX], 0., chipZ[iZ]);
714 if (iX == 0) { // inner column rotated so its dead zone faces the outer module edge
715 TGeoRotation* rot = new TGeoRotation();
716 rot->RotateY(180.);
717 trans->SetRotation(rot);
718 }
719 moduleVol->AddNode(createChip(), chipCopy++, trans);
720 }
721 }
722
723 moduleVol->AddNode(createFPC(), 0, new TGeoTranslation(0, fpcMidY, 0));
724 addConnector(moduleVol, connMidY);
725 addCapacitors(moduleVol, capMidY);
726 addBrackets(moduleVol, bracketMidY);
727 return moduleVol;
728}
729
731{
733 TGeoVolume* rowVol = new TGeoVolumeAssembly(rowName.c_str());
734
735 const int nModulesPerRow = mNumberOfModules / 2;
736 const double moduleLength = constants::OT::fpc::length;
737 const double step = moduleLength + constants::OT::interModuleGap;
738 const double rowHalfLen = getRowHalfLength();
739
740 for (int iModule = 0; iModule < nModulesPerRow; iModule++) {
741 double zPos = -rowHalfLen + moduleLength / 2 + iModule * step;
742 TGeoCombiTrans* trans = new TGeoCombiTrans();
743 trans->SetTranslation(0, 0, zPos);
744 rowVol->AddNode(createModule(), iModule, trans);
745 }
746
747 return rowVol;
748}
749
751{
753 TGeoVolume* staveVol = new TGeoVolumeAssembly(staveName.c_str());
754
755 // Two rows overlapping in phi and staggered in r. They straddle the stave origin, so the
756 // stave is tangent to the barrel circle at its centre and every row-to-row radial step,
757 // within a stave and between neighbours, is rowRadialStagger.
758 const double edgeDead = constants::OT::fpc::wireBondMargin + constants::moduleMLOT::chip::passiveEdgeReadOut;
759 const double inStaveOverlap = 2 * edgeDead + constants::OT::rowActiveOverlap;
760 const double rowOffset = constants::OT::fpc::width - inStaveOverlap;
761
762 TGeoCombiTrans* tRow0 = new TGeoCombiTrans();
763 tRow0->SetTranslation(-rowOffset / 2, 0, 0);
764 staveVol->AddNode(createHalfStave(), 0, tRow0);
765 TGeoCombiTrans* tRow1 = new TGeoCombiTrans();
766 tRow1->SetTranslation(rowOffset / 2, constants::OT::rowRadialStagger, 0);
767 staveVol->AddNode(createHalfStave(), 1, tRow1);
768
769 // Shortened at the mid-rapidity end for the support ring, hence off-centre.
770 TGeoCombiTrans* tPipe = new TGeoCombiTrans();
771 tPipe->SetTranslation(0, constants::OT::coolingPipe::rLocalOffset, getPipeTrim() / 2);
772 staveVol->AddNode(createCoolingPipe(), 0, tPipe);
773
774 // Past the last module at the outer z end (local +z in both eta half-barrels).
775 TGeoCombiTrans* tCard = new TGeoCombiTrans();
776 tCard->SetTranslation(0, constants::OT::rowRadialStagger / 2,
778 staveVol->AddNode(createEndOfStaveCard(), 0, tCard);
779 return staveVol;
780}
781
782void TRKOTLayerRealistic::createLayer(TGeoVolume* motherVolume)
783{
784 const double edgeDead = constants::OT::fpc::wireBondMargin + constants::moduleMLOT::chip::passiveEdgeReadOut;
785 const double inStaveOverlap = 2 * edgeDead + constants::OT::rowActiveOverlap;
786 const double staveWidth = 2 * constants::OT::fpc::width - inStaveOverlap;
787
788 // One eta half-barrel = one row of modules, length set by the FPC.
789 const double lengthHalfBarrel = 2 * getRowHalfLength();
790
791 // The envelope reaches past the last module to hold the end-of-stave cards.
792 const double halfLength = lengthHalfBarrel + constants::OT::barrelHalvesZGap / 2 + constants::OT::eosCard::zGap + constants::OT::eosCard::length;
793
794 // Cut on the vertical plane (x = 0) and at mid-rapidity into four quarter barrels. The
795 // envelope is slotted along both cuts so the separation walls run continuously in r; the
796 // slots clear the walls only, the staves stand back by barrelWallClearance.
797 const double wallThickness = TRKBaseParam::Instance().otBarrelWallThickness;
798 const bool hasWalls = wallThickness > 0.;
799 const double slotHalfWidth = wallThickness / 2 + constants::OT::barrelWallSlotMargin;
800 // The two mid-rapidity walls sit back to back, so the z slot must clear both.
801 const double zSlotHalfWidth = wallThickness + constants::OT::barrelWallSlotMargin;
802 if (hasWalls && zSlotHalfWidth >= constants::OT::barrelHalvesZGap / 2) {
803 LOGP(fatal, "TRKBase.otBarrelWallThickness = {} cm leaves no room for the staves in the {} cm gap between the eta half-barrels",
804 wallThickness, constants::OT::barrelHalvesZGap);
805 }
806
807 auto [rMin, rMax] = getBoundingRadii(staveWidth);
808 TGeoMedium* medAir = gGeoManager->GetMedium("TRK_AIR$");
809 TGeoShape* layer = nullptr;
810 if (hasWalls) {
811 const std::string tubeName = mLayerName + "_envelopesh";
812 const std::string slotName = mLayerName + "_wallslotsh";
813 const std::string zSlotName = mLayerName + "_midslotsh";
814 new TGeoTube(tubeName.c_str(), rMin, rMax, halfLength);
815 new TGeoBBox(slotName.c_str(), slotHalfWidth, rMax + 1., halfLength + 1.);
816 new TGeoBBox(zSlotName.c_str(), rMax + 1., rMax + 1., zSlotHalfWidth);
817 layer = new TGeoCompositeShape((mLayerName + "sh").c_str(), (tubeName + "-" + slotName + "-" + zSlotName).c_str());
818 } else {
819 layer = new TGeoTube(rMin, rMax, halfLength);
820 }
821 TGeoVolume* layerVol = new TGeoVolume(mLayerName.c_str(), layer, medAir);
822 layerVol->SetLineColor(kYellow);
823
824 const double avgRadius = 0.5 * (mInnerRadius + mOuterRadius);
825
826 // Arc lost at each of the two azimuthal cuts: the wall plus the passive stave edge,
827 // never less than the bare chip-to-chip gap.
828 const double accGap = std::max(constants::OT::halfBarrelChipGap + 2 * constants::moduleMLOT::chip::passiveEdgeReadOut,
829 2 * (wallThickness / 2 + constants::OT::barrelWallClearance + edgeDead));
830
831 // Staves per ring: configured, or else the smallest even count leaving rowActiveOverlap between
832 // neighbours (the two boundary staves take activeStaveWidth + accGap, nStaves - 2 junctions share the rest).
833 const double activeStaveWidth = staveWidth - 2 * edgeDead;
834 int nStavesHalfBarrel = mNumberOfStaves;
835 if (nStavesHalfBarrel <= 0) {
836 nStavesHalfBarrel = (int)std::ceil(2. + (avgRadius * 2 * TMath::Pi() - 2 * (activeStaveWidth + accGap)) /
837 (activeStaveWidth - constants::OT::rowActiveOverlap));
838 nStavesHalfBarrel += nStavesHalfBarrel % 2;
839 }
840 if (nStavesHalfBarrel % 2) {
841 LOGP(fatal, "OT layer {}: {} staves per ring, must be even (two azimuthal halves)", mLayerNumber, nStavesHalfBarrel);
842 }
843
844 const int nHalf = nStavesHalfBarrel / 2;
845 const double thetaGap = (activeStaveWidth + accGap) / avgRadius;
846 const double thetaInt = (2. * TMath::Pi() - 2. * thetaGap) / (nStavesHalfBarrel - 2);
847 const double overlap = activeStaveWidth - avgRadius * thetaInt;
848 LOGP(info, "Creating realistic OT layer {}: {} staves/half-barrel, internal overlap {} mm, boundary gap {} mm, flipped={}",
849 mLayerNumber, nStavesHalfBarrel, overlap * 10, accGap * 10, mIsFlipped);
850 if (overlap < constants::OT::rowActiveOverlap) {
851 LOGP(warning, "OT layer {}: active neighbour overlap {} mm is below the required {} mm",
853 }
854
855 const int nStaves = nStavesHalfBarrel * 2;
856
857 for (int iStave = 0; iStave < nStaves; iStave++) {
858 int whichHalfBarrel = iStave / nStavesHalfBarrel;
859 int sInHB = iStave % nStavesHalfBarrel;
860 int azHalf = sInHB / nHalf;
861 int sInAz = sInHB % nHalf;
862
863 // Stave centres placed so the boundary gaps land on the cut plane, keeping the
864 // region where the beam-pipe supports run clear of staves in both half-barrels.
865 const double phiCut = TMath::Pi() / 2;
866 double phi = phiCut + azHalf * TMath::Pi() + thetaGap / 2 + sInAz * thetaInt;
867
868 TGeoRotation* rot = new TGeoRotation("rot");
869 rot->RotateX(180.); // cooling pipe faces the larger-R side (inner for the flipped layer); keeps local phi
870 if (whichHalfBarrel == 1) {
871 rot->RotateY(180.);
872 }
873 if (mIsFlipped) {
874 rot->RotateZ(180.);
875 }
876 rot->RotateZ(phi * TMath::RadToDeg() + 90 + (whichHalfBarrel == 0 ? +1 : -1) * mTiltAngle);
877
878 double zPos = (whichHalfBarrel == 0 ? -1 : 1) * (0.5 * lengthHalfBarrel + constants::OT::barrelHalvesZGap / 2);
879 TGeoCombiTrans* trans = new TGeoCombiTrans();
880 trans->SetRotation(rot);
881 trans->SetTranslation(avgRadius * std::cos(phi), avgRadius * std::sin(phi), zPos);
882 layerVol->AddNode(createStave(), iStave, trans);
883 }
884
885 // Support half-rings carrying the stave space frames, centred on the cooling pipe radius.
886 // One per quarter barrel per z end (mid-rapidity and under the end-of-stave cards): 8 per layer.
887 const double ringRMid = avgRadius + (mIsFlipped ? -1. : 1.) * constants::OT::coolingPipe::rLocalOffset;
888 const double ringRMin = ringRMid - constants::OT::supportRing::radialHeight / 2;
889 const double ringRMax = ringRMid + constants::OT::supportRing::radialHeight / 2;
890 // Stand off the cut plane by the same clearance the boundary staves keep.
891 const double ringDPhi = TMath::RadToDeg() *
892 std::asin((wallThickness / 2 + constants::OT::barrelWallClearance) / ringRMin);
893 const double zRingMid = wallThickness + constants::OT::supportRing::zClearance +
895 const double zRingEos = lengthHalfBarrel + constants::OT::barrelHalvesZGap / 2 +
897
898 for (int azHalf = 0; azHalf < 2; ++azHalf) {
899 TGeoVolume* ringVol = createSupportRing(ringRMin, ringRMax,
900 90. + 180. * azHalf + ringDPhi,
901 270. + 180. * azHalf - ringDPhi, azHalf);
902 int iRing = 0;
903 for (int whichHalfBarrel = 0; whichHalfBarrel < 2; ++whichHalfBarrel) {
904 const double zSign = (whichHalfBarrel == 0) ? -1. : 1.;
905 for (double zAbs : {zRingMid, zRingEos}) {
906 layerVol->AddNode(ringVol, iRing++, new TGeoTranslation(0., 0., zSign * zAbs));
907 }
908 }
909 }
910
911 motherVolume->AddNode(layerVol, 1, nullptr);
912}
913
914std::pair<float, float> TRKOTLayerRealistic::getBoundingRadii(double staveWidth) const
915{
916 auto [radiusMin, radiusMax] = TRKSegmentedLayer::getBoundingRadii(staveWidth);
920 const float outerReach = std::max(pipeOuterReach, ringReach);
921 const float margin = 0.1f;
922 if (!mIsFlipped) {
923 return {radiusMin - connectorReach - margin, radiusMax + outerReach + margin};
924 }
925 return {radiusMin - outerReach - margin, radiusMax + connectorReach + margin};
926}
927// ClassImp(TRKLayer);
928
929} // namespace trk
930} // namespace o2
std::ostringstream debug
float phiCut
Definition Tracker.cxx:213
specs of the ALICE3 TRK
benchmark::State & st
static const char * getTRKStavePattern()
static const char * getTRKChipPattern()
static const char * getTRKSensorPattern()
static const char * getTRKDeadzonePattern()
static const char * getTRKLayerPattern()
static const char * getTRKHalfStavePattern()
static const char * getTRKMetalStackPattern()
static const char * getTRKModulePattern()
static constexpr float Si_X0
Definition TRKLayer.h:64
virtual void createLayer(TGeoVolume *motherVolume)
Definition TRKLayer.cxx:73
virtual TGeoVolume * createSensor()
Definition TRKLayer.cxx:51
virtual TGeoVolume * createMetalStack()
Definition TRKLayer.cxx:62
static constexpr double sSensorThickness
Definition TRKLayer.h:62
void createLayer(TGeoVolume *motherVolume) override
Definition TRKLayer.cxx:321
TGeoVolume * createStave() override
Definition TRKLayer.cxx:263
TGeoVolume * createModule() override
Definition TRKLayer.cxx:688
TGeoVolume * createChip() override
Definition TRKLayer.cxx:524
void createLayer(TGeoVolume *motherVolume) override
Definition TRKLayer.cxx:782
TGeoVolume * createHalfStave()
Definition TRKLayer.cxx:730
TGeoVolume * createStave() override
Definition TRKLayer.cxx:750
TGeoVolume * createHalfStave()
Definition TRKLayer.cxx:435
void createLayer(TGeoVolume *motherVolume) override
Definition TRKLayer.cxx:471
static constexpr float sGapBetweenOuterTrackerBarrelHalves
Definition TRKLayer.h:148
TGeoVolume * createStave() override
Definition TRKLayer.cxx:455
static constexpr double sChipWidth
Definition TRKLayer.h:91
TGeoVolume * createMetalStack() override
Definition TRKLayer.cxx:122
static constexpr int sHalfNumberOfChips
Definition TRKLayer.h:96
TGeoVolume * createSensor() override
Definition TRKLayer.cxx:100
virtual TGeoVolume * createModule()
Definition TRKLayer.cxx:161
static constexpr double sChipLength
Definition TRKLayer.h:92
virtual TGeoVolume * createChip()
Definition TRKLayer.cxx:133
static constexpr double sDeadzoneWidth
Definition TRKLayer.h:93
static constexpr double sModuleLength
Definition TRKLayer.h:94
static constexpr double sModuleWidth
Definition TRKLayer.h:95
TGeoVolume * createDeadzone()
Definition TRKLayer.cxx:111
virtual std::pair< float, float > getBoundingRadii(double staveWidth) const
Definition TRKLayer.cxx:193
GLfloat GLfloat GLfloat alpha
Definition glcorearb.h:279
GLint GLenum GLint x
Definition glcorearb.h:403
GLuint const GLchar * name
Definition glcorearb.h:781
GLint y
Definition glcorearb.h:270
GLuint GLsizei GLsizei * length
Definition glcorearb.h:790
GLenum GLuint GLint GLint layer
Definition glcorearb.h:1310
GLdouble GLdouble GLdouble z
Definition glcorearb.h:843
constexpr double length
Definition Specs.h:112
constexpr double zGap
Definition Specs.h:117
constexpr int nCopperLayers
Definition Specs.h:115
constexpr double thickness
Definition Specs.h:114
constexpr double width
Definition Specs.h:113
constexpr int nLayers
Definition Specs.h:103
constexpr double length
Definition Specs.h:169
constexpr double thickness
Definition Specs.h:171
constexpr double width
Definition Specs.h:170
constexpr double thickness
Definition Specs.h:164
constexpr double thickness
Definition Specs.h:152
constexpr double thickness
Definition Specs.h:158
constexpr double rLocalOffset
Definition Specs.h:177
constexpr double width
Definition Specs.h:182
constexpr double length
Definition Specs.h:181
constexpr double zGap
Definition Specs.h:186
constexpr int nCopperLayers
Definition Specs.h:184
constexpr double thickness
Definition Specs.h:183
constexpr double wireBondMargin
Definition Specs.h:143
constexpr double width
Definition Specs.h:145
constexpr double thickness
Definition Specs.h:146
constexpr double length
Definition Specs.h:144
constexpr double radialHeight
Definition Specs.h:191
constexpr double wallThickness
Definition Specs.h:193
constexpr double sensorThickness
Definition Specs.h:197
constexpr double halfBarrelChipGap
Definition Specs.h:200
constexpr double bracketZDepth
Definition Specs.h:204
constexpr double interModuleGap
Definition Specs.h:137
constexpr double rowActiveOverlap
Definition Specs.h:198
constexpr double connectorZDepth
Definition Specs.h:203
constexpr double interChipGap
Definition Specs.h:140
constexpr double rowRadialStagger
Definition Specs.h:199
constexpr double barrelWallClearance
Definition Specs.h:201
constexpr double barrelWallSlotMargin
Definition Specs.h:202
constexpr double barrelHalvesZGap
Definition Specs.h:205
constexpr double outerEdgeLongSide
Definition Specs.h:92
constexpr double outerEdgeShortSide
Definition Specs.h:93
MatBudgetParamMode
Definition TRKLayer.h:27
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::string to_string(gsl::span< T, Size > span)
Definition common.h:52