231 Material(1,
"Si $", aSi, zSi, dSi, x0Si, 18.5);
238 Material(0,
"W $", aW, zW, dW, x0W, 17.1);
241 Material(3,
"Cu $", 63.54, 29., 8.96, 1.43, 15.);
244 Material(9,
"Al$", 26.98, 13.0, 2.7, 8.9, 37.2);
247 Material(10,
"Pb $", 207.19, 82., 11.35, .56, 18.5);
251 float aP[2] = {12.011, 1.00794};
252 float zP[2] = {6.0, 1.0};
253 float wP[2] = {1.0, 1.0};
255 Mixture(11,
"Polystyrene$", aP, zP, dP, -2, wP);
259 float aG10[4] = {1., 12.011, 15.9994, 28.086};
260 float zG10[4] = {1., 6., 8., 14.};
262 float wG10[4] = {0.15201, 0.10641, 0.49444, 0.24714};
263 Mixture(2,
"G10 $", aG10, zG10, 1.7, 4, wG10);
266 float aAlloy[3] = {183.84, 58.6934, 63.54};
267 float zAlloy[3] = {74.0, 28, 29};
268 float wAlloy[3] = {0.94, 0.04, 0.02};
269 float dAlloy = wAlloy[0] * 19.3 + wAlloy[1] * 8.908 + wAlloy[2] * 8.96;
270 Mixture(5,
"Alloy $", aAlloy, zAlloy, dAlloy, 3, wAlloy);
273 float aSteel[4] = {55.847, 51.9961, 58.6934, 28.0855};
274 float zSteel[4] = {26., 24., 28., 14.};
275 float wSteel[4] = {.715, .18, .1, .005};
277 Mixture(4,
"STAINLESS STEEL$", aSteel, zSteel, dSteel, 4, wSteel);
280 float aAir[4] = {12.0107, 14.0067, 15.9994, 39.948};
281 float zAir[4] = {6., 7., 8., 18.};
282 float wAir[4] = {0.000124, 0.755268, 0.231781, 0.012827};
283 float dAir1 = 1.20479E-10;
284 float dAir = 1.20479E-3;
285 Mixture(98,
"Vacum$", aAir, zAir, dAir1, 4, wAir);
286 Mixture(99,
"Air $", aAir, zAir, dAir, 4, wAir);
291 float aal2o3[2] = {26.981539, 15.9994};
292 float zal2o3[2] = {13., 8.};
293 float wal2o3[2] = {2., 3.};
296 float aglass[2] = {28.0855, 15.9994};
297 float zglass[2] = {14., 8.};
298 float wglass[2] = {1., 2.};
300 Mixture(6,
"Al2O3 $", aal2o3, zal2o3, denscer, -2, wal2o3);
301 Mixture(7,
"glass $", aglass, zglass, dglass, -2, wglass);
324 Mixture(8,
"Ceramic $", aal2o3, zal2o3, denscer, -2, wal2o3);
329 float tmaxfdSi = 10.0;
330 float stemaxSi = 0.1;
331 float deemaxSi = 0.1;
333 float epsilSi = 1.e-3;
334 float stminSi = 0.001;
346 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
349 isxfld, sxmgmx, tmaxfdSi, stemaxSi, deemaxSi, epsilSi, stminSi,
nullptr, 0);
352 isxfld, sxmgmx, tmaxfdSi, stemaxSi, deemaxSi, epsilSi, stminSi,
nullptr, 0);
356 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.01,
nullptr, 0);
360 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.0001,
nullptr, 0);
364 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.0001,
nullptr, 0);
368 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
372 isxfld, sxmgmx, 10.0, 0.01, 0.1, 0.003, 0.003,
nullptr, 0);
376 Medium(
ID_PB,
"Pb // The Scintillator must be first in order in vector for Rin to be set$", 10, 0,
377 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
380 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.001, 0.001,
nullptr, 0);
384 isxfld, sxmgmx, 10.0, 0.1, 0.1, epsil, 0.001,
nullptr, 0);
388 isxfld, sxmgmx, 10.0, 0.1, 0.1, 0.1, 0.1,
nullptr, 0);
392 isxfld, sxmgmx, 10.0, 1.0, 0.1, 0.1, 1.0,
nullptr, 0);
396 isxfld, sxmgmx, 10.0, 1.0, 0.1, epsil, 0.001,
nullptr, 0);
511 TGeoVolumeAssembly* volHCAL =
new TGeoVolumeAssembly(
"HCAL");
513 TGeoVolumeAssembly* HcalTube = gGeoManager->MakeVolumeAssembly(
"ScintCuTubes");
515 TGeoVolume* volCuTube;
516 TGeoVolume* volSciFi;
523 for (
auto& icomp : mGeoCompositions) {
524 Length = icomp->sizeZ() / 2;
526 if (icomp->material() ==
"Pb") {
527 Rout = icomp->sizeX() / 2;
529 volCuTube = gGeoManager->MakeTube(
"Tube", medium, Rin, Rout, Length);
530 volCuTube->SetLineWidth(2);
531 volCuTube->SetLineColor(kRed);
532 mSensitive.push_back(volCuTube->GetName());
534 HcalTube->AddNode(volCuTube, 1,
nullptr);
536 if (icomp->material() ==
"Scint") {
537 RScint = icomp->sizeX() / 2;
538 Rin = RScint + 0.005;
540 volSciFi = gGeoManager->MakeTube(
"ScintFiber", medium, 0., RScint, Length);
541 volSciFi->SetLineWidth(2);
542 volSciFi->SetLineColor(kBlue);
544 mSensitive.push_back(volSciFi->GetName());
545 HcalTube->AddNode(volSciFi, 1,
nullptr);
547 if (icomp->material() ==
"CuHCAL") {
548 Rout = icomp->sizeX() / 2;
550 volCuTube = gGeoManager->MakeTube(
"Tube", medium, Rin, Rout, Length);
551 volCuTube->SetLineWidth(2);
552 volCuTube->SetLineColor(kRed);
554 mSensitive.push_back(volCuTube->GetName());
555 HcalTube->AddNode(volCuTube, 1,
nullptr);
562 double CuBoxThickness = 0.3;
564 TGeoBBox* ODBox =
new TGeoBBox(
"TowerOD", TowerSize / 2, TowerSize / 2, Length);
565 TGeoBBox* IDBox =
new TGeoBBox(
"TowerID", (TowerSize - CuBoxThickness) / 2, (TowerSize - CuBoxThickness) / 2, Length + 0.01);
566 TGeoCompositeShape* TowerHCAL =
new TGeoCompositeShape(
"TowerHCAL",
"TowerOD - TowerID");
567 TGeoVolume* volTower =
new TGeoVolume(
"volTower", TowerHCAL, gGeoManager->GetMedium(
getMediumID(
ID_COPPER)));
568 volTower->SetLineWidth(2);
569 volTower->SetLineColor(42);
571 mSensitive.push_back(volTower->GetName());
573 TGeoVolumeAssembly* volTowerHCAL =
new TGeoVolumeAssembly(
"volTowerHCAL");
574 volTowerHCAL->AddNode(volTower, 1,
nullptr);
582 while (RowPos + CuBoxThickness / 2 + Rout + 2 * Rout < TowerSize) {
584 float ColumnPos = (Rows % 2 == 0) ? 0. : Rout;
585 while (ColumnPos + CuBoxThickness / 2 + Rout + 2 * Rout < TowerSize) {
587 TGeoTranslation* trans =
new TGeoTranslation(ColumnPos - TowerSize / 2 + CuBoxThickness / 2 + Rout, RowPos - TowerSize / 2 + CuBoxThickness / 2 + Rout, 0.);
589 trans->SetName(Form(
"trans_Num_%d", NumTubes));
590 trans->RegisterYourself();
592 volTowerHCAL->AddNode(HcalTube, NumTubes, trans);
597 ColumnPos = Columns * 2 * Rout + ((Rows % 2 == 0) ? 0. : Rout);
602 RowPos = Rows * 2 * Rout * TMath::Sin(TMath::Pi() / 3);
606 Double_t BeamPipeRadius = 3.0;
607 Double_t TowerHalfDiag = TMath::Sqrt2() * 0.5 * TowerSize;
608 Double_t MinRadius = BeamPipeRadius + TowerSize / 2;
622 SizeXHCAL = SizeXHCAL / 2;
624 TGeoVolumeAssembly* volHalfHCAL =
new TGeoVolumeAssembly(
"HalfHCAL");
626 for (Rows = 0; Rows < nTowersY; Rows++) {
628 float ColumnPos = 0.;
629 RowPos = Rows * TowerSize;
630 for (Columns = 0; Columns < nTowersX / 2; Columns++) {
631 ColumnPos = Columns * TowerSize;
632 TGeoTranslation* trans =
new TGeoTranslation(ColumnPos - SizeXHCAL / 2 + TowerSize / 2, RowPos - SizeYHCAL / 2 + TowerSize / 2, 0.);
635 if (Rows == nTowersY / 2) {
636 trans->SetDx(trans->GetTranslation()[0] + TowerSize / 2);
640 volHalfHCAL->AddNode(volTowerHCAL, NumTowers, trans);
644 volHCAL->AddNode(volHalfHCAL, 1,
new TGeoTranslation(SizeXHCAL / 2 + mGeometry->
getDetectorOpeningRight(), 0, 0));
645 TGeoRotation* rotFlipZ =
new TGeoRotation();
646 rotFlipZ->RotateY(180);
647 TGeoCombiTrans* combHalf =
new TGeoCombiTrans(-SizeXHCAL / 2 - mGeometry->
getDetectorOpeningLeft(), 0., 0., rotFlipZ);
648 volHCAL->AddNode(volHalfHCAL, 2, combHalf);
651 for (Rows = 0; Rows < nTowersY; Rows++) {
653 float ColumnPos = 0.;
654 RowPos = Rows * TowerSize;
655 for (Columns = 0; Columns < nTowersX; Columns++) {
656 ColumnPos = Columns * TowerSize;
657 TGeoTranslation* trans =
new TGeoTranslation(ColumnPos - SizeXHCAL / 2 + TowerSize / 2, RowPos - SizeYHCAL / 2 + TowerSize / 2, 0.);
660 Double_t RadialDistance = TMath::Power(trans->GetTranslation()[0], 2) + TMath::Power(trans->GetTranslation()[1], 2);
662 if (RadialDistance < MinRadius * MinRadius || TMath::Abs(trans->GetTranslation()[0]) > SizeXHCAL / 2) {
667 volHCAL->AddNode(volTowerHCAL, NumTowers, trans);
674 LOG(info) <<
"Number of Towers is: " << (NumTowers - 1);
675 LOG(info) <<
"Number of tubes is: " << (NumTubes - 1) * (NumTowers - 1);
679 TGeoBBox* alHcalBox =
new TGeoBBox(
"AlHCalBox", SizeXHCAL / 2.0, SizeYHCAL / 2.0, 0.5 / 2.0);
680 TGeoVolume* volumeAlHcalBox =
new TGeoVolume(
"volAlHcalBox", alHcalBox, gGeoManager->GetMedium(
getMediumID(
ID_ALUMINIUM)));
681 volumeAlHcalBox->SetLineColor(kOrange);
683 TVirtualMC::GetMC()->Gspos(
"volAlHcalBox", 9999,
"FOCAL", 0.0, 0.0, +1.0 * mGeometry->
getFOCALSizeZ() / 2.0 + 1.0, 0,
"ONLY");
685 mSensitive.push_back(
"volAlHcalBox");
688 TGeoVolume* volumeAlUnderBox =
new TGeoVolume(
"volAlUnderBox", alUnderBox, gGeoManager->GetMedium(
getMediumID(
ID_ALUMINIUM)));
689 volumeAlUnderBox->SetLineColor(kOrange);
691 TVirtualMC::GetMC()->Gspos(
"volAlUnderBox", 9999,
"FOCAL", 0.0, -1.0 * mGeometry->
getFOCALSizeY() / 2 - 10.5, 0.0, 0,
"ONLY");
693 mSensitive.push_back(
"volAlUnderBox");
696 volHCAL->SetVisibility();
697 volHCAL->SetVisDaughters();
706 double hole_diameter,
719 TGeoVolumeAssembly* pitchAssembly =
new TGeoVolumeAssembly(
"pitchAssembly");
722 float holeStart = 0.15;
723 float holeEnd = 0.35;
725 TGeoVolumeAssembly* volLowerSheetwHoles =
new TGeoVolumeAssembly(Form(
"volLowerSheetwHoles_%s", suffix.c_str()));
726 TGeoVolume* cuSheet = gGeoManager->MakeBox(
"cuSheet", copper, Lx / 2, (Ly1 - fiber_radius * 2) / 2, Lz / 2);
727 cuSheet->SetLineColor(kOrange + 2);
728 mSensitive.push_back(cuSheet->GetName());
729 TGeoVolume* boxbegin = gGeoManager->MakeBox(
"BoxBegin", copper, holeStart / 2, fiber_radius, Lz / 2);
730 boxbegin->SetLineColor(kOrange + 2);
731 mSensitive.push_back(boxbegin->GetName());
732 TGeoVolume* boxMiddle = gGeoManager->MakeBox(
"BoxMiddle", copper, (hole_spacing - hole_diameter) / 2, fiber_radius, Lz / 2);
733 boxMiddle->SetLineColor(kOrange + 2);
734 mSensitive.push_back(boxMiddle->GetName());
735 TGeoVolume* boxEnd = gGeoManager->MakeBox(
"BoxEnd", copper, holeEnd / 2, fiber_radius, Lz / 2);
736 boxEnd->SetLineColor(kOrange + 2);
737 mSensitive.push_back(boxEnd->GetName());
739 double yPlacement = Ly1 / 2 - fiber_radius;
745 volLowerSheetwHoles->AddNode(cuSheet, 0,
new TGeoTranslation(0, -Ly1 / 2 + (Ly1 - fiber_radius * 2) / 2, zpos));
748 float start_x = -Lx / 2 + holeStart;
750 for (
int ihole = 0; ihole < nholes; ++ihole) {
751 float holePlacement = start_x + ihole * hole_spacing + hole_diameter / 2;
753 volLowerSheetwHoles->AddNode(boxbegin, ihole,
new TGeoTranslation(holePlacement - holeStart / 2 - hole_diameter / 2, yPlacement, zpos));
754 volLowerSheetwHoles->AddNode(boxMiddle, ihole,
new TGeoTranslation(holePlacement + hole_diameter / 2 + (hole_spacing - hole_diameter) / 2, yPlacement, zpos));
755 }
else if (ihole == nholes - 1) {
756 if ((holePlacement + hole_diameter / 2 + holeStart) < Lx / 2 - 0.005) {
757 volLowerSheetwHoles->AddNode(boxEnd, ihole,
new TGeoTranslation(holePlacement + hole_diameter / 2 + holeEnd / 2, yPlacement, zpos));
759 volLowerSheetwHoles->AddNode(boxbegin, ihole,
new TGeoTranslation(holePlacement + hole_diameter / 2 + holeStart / 2, yPlacement, zpos));
762 volLowerSheetwHoles->AddNode(boxMiddle, ihole,
new TGeoTranslation(holePlacement + hole_diameter / 2 + (hole_spacing - hole_diameter) / 2, yPlacement, zpos));
766 pitchAssembly->AddNode(volLowerSheetwHoles, 0,
new TGeoTranslation(0, Ly1 / 2, zpos));
771 TGeoVolume* fullSheet1 = gGeoManager->MakeBox(
"FullSheet1", copper, Lx / 2, Ly2 / 2, Lz / 2);
772 fullSheet1->SetLineColor(kOrange + 2);
773 mSensitive.push_back(fullSheet1->GetName());
774 pitchAssembly->AddNode(fullSheet1, 0,
new TGeoTranslation(0, Ly1 / 2 + Ly2 / 2 + Ly1 / 2, zpos));
780 TGeoVolumeAssembly* volUpperSheetwHoles =
new TGeoVolumeAssembly(Form(
"volUpperSheetwHoles_%s", suffix.c_str()));
782 volUpperSheetwHoles->AddNode(cuSheet, 0,
new TGeoTranslation(0, -Ly1 / 2 + (Ly1 - fiber_radius * 2) / 2, zpos));
785 float start_x2 = -Lx / 2 + holeEnd;
787 for (
int ihole = 0; ihole < nholes; ++ihole) {
788 float holePlacement = start_x2 + ihole * hole_spacing + hole_diameter / 2;
790 volUpperSheetwHoles->AddNode(boxEnd, ihole,
new TGeoTranslation(holePlacement - hole_diameter / 2 - holeEnd / 2, yPlacement, zpos));
791 volUpperSheetwHoles->AddNode(boxMiddle, ihole,
new TGeoTranslation(holePlacement + hole_diameter / 2 + (hole_spacing - hole_diameter) / 2, yPlacement, zpos));
792 }
else if (ihole == nholes - 1) {
793 volUpperSheetwHoles->AddNode(boxbegin, ihole,
new TGeoTranslation(holePlacement + holeStart / 2 + hole_diameter / 2, yPlacement, zpos));
795 if ((holePlacement + hole_spacing + hole_diameter / 2) < Lx / 2 - 0.005) {
796 volUpperSheetwHoles->AddNode(boxMiddle, ihole,
new TGeoTranslation(holePlacement + hole_diameter / 2 + (hole_spacing - hole_diameter) / 2, yPlacement, zpos));
798 volUpperSheetwHoles->AddNode(boxEnd, ihole,
new TGeoTranslation(holePlacement + hole_diameter / 2 + holeEnd / 2, yPlacement, zpos));
804 pitchAssembly->AddNode(volUpperSheetwHoles, 0,
new TGeoTranslation(0, Ly1 / 2 + Ly2 + Ly1 / 2 + Ly1 / 2, zpos));
809 pitchAssembly->AddNode(fullSheet1, 1,
new TGeoTranslation(0, Ly1 / 2 + Ly2 + Ly1 + Ly2 / 2 + Ly1 / 2, zpos));
815 TGeoVolume* fiber = gGeoManager->MakeTube(
"Fiber", scint, 0, fiber_radius, Lz / 2);
816 fiber->SetLineColor(kBlue);
817 mSensitive.push_back(fiber->GetName());
818 for (
int i = 0;
i < nholes; ++
i) {
819 float x_fiber = start_x +
i * hole_spacing + hole_diameter / 2;
820 pitchAssembly->AddNode(fiber,
i,
new TGeoTranslation(x_fiber, Ly1 / 2 - fiber_radius + Ly1 / 2, zpos));
824 for (
int i = 0;
i < nholes; ++
i) {
825 float x_fiber = start_x2 +
i * hole_spacing + hole_diameter / 2;
826 if (x_fiber > Lx / 2 - 0.05) {
829 pitchAssembly->AddNode(fiber,
i + nholes,
new TGeoTranslation(x_fiber, Ly1 / 2 + Ly2 + Ly1 / 2 + Ly1 / 2 - fiber_radius + Ly1 / 2, zpos));
832 return pitchAssembly;
838 TGeoVolumeAssembly* volHCAL =
new TGeoVolumeAssembly(
"HCAL");
846 double fiber_radius = 0.05;
850 for (
auto& comp : mGeoCompositions) {
853 if (comp->material() ==
"Scint") {
854 fiber_radius = comp->sizeX() / 2;
856 if (comp->material() ==
"CuHCAL" && icomp == 0) {
860 if (comp->material() ==
"CuHCAL" && icomp == 2) {
866 double hole_diameter = fiber_radius * 2 + 0.01;
868 int nholes = (int)(Lx / hole_spacing);
871 int nBeamPipeHoles = (int)((Lx - beamPipeHole / 2) / hole_spacing);
874 float pitch_height = Ly1 + Ly2 + Ly1 + Ly2;
877 int numberOfPitchesBeamPipe = (int)((beamPipeHole + 0.001) / pitch_height);
878 int numberofPitchesOnYaxis = (totalNumberOfPitches - numberOfPitchesBeamPipe);
880 TGeoVolumeAssembly* pitchAssembly =
CreatePitchAssembly(Lx, Ly1, Ly2, Lz, hole_diameter, hole_spacing, nholes, fiber_radius,
"Main");
881 pitchAssembly->SetVisibility(
true);
882 TGeoVolumeAssembly* beamPipeAssembly =
CreatePitchAssembly(Lx - beamPipeHole / 2, Ly1, Ly2, Lz, hole_diameter, hole_spacing, nBeamPipeHoles, fiber_radius,
"BeamPipe");
883 beamPipeAssembly->SetVisibility(
true);
885 TGeoVolumeAssembly* HalfHCAL =
new TGeoVolumeAssembly(
"HalfHCAL");
887 for (
int iPitch = 0; iPitch < numberofPitchesOnYaxis; iPitch++) {
888 float placement = iPitch * pitch_height - pitch_height * (totalNumberOfPitches) / 2.0;
889 if (placement < -beamPipeHole / 2.0) {
890 HalfHCAL->AddNode(pitchAssembly, iPitch,
new TGeoTranslation(0, placement, 0.));
892 placement += beamPipeHole;
893 HalfHCAL->AddNode(pitchAssembly, iPitch,
new TGeoTranslation(0, placement, 0.));
897 for (
int iPitch = 0; iPitch < numberOfPitchesBeamPipe; iPitch++) {
898 float placement = iPitch * pitch_height - beamPipeHole / 2.0;
899 HalfHCAL->AddNode(beamPipeAssembly, iPitch,
new TGeoTranslation(-beamPipeHole / 4, placement, 0.));
902 HalfHCAL->SetVisibility(
true);
903 HalfHCAL->SetVisDaughters(
true);
905 volHCAL->AddNode(HalfHCAL, 0,
new TGeoTranslation(-Lx / 2, 0, 0.));
906 TGeoRotation* rotFlipZ =
new TGeoRotation();
907 rotFlipZ->RotateY(180);
908 TGeoCombiTrans* combHalf =
new TGeoCombiTrans(Lx / 2, 0., 0., rotFlipZ);
909 volHCAL->AddNode(HalfHCAL, 1, combHalf);
917 TGeoVolumeAssembly* volHCAL =
new TGeoVolumeAssembly(
"HCAL");
928 TGeoVolumeAssembly* volTower =
new TGeoVolumeAssembly(
"Tower");
930 int iCu(0), iScint(0);
931 for (
auto& icomp : mGeoCompositions) {
933 pars[0] = icomp->sizeX() / 2;
934 pars[1] = icomp->sizeY() / 2;
935 pars[2] = icomp->sizeZ() / 2;
940 if (icomp->material() ==
"Pb") {
943 const TGeoBBox* HPadBox =
new TGeoBBox(
"HPadBox", pars[0], pars[1], pars[2]);
944 TGeoVolume* HPad =
new TGeoVolume(
"HPad", HPadBox, medium);
945 HPad->SetLineColor(kGray);
947 mSensitive.push_back(HPad->GetName());
948 TGeoTranslation* trans =
new TGeoTranslation(icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset);
949 volTower->AddNode(HPad, iCu, trans);
951 if (icomp->material() ==
"Scint") {
954 const TGeoBBox* HScintBox =
new TGeoBBox(
"HScintBox", pars[0], pars[1], pars[2]);
955 TGeoVolume* HScint =
new TGeoVolume(
"HScint", HScintBox, medium);
956 HScint->SetLineColor(kBlue);
958 mSensitive.push_back(HScint->GetName());
959 TGeoTranslation* trans =
new TGeoTranslation(icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset);
960 volTower->AddNode(HScint, iScint, trans);
962 if (icomp->material() ==
"CuHCAL") {
965 const TGeoBBox* HPadBox =
new TGeoBBox(
"HPadBox", pars[0], pars[1], pars[2]);
966 TGeoVolume* HPad =
new TGeoVolume(
"HPad", HPadBox, medium);
967 HPad->SetLineColor(kRed);
969 mSensitive.push_back(HPad->GetName());
970 TGeoTranslation* trans =
new TGeoTranslation(icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset);
971 volTower->AddNode(HPad, iCu, trans);
977 double BeamPipeRadius = 3.6;
978 double TowerHalfDiag = TMath::Sqrt2() * 0.5 * TowerSize;
979 double MinRadius = BeamPipeRadius + TowerHalfDiag;
993 for (Rows = 0; Rows < nTowersY; Rows++) {
995 float ColumnPos = 0.;
996 RowPos = Rows * TowerSize;
997 for (Columns = 0; Columns < nTowersX; Columns++) {
998 ColumnPos = Columns * TowerSize;
1000 TGeoTranslation* trans =
new TGeoTranslation(ColumnPos - SizeXHCAL / 2 + TowerSize / 2, RowPos - SizeYHCAL / 2 + TowerSize / 2, 0.);
1003 double RadialDistance = TMath::Power(ColumnPos - SizeXHCAL / 2 + TowerSize / 2, 2) + TMath::Power(RowPos - SizeYHCAL / 2 + TowerSize / 2, 2);
1005 if (RadialDistance < MinRadius * MinRadius) {
1010 volHCAL->AddNode(volTower, NumTowers, trans);
1015 LOG(info) <<
"Number of Towers is: " << (NumTowers - 1);
1019 TGeoBBox* alHcalBox =
new TGeoBBox(
"AlHCalBox", SizeXHCAL / 2.0, SizeYHCAL / 2.0, 0.5 / 2.0);
1020 TGeoVolume* volumeAlHcalBox =
new TGeoVolume(
"volAlHcalBox", alHcalBox, gGeoManager->GetMedium(
getMediumID(
ID_ALUMINIUM)));
1021 volumeAlHcalBox->SetLineColor(kOrange);
1023 TVirtualMC::GetMC()->Gspos(
"volAlHcalBox", 9999,
"FOCAL", 0.0, 0.0, +1.0 * mGeometry->
getFOCALSizeZ() / 2.0 + 1.0, 0,
"ONLY");
1026 TGeoVolume* volumeAlUnderBox =
new TGeoVolume(
"volAlUnderBox", alUnderBox, gGeoManager->GetMedium(
getMediumID(
ID_ALUMINIUM)));
1027 volumeAlUnderBox->SetLineColor(kOrange);
1029 TVirtualMC::GetMC()->Gspos(
"volAlUnderBox", 9999,
"FOCAL", 0.0, -1.0 * mGeometry->
getFOCALSizeY() / 2 - 10.5, 0.0, 0,
"ONLY");
1032 TGeoVolume* volFOCAL = gGeoManager->GetVolume(
"FOCAL");
1068 mSensitive.push_back(
"EMSC1");
1069 mSensitive.push_back(
"EMSC2");
1076 for (
auto& icomp : mGeoCompositions) {
1078 pars[0] = icomp->sizeX() / 2.;
1079 pars[1] = icomp->sizeY() / 2.;
1080 pars[2] = icomp->sizeZ() / 2.;
1083 if (icomp->material() ==
"PureW") {
1087 mSensitive.push_back(
"EW1");
1088 gGeoManager->GetVolume(
"EW1")->SetLineColor(kBlue);
1089 TVirtualMC::GetMC()->Gspos(
"EW1", icomp->id() + 1,
"EMSC1",
1090 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
1091 TVirtualMC::GetMC()->Gspos(
"EW1", icomp->id() + 1,
"EMSC2",
1092 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
1094 if (icomp->material() ==
"Alloy") {
1098 mSensitive.push_back(
"EW1");
1099 TVirtualMC::GetMC()->Gspos(
"EW1", icomp->id() + 1,
"EMSC1",
1100 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
1101 TVirtualMC::GetMC()->Gspos(
"EW1", icomp->id() + 1,
"EMSC2",
1102 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
1105 if (icomp->material() ==
"G10") {
1109 mSensitive.push_back(
"G10RO1");
1110 gGeoManager->GetVolume(
"G10RO1")->SetLineColor(kGreen);
1111 TVirtualMC::GetMC()->Gspos(
"G10RO1", icomp->id() + 1,
"EMSC1",
1112 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
1113 TVirtualMC::GetMC()->Gspos(
"G10RO1", icomp->id() + 1,
"EMSC2",
1114 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
1117 if (icomp->material() ==
"Cu") {
1121 mSensitive.push_back(
"EWCU");
1122 gGeoManager->GetVolume(
"EWCU")->SetLineColor(kViolet);
1123 TVirtualMC::GetMC()->Gspos(
"EWCU", icomp->id() + 1,
"EMSC1",
1124 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
1125 TVirtualMC::GetMC()->Gspos(
"EWCU", icomp->id() + 1,
"EMSC2",
1126 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
1129 if (icomp->material() ==
"Air") {
1133 mSensitive.push_back(
"EWAIR1");
1134 gGeoManager->GetVolume(
"EWAIR1")->SetLineColor(kGray);
1135 TVirtualMC::GetMC()->Gspos(
"EWAIR1", icomp->id() + 1,
"EMSC1",
1136 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
1137 TVirtualMC::GetMC()->Gspos(
"EWAIR1", icomp->id() + 1,
"EMSC2",
1138 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
1141 if (icomp->material() ==
"Ceramic") {
1145 mSensitive.push_back(
"EWAIR1");
1146 TVirtualMC::GetMC()->Gspos(
"EWAIR1", icomp->id() + 1,
"EMSC1",
1147 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
1148 TVirtualMC::GetMC()->Gspos(
"EWAIR1", icomp->id() + 1,
"EMSC2",
1149 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
1152 if (icomp->material() ==
"SiPad") {
1156 mSensitive.push_back(
"EWSIPAD1");
1157 gGeoManager->GetVolume(
"EWSIPAD1")->SetLineColor(kOrange - 7);
1158 int number = (icomp->id()) + (icomp->stack() << 12) + (icomp->layer() << 16);
1160 TVirtualMC::GetMC()->Gspos(
"EWSIPAD1", number + 1,
"EMSC1",
1161 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
1162 TVirtualMC::GetMC()->Gspos(
"EWSIPAD1", number + 1,
"EMSC2",
1163 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
1167 if (icomp->material() ==
"SiPix") {
1171 mSensitive.push_back(
"EWSIPIX1");
1172 gGeoManager->GetVolume(
"EWSIPIX1")->SetLineColor(kPink);
1174 int number = (icomp->id()) + (icomp->stack() << 12) + (icomp->layer() << 16);
1175 TVirtualMC::GetMC()->Gspos(
"EWSIPIX1", number + 1,
"EMSC1",
1177 TVirtualMC::GetMC()->Gspos(
"EWSIPIX1", number + 1,
"EMSC2",
1182 if (icomp->material() ==
"Si") {
1186 mSensitive.push_back(
"EWSI1");
1187 gGeoManager->GetVolume(
"EWSI1")->SetLineColor(kPink);
1188 TVirtualMC::GetMC()->Gspos(
"EWSI1", icomp->id() + 1,
"EMSC1",
1189 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
1190 TVirtualMC::GetMC()->Gspos(
"EWSI1", icomp->id() + 1,
"EMSC2",
1191 icomp->centerX(), icomp->centerY(), icomp->centerZ() -
offset, 0,
"ONLY");
1197 TGeoVolume* volumeColdPlate =
nullptr;
1201 volumeColdPlate =
new TGeoVolume(
"volColdPlate", coldPlateBox, gGeoManager->GetMedium(
getMediumID(
ID_COPPER)));
1204 volumeColdPlate =
new TGeoVolume(
"volColdPlate", coldPlateBox, gGeoManager->GetMedium(
getMediumID(
ID_ALUMINIUM)));
1206 volumeColdPlate =
new TGeoVolume(
"volColdPlate", coldPlateBox, gGeoManager->GetMedium(
getMediumID(
ID_AIR)));
1209 mSensitive.push_back(volumeColdPlate->GetName());
1210 volumeColdPlate->SetLineColor(kOrange);
1225 mSensitive.push_back(
"ECAL");
1230 TGeoVolume* volumeSiPad =
new TGeoVolume(
"volSiPad", siPadBox, gGeoManager->GetMedium(
getMediumID(
ID_SIPAD)));
1231 volumeSiPad->SetLineColor(kOrange + 7);
1234 mSensitive.push_back(volumeSiPad->GetName());
1238 int itowerx, itowery;
1253 TVirtualMC::GetMC()->Gspos(
"EMSC1", number + 1,
"ECAL", xp, yp, 0, 0,
"ONLY");
1256 TVirtualMC::GetMC()->Gspos(
"volSiPad", -1 * (number + 1),
"FOCAL", xp, yp, -1.0 * geom->
getFOCALSizeZ() / 2.0, 0,
"ONLY");
1258 mSensitive.push_back(
"volSiPad");
1261 mSensitive.push_back(
"volSiPad");
1269 TVirtualMC::GetMC()->Gspos(
"EMSC2", number + 1,
"ECAL", xp, yp, 0, 0,
"ONLY");
1272 TVirtualMC::GetMC()->Gspos(
"volSiPad", -1 * (number + 1),
"FOCAL", xp, yp, -1.0 * geom->
getFOCALSizeZ() / 2.0, 0,
"ONLY");
1274 mSensitive.push_back(
"volSiPad");
1277 mSensitive.push_back(
"volSiPad");