226 Material(1,
"Si $", aSi, zSi, dSi, x0Si, 18.5);
233 Material(0,
"W $", aW, zW, dW, x0W, 17.1);
236 Material(3,
"Cu $", 63.54, 29., 8.96, 1.43, 15.);
239 Material(9,
"Al$", 26.98, 13.0, 2.7, 8.9, 37.2);
242 Material(10,
"Pb $", 207.19, 82., 11.35, .56, 18.5);
246 float aP[2] = {12.011, 1.00794};
247 float zP[2] = {6.0, 1.0};
248 float wP[2] = {1.0, 1.0};
250 Mixture(11,
"Polystyrene$", aP, zP, dP, -2, wP);
254 float aG10[4] = {1., 12.011, 15.9994, 28.086};
255 float zG10[4] = {1., 6., 8., 14.};
257 float wG10[4] = {0.15201, 0.10641, 0.49444, 0.24714};
258 Mixture(2,
"G10 $", aG10, zG10, 1.7, 4, wG10);
261 float aAlloy[3] = {183.84, 58.6934, 63.54};
262 float zAlloy[3] = {74.0, 28, 29};
263 float wAlloy[3] = {0.94, 0.04, 0.02};
264 float dAlloy = wAlloy[0] * 19.3 + wAlloy[1] * 8.908 + wAlloy[2] * 8.96;
265 Mixture(5,
"Alloy $", aAlloy, zAlloy, dAlloy, 3, wAlloy);
268 float aSteel[4] = {55.847, 51.9961, 58.6934, 28.0855};
269 float zSteel[4] = {26., 24., 28., 14.};
270 float wSteel[4] = {.715, .18, .1, .005};
272 Mixture(4,
"STAINLESS STEEL$", aSteel, zSteel, dSteel, 4, wSteel);
275 float aAir[4] = {12.0107, 14.0067, 15.9994, 39.948};
276 float zAir[4] = {6., 7., 8., 18.};
277 float wAir[4] = {0.000124, 0.755268, 0.231781, 0.012827};
278 float dAir1 = 1.20479E-10;
279 float dAir = 1.20479E-3;
280 Mixture(98,
"Vacum$", aAir, zAir, dAir1, 4, wAir);
281 Mixture(99,
"Air $", aAir, zAir, dAir, 4, wAir);
286 float aal2o3[2] = {26.981539, 15.9994};
287 float zal2o3[2] = {13., 8.};
288 float wal2o3[2] = {2., 3.};
291 float aglass[2] = {28.0855, 15.9994};
292 float zglass[2] = {14., 8.};
293 float wglass[2] = {1., 2.};
295 Mixture(6,
"Al2O3 $", aal2o3, zal2o3, denscer, -2, wal2o3);
296 Mixture(7,
"glass $", aglass, zglass, dglass, -2, wglass);
319 Mixture(8,
"Ceramic $", aal2o3, zal2o3, denscer, -2, wal2o3);
324 float tmaxfdSi = 10.0;
325 float stemaxSi = 0.1;
326 float deemaxSi = 0.1;
328 float epsilSi = 1.e-3;
329 float stminSi = 0.001;
341 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
344 isxfld, sxmgmx, tmaxfdSi, stemaxSi, deemaxSi, epsilSi, stminSi,
nullptr, 0);
347 isxfld, sxmgmx, tmaxfdSi, stemaxSi, deemaxSi, epsilSi, stminSi,
nullptr, 0);
351 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.01,
nullptr, 0);
355 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.0001,
nullptr, 0);
359 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.0001,
nullptr, 0);
363 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
367 isxfld, sxmgmx, 10.0, 0.01, 0.1, 0.003, 0.003,
nullptr, 0);
371 Medium(
ID_PB,
"Pb // The Scintillator must be first in order in vector for Rin to be set$", 10, 0,
372 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
375 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001,
nullptr, 0);
379 isxfld, sxmgmx, 10.0, 0.1, 0.1, epsil, 0.001,
nullptr, 0);
383 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
387 isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 1.0,
nullptr, 0);
391 isxfld, sxmgmx, 10.0, 1.0, 0.1, epsil, 0.001,
nullptr, 0);
494 TGeoVolumeAssembly* volHCAL =
new TGeoVolumeAssembly(
"HCAL");
496 TGeoVolumeAssembly* HcalTube = gGeoManager->MakeVolumeAssembly(
"ScintCuTubes");
498 TGeoVolume* volCuTube;
499 TGeoVolume* volSciFi;
506 for (
auto& icomp : mGeoCompositions) {
507 Length = icomp->sizeZ() / 2;
509 if (icomp->material() ==
"Pb") {
510 Rout = icomp->sizeX() / 2;
512 volCuTube = gGeoManager->MakeTube(
"Tube", medium, Rin, Rout, Length);
513 volCuTube->SetLineWidth(2);
514 volCuTube->SetLineColor(kRed);
515 mSensitive.push_back(volCuTube->GetName());
517 HcalTube->AddNode(volCuTube, 1,
nullptr);
519 if (icomp->material() ==
"Scint") {
520 RScint = icomp->sizeX() / 2;
521 Rin = RScint + 0.005;
523 volSciFi = gGeoManager->MakeTube(
"ScintFiber", medium, 0., RScint, Length);
524 volSciFi->SetLineWidth(2);
525 volSciFi->SetLineColor(kBlue);
527 mSensitive.push_back(volSciFi->GetName());
528 HcalTube->AddNode(volSciFi, 1,
nullptr);
530 if (icomp->material() ==
"CuHCAL") {
531 Rout = icomp->sizeX() / 2;
533 volCuTube = gGeoManager->MakeTube(
"Tube", medium, Rin, Rout, Length);
534 volCuTube->SetLineWidth(2);
535 volCuTube->SetLineColor(kRed);
537 mSensitive.push_back(volCuTube->GetName());
538 HcalTube->AddNode(volCuTube, 1,
nullptr);
543 double CuBoxThickness = 0.3;
545 TGeoBBox* ODBox =
new TGeoBBox(
"TowerOD", TowerSize / 2, TowerSize / 2, Length);
546 TGeoBBox* IDBox =
new TGeoBBox(
"TowerID", (TowerSize - CuBoxThickness) / 2, (TowerSize - CuBoxThickness) / 2, Length + 0.01);
547 TGeoCompositeShape* TowerHCAL =
new TGeoCompositeShape(
"TowerHCAL",
"TowerOD - TowerID");
548 TGeoVolume* volTower =
new TGeoVolume(
"volTower", TowerHCAL, gGeoManager->GetMedium(
getMediumID(
ID_COPPER)));
549 volTower->SetLineWidth(2);
550 volTower->SetLineColor(42);
552 mSensitive.push_back(volTower->GetName());
554 TGeoVolumeAssembly* volTowerHCAL =
new TGeoVolumeAssembly(
"volTowerHCAL");
555 volTowerHCAL->AddNode(volTower, 1,
nullptr);
563 while (RowPos + CuBoxThickness / 2 + Rout + 2 * Rout < TowerSize) {
565 float ColumnPos = (Rows % 2 == 0) ? 0. : Rout;
566 while (ColumnPos + CuBoxThickness / 2 + Rout + 2 * Rout < TowerSize) {
568 TGeoTranslation* trans =
new TGeoTranslation(ColumnPos - TowerSize / 2 + CuBoxThickness / 2 + Rout, RowPos - TowerSize / 2 + CuBoxThickness / 2 + Rout, 0.);
570 trans->SetName(Form(
"trans_Num_%d", NumTubes));
571 trans->RegisterYourself();
573 volTowerHCAL->AddNode(HcalTube, NumTubes, trans);
578 ColumnPos = Columns * 2 * Rout + ((Rows % 2 == 0) ? 0. : Rout);
583 RowPos = Rows * 2 * Rout * TMath::Sin(TMath::Pi() / 3);
587 Double_t BeamPipeRadius = 3.0;
588 Double_t TowerHalfDiag = TMath::Sqrt2() * 0.5 * TowerSize;
589 Double_t MinRadius = BeamPipeRadius + TowerSize / 2;
601 for (Rows = 0; Rows < nTowersY; Rows++) {
603 float ColumnPos = 0.;
604 RowPos = Rows * TowerSize;
605 for (Columns = 0; Columns < nTowersX; Columns++) {
606 ColumnPos = Columns * TowerSize;
607 TGeoTranslation* trans =
new TGeoTranslation(ColumnPos - SizeXHCAL / 2 + TowerSize / 2, RowPos - SizeYHCAL / 2 + TowerSize / 2, 0.);
610 Double_t RadialDistance = TMath::Power(trans->GetTranslation()[0], 2) + TMath::Power(trans->GetTranslation()[1], 2);
612 if (RadialDistance < MinRadius * MinRadius || TMath::Abs(trans->GetTranslation()[0]) > SizeXHCAL / 2) {
617 volHCAL->AddNode(volTowerHCAL, NumTowers, trans);
623 LOG(info) <<
"Number of Towers is: " << (NumTowers - 1);
624 LOG(info) <<
"Number of tubes is: " << (NumTubes - 1) * (NumTowers - 1);
628 TGeoBBox* alHcalBox =
new TGeoBBox(
"AlHCalBox", SizeXHCAL / 2.0, SizeYHCAL / 2.0, 0.5 / 2.0);
629 TGeoVolume* volumeAlHcalBox =
new TGeoVolume(
"volAlHcalBox", alHcalBox, gGeoManager->GetMedium(
getMediumID(
ID_ALUMINIUM)));
630 volumeAlHcalBox->SetLineColor(kOrange);
632 TVirtualMC::GetMC()->Gspos(
"volAlHcalBox", 9999,
"FOCAL", 0.0, 0.0, +1.0 * mGeometry->
getFOCALSizeZ() / 2.0 + 1.0, 0,
"ONLY");
634 mSensitive.push_back(
"volAlHcalBox");
636 TGeoBBox* alUnderBox =
new TGeoBBox(
"AlUnderBox", SizeXHCAL / 2.0, 0.5, mGeometry->
getFOCALSizeZ() / 2.0 + 1.5);
637 TGeoVolume* volumeAlUnderBox =
new TGeoVolume(
"volAlUnderBox", alUnderBox, gGeoManager->GetMedium(
getMediumID(
ID_ALUMINIUM)));
638 volumeAlUnderBox->SetLineColor(kOrange);
640 TVirtualMC::GetMC()->Gspos(
"volAlUnderBox", 9999,
"FOCAL", 0.0, -1.0 * mGeometry->
getFOCALSizeY() / 2 - 10.5, 0.0, 0,
"ONLY");
642 mSensitive.push_back(
"volAlUnderBox");
645 volHCAL->SetVisibility();
646 volHCAL->SetVisDaughters();
653 TGeoVolumeAssembly* volHCAL =
new TGeoVolumeAssembly(
"HCAL");
664 TGeoVolumeAssembly* volTower =
new TGeoVolumeAssembly(
"Tower");
666 int iCu(0), iScint(0);
667 for (
auto& icomp : mGeoCompositions) {
669 pars[0] = icomp->sizeX() / 2;
670 pars[1] = icomp->sizeY() / 2;
671 pars[2] = icomp->sizeZ() / 2;
676 if (icomp->material() ==
"Pb") {
679 const TGeoBBox* HPadBox =
new TGeoBBox(
"HPadBox", pars[0], pars[1], pars[2]);
680 TGeoVolume* HPad =
new TGeoVolume(
"HPad", HPadBox, medium);
681 HPad->SetLineColor(kGray);
683 mSensitive.push_back(HPad->GetName());
684 TGeoTranslation* trans =
new TGeoTranslation(icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset);
685 volTower->AddNode(HPad, iCu, trans);
687 if (icomp->material() ==
"Scint") {
690 const TGeoBBox* HScintBox =
new TGeoBBox(
"HScintBox", pars[0], pars[1], pars[2]);
691 TGeoVolume* HScint =
new TGeoVolume(
"HScint", HScintBox, medium);
692 HScint->SetLineColor(kBlue);
694 mSensitive.push_back(HScint->GetName());
695 TGeoTranslation* trans =
new TGeoTranslation(icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset);
696 volTower->AddNode(HScint, iScint, trans);
698 if (icomp->material() ==
"CuHCAL") {
701 const TGeoBBox* HPadBox =
new TGeoBBox(
"HPadBox", pars[0], pars[1], pars[2]);
702 TGeoVolume* HPad =
new TGeoVolume(
"HPad", HPadBox, medium);
703 HPad->SetLineColor(kRed);
705 mSensitive.push_back(HPad->GetName());
706 TGeoTranslation* trans =
new TGeoTranslation(icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset);
707 volTower->AddNode(HPad, iCu, trans);
713 double BeamPipeRadius = 3.6;
714 double TowerHalfDiag = TMath::Sqrt2() * 0.5 * TowerSize;
715 double MinRadius = BeamPipeRadius + TowerHalfDiag;
729 for (Rows = 0; Rows < nTowersY; Rows++) {
731 float ColumnPos = 0.;
732 RowPos = Rows * TowerSize;
733 for (Columns = 0; Columns < nTowersX; Columns++) {
734 ColumnPos = Columns * TowerSize;
736 TGeoTranslation* trans =
new TGeoTranslation(ColumnPos - SizeXHCAL / 2 + TowerSize / 2, RowPos - SizeYHCAL / 2 + TowerSize / 2, 0.);
739 double RadialDistance = TMath::Power(ColumnPos - SizeXHCAL / 2 + TowerSize / 2, 2) + TMath::Power(RowPos - SizeYHCAL / 2 + TowerSize / 2, 2);
741 if (RadialDistance < MinRadius * MinRadius) {
746 volHCAL->AddNode(volTower, NumTowers, trans);
751 LOG(info) <<
"Number of Towers is: " << (NumTowers - 1);
755 TGeoBBox* alHcalBox =
new TGeoBBox(
"AlHCalBox", SizeXHCAL / 2.0, SizeYHCAL / 2.0, 0.5 / 2.0);
756 TGeoVolume* volumeAlHcalBox =
new TGeoVolume(
"volAlHcalBox", alHcalBox, gGeoManager->GetMedium(
getMediumID(
ID_ALUMINIUM)));
757 volumeAlHcalBox->SetLineColor(kOrange);
759 TVirtualMC::GetMC()->Gspos(
"volAlHcalBox", 9999,
"FOCAL", 0.0, 0.0, +1.0 * mGeometry->
getFOCALSizeZ() / 2.0 + 1.0, 0,
"ONLY");
761 TGeoBBox* alUnderBox =
new TGeoBBox(
"AlUnderBox", SizeXHCAL / 2.0, 0.5, mGeometry->
getFOCALSizeZ() / 2.0 + 1.5);
762 TGeoVolume* volumeAlUnderBox =
new TGeoVolume(
"volAlUnderBox", alUnderBox, gGeoManager->GetMedium(
getMediumID(
ID_ALUMINIUM)));
763 volumeAlUnderBox->SetLineColor(kOrange);
765 TVirtualMC::GetMC()->Gspos(
"volAlUnderBox", 9999,
"FOCAL", 0.0, -1.0 * mGeometry->
getFOCALSizeY() / 2 - 10.5, 0.0, 0,
"ONLY");
768 TGeoVolume* volFOCAL = gGeoManager->GetVolume(
"FOCAL");
802 mSensitive.push_back(
"EMSC1");
803 mSensitive.push_back(
"EMSC2");
810 for (
auto& icomp : mGeoCompositions) {
812 pars[0] = icomp->sizeX() / 2.;
813 pars[1] = icomp->sizeY() / 2.;
814 pars[2] = icomp->sizeZ() / 2.;
817 if (icomp->material() ==
"PureW") {
821 mSensitive.push_back(
"EW1");
822 gGeoManager->GetVolume(
"EW1")->SetLineColor(kBlue);
823 TVirtualMC::GetMC()->Gspos(
"EW1", icomp->id() + 1,
"EMSC1",
824 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
825 TVirtualMC::GetMC()->Gspos(
"EW1", icomp->id() + 1,
"EMSC2",
826 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
828 if (icomp->material() ==
"Alloy") {
832 mSensitive.push_back(
"EW1");
833 TVirtualMC::GetMC()->Gspos(
"EW1", icomp->id() + 1,
"EMSC1",
834 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
835 TVirtualMC::GetMC()->Gspos(
"EW1", icomp->id() + 1,
"EMSC2",
836 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
839 if (icomp->material() ==
"G10") {
843 mSensitive.push_back(
"G10RO1");
844 gGeoManager->GetVolume(
"G10RO1")->SetLineColor(kGreen);
845 TVirtualMC::GetMC()->Gspos(
"G10RO1", icomp->id() + 1,
"EMSC1",
846 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
847 TVirtualMC::GetMC()->Gspos(
"G10RO1", icomp->id() + 1,
"EMSC2",
848 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
851 if (icomp->material() ==
"Cu") {
855 mSensitive.push_back(
"EWCU");
856 gGeoManager->GetVolume(
"EWCU")->SetLineColor(kViolet);
857 TVirtualMC::GetMC()->Gspos(
"EWCU", icomp->id() + 1,
"EMSC1",
858 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
859 TVirtualMC::GetMC()->Gspos(
"EWCU", icomp->id() + 1,
"EMSC2",
860 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
863 if (icomp->material() ==
"Air") {
867 mSensitive.push_back(
"EWAIR1");
868 gGeoManager->GetVolume(
"EWAIR1")->SetLineColor(kGray);
869 TVirtualMC::GetMC()->Gspos(
"EWAIR1", icomp->id() + 1,
"EMSC1",
870 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
871 TVirtualMC::GetMC()->Gspos(
"EWAIR1", icomp->id() + 1,
"EMSC2",
872 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
875 if (icomp->material() ==
"Ceramic") {
879 mSensitive.push_back(
"EWAIR1");
880 TVirtualMC::GetMC()->Gspos(
"EWAIR1", icomp->id() + 1,
"EMSC1",
881 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
882 TVirtualMC::GetMC()->Gspos(
"EWAIR1", icomp->id() + 1,
"EMSC2",
883 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
886 if (icomp->material() ==
"SiPad") {
890 mSensitive.push_back(
"EWSIPAD1");
891 gGeoManager->GetVolume(
"EWSIPAD1")->SetLineColor(kOrange - 7);
892 int number = (icomp->id()) + (icomp->stack() << 12) + (icomp->layer() << 16);
894 TVirtualMC::GetMC()->Gspos(
"EWSIPAD1", number + 1,
"EMSC1",
895 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
896 TVirtualMC::GetMC()->Gspos(
"EWSIPAD1", number + 1,
"EMSC2",
897 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
901 if (icomp->material() ==
"SiPix") {
905 mSensitive.push_back(
"EWSIPIX1");
906 gGeoManager->GetVolume(
"EWSIPIX1")->SetLineColor(kPink);
908 int number = (icomp->id()) + (icomp->stack() << 12) + (icomp->layer() << 16);
909 TVirtualMC::GetMC()->Gspos(
"EWSIPIX1", number + 1,
"EMSC1",
911 TVirtualMC::GetMC()->Gspos(
"EWSIPIX1", number + 1,
"EMSC2",
916 if (icomp->material() ==
"Si") {
920 mSensitive.push_back(
"EWSI1");
921 gGeoManager->GetVolume(
"EWSI1")->SetLineColor(kPink);
922 TVirtualMC::GetMC()->Gspos(
"EWSI1", icomp->id() + 1,
"EMSC1",
923 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
924 TVirtualMC::GetMC()->Gspos(
"EWSI1", icomp->id() + 1,
"EMSC2",
925 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
931 TGeoVolume* volumeColdPlate =
nullptr;
935 volumeColdPlate =
new TGeoVolume(
"volColdPlate", coldPlateBox, gGeoManager->GetMedium(
getMediumID(
ID_COPPER)));
938 volumeColdPlate =
new TGeoVolume(
"volColdPlate", coldPlateBox, gGeoManager->GetMedium(
getMediumID(
ID_ALUMINIUM)));
940 volumeColdPlate =
new TGeoVolume(
"volColdPlate", coldPlateBox, gGeoManager->GetMedium(
getMediumID(
ID_AIR)));
943 mSensitive.push_back(volumeColdPlate->GetName());
944 volumeColdPlate->SetLineColor(kOrange);
959 mSensitive.push_back(
"ECAL");
964 TGeoVolume* volumeSiPad =
new TGeoVolume(
"volSiPad", siPadBox, gGeoManager->GetMedium(
getMediumID(
ID_SIPAD)));
965 volumeSiPad->SetLineColor(kOrange + 7);
968 mSensitive.push_back(volumeSiPad->GetName());
972 int itowerx, itowery;
983 TVirtualMC::GetMC()->Gspos(
"EMSC1", number + 1,
"ECAL", xp, yp, 0, 0,
"ONLY");
986 TVirtualMC::GetMC()->Gspos(
"volSiPad", -1 * (number + 1),
"FOCAL", xp, yp, -1.0 * geom->
getFOCALSizeZ() / 2.0, 0,
"ONLY");
988 mSensitive.push_back(
"volSiPad");
991 mSensitive.push_back(
"volSiPad");
995 TVirtualMC::GetMC()->Gspos(
"EMSC2", number + 1,
"ECAL", xp, yp, 0, 0,
"ONLY");
998 TVirtualMC::GetMC()->Gspos(
"volSiPad", -1 * (number + 1),
"FOCAL", xp, yp, -1.0 * geom->
getFOCALSizeZ() / 2.0, 0,
"ONLY");
1000 mSensitive.push_back(
"volSiPad");
1003 mSensitive.push_back(
"volSiPad");