diff --git a/Detectors/ITSMFT/MFT/base/src/HalfCone.cxx b/Detectors/ITSMFT/MFT/base/src/HalfCone.cxx index 3660b21a0bdc3..f1e59ad91e063 100644 --- a/Detectors/ITSMFT/MFT/base/src/HalfCone.cxx +++ b/Detectors/ITSMFT/MFT/base/src/HalfCone.cxx @@ -11,7 +11,8 @@ /// \file HalfCone.cxx /// \brief Class building geometry of one half of one MFT half-cone /// \author sbest@pucp.pe, eric.endress@gmx.de, franck.manso@clermont.in2p3.fr -/// \date 15/12/2016 +/// \Carlos csoncco@pucp.edu.pe +/// \date 13/03/2019 #include "TGeoManager.h" #include "TGeoMatrix.h" @@ -25,6 +26,7 @@ #include "TGeoTube.h" #include "TGeoTrd1.h" #include "TMath.h" +#include "TGeoXtru.h" #include "MFTBase/HalfCone.h" @@ -48,382 +50,885 @@ TGeoVolumeAssembly* HalfCone::createHalfCone(Int_t half) auto* HalfConeVolume = new TGeoVolumeAssembly("HalfConeVolume"); - // Left Support Rail - auto* Half_0 = new TGeoVolumeAssembly("Half_0"); - TGeoMedium* kMedAlu = gGeoManager->GetMedium("MFT_Alu$"); - // Dimensions - - // Lower Piece (6 holes) - // Float_t Lower_x = 2.0; // to avoid overlap with disks, fm, largeur des barres horizontales - Float_t Lower_x = 1.6; - Float_t Lower_y = 1.15; - Float_t Lower_z = 10.7; - - // Middle Piece - // Float_t Middle_x = 2.0; // to avoid overlap with disks, fm - Float_t Middle_x = 1.6; - Float_t Middle_y = 1.15 + 0.00001; - Float_t Middle_z = 14.45; - - // Upper Piece (8 holes) - // Float_t Upper_x = 2.0; // to avoid overlap with disks, fm - Float_t Upper_x = 0.2; - Float_t Upper_y = 1.15; - Float_t Upper_z = 15.291; - - // Upper piece cut - Float_t Upper_cut_x = 4.0; - Float_t Upper_cut_y = 1.15; - Float_t Upper_cut_z = 3.0; - - // Lower piece cut - Float_t Lower_cut_x = 2.0; - Float_t Lower_cut_y = 1.15 + 0.0001; - Float_t Lower_cut_z = 0.6; - - // Trapezoid - Float_t trap_xmax = 2.2; - Float_t trap_xmin = 1.2; - Float_t trap_y = 1.15; - Float_t trap_z = 1.0; - - // Angle of the Middle Piece - auto* MiddleAngle = new TGeoRotation("MiddleAngle", 90., 40., 90.); - - // X distance from the center - Float_t z_Upper_distance = (Upper_z + 9.759) / 2.; // Upper z-length and the distance from Upper to Lower borders - Float_t z_Lower_distance = -(Lower_z + 9.759) / 2.; // Lower z-length and the distance from Upper to Lower borders - // Distance from upper to lower piece - Float_t UpperLowerDistance = 8.8; - - // Upper center Distance - auto* TUpper = new TGeoTranslation("TUpper", UpperLowerDistance / 2., 0., z_Upper_distance); - // Lower center Distance - auto* TLower = new TGeoTranslation("TLower", -UpperLowerDistance / 2., 0., z_Lower_distance); - // Lower cut distance coordinates - auto* TCutUpper = - new TGeoTranslation("TCutUpper", 4.0, .8 + 0.000001, (z_Upper_distance + Upper_z / 2.) + (Upper_cut_z / 2.) - 1.2); - // Upper cut distance coordinates - auto* TCutLower = - new TGeoTranslation("TCutLower", -4.4 - 1.5, 0., (z_Lower_distance + Lower_z / 2.) - (Lower_cut_z / 2.)); - // Trapezoid center Distance (the trapezoid for the upper piece is defined in two parts) - auto* TTrap_0 = new TGeoTranslation("TTrap_0", 2.9, 0., z_Upper_distance + Upper_z / 2. - (trap_xmax / 2.)); - auto* TTrap_1 = - new TGeoTranslation("TTrap_1", 2.9, 0., z_Upper_distance + Upper_z / 2. - (trap_xmax + trap_xmin) / 4.); - - // Rotations - auto* Ry90 = new TGeoRotation("Ry90", 90., 90., 90.); - - // Combined transformations for the trapezoid - auto* cTrap_0 = new TGeoCombiTrans(*TTrap_0, *Ry90); - auto* cTrap_1 = new TGeoCombiTrans(*TTrap_1, *Ry90); - - MiddleAngle->RegisterYourself(); - TUpper->RegisterYourself(); - TLower->RegisterYourself(); - TCutUpper->RegisterYourself(); - TCutLower->RegisterYourself(); - TTrap_0->RegisterYourself(); - TTrap_1->RegisterYourself(); - Ry90->RegisterYourself(); - cTrap_0->SetName("cTrap_0"); - cTrap_0->RegisterYourself(); - cTrap_1->SetName("cTrap_1"); - cTrap_1->RegisterYourself(); - - // Basic Forms for Half_0 - TGeoShape* Half_0_Upper = new TGeoBBox("Half_0_Upper", Upper_x / 2., Upper_y / 2., Upper_z / 2.); - TGeoShape* Half_0_Lower = new TGeoBBox("Half_0_Lower", Lower_x / 2., Lower_y / 2., Lower_z / 2.); - TGeoShape* Half_0_Middle = new TGeoBBox("Half_0_Middle", Middle_x / 2., Middle_y / 2., Middle_z / 2.); - TGeoShape* Half_0_Trap_0 = new TGeoTrd1("Half_0_Trap_0", trap_xmin / 2., trap_xmax / 2., trap_y / 2., trap_z / 2.); - TGeoShape* Half_0_Trap_1 = new TGeoBBox("Half_0_Trap_1", (trap_xmax + trap_xmin) / 4. + 0.00001, - trap_y / 2. + 0.00001, trap_z / 2. + 0.000001); - TGeoShape* Half_0_UpperCut = new TGeoBBox("Half_0_UpperCut", Upper_cut_x / 2., Upper_cut_y / 2., Upper_cut_z / 2.); - TGeoShape* Half_0_LowerCut = new TGeoBBox("Half_0_LowerCut", Lower_cut_x / 2., Lower_cut_y / 2., Lower_cut_z / 2.); - - // Composite shapes for Half_0 - auto* Half_0_Shape_0 = - new TGeoCompositeShape("Half_0_Shape_0", "Half_0_Middle:MiddleAngle+Half_0_Lower:TLower+Half_0_Upper:TUpper"); - auto* Half_0_Shape_1 = - new TGeoCompositeShape("Half_0_Shape_1", "Half_0_Shape_0+Half_0_Trap_0:cTrap_0+Half_0_Trap_1:cTrap_1"); - auto* Half_0_Shape_2 = - new TGeoCompositeShape("Half_0_Shape_2", "Half_0_Shape_1-(Half_0_UpperCut:TCutUpper+Half_0_LowerCut:TCutLower)"); - /* - //Holes - - Float_t hole_distance = 250.5-152.91; - - TGeoRotation *Rx90 = new TGeoRotation("Rx90",0.,90.,0.); - TGeoTranslation *THalf_0_Hole0 = new TGeoTranslation("THalf_0_Hole0",0.,0.,hole_distance-6.); - TGeoTranslation *THalf_0_Hole1 = new TGeoTranslation("THalf_0_Hole1",0.,0.,hole_distance-6.); - TGeoTranslation *THalf_0_Hole2 = new TGeoTranslation("THalf_0_Hole2",0.,0.,hole_distance-32.); - TGeoTranslation *THalf_0_Hole3 = new TGeoTranslation("THalf_0_Hole3",0.,0.,hole_distance-32.-13.5); - TGeoTranslation *THalf_0_Hole4 = new TGeoTranslation("THalf_0_Hole4",0.,0.,hole_distance-74.); - TGeoTranslation *THalf_0_Hole5 = new TGeoTranslation("THalf_0_Hole5",0.,0.,hole_distance-74.-13.5); - TGeoTranslation *THalf_0_Hole6 = new TGeoTranslation("THalf_0_Hole6",0.,0.,hole_distance-116.); - TGeoTranslation *THalf_0_Hole7 = new TGeoTranslation("THalf_0_Hole7",0.,0.,hole_distance-116.-13.5); - - TGeoTranslation *THalf_0_Hole8 = new TGeoTranslation("THalf_0_Hole8",0.,0.,0.); - TGeoTranslation *THalf_0_Hole9 = new TGeoTranslation("THalf_0_Hole9",0.,0.,0.); - TGeoTranslation *THalf_0_Hole10 = new TGeoTranslation("THalf_0_Hole10",0.,0.,0.); - TGeoTranslation *THalf_0_Hole11 = new TGeoTranslation("THalf_0_Hole11",0.,0.,0.); - TGeoTranslation *THalf_0_Hole12 = new TGeoTranslation("THalf_0_Hole12",0.,0.,0.); - TGeoTranslation *THalf_0_Hole13 = new TGeoTranslation("THalf_0_Hole13",0.,0.,0.); - - TGeoCombiTrans *cHalf_0_Hole0 = new TGeoCombiTrans(*THalf_0_Hole0, *Rx90); - TGeoCombiTrans *cHalf_0_Hole1 = new TGeoCombiTrans(*THalf_0_Hole1, *Rx90); - TGeoCombiTrans *cHalf_0_Hole2 = new TGeoCombiTrans(*THalf_0_Hole2, *Rx90); - TGeoCombiTrans *cHalf_0_Hole3 = new TGeoCombiTrans(*THalf_0_Hole3, *Rx90); - TGeoCombiTrans *cHalf_0_Hole4 = new TGeoCombiTrans(*THalf_0_Hole4, *Rx90); - TGeoCombiTrans *cHalf_0_Hole5 = new TGeoCombiTrans(*THalf_0_Hole5, *Rx90); - TGeoCombiTrans *cHalf_0_Hole6 = new TGeoCombiTrans(*THalf_0_Hole6, *Rx90); - TGeoCombiTrans *cHalf_0_Hole7 = new TGeoCombiTrans(*THalf_0_Hole7, *Rx90); - TGeoCombiTrans *cHalf_0_Hole8 = new TGeoCombiTrans(*THalf_0_Hole8, *Rx90); - TGeoCombiTrans *cHalf_0_Hole9 = new TGeoCombiTrans(*THalf_0_Hole9, *Rx90); - TGeoCombiTrans *cHalf_0_Hole10 = new TGeoCombiTrans(*THalf_0_Hole10, *Rx90); - TGeoCombiTrans *cHalf_0_Hole11 = new TGeoCombiTrans(*THalf_0_Hole11, *Rx90); - TGeoCombiTrans *cHalf_0_Hole12 = new TGeoCombiTrans(*THalf_0_Hole12, *Rx90); - TGeoCombiTrans *cHalf_0_Hole13 = new TGeoCombiTrans(*THalf_0_Hole13, *Rx90); - - cHalf_0_Hole0->SetName("cHalf_0_Hole0"); - cHalf_0_Hole1->SetName("cHalf_0_Hole1"); - cHalf_0_Hole2->SetName("cHalf_0_Hole2"); - cHalf_0_Hole3->SetName("cHalf_0_Hole3"); - cHalf_0_Hole4->SetName("cHalf_0_Hole4"); - cHalf_0_Hole5->SetName("cHalf_0_Hole5"); - cHalf_0_Hole6->SetName("cHalf_0_Hole6"); - cHalf_0_Hole7->SetName("cHalf_0_Hole7"); - cHalf_0_Hole8->SetName("cHalf_0_Hole8"); - cHalf_0_Hole9->SetName("cHalf_0_Hole9"); - cHalf_0_Hole10->SetName("cHalf_0_Hole10"); - cHalf_0_Hole11->SetName("cHalf_0_Hole11"); - cHalf_0_Hole12->SetName("cHalf_0_Hole12"); - cHalf_0_Hole13->SetName("cHalf_0_Hole13"); - - cHalf_0_Hole0->RegisterYourself(); - cHalf_0_Hole1->RegisterYourself(); - cHalf_0_Hole2->RegisterYourself(); - cHalf_0_Hole3->RegisterYourself(); - cHalf_0_Hole4->RegisterYourself(); - cHalf_0_Hole5->RegisterYourself(); - cHalf_0_Hole6->RegisterYourself(); - cHalf_0_Hole7->RegisterYourself(); - cHalf_0_Hole8->RegisterYourself(); - cHalf_0_Hole9->RegisterYourself(); - cHalf_0_Hole10->RegisterYourself(); - cHalf_0_Hole11->RegisterYourself(); - cHalf_0_Hole12->RegisterYourself(); - cHalf_0_Hole13->RegisterYourself(); - - Float_t Half_0_r0 = 4./2.; - Float_t Half_0_r1 = 5./2.; - Float_t Half_0_r2 = 6./2.; - Float_t Half_0_r3 = 6.5/2.; - - TGeoShape * Half_0_Hole0 = new TGeoTube("Half_0_Hole0",0.,Half_0_r3,Upper_y+0.00001); - TGeoShape * Half_0_Hole1 = new TGeoTube("Half_0_Hole1",0.,Half_0_r2,Upper_y+0.00001); - TGeoShape * Half_0_Hole2 = new TGeoTube("Half_0_Hole2",0.,Half_0_r1,Upper_y+0.00001); - TGeoShape * Half_0_Hole3 = new TGeoTube("Half_0_Hole3",0.,Half_0_r0,Upper_y+0.00001); - TGeoShape * Half_0_Hole4 = new TGeoTube("Half_0_Hole4",0.,Half_0_r1,Upper_y+0.00001); - TGeoShape * Half_0_Hole5 = new TGeoTube("Half_0_Hole5",0.,Half_0_r0,Upper_y+0.00001); - TGeoShape * Half_0_Hole6 = new TGeoTube("Half_0_Hole6",0.,Half_0_r1,Upper_y+0.00001); - TGeoShape * Half_0_Hole7 = new TGeoTube("Half_0_Hole7",0.,Half_0_r0,Upper_y+0.00001); - - TGeoShape * Half_0_Hole8 = new TGeoTube("Half_ -0_Hole8",0.,Half_0_r1,Lower_y+0.00001); - TGeoShape * Half_0_Hole9 = new TGeoTube("Half_0_Hole9",0.,Half_0_r0,Lower_y+0.00001); - TGeoShape * Half_0_Hole10 = new TGeoTube("Half_0_Hole10",0.,Half_0_r1,Lower_y+0.00001); - TGeoShape * Half_0_Hole11 = new TGeoTube("Half_0_Hole11",0.,Half_0_r0,Lower_y+0.00001); - TGeoShape * Half_0_Hole12 = new TGeoTube("Half_0_Hole12",0.,Half_0_r1,Lower_y+0.00001); - TGeoShape * Half_0_Hole13 = new TGeoTube("Half_0_Hole13",0.,Half_0_r0,Lower_y+0.00001); - - TGeoCompositeShape * Half_0_Holes = new -TGeoCompositeShape("Half_0_Holes","Half_0_Hole0:cHalf_0_Hole0+Half_0_Hole1:cHalf_0_Hole1+Half_0_Hole2:cHalf_0_Hole2+Half_0_Hole3:cHalf_0_Hole3+Half_0_Hole4:cHalf_0_Hole4+Half_0_Hole5:cHalf_0_Hole5+Half_0_Hole6:cHalf_0_Hole6+Half_0_Hole7:cHalf_0_Hole7+Half_0_Hole8:cHalf_0_Hole8+Half_0_Hole9:cHalf_0_Hole9+Half_0_Hole10:cHalf_0_Hole10+Half_0_Hole11:cHalf_0_Hole11+Half_0_Hole12:cHalf_0_Hole12+Half_0_Hole13:cHalf_0_Hole13"); - TGeoCompositeShape * Half_0_Shape_3 = new TGeoCompositeShape("Half_0_Shape_3","Half_0_Shape_2+Half_0_Holes"); - */ - auto* Half_0_Volume = new TGeoVolume("Half_0_Volume", Half_0_Shape_2, kMedAlu); - // Position of the piece relative to the origin which for this code is the center of the the Framework piece (See - // Half_2) - Half_0->AddNode(Half_0_Volume, 1, - new TGeoTranslation(25.6 - 5.4 - .05, -1.15 / 2. + 7.3 + .35, -34.55 / 2. - 4.591 / 2. - .25)); - - // Right Support Rail (the distances and rotations are the same, just mirrored with respect to the yz-plane) - // See the definition of the distances in the Half_0 piece - auto* Half_1 = new TGeoVolumeAssembly("Half_1"); - - // Angle of the Middle Piece - auto* MiddleAngle_inv = new TGeoRotation("MiddleAngle_inv", 90., -40., 90.); - - // X distance from the center - Float_t z_Upper_distance_inv = -(Upper_z + 9.759) / 2.; // Upper x-length and the distance from Upper to Lower borders - Float_t z_Lower_distance_inv = (Lower_z + 9.759) / 2.; // Lower x-length and the distance from Upper to Lower borders - - // Upper center Distance - auto* TUpper_inv = new TGeoTranslation("TUpper_inv", -4.4, 0., z_Upper_distance); - // Lower center Distance - auto* TLower_inv = new TGeoTranslation("TLower_inv", 4.4, 0., z_Lower_distance); - // Lower cut distance - auto* TCutUpper_inv = new TGeoTranslation("TCutUpper_inv", -4.0, .8 + 0.000001, - (z_Upper_distance + Upper_z / 2.) + (Upper_cut_z / 2.) - 1.2); - // Upper cut distance - auto* TCutLower_inv = - new TGeoTranslation("TCutLower_inv", 4.4 + 1.5, 0., (z_Lower_distance + Lower_z / 2.) - (Lower_cut_z / 2.)); - // Trapezoid center Distance (the trapezoid for the upper piece is defined in two parts) - auto* TTrap_0_inv = new TGeoTranslation("TTrap_0_inv", -2.9, 0., z_Upper_distance + Upper_z / 2. - (trap_xmax / 2.)); - auto* TTrap_1_inv = - new TGeoTranslation("TTrap_1_inv", -2.9, 0., z_Upper_distance + Upper_z / 2. - (trap_xmax + trap_xmin) / 4.); - - // Rotations - auto* Ry90_inv = new TGeoRotation("Ry90_inv", 90., -90., 90.); - - // Combined transformations for the trapezoid - auto* cTrap_0_inv = new TGeoCombiTrans(*TTrap_0_inv, *Ry90_inv); - auto* cTrap_1_inv = new TGeoCombiTrans(*TTrap_1_inv, *Ry90_inv); - - MiddleAngle_inv->RegisterYourself(); - TUpper_inv->RegisterYourself(); - TLower_inv->RegisterYourself(); - TCutUpper_inv->RegisterYourself(); - TCutLower_inv->RegisterYourself(); - TTrap_0_inv->RegisterYourself(); - TTrap_1_inv->RegisterYourself(); - Ry90_inv->RegisterYourself(); - cTrap_0_inv->SetName("cTrap_0_inv"); - cTrap_0_inv->RegisterYourself(); - cTrap_1_inv->SetName("cTrap_1_inv"); - cTrap_1_inv->RegisterYourself(); - - // Composite shapes for Half_1 - auto* Half_1_Shape_0 = new TGeoCompositeShape( - "Half_1_Shape_0", "Half_0_Middle:MiddleAngle_inv+Half_0_Lower:TLower_inv+Half_0_Upper:TUpper_inv"); - auto* Half_1_Shape_1 = - new TGeoCompositeShape("Half_1_Shape_1", "Half_1_Shape_0+Half_0_Trap_0:cTrap_0_inv+Half_0_Trap_1:cTrap_1_inv"); - auto* Half_1_Shape_2 = new TGeoCompositeShape( - "Half_1_Shape_2", "Half_1_Shape_1-(Half_0_UpperCut:TCutUpper_inv+Half_0_LowerCut:TCutLower_inv)"); - - auto* Half_1_Volume = new TGeoVolume("Half_1_Volume", Half_1_Shape_2, kMedAlu); - // Position of the piece relative to the origin which for this code is the center of the the Framework piece (See - // Half_2) - Half_1->AddNode(Half_1_Volume, 1, - new TGeoTranslation(-25.6 + 5.4 + .05, -1.15 / 2. + 7.3 + .35, -34.55 / 2. - 4.591 / 2. - .25)); + // Rotation + TGeoRotation* rot1 = new TGeoRotation("rot1", 180, -180, 0); + + rot1->RegisterYourself(); + TGeoRotation* rot2 = new TGeoRotation("rot2", 90, -90, 0); + rot2->RegisterYourself(); + + TGeoRotation* rot3 = new TGeoRotation("rot3", 0, 90, 0); + rot3->RegisterYourself(); + + TGeoRotation* rot_90x = new TGeoRotation("rot_90x", 0, -90, 0); // half0 + rot_90x->RegisterYourself(); + + TGeoRotation* rot_base = new TGeoRotation("rot_base", 180, 180, 0); // rail_r + rot_base->RegisterYourself(); + + TGeoCombiTrans* combi1 = new TGeoCombiTrans(0, -10.3, 1.29, rot1); // y=-10.80 belt + combi1->RegisterYourself(); + TGeoCombiTrans* combi2 = new TGeoCombiTrans(-16.8, 0., 0., rot2); + combi2->RegisterYourself(); + + TGeoRotation* r0 = new TGeoRotation("r0", 10., 0., 0.); + r0->RegisterYourself(); + + // 1st piece Cross_beam_MB0 + + auto* Cross_mb0 = new TGeoVolumeAssembly("Cross_mb0"); + + // rectangular box + Double_t x_boxmb0 = 14.4; // dx= 7.2 cm + Double_t y_boxmb0 = 0.6; + Double_t z_boxmb0 = 0.6; + + ///// holes tub 1hole tranversal + Double_t radin_1hmb0 = 0.; + Double_t radout_1hmb0 = 0.175; // diameter 3.5 H9 (0.35cm) + Double_t high_1hmb0 = 0.7; + + TGeoRotation* rot_1hole_mb0 = new TGeoRotation("rot_1hole_mb0", 0, 90, 0); + rot_1hole_mb0->RegisterYourself(); + // h= hole + TGeoCombiTrans* acombi_1h_mb0 = new TGeoCombiTrans(5.2, 0, 0, rot_1hole_mb0); + acombi_1h_mb0->SetName("acombi_1h_mb0"); + acombi_1h_mb0->RegisterYourself(); + TGeoCombiTrans* bcombi_1h_mb0 = new TGeoCombiTrans(-5.2, 0, 0, rot_1hole_mb0); //y= + bcombi_1h_mb0->SetName("bcombi_1h_mb0"); + bcombi_1h_mb0->RegisterYourself(); + + // 2hole coaxial + Double_t radin_2hmb0 = 0.; + Double_t radout_2hmb0 = 0.15; // diameter M3 + Double_t high_2hmb0 = 1.2; // 12 + + TGeoRotation* rot_2hole_mb0 = new TGeoRotation("rot_2hole_mb0", 90, 90, 0); + rot_2hole_mb0->SetName("rot_2hole_mb0"); + rot_2hole_mb0->RegisterYourself(); + + TGeoCombiTrans* combi_2hole_mb0 = new TGeoCombiTrans(6.7, 0, 0, rot_2hole_mb0); + combi_2hole_mb0->SetName("combi_2hole_mb0"); + combi_2hole_mb0->RegisterYourself(); + + TGeoCombiTrans* combi_2hole_mb0_b = new TGeoCombiTrans(-6.7, 0, 0, rot_2hole_mb0); //y= + combi_2hole_mb0_b->SetName("combi_2hole_mb0_b"); + combi_2hole_mb0_b->RegisterYourself(); + + // shape for cross_mb0.. + // TGeoShape* box_mb0 = new TGeoBBox("s_box_mb0", x_boxmb0 / 2, y_boxmb0 / 2, z_boxmb0 / 2); + new TGeoBBox("box_mb0", x_boxmb0 / 2, y_boxmb0 / 2, z_boxmb0 / 2); + new TGeoTube("hole1_mb0", radin_1hmb0, radout_1hmb0, high_1hmb0 / 2); + new TGeoTube("hole2_mb0", radin_2hmb0, radout_2hmb0, high_2hmb0 / 2); + + ///composite shape for mb0 + + auto* c_mb0_Shape_0 = new TGeoCompositeShape("c_mb0_Shape_0", "box_mb0 - hole1_mb0:acombi_1h_mb0 - hole1_mb0:bcombi_1h_mb0 - hole2_mb0:combi_2hole_mb0 - hole2_mb0:combi_2hole_mb0_b"); + + auto* cross_mb0_Volume = new TGeoVolume("cross_mb0_Volume", c_mb0_Shape_0, kMedAlu); + + Cross_mb0->AddNode(cross_mb0_Volume, 1); + + // 2nd piece cross beam MFT (cbeam) + + auto* Cross_mft = new TGeoVolumeAssembly("Cross_mft"); + + // using the same "box" of the 1 piece + // 2hole coaxial + Double_t radin_hole_cbeam = 0.; + Double_t radout_hole_cbeam = 0.15; // diameter M3 + Double_t high_hole_cbeam = 0.91; // + + // same rotation in tub aximatAl "rot_2hole_mb0" - // Framework - auto* Half_2 = new TGeoVolumeAssembly("Half_2"); + TGeoCombiTrans* combi_hole_1cbeam = new TGeoCombiTrans(6.8, 0, 0, rot_2hole_mb0); + combi_hole_1cbeam->SetName("combi_hole_1cbeam"); + combi_hole_1cbeam->RegisterYourself(); - // Definitions - Float_t Framework_rmin = 23.6; - Float_t Framework_rmax = 30.3; - Float_t Framework_z = .6; + TGeoCombiTrans* combi_hole_2cbeam = new TGeoCombiTrans(-6.8, 0, 0, rot_2hole_mb0); + combi_hole_2cbeam->SetName("combi_hole_2cbeam"); + combi_hole_2cbeam->RegisterYourself(); + + // shape for shape cross beam + + new TGeoTube("hole_cbeam", radin_hole_cbeam, radout_hole_cbeam, high_hole_cbeam / 2); + + // composite shape for cross beam (using the same box of mb0) + auto* c_cbeam_Shape = new TGeoCompositeShape("c_cbeam_Shape", "box_mb0 - hole_cbeam:combi_hole_1cbeam - hole_cbeam:combi_hole_2cbeam"); + + auto* Cross_mft_Volume = new TGeoVolume("Cross_mft_Volume", c_cbeam_Shape, kMedAlu); + + Cross_mft->AddNode(Cross_mft_Volume, 1); + + // 3th piece Framework front + + auto* Fra_front = new TGeoVolumeAssembly("Fra_front"); + auto* Fra_front_L = new TGeoVolumeAssembly("Fra_front_L"); + auto* Fra_front_R = new TGeoVolumeAssembly("Fra_front_R"); + + Double_t x_box_up = 0.6; // cm + Double_t y_box_up = 0.605; + Double_t z_box_up = 2.84; + // hole up + Double_t dia_tub_up = 0.35; + Double_t high_tub_up = 0.65; + // hole down + Double_t dia_tubdown = 0.35; + Double_t high_tubdown = 0.68; + // + Double_t x_boxA_down = 0.8; + Double_t y_boxA_down = 0.6; + Double_t z_boxA_down = 0.6; + + Double_t x_boxB_down = 0.6; + Double_t y_boxB_down = 0.605; + Double_t z_boxB_down = 1.26; // 12.6 + // seg tub + Double_t radin_segtub = 16.9; + Double_t radout_segtub = 17.5; + Double_t high_segtub = 0.6; + Double_t ang_in_segtub = 212.1; + Double_t ang_fin_segtub = 241.92; // + + // trans. rot. + TGeoCombiTrans* combi_3a = new TGeoCombiTrans(-7.4, 0, 8.975, rot2); + combi_3a->SetName("combi_3a"); + combi_3a->RegisterYourself(); + + TGeoTranslation* tr1_up = new TGeoTranslation("tr1_up", -7.4, 0, 8.28); // + + tr1_up->RegisterYourself(); + + TGeoTranslation* tr1_tub1 = new TGeoTranslation("tr1_tub1", 0, 0., 3.075); + tr1_tub1->RegisterYourself(); + + TGeoCombiTrans* combi_3b = new TGeoCombiTrans(7.118, 0, 16.16, rot3); + combi_3b->SetName("combi_3b"); + combi_3b->RegisterYourself(); + + TGeoTranslation* tr_2_box = new TGeoTranslation("tr_2_box", -0.4, 0, 0.7); + tr_2_box->RegisterYourself(); + + TGeoTranslation* tr3_box = new TGeoTranslation("tr3_box", -1.1, 0, 0.63); + tr3_box->RegisterYourself(); + + TGeoTranslation* tr_tubdown = new TGeoTranslation("tr_tubdown", -0.4, 0, 0.7); + tr_tubdown->RegisterYourself(); + + // shape for framewor front + + new TGeoBBox("box_up", x_box_up / 2, y_box_up / 2, z_box_up / 2); + + new TGeoTube("tub_up", 0., dia_tub_up / 2, high_tub_up / 2); // + new TGeoTubeSeg("seg_tub", radin_segtub, radout_segtub, high_segtub / 2, ang_in_segtub, ang_fin_segtub); + + new TGeoBBox("boxB_down", x_boxB_down / 2, y_boxB_down / 2, z_boxB_down / 2); + + new TGeoBBox("boxA_down", x_boxA_down / 2, y_boxA_down / 2, z_boxA_down / 2); + + new TGeoTube("tubdown", 0., dia_tubdown / 2, high_tubdown / 2); + + // Composite shapes for Fra_front + new TGeoCompositeShape("fra_front_Shape_0", "box_up:tr1_up + seg_tub:combi_3b + boxB_down:tr3_box + boxA_down:tr_2_box"); + + auto* fra_front_Shape_1 = new TGeoCompositeShape("fra_front_Shape_1", "fra_front_Shape_0 - tubdown:tr_tubdown - tub_up:combi_3a"); + + TGeoRotation* rot_z180x90 = new TGeoRotation("rot_z180x90", 180, 90, 0); //half0_R + rot_z180x90->RegisterYourself(); + + TGeoRotation* rot_halfR = new TGeoRotation("rot_halfR", 180, 180, 0); // half0_R + rot_halfR->RegisterYourself(); + TGeoCombiTrans* combi_front_L = new TGeoCombiTrans(-7.1, -16.2, 32.5 + 0.675, rot_90x); // x=7.35, y=0, z=15.79 + combi_front_L->SetName("combi_front_L"); + combi_front_L->RegisterYourself(); + + TGeoCombiTrans* combi_front_R = new TGeoCombiTrans(7.1, -16.2, 32.5 + 0.675, rot_z180x90); //x=7.35, y=0, z=15.79 + combi_front_R->SetName("combi_front_R"); + combi_front_R->RegisterYourself(); + + // auto * fra_front_Shape_3 = new TGeoCompositeShape("fra_front_Shape_3","fra_front_Shape_2:rot_halfR "); + + auto* Fra_front_Volume = new TGeoVolume("Fra_front_Volume", fra_front_Shape_1, kMedAlu); + + Fra_front_L->AddNode(Fra_front_Volume, 1, combi_front_L); + Fra_front_R->AddNode(Fra_front_Volume, 1, combi_front_R); + + Fra_front->AddNode(Fra_front_L, 1); + Fra_front->AddNode(Fra_front_R, 2); + + // 4th piece "BASE" framework half support + + auto* base = new TGeoVolumeAssembly("base"); + + // seg tub disc + Double_t radin_disc = 23.6; + Double_t radout_disc = 30.3; + Double_t high_disc = 1.35; + Double_t ang_in_disc = 180; + Double_t ang_fin_disc = 360; + + // holes tub 1hole tranversal o3.5 + Double_t radin_holeB = 0.; + Double_t radout_holeB = 0.175; // diameter 3.5 H11 + Double_t high_holeB = 1.5; + TGeoTranslation* tr1_holeB = new TGeoTranslation("tr1_holeB", -7.5, -28.8, 0); + tr1_holeB->RegisterYourself(); + + TGeoTranslation* tr2_holeB = new TGeoTranslation("tr2_holeB", 7.5, -28.8, 0); + tr2_holeB->RegisterYourself(); + + // box 1 + Double_t x_1box = 61.0; + Double_t y_1box = 13.0; + Double_t z_1box = 1.4; + // box 2 + Double_t x_2box = 51.2; + Double_t y_2box = 14.6; + Double_t z_2box = 1.4; + // box 3 + Double_t x_3box = 45.1; + Double_t y_3box = 23.812; + Double_t z_3box = 1.4; + // seg tub hole + Double_t radin_1hole = 29.3; + Double_t radout_1hole = 30.3; + Double_t high_1hole = 1.4; + Double_t ang_in_1hole = 205; + Double_t ang_fin_1hole = 225; + // seg tub 2 hole + Double_t radin_2hole = 23.0; + Double_t radout_2hole = 25.5; + Double_t high_2hole = 1.4; + Double_t ang_in_2hole = 207.83; + Double_t ang_fin_2hole = 249.998; + // seg tub 3 ARC central xy SEG_3ARC U + Double_t radin_3hole = 25.5; + Double_t radout_3hole = 27.5; + Double_t high_3hole = 1.35; + Double_t ang_in_3hole = 255.253; + Double_t ang_fin_3hole = 284.746; + // hole central down |_| since x=-70 to 0 + Double_t xc_box = 7.0; + Double_t yc_box = 5.772; + Double_t zc_box = 1.4; + + TGeoTranslation* tr_cbox = new TGeoTranslation("tr_cbox", -xc_box / 2, -radout_disc + 0.888, 0); + tr_cbox->RegisterYourself(); + // box 4 lamine 1 + Double_t x_labox = 60.0; + Double_t y_labox = 30.3; + Double_t z_labox = 0.305; + TGeoTranslation* tr_la = new TGeoTranslation("tr_la", 0, -y_labox / 2 - 9.3, high_disc / 2); + tr_la->RegisterYourself(); + + // box 5 lamin 2 + Double_t x_2labox = 51.2; + Double_t y_2labox = 2.8; // C-B + Double_t z_2labox = 0.303; + TGeoTranslation* tr_2la = new TGeoTranslation("tr_2la", 0, -8.1, high_disc / 2); // + tr_2la->RegisterYourself(); + + // circular border C SEG_BORD + // seg tub 3 xy + Double_t radin_bord = 0.5; + Double_t radout_bord = 0.9; // + Double_t high_bord = 1.355; // 13.5 + Double_t ang_in_bord = 0; + Double_t ang_fin_bord = 90; + // TGeoRotation *rot_bord1 = new TGeoRotation("rot_bord1", ang_in_1hole +0.0167,0,0); + TGeoRotation* rot1_bord1 = new TGeoRotation("rot1_bord1", 14.8, 0, 0); + rot1_bord1->RegisterYourself(); + TGeoCombiTrans* combi_bord1 = new TGeoCombiTrans(-26.7995, -13.0215, 0, rot1_bord1); // y= + combi_bord1->SetName("combi_bord1"); + combi_bord1->RegisterYourself(); + + TGeoRotation* rot2_bord1 = new TGeoRotation("rot2_bord1", -50, 0, 0); + rot2_bord1->RegisterYourself(); + TGeoCombiTrans* combi2_bord1 = new TGeoCombiTrans(-21.3795, -20.7636, 0, rot2_bord1); // y= + combi2_bord1->SetName("combi2_bord1"); + combi2_bord1->RegisterYourself(); // - Float_t Framework_Bottom_z = 1.35; - - // Holes definition - - // Radii - Float_t Hole_rmin_0 = 25.5; - Float_t Hole_rmax_0 = 28.0; - Float_t Hole_rmax_1 = 27.5; - Float_t Hole_rmin_2 = 29.0; - Float_t Hole_z = 1.8; - - // Angles - Float_t Framework_Angle = 12.3838; - // Holes maximum and minimum angles - Float_t angle_0_min = 20.; - Float_t angle_0_max = 70.; - Float_t angle_1_min = 80.; - Float_t angle_1_max = 100.; - Float_t angle_2_min = 110.; - Float_t angle_2_max = 160.; - Float_t angle_3_min = 75.; - Float_t angle_3_max = 105.; - // Middle step - Float_t Step_Angle = 2.; - - // Translations - // Distances for the cuts of the upper central hole. - auto* tHole3 = new TGeoTranslation("tHole3", 8.0, 30., 0.); - auto* tHole3m = new TGeoTranslation("tHole3m", -8.0, 30., 0.); - // Distances for the bottom and bottom limit cuts. - auto* tLimit = new TGeoTranslation("tLimit", 0., 9.3 + 6.5, - -(Framework_z + Hole_z + 2.) / 2. - 0.00001); // Half the y-direction of the box - auto* tLimit_2 = new TGeoTranslation("tLimit_2", 0., 9.3, - (Framework_z + Hole_z + 2.) / 2. - 0.00001); // Half the y-direction of the box - auto* tLimitm = new TGeoTranslation("tLimitm", 0., 9.3 + 6.5, - (Framework_z + Hole_z + 2.) / 2. + 0.00001); // Half the y-direction of the box - auto* tBottom = new TGeoTranslation("tBottom", 0., 0., -.175); - // Distance for the steps - auto* tStep_0 = new TGeoTranslation("tStep_0", 0., 0., -.3); - auto* tStep_1 = new TGeoTranslation("tStep_1", 0., 0., .15 / 2.); - - tHole3m->RegisterYourself(); - tHole3->RegisterYourself(); - tLimit->RegisterYourself(); - tLimit_2->RegisterYourself(); - tLimitm->RegisterYourself(); - tBottom->RegisterYourself(); - tStep_0->RegisterYourself(); - tStep_1->RegisterYourself(); - - // Basic shapes for Half_2 - - TGeoShape* Framework = new TGeoTubeSeg("Framework", Framework_rmin, Framework_rmax, Framework_z / 2., Framework_Angle, - 180. - Framework_Angle); - // This are the elevations at the ends of the framework arc, this number (15) doesn't matter, it just has to be big - // enough for the cut. - TGeoShape* Framework_Bottom_0 = new TGeoTubeSeg("Framework_Bottom_0", Framework_rmin, Framework_rmax, - Framework_Bottom_z / 2., Framework_Angle, 15. + Framework_Angle); - // Same for the 165 here. - TGeoShape* Framework_Bottom_1 = - new TGeoTubeSeg("Framework_Bottom_1", Framework_rmin, Framework_rmax, Framework_Bottom_z / 2., - 165. - Framework_Angle, 180. - Framework_Angle); - // This is the elevation at the center of the framework arc. The extra in the z-length is the length of the steps. - TGeoShape* Framework_Step_0 = new TGeoTubeSeg("Framework_Step_0", Hole_rmax_1, Framework_rmax, - (Framework_z + .6) / 2. + 0.00001, 90. - Step_Angle, 90. + Step_Angle); - TGeoShape* Framework_Step_1 = new TGeoTubeSeg("Framework_Step_1", Hole_rmax_1, Hole_rmin_2, - (Framework_z + .15) / 2. + 0.00001, 90. - Step_Angle, 90. + Step_Angle); - // This three are the holes in the framework arc - TGeoShape* Hole_Framework_0 = - new TGeoTubeSeg("Hole_Framework_0", Hole_rmin_0, Hole_rmax_0, Hole_z / 2., angle_0_min, angle_0_max); - TGeoShape* Hole_Framework_1 = - new TGeoTubeSeg("Hole_Framework_1", Hole_rmin_0, Hole_rmax_1, Hole_z / 2., angle_1_min, angle_1_max); - TGeoShape* Hole_Framework_2 = - new TGeoTubeSeg("Hole_Framework_2", Hole_rmin_0, Hole_rmax_0, Hole_z / 2., angle_2_min, angle_2_max); - - // This is the hole in the upper middle of the framework arc (the .005 is to make a good cut) - TGeoShape* Hole_Framework_3 = - new TGeoTubeSeg("Hole_Framework_3", Hole_rmin_2, Framework_rmax + .005, Hole_z / 2., angle_3_min, angle_3_max); - // The upper central hole is not just an arc, its limits are straigth lines. - TGeoShape* Hole3_Limit = new TGeoBBox("Hole3_Limit", 2. / 2., 5. / 2., (Hole_z + 0.0001) / 2.); - // This are the cuts for the bottom parts of the framework. - TGeoShape* Framework_Limit_0 = new TGeoBBox("Framework_Limit_0", 60. / 2., 13. / 2., Hole_z / 2. + 1.); - TGeoShape* Framework_Limit_1 = new TGeoBBox("Framework_Limit_1", 51.2 / 2., 14.6 / 2., Hole_z / 2. + 1.); - - // Composite shapes for Half_2 - // The first term is the framework arc and the bottom limits - // The second term is the three other holes in the arc. - // The third term is just the upper center hole. I also include here the limits to shape the ends of the framework - // arc. - // This can be done with smaller pieces, but more of them. I don't know which is better. - auto* Half_2_Shape_0 = - new TGeoCompositeShape("Half_2_Shape_0", "Hole_Framework_3-(Hole3_Limit:tHole3m+Hole3_Limit:tHole3)"); - auto* Half_2_Shape_1 = new TGeoCompositeShape("Half_2_Shape_1", - "(Framework+Framework_Bottom_0:tBottom+Framework_Bottom_1:tBottom) - " - "(Hole_Framework_0+Hole_Framework_1+Hole_Framework_2)-(Half_2_Shape_0+" - "Framework_Limit_1:tLimit_2+Framework_Limit_0:tLimit+Framework_Limit_0:" - "tLimitm+Framework_Limit_0+Framework_Limit_1) "); - // Add square behind the step in the middle - auto* Half_2_Shape_2 = - new TGeoCompositeShape("Half_2_Shape_2", "Half_2_Shape_1+Framework_Step_0:tStep_0+Framework_Step_1:tStep_1"); - - auto* Half_2_Volume = new TGeoVolume("Half_2_Volume", Half_2_Shape_2, kMedAlu); - - Half_2->AddNode(Half_2_Volume, 1, new TGeoTranslation(0., 0., 0.)); - - // Shell - // This piece is not coded exactly, + TGeoRotation* rot1_bord2 = new TGeoRotation("rot1_bord2", 250, 0, 0); + rot1_bord2->RegisterYourself(); + TGeoCombiTrans* combi1_bord2 = new TGeoCombiTrans(-9.0527, -23.3006, 0, rot1_bord2); // y= + combi1_bord2->SetName("combi1_bord2"); + combi1_bord2->RegisterYourself(); + // e|°____°| + TGeoRotation* rot_cent_bord = new TGeoRotation("rot_cent_bord", 90, 0, 0); + rot_cent_bord->RegisterYourself(); + TGeoCombiTrans* combi_cent_bord = new TGeoCombiTrans(-6.5, -27.094, 0, rot_cent_bord); // y= + combi_cent_bord->SetName("combi_cent_bord"); + combi_cent_bord->RegisterYourself(); + // box tonge + Double_t x_tong = 2.0; + Double_t y_tong = 2.81; + Double_t z_tong = 1.35; + TGeoTranslation* tr_tong = new TGeoTranslation("tr_tong", 0, -28.6, 0); // + tr_tong->RegisterYourself(); + // circular central hole1 to conexion with other parts + Double_t radin_hole1 = 0; + Double_t radout_hole1 = 0.4; + Double_t high_hole1 = 1.36; + TGeoTranslation* tr_hole1 = new TGeoTranslation("tr_hole1", 0, -28.0, 0); // tonge + tr_hole1->RegisterYourself(); + + TGeoTranslation* tr2_hole1 = new TGeoTranslation("tr2_hole1", -26.5, -8.5, 0); // left + tr2_hole1->RegisterYourself(); + + TGeoTranslation* tr3_hole1 = new TGeoTranslation("tr3_hole1", 26.5, -8.5, 0); // right + tr3_hole1->RegisterYourself(); + + // circular hole2 ; hole2 r=6.7 + Double_t radin_hole2 = 0; + Double_t radout_hole2 = 0.335; // diameter 6.7 + Double_t high_hole2 = 1.36; // 13.5 + TGeoTranslation* tr1_hole2 = new TGeoTranslation("tr1_hole2", -28.0, -8.5, 0); // + tr1_hole2->RegisterYourself(); + + TGeoTranslation* tr2_hole2 = new TGeoTranslation("tr2_hole2", 28.0, -8.5, 0); // + tr2_hole2->RegisterYourself(); + + //////////// hole "0" two tubs together + Double_t radin_T1 = 0.325; // diam 0.65cm + Double_t radout_T1 = 0.55; // dia 1.1 + Double_t high_T1 = 1.2; // dz 6 + + Double_t radin_T2 = 0; + Double_t radout_T2 = 1.1; + Double_t high_T2 = 1.2; // dz 6 + + // shape for base + + new TGeoTubeSeg("disc", radin_disc, radout_disc, high_disc / 2, ang_in_disc, ang_fin_disc); + + new TGeoBBox("box1", x_1box / 2, y_1box / 2, z_1box / 2); + new TGeoBBox("box2", x_2box / 2, y_2box / 2, z_2box / 2); + new TGeoBBox("box3", x_3box / 2, y_3box / 2, z_3box / 2); + new TGeoBBox("labox1", x_labox / 2, y_labox / 2, z_labox / 2); + new TGeoBBox("labox2", x_2labox / 2, y_2labox / 2, z_2labox / 2); + new TGeoBBox("cbox", xc_box / 2, yc_box / 2, zc_box / 2); + new TGeoBBox("tongbox", x_tong / 2, y_tong / 2, z_tong / 2); + + new TGeoTubeSeg("seg_1hole", radin_1hole, radout_1hole, high_1hole / 2, ang_in_1hole, ang_fin_1hole); // r_in,r_out,dZ,ang,ang + new TGeoTubeSeg("seg_2hole", radin_2hole, radout_2hole, high_2hole / 2, ang_in_2hole, ang_fin_2hole); + new TGeoTubeSeg("seg_3hole", radin_3hole, radout_3hole, high_3hole / 2, ang_in_3hole, ang_fin_3hole); // y|u| + new TGeoTubeSeg("seg_bord", radin_bord, radout_bord, high_bord / 2, ang_in_bord, ang_fin_bord); + + new TGeoTube("circ_hole1", radin_hole1, radout_hole1, high_hole1 / 2); + + new TGeoTube("circ_hole2", radin_hole2, radout_hole2, high_hole2 / 2); + + new TGeoTube("circ_holeB", radin_holeB, radout_holeB, high_holeB / 2); + + // composite shape for base + + new TGeoCompositeShape("base_Shape_0", " disc - box1 - box2 - box3 - circ_holeB:tr1_holeB - circ_holeB:tr2_holeB"); + new TGeoCompositeShape("base_Shape_1", "(seg_1hole - seg_bord:combi_bord1 - seg_bord:combi2_bord1) + seg_2hole -seg_bord:combi1_bord2 + cbox:tr_cbox"); + + new TGeoCompositeShape("base_Shape_2", " seg_3hole + seg_bord:combi_cent_bord"); // seg_bord:combi_cent_bord + + new TGeoCompositeShape("base_Shape_3", " labox1:tr_la + labox2:tr_2la "); + + auto* base_Shape_4 = new TGeoCompositeShape("base_Shape_4", "base_Shape_0 - base_Shape_1 - base_Shape_1:rot1 + base_Shape_2 + tongbox:tr_tong - circ_hole1:tr_hole1 - circ_hole1:tr2_hole1 - circ_hole1:tr3_hole1 - circ_hole2:tr1_hole2 - circ_hole2:tr2_hole2 - base_Shape_3 "); + + // auto * base_Shape_5 = new TGeoCompositeShape("base_Shape_5","disc-box1 -box2 -box3 -seg_1hole -seg_2hole +seg_3hole -seg_1hole:rot1-seg_2hole:rot1 - cbox:tr_cbox - labox:tr_la - labox2:tr_2la + seg_bord "); + + // auto * base0_Volume = new TGeoVolume("base0_Volume",base_Shape_0,kMedAlu); + // auto * base1_Volume = new TGeoVolume("base1_Volume",base_Shape_1,kMedAlu); + // auto * base2_Volume = new TGeoVolume("base2_Volume",base_Shape_2,kMedAlu); + // auto * base3_Volume = new TGeoVolume("base3_Volume",base_Shape_3,kMedAlu); + + auto* base4_Volume = new TGeoVolume("base4_Volume", base_Shape_4, kMedAlu); + + base->AddNode(base4_Volume, 2, rot_base); + // base->AddNode(base4_Volume,2); + + // 5th piece MIDLE Framework midle + + auto* midle = new TGeoVolumeAssembly("Midle"); + auto* midle_L = new TGeoVolumeAssembly("Midle_L"); + auto* midle_R = new TGeoVolumeAssembly("Midle_R"); + + // box up to quit and to join + Double_t x_midle = 0.8; //dx=4 + Double_t y_midle = 3.495; //y=34.9 + Double_t z_midle = 0.62; //z=6 + // tr1 to join with arc + TGeoTranslation* tr1_midle_box = new TGeoTranslation("tr1_midle_box", -14.4, -0.745, 0); // -152,-17.45,0 + tr1_midle_box->RegisterYourself(); + // tr2 to quiet + TGeoTranslation* tr2_midle_box = new TGeoTranslation("tr2_midle_box", -15.2, -0.745, 0); // -152,-17.45,0 + tr2_midle_box->RegisterYourself(); + + // box down_1 + Double_t x_midle_d1box = 0.4; // dx=4 + Double_t y_midle_d1box = 0.28; + Double_t z_midle_d1box = 0.66; + TGeoTranslation* tr_midle_d1box = new TGeoTranslation("tr_midle_d1box", -7.3, -11.96, 0.); // 81 + tr_midle_d1box->RegisterYourself(); + + // box down_2 + Double_t x_midle_d2box = 0.8; // dx=4 + Double_t y_midle_d2box = 1.0; + Double_t z_midle_d2box = 0.66; // + TGeoTranslation* tr_midle_d2box = new TGeoTranslation("tr_midle_d2box", -7.5, -12.6249, 0); // 81 + tr_midle_d2box->RegisterYourself(); + + // arc circ part + Double_t radin_midle = 14.0; + Double_t radout_midle = 15.0; // + Double_t high_midle = 0.6; // + Double_t ang_in_midle = 180; + Double_t ang_fin_midle = 238.21; // alfa=57.60 + + // circular hole1 ; hole_midle d=3.5 + Double_t radin_mid_1hole = 0.; + Double_t radout_mid_1hole = 0.175; // diameter 3.5 + Double_t high_mid_1hole = 1.5; // 2.4 + + TGeoRotation* rot_mid_1hole = new TGeoRotation("rot_mid_1hole", 90, 90, 0); + rot_mid_1hole->RegisterYourself(); + TGeoCombiTrans* combi_mid_1tubhole = new TGeoCombiTrans(-14.2, 0.325, 0, rot_mid_1hole); // + combi_mid_1tubhole->SetName("combi_mid_1tubhole"); + combi_mid_1tubhole->RegisterYourself(); + + // circular hole2 ; hole_midle d=3 + Double_t radin_mid_2hole = 0.; + Double_t radout_mid_2hole = 0.15; // diameter 3 + Double_t high_mid_2hole = 1.8; // + + TGeoCombiTrans* combi_mid_2tubhole = new TGeoCombiTrans(-7.7, -12.355, 0, rot_mid_1hole); //x=81 + combi_mid_2tubhole->SetName("combi_mid_2tubhole"); + combi_mid_2tubhole->RegisterYourself(); + + // shape for midle + new TGeoBBox("midle_box", x_midle / 2, y_midle / 2, z_midle / 2); + + new TGeoBBox("midle_d1box", x_midle_d1box / 2, y_midle_d1box / 2, z_midle_d1box / 2); + + new TGeoBBox("midle_d2box", x_midle_d2box / 2, y_midle_d2box / 2, z_midle_d2box / 2); + + new TGeoTubeSeg("arc_midle", radin_midle, radout_midle, high_midle / 2, ang_in_midle, ang_fin_midle); + + new TGeoTube("mid_1tubhole", radin_mid_1hole, radout_mid_1hole, high_mid_1hole / 2); + + new TGeoTube("mid_2tubhole", radin_mid_2hole, radout_mid_2hole, high_mid_2hole / 2); + + // composite shape for midle + + new TGeoCompositeShape("midle_Shape_0", " arc_midle + midle_box:tr1_midle_box - midle_box:tr2_midle_box - midle_d1box:tr_midle_d1box - midle_d2box:tr_midle_d2box"); + + auto* midle_Shape_1 = new TGeoCompositeShape("midle_Shape_1", " midle_Shape_0 -mid_1tubhole:combi_mid_1tubhole-mid_2tubhole:combi_mid_2tubhole"); + + TGeoRotation* rot_midlez = new TGeoRotation("rot_midley", 180, 180, 0); + rot_midlez->RegisterYourself(); + TGeoCombiTrans* combi_midle_L = new TGeoCombiTrans(0, -7.625, 24.15 + 0.675, rot_90x); // x=7.35, y=0, z=15.79- 0,-7.625,24.15+0.675-80) + combi_midle_L->SetName("combi_midle_L"); + combi_midle_L->RegisterYourself(); + + TGeoTranslation* tr_midle_L = new TGeoTranslation("tr_midle_L", 0, -7.625, 24.15 + 0.675); // -152,-17.45,0 + tr_midle_L->RegisterYourself(); + + TGeoCombiTrans* combi_midle_R = new TGeoCombiTrans(0, -7.625, 24.15 + 0.675, rot_midlez); // x=7.35, y=0, z=15.79 + combi_midle_R->SetName("combi_midle_R"); + combi_midle_R->RegisterYourself(); + + auto* midle_Volume = new TGeoVolume("midle_Volume", midle_Shape_1, kMedAlu); + + midle_L->AddNode(midle_Volume, 1, tr_midle_L); + midle_R->AddNode(midle_Volume, 1, combi_midle_R); + + // midle->AddNode(midle_Volume,1); + midle->AddNode(midle_L, 1); + midle->AddNode(midle_R, 2); + + // new piece _/ \_ + // Support_rail_L & Support_rail_R + + auto* rail_L_R = new TGeoVolumeAssembly("rail_L_R"); + + // 6 piece RAIL LEFT RL0000 + auto* rail_L = new TGeoVolumeAssembly("rail_L"); + + // box down_2 + Double_t x_RL_1box = 3.0; // dx=15 + Double_t y_RL_1box = 1.21; // dy=6, -dy=6 + Double_t z_RL_1box = 0.8; // dz=4 to quit + TGeoTranslation* tr_RL_1box = new TGeoTranslation(0, y_RL_1box / 2, 1.825); // 81 + tr_RL_1box->SetName("tr_RL_1box"); + tr_RL_1box->RegisterYourself(); + + TGeoXtru* xtru_RL1 = new TGeoXtru(2); + xtru_RL1->SetName("S_XTRU_RL1"); + + Double_t x_RL1[5] = { -1.5, 1.5, 0.5, 0.5, -1.5 }; // 93,93,73,73,-15}; //vertices + Double_t y_RL1[5] = { 1.2, 1.2, 2.2, 8.2, 8.2 }; // 357.5,357.5,250.78,145.91}; + xtru_RL1->DefinePolygon(5, x_RL1, y_RL1); + xtru_RL1->DefineSection(0, -2.225, 0., 0., 1); // (plane,-zplane/ +zplane, x0, y0,(x/y)) + xtru_RL1->DefineSection(1, 2.225, 0., 0., 1); + + TGeoXtru* xtru_RL2 = new TGeoXtru(2); + xtru_RL2->SetName("S_XTRU_RL2"); + + Double_t x_RL2[8] = { -1.5, 0.5, 0.5, 9.3, 9.3, 7.3, 7.3, -1.5 }; // vertices + Double_t y_RL2[8] = { 8.2, 8.2, 13.863, 24.35, 35.75, 35.75, 25.078, 14.591 }; + + xtru_RL2->DefinePolygon(8, x_RL2, y_RL2); + + xtru_RL2->DefineSection(0, 0.776, 0, 0, 1); // (plane,-zplane/+zplane, x0, y0,(x/y)) + xtru_RL2->DefineSection(1, 2.225, 0, 0, 1); + + // box knee + Double_t x_RL_kneebox = 1.5; // dx=7.5 + Double_t y_RL_kneebox = 3.5; // dy=17.5 + Double_t z_RL_kneebox = 1.5; // dz=7.5 to quit + TGeoTranslation* tr_RL_kneebox = new TGeoTranslation(0, 0, 0); // 81 x =-2.5, y=145.91 + tr_RL_kneebox->SetName("tr_RL_kneebox"); + tr_RL_kneebox->RegisterYourself(); + + TGeoRotation* rot_knee = new TGeoRotation("rot_knee", -40, 0, 0); + rot_knee->SetName("rot_knee"); + rot_knee->RegisterYourself(); + TGeoCombiTrans* combi_knee = new TGeoCombiTrans(0.96, 1.75 + 0.81864, 0, rot_knee); // y= + combi_knee->SetName("combi_knee"); + combi_knee->RegisterYourself(); + // quit diagona-> qdi + Double_t x_qdi_box = 3.1; // + Double_t y_qdi_box = 7.159; // + Double_t z_qdi_box = 3.005; // + + TGeoRotation* rot_qdi = new TGeoRotation("rot_qdi", 0, 24.775, 0); + rot_qdi->RegisterYourself(); + TGeoCombiTrans* combi_qdi = new TGeoCombiTrans(0, 5.579, -2.087, rot_qdi); // y= + combi_qdi->SetName("combi_qdi"); + combi_qdi->RegisterYourself(); + // knee small + + TGeoXtru* xtru3_RL = new TGeoXtru(2); + xtru3_RL->SetName("xtru3_RL"); + + Double_t x_3RL[6] = { -0.75, 0.75, 0.75, 2.6487, 1.4997, -0.75 }; // vertices + Double_t y_3RL[6] = { -1.75, -1.75, 1.203, 3.465, 4.4311, 1.75 }; + + xtru3_RL->DefinePolygon(6, x_3RL, y_3RL); + xtru3_RL->DefineSection(0, -0.75, 0, 0, 1); // (plane,-zplane/+zplane, x0, y0,(x/y)) + xtru3_RL->DefineSection(1, 0.76, 0, 0, 1); + + TGeoTranslation* tr_vol3_RL = new TGeoTranslation(-0.25, 12.66, 0); // + tr_vol3_RL->SetName("tr_vol3_RL"); + tr_vol3_RL->RegisterYourself(); + + // circular holes could be for rail R and L .. + // circular hole1_RL (a(6,22)); hole_midle d=6.5 H11 + Double_t radin_RL1hole = 0.; + Double_t radout_RL1hole = 0.325; // diameter 3.5 + Double_t high_RL1hole = 1.0; // + + TGeoRotation* rot_RL1hole = new TGeoRotation("rot_RL1hole", 0, 0, 0); + rot_RL1hole->RegisterYourself(); + TGeoCombiTrans* combi_RL1hole = new TGeoCombiTrans(0.7, 0.6, 1.85, rot_RL1hole); //y= + combi_RL1hole->SetName("combi_RL1hole"); + combi_RL1hole->RegisterYourself(); + // similar hole for R Join. + // circular hole_ir. diameter=M3 (3 mm)) prof trou:8, tar:6mm + Double_t radin_ir_railL = 0.; + Double_t radout_ir_railL = 0.15; // diameter 0.3cm + Double_t high_ir_railL = 3.9; // + TGeoRotation* rot_ir_RL = new TGeoRotation("rot_ir_RL", 90, 90, 0); + rot_ir_RL->RegisterYourself(); + // in y = l_253.5 - 6. enter in (0,6,0) + TGeoCombiTrans* combi_ir1_RL = new TGeoCombiTrans(8.62, 24.75, 1.5, rot_ir_RL); + combi_ir1_RL->SetName("combi_ir1_RL"); + combi_ir1_RL->RegisterYourself(); + + TGeoCombiTrans* combi_ir2_RL = new TGeoCombiTrans(8.6, 33.15, 1.5, rot_ir_RL); + combi_ir2_RL->SetName("combi_ir2_RL"); + combi_ir2_RL->RegisterYourself(); + + // shape for Rail L geom + new TGeoBBox("RL_1box", x_RL_1box / 2, y_RL_1box / 2, z_RL_1box / 2); + new TGeoBBox("RL_kneebox", x_RL_kneebox / 2, y_RL_kneebox / 2, z_RL_kneebox / 2); // no_ used + new TGeoBBox("qdi_box", x_qdi_box / 2, y_qdi_box / 2, z_qdi_box / 2); + + // auto *s_RL1hole=new TGeoTube("S_RL1HOLE",radin_RL1hole,radout_RL1hole,high_RL1hole/2); + // auto *s_irL_hole=new TGeoTube("S_irL_HOLE",radin_ir_railL,radout_ir_railL,high_ir_railL/2); + // composite shape for rail L + + auto* RL_Shape_0 = new TGeoCompositeShape("RL_Shape_0", " xtru3_RL:tr_vol3_RL + S_XTRU_RL1 + S_XTRU_RL2 + RL_1box:tr_RL_1box - qdi_box:combi_qdi"); + + TGeoVolume* rail_L_vol0 = new TGeoVolume("RAIL_L_VOL0", RL_Shape_0, kMedAlu); + + rail_L->AddNode(rail_L_vol0, 1, new TGeoTranslation(0., 0., 1.5)); + + // piece 7th RAIL RIGHT + // auto *rail_R = new TGeoVolumeAssembly("rail_R"); + + Double_t x_RR_1box = 3.0; // dx=15 + Double_t y_RR_1box = 1.2; // dy=6, -dy=6 + Double_t z_RR_1box = 0.8; // dz=4 to quit + TGeoTranslation* tr_RR_1box = new TGeoTranslation("tr_RR_1box", 0, 0.6, 1.825); // 81 + tr_RR_1box->RegisterYourself(); + + TGeoXtru* part_RR1 = new TGeoXtru(2); + part_RR1->SetName("part_RR1"); + // TGeoVolume *vol_RR1 = gGeoManager->MakeXtru("S_part_RR1",kMedAlu,2); + // TGeoXtru *part_RR1 = (TGeoXtru*)vol_RR1->GetShape(); + + Double_t x_RR1[5] = { -1.5, -0.5, -0.5, 1.5, 1.5 }; // C,D,K,L,C' //vertices + Double_t y_RR1[5] = { 1.2, 2.2, 8.2, 8.2, 1.2 }; // 357.5,357.5,250.78,145.91}; + + part_RR1->DefinePolygon(5, x_RR1, y_RR1); + part_RR1->DefineSection(0, -2.225, 0, 0, 1); // (plane,-zplane/ +zplane, x0, y0,(x/y)) + part_RR1->DefineSection(1, 2.225, 0, 0, 1); + + TGeoXtru* part_RR2 = new TGeoXtru(2); + part_RR2->SetName("part_RR2"); + // TGeoVolume *vol_RR2 = gGeoManager->MakeXtru("part_RR2",Al,2); + // TGeoXtru *xtru_RR2 = (TGeoXtru*)vol_RR2->GetShape(); + + Double_t x_RR2[8] = { -0.5, -0.5, -9.3, -9.3, -7.3, -7.3, 1.5, 1.5 }; // K,E,F,G,H,I,J,L // vertices + Double_t y_RR2[8] = { 8.2, 13.863, 24.35, 35.75, 35.75, 25.078, 14.591, 8.2 }; + + part_RR2->DefinePolygon(8, x_RR2, y_RR2); + part_RR2->DefineSection(0, 0.776, 0, 0, 1); // (plane,-zplane/+zplane, x0, y0,(x/y)) + part_RR2->DefineSection(1, 2.225, 0, 0, 1); + + // knee (small) + + TGeoXtru* part_RR3 = new TGeoXtru(2); + part_RR3->SetName("part_RR3"); + + Double_t x_3RR[6] = { 1.0, 1.0, -1.2497, -2.2138, -0.5, -0.5 }; // R,Q,P,O,N.M // vertices + Double_t y_3RR[6] = { 10.91, 14.41, 17.0911, 15.9421, 13.86, 10.91 }; + + part_RR3->DefinePolygon(6, x_3RR, y_3RR); + part_RR3->DefineSection(0, -0.75, 0, 0, 1); // (plane,-zplane/+zplane, x0, y0,(x/y)) + part_RR3->DefineSection(1, 0.78, 0, 0, 1); + + TGeoTranslation* tr_vol3_RR = new TGeoTranslation("tr_vol3_RR", -0.25, 12.66, 0); // + tr_vol3_RR->RegisterYourself(); + + // quit diagona-> qdi + Double_t x_qdi_Rbox = 3.1; // dx=1.5 + Double_t y_qdi_Rbox = 7.159; // + Double_t z_qdi_Rbox = 3.005; // + + TGeoRotation* rot_Rqdi = new TGeoRotation("rot_Rqdi", 0, 24.775, 0); + rot_Rqdi->RegisterYourself(); + TGeoCombiTrans* combi_Rqdi = new TGeoCombiTrans(0, 5.579, -2.087, rot_Rqdi); // y= + combi_Rqdi->SetName("combi_Rqdi"); + combi_Rqdi->RegisterYourself(); + + // holes circular hole_a. diameter=6.5 (a(6,22)); hole_midle d=6.5 H11 + Double_t radin_a_rail = 0.; + Double_t radout_a_rail = 0.325; // diameter 3.5 + Double_t high_a_rail = 0.82; // + + TGeoTranslation* tr_a_RR = new TGeoTranslation("tr_a_RR", -0.7, 0.6, 1.825); // right + tr_a_RR->RegisterYourself(); + // circular hole_ir. diameter=M3 (3 mm)) prof trou:8, tar:6mm + Double_t radin_ir_rail = 0.; + Double_t radout_ir_rail = 0.15; // diameter 3 + Double_t high_ir_rail = 3.2; // 19 + TGeoRotation* rot_ir_RR = new TGeoRotation("rot_ir_RR", 90, 90, 0); + rot_ir_RR->RegisterYourself(); + // in y = l_253.5 - 6. center in (0,6,0) + TGeoCombiTrans* combi_ir_RR = new TGeoCombiTrans(-8.62, 24.75, 1.5, rot_ir_RR); + combi_ir_RR->SetName("combi_ir_RR"); + combi_ir_RR->RegisterYourself(); + + TGeoCombiTrans* combi_ir2_RR = new TGeoCombiTrans(-8.6, 33.15, 1.5, rot_ir_RR); + combi_ir2_RR->SetName("combi_ir2_RR"); + combi_ir2_RR->RegisterYourself(); + + TGeoCombiTrans* combi_rail_R = new TGeoCombiTrans(24.1, -1.825, 0, rot_90x); // y= + combi_rail_R->SetName("combi_rail_R"); + combi_rail_R->RegisterYourself(); + TGeoCombiTrans* combi_rail_L = new TGeoCombiTrans(-24.1, -1.825, 0, rot_90x); // y= + combi_rail_L->SetName("combi_rail_L"); + combi_rail_L->RegisterYourself(); + + // trasl L and R + TGeoTranslation* tr_sr_l = new TGeoTranslation("tr_sr_l", -15.01, 0, 0); // + tr_sr_l->RegisterYourself(); + TGeoTranslation* tr_sr_r = new TGeoTranslation("tr_sr_r", 15.01, 0, 0); // + tr_sr_r->RegisterYourself(); + + // shape for rail R + new TGeoBBox("RR_1box", x_RR_1box / 2, y_RR_1box / 2, z_RR_1box / 2); + + // auto *s_qdi_Rbox =new TGeoBBox("S_QDI_RBOX", x_qdi_Rbox/2,y_qdi_Rbox/2,z_qdi_Rbox/2); + + // auto *s_ir_hole=new TGeoTube("S_ir_HOLE",radin_ir_rail,radout_ir_rail,high_ir_rail/2); + + // auto *s_cc_hole=new TGeoTube("S_CC_HOLE",radin_cc_rail,radout_cc_rail,high_cc_rail/2); + + // composite shape for rail R + new TGeoCompositeShape("RR_Shape_0", "RR_1box:tr_RR_1box + part_RR1 + part_RR2 + part_RR3 - qdi_box:combi_qdi "); + + // auto * RR_Shape_0 = new TGeoCompositeShape("RR_Shape_0","RR_1box:tr_RR_1box+ S_part_RR1 + part_RR2 +part_RR3- qdi_box:combi_qdi + S_ir_HOLE:combi_ir_RR +S_ir_HOLE:combi_ir2_RR "); //-RR_1box:tr_RL_1box- S_b_HOLE:tr_b_RR -S_CC_HOLE:combi_cc2_RR + + // JOIN only for show L and R parts + auto* rail_L_R_Shape = new TGeoCompositeShape("RAIL_L_R_Shape", " RL_Shape_0:combi_rail_L + RR_Shape_0:combi_rail_R"); + + TGeoVolume* rail_L_R_vol0 = new TGeoVolume("RAIL_L_R_VOL0", rail_L_R_Shape, kMedAlu); + + TGeoRotation* rot_rLR = new TGeoRotation("rot_rLR", 180, 180, 0); + rot_rLR->RegisterYourself(); + TGeoCombiTrans* combi_rLR = new TGeoCombiTrans(0, -6.9, -0.5, rot_rLR); // 0,-6.9,-0.5-80 + combi_rLR->SetName("combi_rLR"); + combi_rLR->RegisterYourself(); + + rail_L_R->AddNode(rail_L_R_vol0, 2, combi_rLR); + + // piece 8th support rail MB \_ + + auto* sup_rail_MBL = new TGeoVolumeAssembly("sup_rail_MBL"); + + TGeoXtru* part_MBL_0 = new TGeoXtru(2); + part_MBL_0->SetName("part_MBL_0"); // V-MBL_0 + + // vertices a,b,c,d,e,f,g,h + Double_t x[8] = { 0., 0, 6.1, 31.55, 34.55, 34.55, 31.946, 6.496 }; + Double_t y[8] = { -0.4, 0.4, 0.4, 13.0, 13.0, 12.2, 12.2, -0.4 }; + + part_MBL_0->DefinePolygon(8, x, y); + part_MBL_0->DefineSection(0, -0.4, 0, 0, 1); // (plane, -zplane/ +zplane,x0,y0,(x/y)) + part_MBL_0->DefineSection(1, 0.4, 0, 0, 1); + + TGeoRotation* rot1_MBL_0 = new TGeoRotation("rot1_MBL_0", -90, -90, 90); + rot1_MBL_0->RegisterYourself(); + + // quit box in diag + Double_t x_mb_box = 0.8; // dx=4 + Double_t y_mb_box = 0.8; // dy=4 + Double_t z_mb_box = 0.81; // dz=4 to quit + TGeoTranslation* tr_mb_box = new TGeoTranslation("tr_mb_box", 24.05, 9.55, 0); // 240.5 + tr_mb_box->RegisterYourself(); + + // lateral hole-box + Double_t x_lat_box = 0.7; //dx=0.35 + Double_t y_lat_box = 1.8; // dy=0.9 + Double_t z_lat_box = 0.2; // dz=0.1 + TGeoTranslation* tr_lat1L_box = new TGeoTranslation("tr_lat1L_box", 4.6, 0, 0.4); // + tr_lat1L_box->RegisterYourself(); + TGeoTranslation* tr_lat2L_box = new TGeoTranslation("tr_lat2L_box", 9.6, 1.65, 0.4); // + tr_lat2L_box->RegisterYourself(); + TGeoTranslation* tr_lat3L_box = new TGeoTranslation("tr_lat3L_box", 18.53, 6.1, 0.4); // + tr_lat3L_box->RegisterYourself(); + TGeoTranslation* tr_lat4L_box = new TGeoTranslation("tr_lat4L_box", 26.45, 10, 0.4); // + tr_lat4L_box->RegisterYourself(); + TGeoTranslation* tr_lat5L_box = new TGeoTranslation("tr_lat5L_box", 29.9, 11.6, 0.4); // + tr_lat5L_box->RegisterYourself(); + + TGeoTranslation* tr_lat1R_box = new TGeoTranslation("tr_lat1R_box", 4.6, 0, -0.4); // + tr_lat1R_box->RegisterYourself(); + TGeoTranslation* tr_lat2R_box = new TGeoTranslation("tr_lat2R_box", 9.6, 1.65, -0.4); // + tr_lat2R_box->RegisterYourself(); + TGeoTranslation* tr_lat3R_box = new TGeoTranslation("tr_lat3R_box", 18.53, 6.1, -0.4); // + tr_lat3R_box->RegisterYourself(); + TGeoTranslation* tr_lat4R_box = new TGeoTranslation("tr_lat4R_box", 26.45, 10, -0.4); // + tr_lat4R_box->RegisterYourself(); + TGeoTranslation* tr_lat5R_box = new TGeoTranslation("tr_lat5R_box", 29.9, 11.6, -0.4); // + tr_lat5R_box->RegisterYourself(); + + // circular hole_1mbl. diameter=3.5 H9 + Double_t radin_1mb = 0.; + Double_t radout_1mb = 0.175; // diameter 3.5mm _0.35 cm + Double_t high_1mb = 2.825; // dh=+/- 4 + TGeoTranslation* tr1_mb = new TGeoTranslation("tr1_mb", 18.48, 6.1, 0.); // right + tr1_mb->RegisterYourself(); + + TGeoTranslation* tr2_mb = new TGeoTranslation("tr2_mb", 24.15, 8.9, 0.); // right + tr2_mb->RegisterYourself(); + + // circular hole_2mbl inclined and hole-up.diameter=M3 (3 mm)) prof , tar:8mm + Double_t radin_2mb = 0.; + Double_t radout_2mb = 0.15; // diameter 0.3 + Double_t high_2mb = 0.82; /// dh=+/- 4 + + TGeoRotation* rot_hole2_MBL = new TGeoRotation("rot_hole2_MBL", 0, 90, 0); + rot_hole2_MBL->RegisterYourself(); + + TGeoTranslation* tr_mbl = new TGeoTranslation("tr_mbl", -7.5, 0., 0.); // + tr_mbl->RegisterYourself(); + + TGeoTranslation* tr_mbr = new TGeoTranslation("tr_mbr", 7.5, 0, 0); // + tr_mbr->RegisterYourself(); + + // hole up || hup + TGeoCombiTrans* combi_hup_mb = new TGeoCombiTrans(32.5, 12.6, 0, rot_90x); //y= + combi_hup_mb->SetName("combi_hup_mb"); + combi_hup_mb->RegisterYourself(); + + // shape for rail MB + new TGeoBBox("mb_box", x_mb_box / 2, y_mb_box / 2, z_mb_box / 2); + new TGeoTube("hole_1mbl", radin_1mb, radout_1mb, high_1mb / 2); // d3.5 + new TGeoTube("hole_2mbl", radin_2mb, radout_2mb, high_2mb / 2); // d3 + new TGeoBBox("lat_box", x_lat_box / 2, y_lat_box / 2, z_lat_box / 2); + + // composite shape for rail_MB R + L + + // auto * MB_Shape_0 = new TGeoCompositeShape("MB_Shape_0"," V_MBL_0 - mb_box:tr_mb_box - hole_1mbl:tr1_mb + hole_1mbl:tr2_mb -hole_2mbl:combi_hup_mb "); + new TGeoCompositeShape("MB_Shape_0", "part_MBL_0 - mb_box:tr_mb_box - hole_1mbl:tr1_mb - hole_2mbl:combi_hup_mb"); + + new TGeoCompositeShape("MB_Shape_0L", "MB_Shape_0 - lat_box:tr_lat1L_box - lat_box:tr_lat2L_box - lat_box:tr_lat3L_box - lat_box:tr_lat4L_box - lat_box:tr_lat5L_box"); + + new TGeoCompositeShape("MB_Shape_0R", "MB_Shape_0 - lat_box:tr_lat1R_box - lat_box:tr_lat2R_box - lat_box:tr_lat3R_box - lat_box:tr_lat4R_box - lat_box:tr_lat5R_box"); + + new TGeoCompositeShape("MB_Shape_1L", "MB_Shape_0L:rot1_MBL_0 - hole_2mbl"); // one piece "completed" + // left and right + new TGeoCompositeShape("MB_Shape_1R", "MB_Shape_0R:rot1_MBL_0 - hole_2mbl"); + + auto* MB_Shape_2 = new TGeoCompositeShape("MB_Shape_2", " MB_Shape_1L:tr_mbl + MB_Shape_1R:tr_mbr "); + + // TGeoVolume *sup_rail_MBL_vol0 = new TGeoVolume("SUPPORT_MBL_VOL0",MB_Shape_0,Al); + TGeoVolume* sup_rail_MBL_vol = new TGeoVolume("SUPPORT_MBL_VOL", MB_Shape_2, kMedAlu); + + sup_rail_MBL->AddNode(sup_rail_MBL_vol, 1, rot_halfR); + + auto* stair = new TGeoVolumeAssembly("stair"); + + stair->AddNode(sup_rail_MBL, 1, new TGeoTranslation(0, 0 - 28.8, 0 + 0.675)); + stair->AddNode(Cross_mft, 2, new TGeoTranslation(0, -28.8, 4.55 + 0.675)); + stair->AddNode(Cross_mb0, 3, new TGeoTranslation(0, 1.65 - 28.8, 9.55 + 0.675)); + stair->AddNode(Cross_mb0, 4, new TGeoTranslation(0, 6.1 - 28.8, 18.48 + 0.675)); + stair->AddNode(Cross_mft, 6, new TGeoTranslation(0, 10.0 - 28.8, 26.4 + 0.675)); + stair->AddNode(Cross_mft, 7, new TGeoTranslation(0, 11.6 - 28.8, 29.85 + 0.675)); + + Double_t t_final_x; + Double_t t_final_y; + Double_t t_final_z; + + Double_t r_final_x; + Double_t r_final_y; + Double_t r_final_z; + + if (half == 0) { + t_final_x = 0; + t_final_y = 0; + t_final_z = -80; + + r_final_x = 0; + r_final_y = 0; + r_final_z = 0; + } + + if (half == 1) { + t_final_x = 0; + t_final_y = 0; + t_final_z = -80; + + r_final_x = 0; + r_final_y = 0; + r_final_z = 180; + } + + auto* t_final = new TGeoTranslation("t_final", t_final_x, t_final_y, t_final_z); + auto* r_final = new TGeoRotation("r_final", r_final_x, r_final_y, r_final_z); + auto* c_final = new TGeoCombiTrans(*t_final, *r_final); auto* Half_3 = new TGeoVolumeAssembly("Half_3"); @@ -465,8 +970,7 @@ TGeoCompositeShape("Half_0_Holes","Half_0_Hole0:cHalf_0_Hole0+Half_0_Hole1:cHalf // Basic shapes for Half_3 TGeoShape* Shell_0 = new TGeoTubeSeg("Shell_0", Shell_rmax / 2. - .1, Shell_rmax / 2., 6.2 / 2., 12., 168.); TGeoShape* Shell_1 = new TGeoTubeSeg("Shell_1", Shell_rmin / 2. - .1, Shell_rmin / 2., 3.2 / 2., 0., 180.); - TGeoShape* Shell_2 = new TGeoConeSeg("Shell_2", (25.15 + 1.0) / 2., Shell_rmin / 2. - .1, Shell_rmin / 2., - Shell_rmax / 2. - .1, Shell_rmax / 2., 0., 180.); + new TGeoConeSeg("Shell_2", (25.15 + 1.0) / 2., Shell_rmin / 2. - .1, Shell_rmin / 2., Shell_rmax / 2. - .1, Shell_rmax / 2., 0., 180.); TGeoShape* Shell_3 = new TGeoTube("Shell_3", 0., Shell_rmin / 2. + .1, .1 / 2.); TGeoShape* ShellHole_0 = new TGeoTrd1("ShellHole_0", 17.5 / 4., 42.5 / 4., 80. / 2., (25.15 + 1.) / 2.); TGeoShape* ShellHole_1 = new TGeoBBox("ShellHole_1", 42.5 / 4., 80. / 2., 2. / 2. + 0.00001); @@ -479,192 +983,35 @@ TGeoCompositeShape("Half_0_Holes","Half_0_Hole0:cHalf_0_Hole0+Half_0_Hole1:cHalf // Composite shapes for Half_3 auto* Half_3_Shape_0 = new TGeoCompositeShape("Half_3_Shape_0", "Shell_Cut_0+Shell_Cut_1:tShell_Cut"); - auto* Half_3_Shape_1 = - new TGeoCompositeShape("Half_3_Shape_1", "Shell_2-Half_3_Shape_0:cShell_Cut-Half_3_Shape_0:cShell_Cut_inv"); + new TGeoCompositeShape("Half_3_Shape_1", "Shell_2 - Half_3_Shape_0:cShell_Cut - Half_3_Shape_0:cShell_Cut_inv"); auto* Half_3_Shape_2 = new TGeoCompositeShape("Half_3_Shape_2", "ShellHole_0+ShellHole_1:tShellHole"); - auto* Half_3_Shape_3 = new TGeoCompositeShape( - "Half_3_Shape_3", "Shell_3:tShellHole_1 - (ShellHole_2:tShellHole_1+ShellHole_3:tShellHole_0)"); - auto* Half_3_Shape_4 = - new TGeoCompositeShape("Half_3_Shape_4", - "(Shell_0:tShell_0 + Half_3_Shape_1+ Shell_1:tShell_1) - (Half_3_Shape_2 + " - "Half_3_Shape_2:Rz + Half_3_Shape_2:Rz_inv)+Half_3_Shape_3"); + new TGeoCompositeShape("Half_3_Shape_3", "Shell_3:tShellHole_1 -(ShellHole_2:tShellHole_1 + ShellHole_3:tShellHole_0)"); + auto* Half_3_Shape_4 = new TGeoCompositeShape("Half_3_Shape_4", + "(Shell_0:tShell_0 + Half_3_Shape_1+ Shell_1:tShell_1) - (Half_3_Shape_2 + " + "Half_3_Shape_2:Rz + Half_3_Shape_2:Rz_inv)+Half_3_Shape_3"); auto* Half_3_Volume = new TGeoVolume("Half_3_Volume", Half_3_Shape_4, kMedAlu); // Position of the piece relative to the origin which for this code is the center of the the Framework piece (See // Half_2) - Half_3->AddNode(Half_3_Volume, 1, new TGeoTranslation(0., 0., -19.)); - - // Half_4 - // Front Framework - - // The part is the arc, the two legs of the sides, and 4 cuts. - - auto* Half_4 = new TGeoVolumeAssembly("Half_4"); - - // Front dimensions - Float_t Front_rmin = 19.7; - Float_t Front_rmax = 21.5; - Float_t Front_z = .6; - Float_t Front_Angle = 38.612; - - // Legs dimensions - Float_t Leg_x = 2.; - Float_t Leg_y = 6.917; - Float_t Leg_z = .6; - Float_t Distance_Leg_x = 14.8; - Float_t Distance_Leg_y = 6.5; - - // Lateral legs cut dimensions - Float_t Leg_Lateral_Cut_x = 1.5; - Float_t Leg_Lateral_Cut_y = 1.15; - - // Translations - // The position of the legs - auto* tLeg_Right = new TGeoTranslation("tLeg_Right", Distance_Leg_x + Leg_x / 2., Distance_Leg_y + Leg_y / 2., 0.); - auto* tLeg_Left = new TGeoTranslation("tLeg_Left", -Distance_Leg_x - Leg_x / 2., Distance_Leg_y + Leg_y / 2., 0.); - // Distances to the center of the piece to make the cut. - auto* tLeg_Cut_Right = - new TGeoTranslation("tLeg_Cut_Right", -Distance_Leg_x - (Leg_x - Leg_Lateral_Cut_x) - Leg_Lateral_Cut_x / 2., - Distance_Leg_y + Leg_Lateral_Cut_y / 2., 0.); - auto* tLeg_Cut_Left = - new TGeoTranslation("tLeg_Cut_Left", Distance_Leg_x + (Leg_x - Leg_Lateral_Cut_x) + Leg_Lateral_Cut_x / 2., - Distance_Leg_y + Leg_Lateral_Cut_y / 2., 0.); - // y-length to the upper cut, plus half the y-length of the leg_Upper_Cut - auto* tLeg_Cut_Upper = new TGeoTranslation("tLeg_Cut_Upper", 0., 21.4 + .25, 0.); - - tLeg_Right->RegisterYourself(); - tLeg_Left->RegisterYourself(); - tLeg_Cut_Right->RegisterYourself(); - tLeg_Cut_Left->RegisterYourself(); - tLeg_Cut_Upper->RegisterYourself(); - - // Basic shapes of Half_4 - - TGeoShape* Front = new TGeoTubeSeg("Front", Front_rmin, Front_rmax, Front_z / 2., Front_Angle, 180. - Front_Angle); - TGeoShape* leg = new TGeoBBox("leg", Leg_x / 2., Leg_y / 2., Leg_z / 2.); - // The lateral cut is used twice, so there are 4 cuts. The z dimension is just a bit bigger so it cuts completly the - // piece. - // To avoid another translation, the y length is made so that it reaches the piece and cuts the needed. - TGeoShape* leg_Central_Cut = new TGeoBBox("leg_Central_Cut", 1.8 / 2., 40.4 / 2., Leg_z / 2. + 0.001); - TGeoShape* leg_Lateral_Cut = - new TGeoBBox("leg_Lateral_Cut", (1.5 + 0.0001) / 2., (1.15 + 0.0001) / 2., Leg_z / 2. + 0.001); - // This shape only has to be bigger than the section to cut. - TGeoShape* leg_Upper_Cut = new TGeoBBox("leg_Upper_Cut", 4. / 2., .5 / 2., Leg_z / 2. + 0.001); - - // The front piece + the 2 legs, and then making the 4 cuts - auto* Half_4_Shape_0 = - new TGeoCompositeShape("Half_4_Shape_0", - "(Front+leg:tLeg_Right+leg:tLeg_Left)-(leg_Central_Cut+leg_Lateral_Cut:tLeg_Cut_Right+leg_" - "Lateral_Cut:tLeg_Cut_Left+leg_Upper_Cut:tLeg_Cut_Upper)"); - - auto* Half_4_Volume = new TGeoVolume("Half_4_Volume", Half_4_Shape_0, kMedAlu); - // Position of the piece relative to the origin which for this code is the center of the the Framework piece (See - // Half_2) - Half_4->AddNode(Half_4_Volume, 1, new TGeoTranslation(0., 0., -25.)); - - // Half_5 - - // Support PCB - auto* Half_5 = new TGeoVolumeAssembly("Half_5"); - - // Dimensions - - Float_t PCB_Angle = 24.3838; - - // Float_t PCB_Central_Projection = 25.15; // overlap issue, fm - Float_t PCB_Central_Projection = 24.00; - - Float_t PCB_Central_x = .8; - Float_t PCB_Central_y = .5; - Float_t PCB_Central_z = PCB_Central_Projection / cos(PCB_Angle * TMath::Pi() / 180.); - - Float_t PCB_Right_x = .8; - Float_t PCB_Right_y = .5; - Float_t PCB_Right_z = 3.2; - - Float_t PCB_Left_x = .8; - Float_t PCB_Left_y = .5; - Float_t PCB_Left_z = 6.2; - - // Translations, rotations and combinations - - auto* RxPCB = new TGeoRotation("RxPCB", 0., -PCB_Angle, 0.); - // Distance of one support to the other one. (this refers to the whole piece) - auto* tPCB = new TGeoTranslation("tPCB", .6, 0., 0.); - auto* tPCB_inv = new TGeoTranslation("tPCB_inv", -.6, 0., 0.); - // Distance of the Left and Right piece from the center piece. (this refers to parts of the piece) - auto* tPCB_Right = new TGeoTranslation("tPCB_Right", 0., -(12.4 - (PCB_Right_y + PCB_Left_y)) / 2., - -(PCB_Central_Projection + PCB_Right_z) / 2.); - auto* tPCB_Left = new TGeoTranslation("tPCB_Left", 0., (12.4 - (PCB_Right_y + PCB_Left_y)) / 2., - (PCB_Central_Projection + PCB_Left_z) / 2.); - // Distance of the cut - auto* tPCB_Cut = new TGeoTranslation("tPCB_Cut", 0., -(12.4 / 2. - 3.6 + 2. / 2.), - -(PCB_Central_Projection / 2. - (10.1 - PCB_Right_z) - 2. / 2.)); - - RxPCB->RegisterYourself(); - tPCB->RegisterYourself(); - tPCB_inv->RegisterYourself(); - tPCB_Right->RegisterYourself(); - tPCB_Left->RegisterYourself(); - tPCB_Cut->RegisterYourself(); - - TGeoShape* Central_PCB = new TGeoBBox("Central_PCB", PCB_Central_x / 2., PCB_Central_y / 2., PCB_Central_z / 2.); - TGeoShape* Right_PCB = new TGeoBBox("Right_PCB", PCB_Right_x / 2., PCB_Right_y / 2., PCB_Right_z / 2.); - TGeoShape* Left_PCB = new TGeoBBox("Left_PCB", PCB_Left_x / 2., PCB_Left_y / 2., PCB_Left_z / 2.); - - TGeoShape* Cut_PCB = new TGeoBBox("Cut_PCB", 4. / 2., 2. / 2., 2. / 2.); - - auto* Half_5_Shape_0 = - new TGeoCompositeShape("Half_5_Shape_0", "Central_PCB:RxPCB+Right_PCB:tPCB_Right+Left_PCB:tPCB_Left"); - auto* Half_5_Shape_1 = new TGeoCompositeShape("Half_5_Shape_1", "Half_5_Shape_0:tPCB + Half_5_Shape_0:tPCB_inv"); - auto* Half_5_Shape_2 = new TGeoCompositeShape("Half_5_Shape_2", "Half_5_Shape_1 - Cut_PCB:tPCB_Cut"); - - auto* Half_5_Volume = new TGeoVolume("Half_5_Volume", Half_5_Shape_2, kMedAlu); - Half_5->AddNode(Half_5_Volume, 1, new TGeoTranslation(0., 30.283 - 6.2, -(28.35 / 2. + 3.2) - .9 - .6 - .5)); - - // The final translation and rotation of the Half Cone to its final position, this are the parameters of the function - - // Position of the radius center of the Framework (See Half_2) - Float_t tTotal_x; - Float_t tTotal_y; - Float_t tTotal_z; - - // Angle of the Half Cone, the z-axis is pointing in the beam axis, and the y-axis in the uppward direction. (It is in - // Euler angles) - Float_t rTotal_x; - Float_t rTotal_y; - Float_t rTotal_z; - - if (half == 0) { - rTotal_x = 90.; - rTotal_y = 180.; - rTotal_z = 90.; - tTotal_x = 0.; - // tTotal_y = -0.1; // to be defined - tTotal_y = -0.5; // to avoid overlap with disks, fm, vertical position of the total - tTotal_z = -80.0; // position still to be defined - } - if (half == 1) { - rTotal_x = 90.; - rTotal_y = 180.; - rTotal_z = -90.; - tTotal_x = 0.; - // tTotal_y = 0.1; // to be defined - tTotal_y = 0.5; // to avoid overlap with disks, fm, vertical position of the total - tTotal_z = -80.0; // position still to be defined - } - - auto* tTotal = new TGeoTranslation("tTotal", tTotal_x, tTotal_y, tTotal_z); - auto* rTotal = new TGeoRotation("rTotal", rTotal_x, rTotal_y, rTotal_z); - auto* cTotal = new TGeoCombiTrans(*tTotal, *rTotal); - - // overlap problem - HalfConeVolume->AddNode(Half_0, 0, cTotal); // barres intérieures horizontales fm - HalfConeVolume->AddNode(Half_1, 0, cTotal); // barres intérieures horizontales fm - HalfConeVolume->AddNode(Half_2, 0, cTotal); - HalfConeVolume->AddNode(Half_3, 0, cTotal); - HalfConeVolume->AddNode(Half_4, 0, cTotal); // support milieu perpendiculaire - HalfConeVolume->AddNode(Half_5, 0, cTotal); // barre médiane + // Half_3->AddNode(Half_3_Volume, 1, new TGeoTranslation(0., 0., -19.)); + + TGeoRotation* rot_z180 = new TGeoRotation("rot_z180", 0, 180, 0); // orig: (180,0,0) + rot_z180->RegisterYourself(); + // in y = l_253.5 - 6. center in (0,6,0) + TGeoCombiTrans* combi_coat = new TGeoCombiTrans(0, 0, 19.5 - 0.45, rot_z180); // TGeoCombiTrans(0,0, -19.5,rot_z180) // -0.5 ->0.45 + combi_coat->SetName("combi_coat"); + combi_coat->RegisterYourself(); + + Half_3->AddNode(Half_3_Volume, 1, combi_coat); + // Half_3_Volume->SetLineColor(1); + + HalfConeVolume->AddNode(stair, 1, c_final); // + HalfConeVolume->AddNode(base, 2, c_final); + HalfConeVolume->AddNode(rail_L_R, 3, c_final); // R&L + HalfConeVolume->AddNode(Fra_front, 4, c_final); + HalfConeVolume->AddNode(midle, 5, c_final); // + HalfConeVolume->AddNode(Half_3, 6, c_final); + // HalfConeVolume->AddNode(Half_3,8, new TGeoCombiTrans(0,0,0-0.5,rot_halfR)); //-0.675 return HalfConeVolume; }