16#include "TGeoManager.h"
17#include "TGeoVolume.h"
19#include "TGeoMatrix.h"
22#include "TGeoCompositeShape.h"
23#include "TGeoBoolNode.h"
26#include <fairlogger/Logger.h>
63 Int_t idHalfMFT = mftGeom->
getHalfID(mLadderSeg->GetUniqueID());
64 Int_t idHalfDisk = mftGeom->
getDiskID(mLadderSeg->GetUniqueID());
65 Int_t idLadder = mftGeom->
getLadderID(mLadderSeg->GetUniqueID());
68 TGeoMedium* kMedAir = gGeoManager->GetMedium(
"MFT_Air$");
69 auto* flex =
new TGeoVolumeAssembly(Form(
"flex_%d_%d_%d", idHalfMFT, idHalfDisk, idLadder));
97 flex->AddNode(varnishlayerIn, 1,
new TGeoTranslation(0., 0., zvarnishIn));
98 flex->AddNode(agnd_dgnd, 1,
new TGeoTranslation(0., 0., zgnd));
99 flex->AddNode(kaptonlayer, 1,
new TGeoTranslation(0., 0., zkaptonlayer));
100 flex->AddNode(lines, 1,
new TGeoTranslation(0., 0., zlines));
101 flex->AddNode(varnishlayerOut, 1,
new TGeoTranslation(0., 0., zvarnishOut));
113 TGeoVolumeAssembly* electric[200];
118 auto* rotation =
new TGeoRotation(
"rotation", 90., 0., 0.);
119 auto* rotationpi =
new TGeoRotation(
"rotationpi", 180., 0., 0.);
120 auto* transformation0 =
123 auto* transformation1 =
127 for (Int_t
id = 0;
id < 2;
id++) {
130 flex->AddNode(electric[0], 1, transformation0);
131 flex->AddNode(electric[1], 2, transformation1);
135 for (Int_t
id = 0;
id < 4 * nbsensors;
id++) {
136 electric[
id + total] =
139 for (Int_t
id = 0;
id < 2 * nbsensors;
id++) {
140 flex->AddNode(electric[
id + total],
id + 1000,
144 flex->AddNode(electric[
id + total + 2 * nbsensors],
id + 2000,
148 total = total + 4 * nbsensors;
151 for (Int_t
id = 0;
id < 3;
id++) {
152 electric[
id + total] =
155 for (Int_t
id = 0;
id < 3;
id++) {
156 flex->AddNode(electric[
id + total],
id + 3000,
181 TGeoMedium* kMedAlu = gGeoManager->GetMedium(
"MFT_Alu$");
182 TGeoMedium* kMedPeek = gGeoManager->GetMedium(
"MFT_PEEK$");
191 auto* connecto =
new TGeoSubtraction(connect, remov,
nullptr,
t1);
192 auto* connector =
new TGeoCompositeShape(
"connector", connecto);
193 auto* connectord =
new TGeoVolume(
"connectord", connector, kMedAlu);
194 connectord->SetVisibility(kTRUE);
195 connectord->SetLineColor(kRed);
196 connectord->SetLineWidth(1);
197 connectord->SetFillColor(connectord->GetLineColor());
198 connectord->SetFillStyle(4000);
200 Double_t interspace = 0.1;
201 Double_t step = 0.04;
202 for (Int_t
id = 0;
id < 37;
id++) {
204 connectord,
id + total,
208 auto* transformationpi =
212 flex->AddNode(connectord,
id + total + 37, transformationpi);
215 Double_t boxthickness = 0.05;
220 auto* boxconnecto =
new TGeoSubtraction(boxconnect, boxremov,
nullptr,
nullptr);
221 auto* boxconnector =
new TGeoCompositeShape(
"boxconnector", boxconnecto);
222 auto* boxconnectord =
new TGeoVolume(
"boxconnectord", boxconnector, kMedPeek);
223 flex->AddNode(boxconnectord, 1,
230TGeoVolumeAssembly* Flex::makeElectricComponent(Double_t dx, Double_t dy, Double_t dz, Int_t
id)
234 Int_t idHalfMFT = mftGeom->
getHalfID(mLadderSeg->GetUniqueID());
235 Int_t idHalfDisk = mftGeom->
getDiskID(mLadderSeg->GetUniqueID());
236 Int_t idLadder = mftGeom->
getLadderID(mLadderSeg->GetUniqueID());
238 TGeoMedium* kmedX7R = gGeoManager->GetMedium(
"MFT_X7Rcapacitors$");
239 TGeoMedium* kmedX7Rw = gGeoManager->GetMedium(
"MFT_X7Rweld$");
241 auto* X7R0402 =
new TGeoVolumeAssembly(Form(
"X7R_%d_%d_%d_%d", idHalfMFT, idHalfDisk, idLadder,
id));
243 auto* capacit =
new TGeoBBox(
"capacitor", dx / 2, dy / 2, dz / 2);
244 auto* weld =
new TGeoBBox(
"weld", (dx / 4) / 2, dy / 2, (dz / 2) / 2);
246 new TGeoVolume(Form(
"capacitor_%d_%d_%d_%d", idHalfMFT, idHalfDisk, idLadder,
id), capacit, kmedX7R);
247 auto* welding0 =
new TGeoVolume(Form(
"welding0_%d_%d_%d_%d", idHalfMFT, idHalfDisk, idLadder,
id), weld, kmedX7Rw);
248 auto* welding1 =
new TGeoVolume(Form(
"welding1_%d_%d_%d_%d", idHalfMFT, idHalfDisk, idLadder,
id), weld, kmedX7Rw);
249 capacitor->SetVisibility(kTRUE);
250 capacitor->SetLineColor(kRed);
251 capacitor->SetLineWidth(1);
252 capacitor->SetFillColor(capacitor->GetLineColor());
253 capacitor->SetFillStyle(4000);
255 welding0->SetVisibility(kTRUE);
256 welding0->SetLineColor(kGray);
257 welding0->SetLineWidth(1);
258 welding0->SetFillColor(welding0->GetLineColor());
259 welding0->SetFillStyle(4000);
261 welding1->SetVisibility(kTRUE);
262 welding1->SetLineColor(kGray);
263 welding1->SetLineWidth(1);
264 welding1->SetFillColor(welding1->GetLineColor());
265 welding1->SetFillStyle(4000);
267 X7R0402->AddNode(capacitor, 1,
new TGeoTranslation(0., 0., 0.));
268 X7R0402->AddNode(welding0, 1,
new TGeoTranslation(dx / 2 + (dx / 4) / 2, 0., (dz / 2) / 2));
269 X7R0402->AddNode(welding1, 1,
new TGeoTranslation(-dx / 2 - (dx / 4) / 2, 0., (dz / 2) / 2));
271 X7R0402->SetVisibility(kTRUE);
295TGeoVolume* Flex::makeLines(Int_t nbsensors, Double_t
length, Double_t widthflex, Double_t thickness)
302 auto* layer_def =
new TGeoBBox(
"layer_def",
length / 2, widthflex / 2, thickness / 2);
309 auto* layerholesub1 =
new TGeoSubtraction(layer_def, hole1,
nullptr,
t1);
310 auto* layerhole1 =
new TGeoCompositeShape(
"layerhole1", layerholesub1);
313 auto* layerholesub2 =
new TGeoSubtraction(layerhole1, hole2,
nullptr, t2);
314 auto*
layer =
new TGeoCompositeShape(
"layerhole2", layerholesub2);
317 TGeoTranslation *t[6], *ts[15], *tvdd, *tl[2];
318 TGeoSubtraction* layerl[25];
319 TGeoCompositeShape* layern[25];
321 Int_t kTotalLinesNb = 0;
322 Int_t kTotalLinesNb1, kTotalLinesNb2;
323 Double_t length_line;
330 layerl[0] =
new TGeoSubtraction(
layer, line[0],
nullptr, t[0]);
331 layern[0] =
new TGeoCompositeShape(Form(
"layer%d", 0), layerl[0]);
335 for (
int iline = istart; iline < istop; iline++) {
339 line[iline] =
new TGeoBBox(Form(
"line%d", iline),
342 layerl[iline] =
new TGeoSubtraction(layern[iline - 1], line[iline],
nullptr, t[iline]);
343 layern[iline] =
new TGeoCompositeShape(Form(
"layer%d", iline), layerl[iline]);
348 istart = kTotalLinesNb + 1;
349 istop = 6 + 3 * nbsensors;
350 for (
int iline = istart; iline < istop; iline++) {
358 layerl[iline] =
new TGeoSubtraction(layern[iline - 1], line[iline],
nullptr, ts[iline - 6]);
359 layern[iline] =
new TGeoCompositeShape(Form(
"layer%d", iline), layerl[iline]);
368 layerl[kTotalLinesNb] =
new TGeoSubtraction(layern[kTotalLinesNb - 1], line[kTotalLinesNb],
nullptr, tvdd);
369 layern[kTotalLinesNb] =
new TGeoCompositeShape(Form(
"layer%d", kTotalLinesNb), layerl[kTotalLinesNb]);
373 istart = kTotalLinesNb;
374 istop = kTotalLinesNb + 2;
375 for (
int iline = istart; iline < istop; iline++) {
382 layerl[iline] =
new TGeoSubtraction(layern[iline - 1], line[iline],
nullptr, tl[iline - istart]);
383 layern[iline] =
new TGeoCompositeShape(Form(
"layer%d", iline), layerl[iline]);
388 Int_t idHalfMFT = mftGeom->
getHalfID(mLadderSeg->GetUniqueID());
389 Int_t idHalfDisk = mftGeom->
getDiskID(mLadderSeg->GetUniqueID());
390 Int_t idLadder = mftGeom->
getLadderID(mLadderSeg->GetUniqueID());
392 TGeoMedium* kMedAlu = gGeoManager->GetMedium(
"MFT_Alu$");
395 new TGeoVolume(Form(
"lineslayer_%d_%d_%d", idHalfMFT, idHalfDisk, idLadder), layern[kTotalLinesNb - 1], kMedAlu);
396 lineslayer->SetVisibility(
true);
397 lineslayer->SetLineColor(kBlue);
403TGeoVolume* Flex::makeAGNDandDGND(Double_t
length, Double_t widthflex, Double_t thickness)
407 auto*
layer =
new TGeoBBox(
"layer",
length / 2, widthflex / 2, thickness / 2);
412 auto* layerholesub1 =
new TGeoSubtraction(
layer, hole1,
nullptr,
t1);
413 auto* layerhole1 =
new TGeoCompositeShape(
"layerhole1", layerholesub1);
416 auto* layerholesub2 =
new TGeoSubtraction(layerhole1, hole2,
nullptr, t2);
417 auto* layerhole2 =
new TGeoCompositeShape(
"layerhole2", layerholesub2);
421 TGeoTranslation* t[3];
422 TGeoCompositeShape* layern[3];
423 TGeoSubtraction* layerl[3];
424 Double_t length_line;
432 layerl[0] =
new TGeoSubtraction(layerhole2, line[0],
nullptr, t[0]);
433 layern[0] =
new TGeoCompositeShape(Form(
"layer%d", 0), layerl[0]);
439 layerl[1] =
new TGeoSubtraction(layern[0], line[1],
nullptr, t[1]);
440 layern[1] =
new TGeoCompositeShape(Form(
"layer%d", 1), layerl[1]);
446 layerl[2] =
new TGeoSubtraction(layern[1], line[2],
nullptr, t[2]);
447 layern[2] =
new TGeoCompositeShape(Form(
"layer%d", 2), layerl[2]);
452 Int_t idHalfMFT = mftGeom->
getHalfID(mLadderSeg->GetUniqueID());
453 Int_t idHalfDisk = mftGeom->
getDiskID(mLadderSeg->GetUniqueID());
454 Int_t idLadder = mftGeom->
getLadderID(mLadderSeg->GetUniqueID());
456 TGeoMedium* kMedAlu = gGeoManager->GetMedium(
"MFT_Alu$");
457 auto* alulayer =
new TGeoVolume(Form(
"alulayer_%d_%d_%d", idHalfMFT, idHalfDisk, idLadder), layern[2], kMedAlu);
458 alulayer->SetVisibility(
true);
459 alulayer->SetLineColor(kBlue);
465TGeoVolume* Flex::makeKapton(Double_t
length, Double_t widthflex, Double_t thickness)
468 auto*
layer =
new TGeoBBox(
"layer",
length / 2, widthflex / 2, thickness / 2);
474 auto* layerholesub1 =
new TGeoSubtraction(
layer, hole1,
nullptr,
t1);
475 auto* layerhole1 =
new TGeoCompositeShape(
"layerhole1", layerholesub1);
478 auto* layerholesub2 =
new TGeoSubtraction(layerhole1, hole2,
nullptr, t2);
479 auto* layerhole2 =
new TGeoCompositeShape(
"layerhole2", layerholesub2);
482 Int_t idHalfMFT = mftGeom->
getHalfID(mLadderSeg->GetUniqueID());
483 Int_t idHalfDisk = mftGeom->
getDiskID(mLadderSeg->GetUniqueID());
484 Int_t idLadder = mftGeom->
getLadderID(mLadderSeg->GetUniqueID());
486 TGeoMedium* kMedKapton = gGeoManager->GetMedium(
"MFT_Kapton$");
488 new TGeoVolume(Form(
"kaptonlayer_%d_%d_%d", idHalfMFT, idHalfDisk, idLadder), layerhole2, kMedKapton);
489 kaptonlayer->SetVisibility(
true);
490 kaptonlayer->SetLineColor(kYellow);
496TGeoVolume* Flex::makeVarnish(Double_t
length, Double_t widthflex, Double_t thickness, Int_t iflag)
499 auto*
layer =
new TGeoBBox(
"layer",
length / 2, widthflex / 2, thickness / 2);
505 auto* layerholesub1 =
new TGeoSubtraction(
layer, hole1,
nullptr,
t1);
506 auto* layerhole1 =
new TGeoCompositeShape(
"layerhole1", layerholesub1);
509 auto* layerholesub2 =
new TGeoSubtraction(layerhole1, hole2,
nullptr, t2);
510 auto* layerhole2 =
new TGeoCompositeShape(
"layerhole2", layerholesub2);
513 Int_t idHalfMFT = mftGeom->
getHalfID(mLadderSeg->GetUniqueID());
514 Int_t idHalfDisk = mftGeom->
getDiskID(mLadderSeg->GetUniqueID());
515 Int_t idLadder = mftGeom->
getLadderID(mLadderSeg->GetUniqueID());
517 TGeoMedium* kMedVarnish = gGeoManager->GetMedium(
"MFT_Epoxy$");
518 TGeoMaterial* kMatVarnish = kMedVarnish->GetMaterial();
521 new TGeoVolume(Form(
"varnishlayer_%d_%d_%d_%d", idHalfMFT, idHalfDisk, idLadder, iflag), layerhole2, kMedVarnish);
522 varnishlayer->SetVisibility(
true);
523 varnishlayer->SetLineColor(kGreen - 1);
Chip (sensor) segmentation description.
Flex (Printed Cabled Board) class for ALICE MFT upgrade.
Class handling both virtual segmentation and real volumes.
Description of the virtual segmentation of a ladder.
Class building the Ladder geometry.
Definition of the SegmentationAlpide class.
static constexpr float SensorSizeCols
void makeElectricComponents(TGeoVolumeAssembly *flex, Int_t nbsensors, Double_t length, Double_t zvarnish)
TGeoVolumeAssembly * makeFlex(Int_t nbsensors, Double_t length)
static const Double_t sCapacitorDy
static const Double_t sHoleShift1
static const Double_t sEpsilon
static const Double_t sVarnishThickness
static const Double_t sShiftDDGNDline
Int_t getDiskID(UInt_t uniqueID) const
Returns Half-Disk ID based on Unique ID provided.
static const Double_t sLineWidth
static const Double_t sConnectorLength
Int_t getLadderID(UInt_t uniqueID) const
Returns Ladder ID based on Unique ID provided.
static const Double_t sConnectorOffset
Int_t getHalfID(UInt_t uniqueID) const
Returns Half-MFT ID based on Unique ID provided.
static const Double_t sGlueThickness
static const Double_t sKaptonThickness
static Geometry * instance()
Singleton access.
static const Double_t sCapacitorDz
static const Double_t sConnectorWidth
static const Double_t sClearance
static const Double_t sConnectorHeight
static const Double_t sFlexHeight
Flex Height.
static const Double_t sConnectorThickness
static const Double_t sRadiusHole1
static const Double_t sShiftline
static const Double_t sRadiusHole2
static const Double_t sHoleShift2
static const Double_t sCapacitorDx
static const Double_t sAluThickness
GLuint GLsizei GLsizei * length
GLenum GLuint GLint GLint layer
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat GLfloat t1