297 const double win_size_x = hc_size_x + 2 * WIN_FrameX_thickness;
298 const double win_size_y = hc_size_y + 2 * WIN_FrameY_thickness;
301 TGeoBBox* winIn_C =
new TGeoBBox(
"winIn_C", win_size_x / 2., win_size_y / 2., winIn_C_thickness / 2.);
302 TGeoVolume* vol_winIn_C =
304 vol_winIn_C->SetLineColor(kBlack);
305 fHeight = winIn_C_thickness;
308 TGeoBBox* winIn_HC =
new TGeoBBox(
"winIn_HC", hc_size_x / 2., hc_size_y / 2., winIn_HC_thickness / 2.);
310 vol_winIn_HC->SetLineColor(kOrange);
311 fHeight += winIn_HC_thickness;
314 TGeoBBox* winIn_fx =
new TGeoBBox(
"winIn_fx", (hc_size_x + 2 * WIN_FrameX_thickness) / 2, WIN_FrameY_thickness / 2,
315 winIn_HC_thickness / 2.);
317 vol_winIn_fx->SetLineColor(kBlue);
318 TGeoBBox* winIn_xout =
new TGeoBBox(
"winIn_xout", hc_size_x / 2 + 2 * WIN_FrameX_thickness, WIN_OutY_thickness / 2,
319 winIn_HC_thickness / 2.);
320 TGeoVolume* vol_winIn_xout =
322 vol_winIn_xout->SetLineColor(kBlue + 2);
325 TGeoBBox* winIn_fy =
new TGeoBBox(
"winIn_fy", WIN_FrameX_thickness / 2, hc_size_y / 2, winIn_HC_thickness / 2.);
327 vol_winIn_fy->SetLineColor(kCyan);
329 new TGeoBBox(
"winIn_k", WIN_FrameX_thickness / 2, hc_size_y / 2 + WIN_FrameY_thickness, winIn_HC_thickness / 2.);
331 vol_winIn_k->SetLineColor(kViolet);
332 TGeoBBox* winIn_yout =
333 new TGeoBBox(
"winIn_yout", WIN_OutX_thickness / 2, hc_size_y / 2 + WIN_FrameY_thickness + WIN_OutY_thickness,
334 winIn_HC_thickness / 2.);
335 TGeoVolume* vol_winIn_yout =
337 vol_winIn_yout->SetLineColor(kViolet + 5);
342 fVol->SetLineColor(kOrange);
343 fVol->SetTransparency(50);
346 fHeight = -fHeight / 2 + winIn_HC_thickness / 2;
347 fVol->AddNode(vol_winIn_HC, 1,
new TGeoTranslation(
"", 0., 0., fHeight));
348 y = (hc_size_y + WIN_FrameY_thickness) / 2.;
349 fVol->AddNode(vol_winIn_fx, 1,
new TGeoTranslation(
"", 0.,
y, fHeight));
350 fVol->AddNode(vol_winIn_fx, 2,
new TGeoTranslation(
"", 0., -
y, fHeight));
351 y += 0.5 * (WIN_FrameY_thickness + WIN_OutY_thickness);
352 fVol->AddNode(vol_winIn_xout, 1,
new TGeoTranslation(
"", 0.,
y, fHeight));
353 fVol->AddNode(vol_winIn_xout, 2,
new TGeoTranslation(
"", 0., -
y, fHeight));
354 x = (hc_size_x + WIN_FrameX_thickness) / 2.;
355 fVol->AddNode(vol_winIn_fy, 1,
new TGeoTranslation(
"",
x, 0., fHeight));
356 fVol->AddNode(vol_winIn_fy, 2,
new TGeoTranslation(
"", -
x, 0., fHeight));
357 x += WIN_FrameX_thickness;
358 fVol->AddNode(vol_winIn_k, 1,
new TGeoTranslation(
"",
x, 0., fHeight));
359 fVol->AddNode(vol_winIn_k, 2,
new TGeoTranslation(
"", -
x, 0., fHeight));
360 x += 0.5 * (WIN_FrameX_thickness + WIN_OutX_thickness);
361 fVol->AddNode(vol_winIn_yout, 1,
new TGeoTranslation(
"",
x, 0., fHeight));
362 fVol->AddNode(vol_winIn_yout, 2,
new TGeoTranslation(
"", -
x, 0., fHeight));
364 fHeight += 0.5 * (winIn_HC_thickness + winIn_C_thickness);
365 fVol->AddNode(vol_winIn_C, 1,
new TGeoTranslation(
"", 0., 0., fHeight));
366 fHeight += 0.5 * winIn_C_thickness;
379 vol_gas->SetLineColor(kRed);
381 TGeoBBox* gas_ext =
new TGeoBBox(
"trd_gas_dstr", 0.5 *
activeAreaX, 0.5 * gas_extra, 0.5 * gas_thickness);
383 vol_gas_ext->SetLineColor(kMagenta);
385 fHeight = gas_thickness;
388 const double gas_size_y =
activeAreaY + 2 * gas_extra;
391 auto* gas_xin =
new TGeoBBox(
"gas_xin", gas_size_x / 2 + cathode_width, WIN_OutY_thickness / 2, gas_thickness / 2.);
393 vol_gas_xin->SetLineColor(kViolet + 5);
394 auto* gas_xout =
new TGeoBBox(
"gas_xout", gas_size_x / 2 + cathode_width, WIN_OutY_thickness / 2,
395 (gas_thickness ) / 2.);
397 vol_gas_xout->SetLineColor(kViolet + 5);
399 TGeoBBox* gas_k =
new TGeoBBox(
"gas_k", cathode_width / 2, gas_size_y / 2, ledge_thickness / 2.);
401 vol_gas_k->SetLineColor(kViolet);
402 TGeoBBox* gas_a =
new TGeoBBox(
"gas_a", anode_width / 2, gas_size_y / 2, ledge_thickness / 2.);
404 vol_gas_a->SetLineColor(kViolet + 2);
405 TGeoBBox* gas_d =
new TGeoBBox(
"gas_d", dist_width / 2, gas_size_y / 2, ledge_thickness / 2.);
407 vol_gas_d->SetLineColor(kViolet + 4);
408 TGeoBBox* gas_yout =
new TGeoBBox(
"gas_yout", WIN_OutX_thickness / 2, 2 * WIN_OutY_thickness + gas_size_y / 2,
409 (gas_thickness ) / 2.);
411 vol_gas_yout->SetLineColor(kViolet + 5);
416 fVol->SetLineColor(kYellow);
417 fVol->SetTransparency(50);
421 fVol->AddNode(vol_gas, 0,
new TGeoTranslation(
"", 0., 0., fHeight));
422 x = 0.5 * (gas_size_x + cathode_width);
423 fVol->AddNode(vol_gas_k, 1,
new TGeoTranslation(
"",
x, 0., fHeight - ledge_thickness));
424 fVol->AddNode(vol_gas_k, 2,
new TGeoTranslation(
"", -
x, 0., fHeight - ledge_thickness));
425 x = 0.5 * (gas_size_x + anode_width);
426 fVol->AddNode(vol_gas_a, 1,
new TGeoTranslation(
"",
x, 0., fHeight));
427 fVol->AddNode(vol_gas_a, 2,
new TGeoTranslation(
"", -
x, 0., fHeight));
428 x = 0.5 * (gas_size_x + dist_width);
429 fVol->AddNode(vol_gas_d, 1,
new TGeoTranslation(
"",
x, 0., fHeight + ledge_thickness));
430 fVol->AddNode(vol_gas_d, 2,
new TGeoTranslation(
"", -
x, 0., fHeight + ledge_thickness));
431 x = 0.5 * gas_size_x + cathode_width + 0.5 * WIN_OutX_thickness;
432 fVol->AddNode(vol_gas_yout, 1,
new TGeoTranslation(
"",
x, 0., fHeight ));
433 fVol->AddNode(vol_gas_yout, 2,
new TGeoTranslation(
"", -
x, 0., fHeight ));
435 fVol->AddNode(vol_gas_ext, 0,
new TGeoTranslation(
"", 0.,
y, fHeight));
436 fVol->AddNode(vol_gas_ext, 1,
new TGeoTranslation(
"", 0., -
y, fHeight));
437 y += 0.5 * (gas_extra + WIN_OutY_thickness);
438 fVol->AddNode(vol_gas_xin, 1,
new TGeoTranslation(
"", 0,
y, fHeight));
439 fVol->AddNode(vol_gas_xin, 2,
new TGeoTranslation(
"", 0, -
y, fHeight));
440 y += WIN_OutY_thickness;
441 fVol->AddNode(vol_gas_xout, 1,
new TGeoTranslation(
"", 0,
y, fHeight ));
442 fVol->AddNode(vol_gas_xout, 2,
new TGeoTranslation(
"", 0, -
y, fHeight ));
443 fHeight += gas_thickness;
452 const double hc_size_y =
activeAreaY - 2 * BKP_OutY_correct;
453 const double bkp_size_x = hc_size_x + 2 * BKP_Frame_width;
454 const double bkp_size_y = hc_size_y + 2 * BKP_Frame_width;
459 vol_pp->SetLineColor(kBlue);
460 fHeight = pp_pads_thickness;
463 TGeoBBox* pp_PCB =
new TGeoBBox(
"pp_pcb", bkp_size_x / 2., bkp_size_y / 2., pp_pcb_thickness / 2.);
465 vol_pp_PCB->SetLineColor(kGreen);
466 fHeight += pp_pcb_thickness;
469 auto vol_bp =
new TGeoVolumeAssembly(
"bkp_int");
470 auto vol_bp_ASIC =
new TGeoVolumeAssembly(
"");
472 Color_t bp_col[3] = {kOrange, kGray, kRed + 2};
473 const char* matName[3] = {
"TRDaramide",
"TRDG10",
"TRDcopper"};
475 double dxHC[2] = {hc_unitx / 2., (hc_unitx - hc_holex) / 4.}, dyHC[2] = {(hc_unity - hc_holey) / 4., hc_holey / 2.},
476 hHCx((hc_unitx + hc_holex) / 4.), hHCy((hc_unity + hc_holey) / 4.), hHC(0.),
477 hHCz[] = {hc_thickness, cu_pcb_thickness, cu_thickness};
478 for (
int ibpz(0); ibpz < 3; ibpz++) {
479 hHC += 0.5 * hHCz[ibpz];
480 for (
int ibpy(-1), jbp(0); ibpy < 2; ibpy += 2) {
481 auto bpShp =
new TGeoBBox(
"", dxHC[0], dyHC[0], hHCz[ibpz] / 2.);
483 vol_cmp->SetLineColor(bp_col[ibpz]);
484 vol_bp_ASIC->AddNode(vol_cmp, jbp++,
new TGeoTranslation(
"", 0., ibpy * hHCy, hHC));
486 for (
int ibpx(-1), jbp(0); ibpx < 2; ibpx += 2) {
487 auto bpShp =
new TGeoBBox(
"", dxHC[1], dyHC[1], hHCz[ibpz] / 2.);
489 vol_cmp->SetLineColor(bp_col[ibpz]);
490 vol_bp_ASIC->AddNode(vol_cmp, jbp++,
new TGeoTranslation(
"", ibpx * hHCx, 0., hHC));
492 hHC += 0.5 * hHCz[ibpz];
495 for (Int_t c(0), ifc(0); c < 9; c++) {
496 for (Int_t r(0); r < 10; r++) {
497 vol_bp->AddNode(vol_bp_ASIC, ifc++,
new TGeoTranslation(
"", (c - 4) * hc_unitx, hc_unity * (0.5 + r), 0.));
498 vol_bp->AddNode(vol_bp_ASIC, ifc++,
new TGeoTranslation(
"", (c - 4) * hc_unitx, -hc_unity * (r + 0.5), 0.));
505 new TGeoBBox(
"", hc_size_x / 2, (BKP_OutY_thickness - BKP_OutY_correct) / 2, (hHC - BKP_Frame_closure) / 2.);
507 auto xoutFc =
new TGeoBBox(
"", hc_size_x / 2, (BKP_Frame_width - BKP_OutY_correct) / 2, BKP_Frame_closure / 2.);
509 auto vol_bkp_xout =
new TGeoVolumeAssembly(
"bkp_xout");
510 vol_bkp_xout->AddNode(
511 xvolFc, 1,
new TGeoTranslation(
"", 0, (BKP_Frame_width - BKP_OutY_thickness) / 2, (BKP_Frame_closure - hHC) / 2));
512 vol_bkp_xout->AddNode(xvolBd, 1,
new TGeoTranslation(
"", 0., 0., BKP_Frame_closure / 2));
513 vol_bkp_xout->SetLineColor(kViolet + 2);
517 new TGeoBBox(
"", BKP_OutX_thickness / 2, hc_size_y / 2 + BKP_OutY_thickness, (hHC - BKP_Frame_closure) / 2.);
519 auto youtFc =
new TGeoBBox(
"", BKP_Frame_width / 2, hc_size_y / 2 + BKP_Frame_width, BKP_Frame_closure / 2.);
521 auto vol_bkp_yout =
new TGeoVolumeAssembly(
"bkp_yout");
522 vol_bkp_yout->AddNode(yvolFc, 1,
523 new TGeoTranslation(
"t_bkp_yout_fc", (BKP_Frame_width - BKP_OutX_thickness) / 2, 0.,
524 (BKP_Frame_closure - hHC) / 2));
525 vol_bkp_yout->AddNode(yvolBd, 1,
new TGeoTranslation(
"t_bkp_yout_bd", 0., 0., BKP_Frame_closure / 2));
526 vol_bkp_yout->SetLineColor(kViolet + 2);
529 fVol =
new TGeoVolume(GetName(),
new TGeoBBox(
"", bkp_size_x / 2, bkp_size_y / 2, fHeight / 2),
531 fVol->SetLineColor(kOrange);
532 fVol->SetTransparency(50);
535 fHeight = -fHeight / 2 + 0.5 * pp_pads_thickness;
536 fVol->AddNode(vol_pp, 1,
new TGeoTranslation(
"", 0., 0., fHeight));
537 fHeight += 0.5 * (pp_pads_thickness + pp_pcb_thickness);
538 fVol->AddNode(vol_pp_PCB, 1,
new TGeoTranslation(
"", 0., 0., fHeight));
539 fHeight += 0.5 * pp_pcb_thickness;
540 fVol->AddNode(vol_bp, 1,
new TGeoTranslation(
"", 0., 0., fHeight));
541 fHeight += 0.5 * hHC;
543 x = 0.5 * (hc_size_x + BKP_OutX_thickness);
544 auto* fy_tra =
new TGeoTranslation(
"",
x, 0., fHeight);
545 fVol->AddNode(vol_bkp_yout, 1, fy_tra);
546 auto* fy_rot =
new TGeoRotation();
547 fy_rot->RotateZ(180.);
548 auto* fy_mat =
new TGeoHMatrix(
"");
549 (*fy_mat) = (*fy_rot) * (*fy_tra);
550 fVol->AddNode(vol_bkp_yout, 2, fy_mat);
551 y = 0.5 * (hc_size_y + BKP_OutY_thickness + BKP_OutY_correct);
552 fy_tra =
new TGeoTranslation(
"", 0.,
y, fHeight);
553 fVol->AddNode(vol_bkp_xout, 1, fy_tra);
554 fy_mat =
new TGeoHMatrix(
"");
555 (*fy_mat) = (*fy_rot) * (*fy_tra);
556 fVol->AddNode(vol_bkp_xout, 2, fy_mat);
557 fHeight += 0.5 * hHC;
568 fHeight = FASPRO_zspace;
570 TString scu =
"", spcb =
"";
571 TGeoTranslation* tr(
nullptr);
572 double FASPRO_thickness(0.);
573 for (
int ily(0); ily < FASPRO_Nly; ily++) {
575 double lyThickEff = FASPRO_ly_cu[ily][0] * FASPRO_ly_cu[ily][1] * 1.e-6;
576 new TGeoBBox(Form(
"faspro_ly%02d", ily), FASPRO_length / 2., FASPRO_width / 2., lyThickEff / 2.);
577 FASPRO_thickness += lyThickEff / 2;
578 tr =
new TGeoTranslation(Form(
"t_faspro_ly%02d", ily), 0., 0., FASPRO_thickness);
579 tr->RegisterYourself();
580 scu += Form(
"%cfaspro_ly%02d:t_faspro_ly%02d", (ily ?
'+' :
' '), ily, ily);
581 FASPRO_thickness += lyThickEff / 2;
582 if (ily == FASPRO_Nly - 1)
break;
584 double lyThickPcb = 1.e-4 * FASPRO_ly_pcb[ily] / 2.;
585 new TGeoBBox(Form(
"faspro_ly%02d_pcb", ily), FASPRO_length / 2., FASPRO_width / 2., lyThickPcb);
586 FASPRO_thickness += lyThickPcb;
587 tr =
new TGeoTranslation(Form(
"t_faspro_ly%02d_pcb", ily), 0., 0., FASPRO_thickness);
588 tr->RegisterYourself();
589 spcb += Form(
"%cfaspro_ly%02d_pcb:t_faspro_ly%02d_pcb", (ily ?
'+' :
' '), ily, ily);
590 FASPRO_thickness += lyThickPcb;
592 for (
int ihole(0); ihole < FASPRO_Nfasp; ihole++) {
593 new TGeoBBox(Form(
"faspro_hole%d", ihole), FASPRO_hole_x / 2., FASPRO_hole_y / 2., 1.e-4 + FASPRO_thickness / 2.);
595 new TGeoTranslation(Form(
"t_faspro_hole%d", ihole), HOLE_pos[ihole][0], HOLE_pos[ihole][1], FASPRO_thickness / 2);
596 tr->RegisterYourself();
597 scu += Form(
"-faspro_hole%d:t_faspro_hole%d", ihole, ihole);
598 spcb += Form(
"-faspro_hole%d:t_faspro_hole%d", ihole, ihole);
600 auto faspro_cu =
new TGeoCompositeShape(
"faspro_cu", scu.Data());
602 vol_faspro_cu->SetLineColor(kRed - 3);
603 auto faspro_pcb =
new TGeoCompositeShape(
"faspro_pcb", spcb.Data());
604 auto vol_faspro_pcb =
new TGeoVolume(
"faspro_pcb", faspro_pcb,
606 vol_faspro_pcb->SetLineColor(kGreen + 3);
608 fHeight += FASPRO_thickness;
611 auto fasp =
new TGeoBBox(
"fasp", FASP_x / 2., FASP_y / 2., FASP_z / 2.);
613 vol_fasp->SetLineColor(kBlack);
615 auto adc =
new TGeoBBox(
"adc", ADC_x / 2., ADC_y / 2., ADC_z / 2.);
617 vol_adc->SetLineColor(kBlack);
619 auto fpga =
new TGeoBBox(
"fpga", FPGA_x / 2., FPGA_y / 2., FPGA_z / 2.);
621 vol_fpga->SetLineColor(kBlack);
623 auto dcdc =
new TGeoBBox(
"dcdc", DCDC_x / 2., DCDC_y / 2., DCDC_z / 2.);
625 vol_dcdc->SetLineColor(kBlack);
627 auto connFc =
new TGeoBBox(
"connFc", ConnFC_x / 2., ConnFC_y / 2., ConnFC_z / 2.);
629 vol_conn_fc->SetLineColor(kYellow);
631 auto connBrg =
new TGeoBBox(
"connBrg", ConnBRG_x / 2., ConnBRG_y / 2., ConnBRG_z / 2.);
633 vol_conn_brg->SetLineColor(kYellow + 2);
634 fHeight += ConnBRG_z;
640 fVol =
new TGeoVolumeAssembly(Form(
"%s1%d", GetName(), fType));
641 fVol->SetLineColor(kGreen);
642 fVol->SetTransparency(50);
645 fHeight = -0.5 * fHeight + FASPRO_zspace;
646 fVol->AddNode(vol_faspro_cu, 1,
new TGeoTranslation(
"", 0., 0., fHeight));
647 fVol->AddNode(vol_faspro_pcb, 1,
new TGeoTranslation(
"", 0., 0., fHeight));
650 for (
int ifasp(0), jfasp(0); ifasp <
faspFeb[fType].nasic; ifasp++) {
651 vol_fasp->SetTitle(Form(
"%x", 0xff ));
653 fVol->AddNode(vol_fasp, jfasp,
654 new TGeoTranslation(
"", FASP_pos[ifasp][0], FASP_pos[ifasp][1], fHeight - FASP_z / 2));
656 fHeight += FASPRO_thickness;
658 for (
int iadc(0); iadc < FASPRO_Nadc; iadc++)
659 fVol->AddNode(vol_adc, iadc + 1,
new TGeoTranslation(
"", ADC_pos[iadc][0], ADC_pos[iadc][1], fHeight + ADC_z / 2));
660 for (
int ifpga(0); ifpga < FASPRO_Nfpga; ifpga++)
661 fVol->AddNode(vol_fpga, ifpga + 1,
662 new TGeoTranslation(
"", FPGA_pos[ifpga][0], FPGA_pos[ifpga][1], fHeight + FPGA_z / 2));
663 for (
int idcdc(0); idcdc < FASPRO_Ndcdc; idcdc++)
664 fVol->AddNode(vol_dcdc, idcdc + 1,
665 new TGeoTranslation(
"", DCDC_pos[idcdc][0], DCDC_pos[idcdc][1], fHeight + DCDC_z / 2));
667 for (
int ifasp(0); ifasp < FASPRO_Nfasp; ifasp++)
668 fVol->AddNode(vol_conn_fc, ifasp + 1,
669 new TGeoTranslation(
"", ConnFC_pos[ifasp][0], ConnFC_pos[ifasp][1], fHeight + ConnFC_z / 2));
670 for (
int iconn(0); iconn < 2; iconn++)
671 fVol->AddNode(vol_conn_brg, iconn + 1,
672 new TGeoTranslation(
"", ConnBRG_pos[iconn][0], ConnBRG_pos[iconn][1], fHeight + ConnBRG_z / 2));
673 fHeight += ConnBRG_z;