Skip to content
Snippets Groups Projects

bellow and downstream beam pipe section for arbitrary angles

Closed Ondrej Hofman requested to merge hofmanond_AT_fjfi.cvut.cz/cbmroot_geometry:v21z into master
4 unresolved threads
1 file
+ 813
0
Compare changes
  • Side-by-side
  • Inline
+ 813
0
#include "TGeoArb8.h"
#include "TGeoCompositeShape.h"
#include "TGeoCone.h"
#include "TGeoManager.h"
#include "TGeoMatrix.h"
#include "TGeoSystemOfUnits.h"
#include "TGeoTube.h"
#include "TPad.h"
#include "TROOT.h"
#include "TSystem.h"
#include "iostream"
#include "stdio.h"
using namespace std;
using namespace TGeoUnit;
void bpipe_bellow(const char* geoTag = "v21i")
{
//--- Definition of a simple geometry
gSystem->Load("libGeom");
TGeoManager* geom = new TGeoManager("bellow_v21i", "Beampipe for Au+Au 10 AGeV - 10.96 AGeV/c");
//--- define some materials
TGeoMixture* matCarbonFiber = new TGeoMixture("BP_carbonfiber", 4, 1.5);
matCarbonFiber->AddElement(12.001, 6.0, 0.8926);
matCarbonFiber->AddElement(1.0079, 1.0, 0.0192);
matCarbonFiber->AddElement(35.453, 17.0, 0.0271);
matCarbonFiber->AddElement(15.999, 8.0, 0.0611);
TGeoMixture* matStainless = new TGeoMixture("BP_stainless", 10, 8.0);
matStainless->AddElement(12.0, 6.0, 0.00035);
matStainless->AddElement(51.94, 24.0, 0.175);
matStainless->AddElement(54.94, 25.0, 0.01);
matStainless->AddElement(95.94, 42.0, 0.025);
matStainless->AddElement(14.0, 7.0, 0.0005);
matStainless->AddElement(58.6934, 28.0, 0.115);
matStainless->AddElement(30.97, 15.0, 0.000225);
matStainless->AddElement(31.97, 16.0, 0.000075);
matStainless->AddElement(27.98, 14.0, 0.005);
matStainless->AddElement(55.93, 26.0, 0.67135);
TGeoMaterial* matVacuum = new TGeoMaterial("BP_vacuum", 1.e-16, 1.e-16, 1.e-16);
TGeoMaterial* matAl = new TGeoMaterial("BP_aluminium", 26.9815386, 13, 2.7, 24.01);
// //--- define some media
TGeoMedium* Vacuum = new TGeoMedium("BP_vacuum", 1, matVacuum);
TGeoMedium* Al = new TGeoMedium("BP_aluminium", 2, matAl);
TGeoMedium* CF = new TGeoMedium("BP_carbonfiber", 3, matCarbonFiber);
TGeoMedium* Stainless = new TGeoMedium("BP_stainless", 4, matStainless);
Double_t conus_lenght = 1585 * mm;
Double_t rmin1 = 55 * mm;
Double_t rmax1 = 56 * mm;
Double_t rmin2 = 125 * mm;
Double_t rmax2 = 126 * mm;
Double_t d36 = 1.5;
Double_t d127 = 7.294069420859877e-06 + 1.2479839742951593*d36 + 0.0037968852322377233*pow(d36,2) - 0.11203345364357689*pow(d36,3) + 0.012577339470240288*pow(d36,4) + 0.002223421249209074*pow(d36,5);
Double_t d128 = 0.00010355793443926368 + 12.477671371827977*d36 + 0.05536895222215394*pow(d36,2) - 1.2845601842674421*pow(d36,3) + 0.18858212656481052*pow(d36,4) + 0.017857895050172077*pow(d36,5);
Double_t d129 = -4.512106875903182e-06 + 40.24761593186211*d36 - 0.0025334264845256957*pow(d36,2) + 0.03241199785617298*pow(d36,3) - 0.008712593005028845*pow(d36,4) - 7.35577705040771e-05*pow(d36,5);
Double_t d130 = -0.00010854003665182663 + 68.62811100381569*d36 - 0.05797504360307426*pow(d36,2) + 1.3160838366248073*pow(d36,3) - 0.19757068693136298*pow(d36,4) - 0.01793583786637542*pow(d36,5);
Double_t d131 = -7.326287337690907e-06 + 80.77377301650138*d36 - 0.0038674646150131204*pow(d36,2) + 0.10903798955321471*pow(d36,3) - 0.01283038216214754*pow(d36,4) - 0.002236185021075655*pow(d36,5);
Double_t d132 = -2.383058506214219e-07 + 82.58898397301633*d36 - 1.631756439892984e-05*pow(d36,2) - 0.00416635671175113*pow(d36,3) - 1.840063064176762e-05*pow(d36,4) + 4.560867652065202e-06*pow(d36,5);
Double_t d133 = 32.49999996482266 - 1.704170122719994e-05*d36 - 0.04431491377812864*pow(d36,2) - 0.0009653955502889069*pow(d36,3) + 0.009165519854288994*pow(d36,4) - 0.001995022897372307*pow(d36,5);
Double_t d134 = 84.99999533291219 - 0.00023492454989418064*d36 - 1.508980395224628*pow(d36,2) - 0.028226115194511466*pow(d36,3) + 0.31431940210450693*pow(d36,4) - 0.06920478399195312*pow(d36,5);
Double_t d135 = 154.9999997696283 + 4.3171911594419895e-05*d36 - 0.15564190895484586*pow(d36,2) + 0.00224649962710786*pow(d36,3) - 0.022605510070782774*pow(d36,4) + 0.004318423659521891*pow(d36,5);
Double_t d136 = 225.00000450925046 + 0.00027745677807783614*d36 + 1.0185438873226513*pow(d36,2) + 0.030660915630686753*pow(d36,3) - 0.3390962755774437*pow(d36,4) + 0.0738992784146837*pow(d36,5);
Double_t d137 = 277.4999993648013 + 3.8721714787300655e-05*d36 - 0.6497990276281006*pow(d36,2) + 0.0013164770345282354*pow(d36,3) - 0.011439622406070105*pow(d36,4) + 0.0023984105400061875*pow(d36,5);
Double_t d138 = 309.9999990600503 + 3.9513895687954496e-05*d36 - 0.7209370082352035*pow(d36,2) + 0.0003944851893596362*pow(d36,3) - 0.0002814664500329158*pow(d36,4) + 7.986450047323582e-05*pow(d36,5);
Double_t d139 = 89.9999772845647 - 4.08602445882051*d36 - 0.01188878178525147*pow(d36,2) + 0.36179268419896643*pow(d36,3) - 0.03925056116635401*pow(d36,4) - 0.007419632893936052*pow(d36,5);
Double_t d140 = 89.99996863771086 - 6.129243305301439*d36 - 0.01624092015329456*pow(d36,2) + 0.5278524620027587*pow(d36,3) - 0.05340432202855683*pow(d36,4) - 0.011458569687558979*pow(d36,5);
Double_t d141 = 90.00000368110602 - 6.373959367140148*d36 + 0.002055006462786546*pow(d36,2) + 0.05023230486307997*pow(d36,3) + 0.007154185475047951*pow(d36,4) - 0.0010502119202112899*pow(d36,5);
Double_t d142 = 89.99999629621664 + 5.87395997214169*d36 - 0.00205772584370252*pow(d36,2) - 0.05022776285204186*pow(d36,3) - 0.007157395192331953*pow(d36,4) + 0.0010510233593369947*pow(d36,5);
Double_t d143 = 90.0000313320887 + 6.129243683481753*d36 + 0.01624012370530082*pow(d36,2) - 0.5278522355976671*pow(d36,3) + 0.05340476970656798*pow(d36,4) + 0.01145833393159645*pow(d36,5);
Double_t d144 = 90.00002272843388 + 4.086024242188609*d36 + 0.01188953862630778*pow(d36,2) - 0.3617937189855124*pow(d36,3) + 0.039251178726477154*pow(d36,4) + 0.007419497826754703*pow(d36,5);
Double_t d145 = 69.99998405262693 + 0.0009565137847534624*d36 + 14.588413039891266*pow(d36,2) + 0.016046178259633847*pow(d36,3) - 0.20648248682816697*pow(d36,4) + 0.001568060629276591*pow(d36,5);
Double_t rail_cord[] = {23.0, 0, 4.5, 21.4, 2.8, 4.5};
Double_t top_plate_cord[] = {10, 0, 2.1, 10.15, 0, 4.05, 11.75, 2.15, 4.0, 15.3, 4.28,
2.85, 18.1, 5.27, 2.85, 19.75, 5.65, 5.0, 21.1, 5.65, 0};
Double_t side_plate_cord[] = {11.3, 0, 2, 11.3, 0, 7.55, 16, 6.8, 4.6, 8.7, 6.8, 4.6,
19.8, 8.3, 2.35, 13.6, 8.3, 2.35, 20.8, 7.9, 3.0, 14.8, 7.9, 3.0,
21.3, 6.8, 1.5, 16.3, 6.8, 1.5, 21.3, 6.3, 0, 17.4, 6.3, 0};
//-----------------------DEFINITION OF TRANSFORMATIONS--------------------------------------------------------------------------------------
TGeoRotation* rot_top = new TGeoRotation("rot_top");
rot_top->SetAngles(0, 0, 0);
TGeoCombiTrans* combi_top = new TGeoCombiTrans(0, 15.2, 0, rot_top);
TGeoRotation* rot_bott = new TGeoRotation("rot_bott");
rot_bott->SetAngles(180, 0, 0);
TGeoCombiTrans* combi_bott = new TGeoCombiTrans(0, -15.2, 0, rot_bott);
TGeoRotation* rot_rail_top = new TGeoRotation("rot_rail_top");
rot_rail_top->SetAngles(0, 0, 0);
TGeoCombiTrans* combi_rail_top = new TGeoCombiTrans(0, 20.15 - rail_cord[4], rail_cord[2] + 33, rot_rail_top);
TGeoRotation* rot_rail = new TGeoRotation("rot_rail_bott");
rot_rail->SetAngles(0, 0, 0);
TGeoCombiTrans* combi_rail_bott = new TGeoCombiTrans(0, -20.15, rail_cord[2] + 33, rot_rail);
TGeoTranslation* ident_translation = new TGeoTranslation("ident_translation", 0, 0, 0);
ident_translation->RegisterYourself();
TGeoRotation* ident_rotation = new TGeoRotation("ident_rotation");
ident_rotation->RotateY(0);
ident_rotation->RotateY(0);
ident_rotation->RegisterYourself();
TGeoRotation* rot_left = new TGeoRotation("rot_left");
rot_left->SetAngles(90, 0, 0);
TGeoCombiTrans* combi_left = new TGeoCombiTrans(-15.2, 0, 0, rot_left);
TGeoRotation* rot_right = new TGeoRotation("rot_right");
rot_right->SetAngles(270, 0, 0);
TGeoCombiTrans* combi_right = new TGeoCombiTrans(15.2, 0, 0, rot_right);
TGeoCombiTrans* tr_top_0a = new TGeoCombiTrans(0, 15.2, top_plate_cord[2], rot_top);
TGeoCombiTrans* tr_top_1a = new TGeoCombiTrans(0, 15.2, 2 * top_plate_cord[2] + top_plate_cord[5], rot_top);
TGeoCombiTrans* tr_top_2a = new TGeoCombiTrans(
0, 15.2, 2 * top_plate_cord[2] + top_plate_cord[5] + top_plate_cord[5] + top_plate_cord[8], rot_top);
TGeoCombiTrans* tr_top_3a = new TGeoCombiTrans(0, 15.2,
2 * top_plate_cord[2] + top_plate_cord[5] + top_plate_cord[5]
+ top_plate_cord[8] + top_plate_cord[8] + top_plate_cord[11],
rot_top);
TGeoCombiTrans* tr_top_4a =
new TGeoCombiTrans(0, 15.2,
2 * top_plate_cord[2] + top_plate_cord[5] + top_plate_cord[5] + top_plate_cord[8]
+ top_plate_cord[8] + top_plate_cord[11] + top_plate_cord[11] + top_plate_cord[14],
rot_top);
TGeoCombiTrans* tr_top_5a = new TGeoCombiTrans(
0, 15.2,
2 * top_plate_cord[2] + top_plate_cord[5] + top_plate_cord[5] + top_plate_cord[8] + top_plate_cord[8]
+ top_plate_cord[11] + top_plate_cord[11] + top_plate_cord[14] + top_plate_cord[14] + top_plate_cord[17],
rot_top);
TGeoCombiTrans* tr_bott_0a = new TGeoCombiTrans(0, -15.2, top_plate_cord[2], rot_bott);
TGeoCombiTrans* tr_bott_1a = new TGeoCombiTrans(0, -15.2, 2 * top_plate_cord[2] + top_plate_cord[5], rot_bott);
TGeoCombiTrans* tr_bott_2a = new TGeoCombiTrans(
0, -15.2, 2 * top_plate_cord[2] + top_plate_cord[5] + top_plate_cord[5] + top_plate_cord[8], rot_bott);
TGeoCombiTrans* tr_bott_3a = new TGeoCombiTrans(0, -15.2,
2 * top_plate_cord[2] + top_plate_cord[5] + top_plate_cord[5]
+ top_plate_cord[8] + top_plate_cord[8] + top_plate_cord[11],
rot_bott);
TGeoCombiTrans* tr_bott_4a =
new TGeoCombiTrans(0, -15.2,
2 * top_plate_cord[2] + top_plate_cord[5] + top_plate_cord[5] + top_plate_cord[8]
+ top_plate_cord[8] + top_plate_cord[11] + top_plate_cord[11] + top_plate_cord[14],
rot_bott);
TGeoCombiTrans* tr_bott_5a = new TGeoCombiTrans(
0, -15.2,
2 * top_plate_cord[2] + top_plate_cord[5] + top_plate_cord[5] + top_plate_cord[8] + top_plate_cord[8]
+ top_plate_cord[11] + top_plate_cord[11] + top_plate_cord[14] + top_plate_cord[14] + top_plate_cord[17],
rot_bott);
TGeoCombiTrans* tr_side_left_0a = new TGeoCombiTrans(-15.2, 0, side_plate_cord[2], rot_left);
TGeoCombiTrans* tr_side_left_1a = new TGeoCombiTrans(-15.2, 0, 2 * side_plate_cord[2] + side_plate_cord[5], rot_left);
TGeoCombiTrans* tr_side_left_2a = new TGeoCombiTrans(
-15.2, 0, 2 * side_plate_cord[2] + side_plate_cord[5] + side_plate_cord[5] + side_plate_cord[8], rot_left);
TGeoCombiTrans* tr_side_left_3a =
new TGeoCombiTrans(-15.2, 0,
2 * side_plate_cord[2] + side_plate_cord[5] + side_plate_cord[5] + side_plate_cord[8]
+ side_plate_cord[8] + side_plate_cord[14],
rot_left);
TGeoCombiTrans* tr_side_left_4a =
new TGeoCombiTrans(-15.2, 0,
2 * side_plate_cord[2] + side_plate_cord[5] + side_plate_cord[5] + side_plate_cord[8]
+ side_plate_cord[8] + side_plate_cord[14] + side_plate_cord[14] + side_plate_cord[20],
rot_left);
TGeoCombiTrans* tr_side_left_5a = new TGeoCombiTrans(
-15.2, 0,
2 * side_plate_cord[2] + side_plate_cord[5] + side_plate_cord[5] + side_plate_cord[8] + side_plate_cord[8]
+ side_plate_cord[14] + side_plate_cord[14] + side_plate_cord[20] + side_plate_cord[20] + side_plate_cord[26],
rot_left);
TGeoCombiTrans* tr_side_right_0a = new TGeoCombiTrans(15.2, 0, side_plate_cord[2], rot_right);
TGeoCombiTrans* tr_side_right_1a =
new TGeoCombiTrans(15.2, 0, 2 * side_plate_cord[2] + side_plate_cord[5], rot_right);
TGeoCombiTrans* tr_side_right_2a = new TGeoCombiTrans(
15.2, 0, 2 * side_plate_cord[2] + side_plate_cord[5] + side_plate_cord[5] + side_plate_cord[8], rot_right);
TGeoCombiTrans* tr_side_right_3a =
new TGeoCombiTrans(15.2, 0,
2 * side_plate_cord[2] + side_plate_cord[5] + side_plate_cord[5] + side_plate_cord[8]
+ side_plate_cord[8] + side_plate_cord[14],
rot_right);
TGeoCombiTrans* tr_side_right_4a =
new TGeoCombiTrans(15.2, 0,
2 * side_plate_cord[2] + side_plate_cord[5] + side_plate_cord[5] + side_plate_cord[8]
+ side_plate_cord[8] + side_plate_cord[14] + side_plate_cord[14] + side_plate_cord[20],
rot_right);
TGeoCombiTrans* tr_side_right_5a = new TGeoCombiTrans(
15.2, 0,
2 * side_plate_cord[2] + side_plate_cord[5] + side_plate_cord[5] + side_plate_cord[8] + side_plate_cord[8]
+ side_plate_cord[14] + side_plate_cord[14] + side_plate_cord[20] + side_plate_cord[20] + side_plate_cord[26],
rot_right);
TGeoRotation* rot_sts_conus_connection = new TGeoRotation("rot_sts_conus_connection");
rot_sts_conus_connection->RotateZ(180);
TGeoCombiTrans* ctr_sts_conus_connection = new TGeoCombiTrans(0, 0, -1600 * mm, rot_sts_conus_connection);
TGeoRotation* rotation_of_sts_tube = new TGeoRotation("rotation_of_sts_tube");
rotation_of_sts_tube->RotateZ(180);
rotation_of_sts_tube->RotateY(-1.277);
TGeoCombiTrans* ctr_sts_tube = new TGeoCombiTrans(0.3707676 * mm, 0, -1631.001 * mm, rotation_of_sts_tube);
TGeoRotation* rot_global = new TGeoRotation("rot_global");
rot_global->RotateY(1.277);
TGeoCombiTrans* ctr_global = new TGeoCombiTrans(0, 0, 3214.99917754 * mm, rot_global);
TGeoRotation* rot_s1 = new TGeoRotation("rot_s1");
rot_s1->RotateY((90-d139));
TGeoCombiTrans* ctr_s1 = new TGeoCombiTrans("ctr_s1", d127 * mm, 0, (d133 + 15) * mm, rot_s1);
TGeoRotation* rot_s2 = new TGeoRotation("rot_s2");
rot_s2->RotateY(((90-d139) + 2*(90-d140)));
TGeoCombiTrans* ctr_s2 = new TGeoCombiTrans("ctr_s2", d128 * mm, 0, (d134 + 15) * mm, rot_s2);
TGeoRotation* rot_s3 = new TGeoRotation("rot_s3");
// rot_s3->RotateZ(180.);
rot_s3->RotateY(((90-d139) + 2*(90-d140) + 2*(90-d141)));
TGeoCombiTrans* ctr_s3 = new TGeoCombiTrans("ctr_s3", d129 * mm, 0, (d135 + 15) * mm, rot_s3);
TGeoRotation* rot_s4 = new TGeoRotation("rot_s4");
// rot_s4->RotateZ(180.);
rot_s4->RotateY(((90-d139) + 2*(90-d140) + 2*(90-d141) + 2*(90-d142)));
TGeoCombiTrans* ctr_s4 = new TGeoCombiTrans("ctr_s4", d130 * mm, 0, (d136 + 15) * mm, rot_s4);
TGeoRotation* rot_s5 = new TGeoRotation("rot_s5");
// rot_s5->RotateZ(180.);
rot_s5->RotateY(((90-d139) + 2*((90-d140) + (90-d141) + (90-d142) + (90-d143))));
TGeoCombiTrans* ctr_s5 = new TGeoCombiTrans("ctr_s5", d131 * mm, 0, (d137 + 15) * mm, rot_s5);
TGeoRotation* rot_plate = new TGeoRotation("rot_plate");
rot_plate->RotateY(-d36);
TGeoCombiTrans* ctr_plate_up =
new TGeoCombiTrans("ctr_plate_up", -30 * mm, (147 + 12.5) * mm, (292.8 + 90) * mm, rot_plate);
TGeoCombiTrans* ctr_plate_down =
new TGeoCombiTrans("ctr_plate_down", -30 * mm, -(147 + 12.5) * mm, (292.8 + 90) * mm, rot_plate);
TGeoTranslation* tr_plate_up = new TGeoTranslation("tr_plate_up", 0. * mm, (147 + 12.5) * mm, 0. * mm);
tr_plate_up->RegisterYourself();
TGeoTranslation* tr_plate_down = new TGeoTranslation("tr_plate_down", 0. * mm, -(147 + 12.5) * mm, 0. * mm);
tr_plate_down->RegisterYourself();
TGeoRotation* rot_lsn = new TGeoRotation("rot_lsn");
//rot_s5->RotateZ(180.);
rot_lsn->RotateY(-90);
TGeoCombiTrans* ctr_lsn = new TGeoCombiTrans("ctr_lsn", -22.5 * mm, -159.5 * mm, 534. * mm, rot_lsn);
TGeoTranslation* mot_transl = new TGeoTranslation("mot_transl", -286.5 * mm, -159.5 * mm, 534. * mm);
TGeoTranslation orig_translation("orig_translation", -0.15707676 * mm, 0, 3230 * mm);
TGeoTranslation orig_translation_cone("orig_translation_cone", -0.15707676 * mm, 0, 1645 * mm);
//TGeoCombiTrans *origin_translation = new TGeoCombiTrans(orig_translation,ident);
TGeoRotation orig_rotation("orig_rotation");
orig_rotation.RotateY(1.277);
//TGeoCombiTrans *origin_rotation = new TGeoCombiTrans(0,orig_rotation);
//orig_rotation->RegisterYourself();
//TGeoHMatrix orig_combi = orig_translation * orig_rotation;
TGeoHMatrix orig_combi = orig_rotation * orig_translation;
TGeoHMatrix orig_combi_cone = orig_rotation * orig_translation_cone;
TGeoHMatrix* origin_combi = new TGeoHMatrix(orig_combi);
TGeoHMatrix* origin_combi_cone = new TGeoHMatrix(orig_combi_cone);
//TGeoTranslation* cone_transl = new TGeoTranslation("cone_transl", -286.5 * mm, -159.5 * mm, 534. * mm);
TGeoRotation* rot_psd_tube = new TGeoRotation("rot_psd_tube");
rot_psd_tube->RotateY(1 - 1.5 * d36);
TGeoCombiTrans* ctr_psd_tube = new TGeoCombiTrans("ctr_psd_tube", (206.6 - 76.53) * mm, 0. * mm, (10797.9 - 3999.28) * mm, rot_psd_tube);
TGeoRotation* rot_s6 = new TGeoRotation("rot_s6");
//rot_s5->RotateZ(180.);
rot_s6->RotateY(-d36);
TGeoCombiTrans* ctr_s6 = new TGeoCombiTrans("ctr_s6", 4727.5 * sin(d36 * (pi / 180)) * mm, 0,
(4727.5 * cos(-d36 * (pi / 180)) - 4402.7) * mm, rot_s6);
TGeoTranslation* nut_transl = new TGeoTranslation("nut_transl", 0. * mm, 0. * mm, 10. * mm);
nut_transl->RegisterYourself();
//------------------------------------DEFINITIONS OF VOLUMES----------------------------------------
//--- make the top container volume
Double_t worldx = 800 * mm;
Double_t worldy = 220 * mm;
Double_t worldz = 18100 * mm;
//TGeoVolume* full_assembly = geom->MakeBox("pipe_v21g", Vacuum, worldx, worldy, worldz);
TGeoVolumeAssembly* full_assembly = new TGeoVolumeAssembly("pipe_v21i");
geom->SetTopVolume(full_assembly);
full_assembly->SetVisibility(kTRUE);
//TGeoVolume* conical_beam_pipe = geom->MakeBox("conical_beam_pipe", Vacuum, 220 * mm, 220 * mm, 1825 * mm);
TGeoVolume* conical_beam_pipe = new TGeoVolumeAssembly("conical_beam_pipe");
conical_beam_pipe->SetVisibility(kFALSE);
TGeoVolume* vacuum_conical_beam_pipe = new TGeoVolumeAssembly("vacuum_conical_beam_pipe");
vacuum_conical_beam_pipe->SetVisibility(kFALSE);
//TGeoVolume* bellow_ass = geom->MakeBox("Bellow assembly", Vacuum, 350 * mm, 220 * mm, 600 * mm);
TGeoVolume* bellow_ass = new TGeoVolumeAssembly("Bellow assembly");
bellow_ass->SetVisibility(kFALSE);
TGeoVolume* vacuum_bellow_ass = new TGeoVolumeAssembly("Vacuum_bellow assembly");
vacuum_bellow_ass->SetVisibility(kFALSE);
TGeoBBox* flange_box = new TGeoBBox("flange_box", 15.2, 15.2, 1.5);
TGeoTube* flange_hole = new TGeoTube("flange_hole", 0., 12.5, 1.6);
// TOP PLATE--------------------------------------------------------------------------------------
TGeoVolume* sub_t_plate1 = geom->MakeArb8("sub_t_plate1", CF, top_plate_cord[2]);
sub_t_plate1->SetLineColor(kGray);
TGeoArb8* t_arb1 = (TGeoArb8*) sub_t_plate1->GetShape();
t_arb1->SetVertex(0, top_plate_cord[0], top_plate_cord[1]);
t_arb1->SetVertex(1, -top_plate_cord[0], top_plate_cord[1]);
t_arb1->SetVertex(2, -top_plate_cord[0], top_plate_cord[1] + 1.0);
t_arb1->SetVertex(3, top_plate_cord[0], top_plate_cord[1] + 1.0);
t_arb1->SetVertex(4, top_plate_cord[3], top_plate_cord[4]);
t_arb1->SetVertex(5, -top_plate_cord[3], top_plate_cord[4]);
t_arb1->SetVertex(6, -top_plate_cord[3], top_plate_cord[4] + 1.0);
t_arb1->SetVertex(7, top_plate_cord[3], top_plate_cord[4] + 1.0);
TGeoVolume* sub_t_plate2 = geom->MakeArb8("sub_t_plate2", CF, top_plate_cord[5]);
sub_t_plate2->SetLineColor(kGray);
TGeoArb8* t_arb2 = (TGeoArb8*) sub_t_plate2->GetShape();
t_arb2->SetVertex(0, top_plate_cord[3], top_plate_cord[4]);
t_arb2->SetVertex(1, -top_plate_cord[3], top_plate_cord[4]);
t_arb2->SetVertex(2, -top_plate_cord[3], top_plate_cord[4] + 1.0);
t_arb2->SetVertex(3, top_plate_cord[3], top_plate_cord[4] + 1.0);
t_arb2->SetVertex(4, top_plate_cord[6], top_plate_cord[7]);
t_arb2->SetVertex(5, -top_plate_cord[6], top_plate_cord[7]);
t_arb2->SetVertex(6, -top_plate_cord[6], top_plate_cord[7] + 1.0);
t_arb2->SetVertex(7, top_plate_cord[6], top_plate_cord[7] + 1.0);
TGeoVolume* sub_t_plate3 = geom->MakeArb8("sub_t_plate3", CF, top_plate_cord[8]);
sub_t_plate3->SetLineColor(kGray);
TGeoArb8* t_arb3 = (TGeoArb8*) sub_t_plate3->GetShape();
t_arb3->SetVertex(0, top_plate_cord[6], top_plate_cord[7]);
t_arb3->SetVertex(1, -top_plate_cord[6], top_plate_cord[7]);
t_arb3->SetVertex(2, -top_plate_cord[6], top_plate_cord[7] + 1.0);
t_arb3->SetVertex(3, top_plate_cord[6], top_plate_cord[7] + 1.0);
t_arb3->SetVertex(4, top_plate_cord[9], top_plate_cord[10]);
t_arb3->SetVertex(5, -top_plate_cord[9], top_plate_cord[10]);
t_arb3->SetVertex(6, -top_plate_cord[9], top_plate_cord[10] + 1.0);
t_arb3->SetVertex(7, top_plate_cord[9], top_plate_cord[10] + 1.0);
TGeoVolume* sub_t_plate4 = geom->MakeArb8("sub_t_plate4", CF, top_plate_cord[11]);
sub_t_plate4->SetLineColor(kGray);
TGeoArb8* t_arb4 = (TGeoArb8*) sub_t_plate4->GetShape();
t_arb4->SetVertex(0, top_plate_cord[9], top_plate_cord[10]);
t_arb4->SetVertex(1, -top_plate_cord[9], top_plate_cord[10]);
t_arb4->SetVertex(2, -top_plate_cord[9], top_plate_cord[10] + 1.0);
t_arb4->SetVertex(3, top_plate_cord[9], top_plate_cord[10] + 1.0);
t_arb4->SetVertex(4, top_plate_cord[12], top_plate_cord[13]);
t_arb4->SetVertex(5, -top_plate_cord[12], top_plate_cord[13]);
t_arb4->SetVertex(6, -top_plate_cord[12], top_plate_cord[13] + 1.0);
t_arb4->SetVertex(7, top_plate_cord[12], top_plate_cord[13] + 1.0);
TGeoVolume* sub_t_plate5 = geom->MakeArb8("sub_t_plate5", CF, top_plate_cord[14]);
sub_t_plate5->SetLineColor(kGray);
TGeoArb8* t_arb5 = (TGeoArb8*) sub_t_plate5->GetShape();
t_arb5->SetVertex(0, top_plate_cord[12], top_plate_cord[13]);
t_arb5->SetVertex(1, -top_plate_cord[12], top_plate_cord[13]);
t_arb5->SetVertex(2, -top_plate_cord[12], top_plate_cord[13] + 1.0);
t_arb5->SetVertex(3, top_plate_cord[12], top_plate_cord[13] + 1.0);
t_arb5->SetVertex(4, top_plate_cord[15], top_plate_cord[17]);
t_arb5->SetVertex(5, -top_plate_cord[15], top_plate_cord[17]);
t_arb5->SetVertex(6, -top_plate_cord[15], top_plate_cord[17] + 1.0);
t_arb5->SetVertex(7, top_plate_cord[15], top_plate_cord[17] + 1.0);
TGeoVolume* sub_t_plate6 = geom->MakeArb8("sub_t_plate6", CF, top_plate_cord[17]);
sub_t_plate6->SetLineColor(kGray);
TGeoArb8* t_arb6 = (TGeoArb8*) sub_t_plate6->GetShape();
t_arb6->SetVertex(0, top_plate_cord[15], top_plate_cord[17]);
t_arb6->SetVertex(1, -top_plate_cord[15], top_plate_cord[17]);
t_arb6->SetVertex(2, -top_plate_cord[15], top_plate_cord[17] + 1.0);
t_arb6->SetVertex(3, top_plate_cord[15], top_plate_cord[17] + 1.0);
t_arb6->SetVertex(4, top_plate_cord[18], top_plate_cord[17]);
t_arb6->SetVertex(5, -top_plate_cord[18], top_plate_cord[17]);
t_arb6->SetVertex(6, -top_plate_cord[18], top_plate_cord[17] + 1.0);
t_arb6->SetVertex(7, top_plate_cord[18], top_plate_cord[17] + 1.0);
// SIDE PLATE--------------------------------------------------------------------------------------
TGeoVolume* sub_s_plate1 = geom->MakeArb8("sub_s_plate1", CF, side_plate_cord[2]);
sub_s_plate1->SetLineColor(kGray);
TGeoArb8* s_arb1 = (TGeoArb8*) sub_s_plate1->GetShape();
s_arb1->SetVertex(0, side_plate_cord[0], side_plate_cord[1]);
s_arb1->SetVertex(1, -side_plate_cord[0], side_plate_cord[1]);
s_arb1->SetVertex(2, -side_plate_cord[0], side_plate_cord[1] + 1.0);
s_arb1->SetVertex(3, side_plate_cord[0], side_plate_cord[1] + 1.0);
s_arb1->SetVertex(4, side_plate_cord[3], side_plate_cord[4]);
s_arb1->SetVertex(5, -side_plate_cord[3], side_plate_cord[4]);
s_arb1->SetVertex(6, -side_plate_cord[3], side_plate_cord[4] + 1.0);
s_arb1->SetVertex(7, side_plate_cord[3], side_plate_cord[4] + 1.0);
TGeoVolume* sub_s_plate2 = geom->MakeArb8("sub_s_plate2", CF, side_plate_cord[5]);
sub_s_plate2->SetLineColor(kGray);
TGeoArb8* s_arb2 = (TGeoArb8*) sub_s_plate2->GetShape();
s_arb2->SetVertex(0, side_plate_cord[3], side_plate_cord[4]);
s_arb2->SetVertex(1, -side_plate_cord[3], side_plate_cord[4]);
s_arb2->SetVertex(2, -side_plate_cord[3], side_plate_cord[4] + 1.0);
s_arb2->SetVertex(3, side_plate_cord[3], side_plate_cord[4] + 1.0);
s_arb2->SetVertex(4, side_plate_cord[6], side_plate_cord[7]);
s_arb2->SetVertex(5, -side_plate_cord[6], side_plate_cord[7]);
s_arb2->SetVertex(6, -side_plate_cord[6], side_plate_cord[7] + 1.0);
s_arb2->SetVertex(7, side_plate_cord[6], side_plate_cord[7] + 1.0);
TGeoVolume* sub_s_plate3 = geom->MakeArb8("sub_s_plate3", CF, side_plate_cord[8]);
sub_s_plate3->SetLineColor(kGray);
TGeoArb8* s_arb3 = (TGeoArb8*) sub_s_plate3->GetShape();
s_arb3->SetVertex(0, side_plate_cord[6], side_plate_cord[7]);
s_arb3->SetVertex(1, side_plate_cord[9], side_plate_cord[10]);
s_arb3->SetVertex(2, side_plate_cord[9], side_plate_cord[10] + 1.0);
s_arb3->SetVertex(3, side_plate_cord[6], side_plate_cord[7] + 1.0);
s_arb3->SetVertex(4, side_plate_cord[12], side_plate_cord[13]);
s_arb3->SetVertex(5, side_plate_cord[15], side_plate_cord[16]);
s_arb3->SetVertex(6, side_plate_cord[15], side_plate_cord[16] + 1.0);
s_arb3->SetVertex(7, side_plate_cord[12], side_plate_cord[13] + 1.0);
TGeoVolume* sub_s_plate4 = geom->MakeArb8("sub_s_plate4", CF, side_plate_cord[8]);
sub_s_plate4->SetLineColor(kGray);
TGeoArb8* s_arb4 = (TGeoArb8*) sub_s_plate4->GetShape();
s_arb4->SetVertex(0, -side_plate_cord[6], side_plate_cord[7]);
s_arb4->SetVertex(1, -side_plate_cord[9], side_plate_cord[10]);
s_arb4->SetVertex(2, -side_plate_cord[9], side_plate_cord[10] + 1.0);
s_arb4->SetVertex(3, -side_plate_cord[6], side_plate_cord[7] + 1.0);
s_arb4->SetVertex(4, -side_plate_cord[12], side_plate_cord[13]);
s_arb4->SetVertex(5, -side_plate_cord[15], side_plate_cord[16]);
s_arb4->SetVertex(6, -side_plate_cord[15], side_plate_cord[16] + 1.0);
s_arb4->SetVertex(7, -side_plate_cord[12], side_plate_cord[13] + 1.0);
TGeoVolume* sub_s_plate5 = geom->MakeArb8("sub_s_plate5", CF, side_plate_cord[14]);
sub_s_plate5->SetLineColor(kGray);
TGeoArb8* s_arb5 = (TGeoArb8*) sub_s_plate5->GetShape();
s_arb5->SetVertex(0, side_plate_cord[12], side_plate_cord[13]);
s_arb5->SetVertex(1, side_plate_cord[15], side_plate_cord[16]);
s_arb5->SetVertex(2, side_plate_cord[15], side_plate_cord[16] + 1.0);
s_arb5->SetVertex(3, side_plate_cord[12], side_plate_cord[13] + 1.0);
s_arb5->SetVertex(4, side_plate_cord[18], side_plate_cord[19]);
s_arb5->SetVertex(5, side_plate_cord[21], side_plate_cord[22]);
s_arb5->SetVertex(6, side_plate_cord[21], side_plate_cord[22] + 1.0);
s_arb5->SetVertex(7, side_plate_cord[18], side_plate_cord[19] + 1.0);
TGeoVolume* sub_s_plate6 = geom->MakeArb8("sub_s_plate6", CF, side_plate_cord[14]);
sub_s_plate6->SetLineColor(kGray);
TGeoArb8* s_arb6 = (TGeoArb8*) sub_s_plate6->GetShape();
s_arb6->SetVertex(0, -side_plate_cord[12], side_plate_cord[13]);
s_arb6->SetVertex(1, -side_plate_cord[15], side_plate_cord[16]);
s_arb6->SetVertex(2, -side_plate_cord[15], side_plate_cord[16] + 1.0);
s_arb6->SetVertex(3, -side_plate_cord[12], side_plate_cord[13] + 1.0);
s_arb6->SetVertex(4, -side_plate_cord[18], side_plate_cord[19]);
s_arb6->SetVertex(5, -side_plate_cord[21], side_plate_cord[22]);
s_arb6->SetVertex(6, -side_plate_cord[21], side_plate_cord[22] + 1.0);
s_arb6->SetVertex(7, -side_plate_cord[18], side_plate_cord[19] + 1.0);
TGeoVolume* sub_s_plate7 = geom->MakeArb8("sub_s_plate7", CF, side_plate_cord[20]);
sub_s_plate7->SetLineColor(kGray);
TGeoArb8* s_arb7 = (TGeoArb8*) sub_s_plate7->GetShape();
s_arb7->SetVertex(0, side_plate_cord[18], side_plate_cord[19]);
s_arb7->SetVertex(1, side_plate_cord[21], side_plate_cord[22]);
s_arb7->SetVertex(2, side_plate_cord[21], side_plate_cord[22] + 1.0);
s_arb7->SetVertex(3, side_plate_cord[18], side_plate_cord[19] + 1.0);
s_arb7->SetVertex(4, side_plate_cord[24], side_plate_cord[25]);
s_arb7->SetVertex(5, side_plate_cord[27], side_plate_cord[28]);
s_arb7->SetVertex(6, side_plate_cord[27], side_plate_cord[28] + 1.0);
s_arb7->SetVertex(7, side_plate_cord[24], side_plate_cord[25] + 1.0);
TGeoVolume* sub_s_plate8 = geom->MakeArb8("sub_s_plate8", CF, side_plate_cord[20]);
sub_s_plate8->SetLineColor(kGray);
TGeoArb8* s_arb8 = (TGeoArb8*) sub_s_plate8->GetShape();
s_arb8->SetVertex(0, -side_plate_cord[18], side_plate_cord[19]);
s_arb8->SetVertex(1, -side_plate_cord[21], side_plate_cord[22]);
s_arb8->SetVertex(2, -side_plate_cord[21], side_plate_cord[22] + 1.0);
s_arb8->SetVertex(3, -side_plate_cord[18], side_plate_cord[19] + 1.0);
s_arb8->SetVertex(4, -side_plate_cord[24], side_plate_cord[25]);
s_arb8->SetVertex(5, -side_plate_cord[27], side_plate_cord[28]);
s_arb8->SetVertex(6, -side_plate_cord[27], side_plate_cord[28] + 1.0);
s_arb8->SetVertex(7, -side_plate_cord[24], side_plate_cord[25] + 1.0);
TGeoVolume* sub_s_plate9 = geom->MakeArb8("sub_s_plate9", CF, side_plate_cord[26]);
sub_s_plate9->SetLineColor(kGray);
TGeoArb8* s_arb9 = (TGeoArb8*) sub_s_plate9->GetShape();
s_arb9->SetVertex(0, side_plate_cord[24], side_plate_cord[25]);
s_arb9->SetVertex(1, side_plate_cord[27], side_plate_cord[28]);
s_arb9->SetVertex(2, side_plate_cord[27], side_plate_cord[28] + 1.0);
s_arb9->SetVertex(3, side_plate_cord[24], side_plate_cord[25] + 1.0);
s_arb9->SetVertex(4, side_plate_cord[30], side_plate_cord[31]);
s_arb9->SetVertex(5, side_plate_cord[33], side_plate_cord[34]);
s_arb9->SetVertex(6, side_plate_cord[33], side_plate_cord[34] + 1.0);
s_arb9->SetVertex(7, side_plate_cord[30], side_plate_cord[31] + 1.0);
TGeoVolume* sub_s_plate10 = geom->MakeArb8("sub_s_plate10", CF, side_plate_cord[26]);
sub_s_plate10->SetLineColor(kGray);
TGeoArb8* s_arb10 = (TGeoArb8*) sub_s_plate10->GetShape();
s_arb10->SetVertex(0, -side_plate_cord[24], side_plate_cord[25]);
s_arb10->SetVertex(1, -side_plate_cord[27], side_plate_cord[28]);
s_arb10->SetVertex(2, -side_plate_cord[27], side_plate_cord[28] + 1.0);
s_arb10->SetVertex(3, -side_plate_cord[24], side_plate_cord[25] + 1.0);
s_arb10->SetVertex(4, -side_plate_cord[30], side_plate_cord[31]);
s_arb10->SetVertex(5, -side_plate_cord[33], side_plate_cord[34]);
s_arb10->SetVertex(6, -side_plate_cord[33], side_plate_cord[34] + 1.0);
s_arb10->SetVertex(7, -side_plate_cord[30], side_plate_cord[31] + 1.0);
// RAIL------------------------------------------------------------------------------------
TGeoVolume* sub_rail = geom->MakeArb8("sub_rail", Al, rail_cord[2]);
sub_rail->SetLineColor(kBlue);
TGeoArb8* r_arb1 = (TGeoArb8*) sub_rail->GetShape();
r_arb1->SetVertex(0, rail_cord[0], rail_cord[1]);
r_arb1->SetVertex(1, -rail_cord[0], rail_cord[1]);
r_arb1->SetVertex(2, -rail_cord[0], rail_cord[1] + rail_cord[4]);
r_arb1->SetVertex(3, rail_cord[0], rail_cord[1] + rail_cord[4]);
r_arb1->SetVertex(4, rail_cord[3], rail_cord[1]);
r_arb1->SetVertex(5, -rail_cord[3], rail_cord[1]);
r_arb1->SetVertex(6, -rail_cord[3], rail_cord[1] + rail_cord[4]);
r_arb1->SetVertex(7, rail_cord[3], rail_cord[1] + rail_cord[4]);
// DOWNSTREAM_CARBON-FIBRE_RICH_MUCH_FLANGE_TO_BELLOW_ASS------------------------------------------------------------------------------------
TGeoBBox* rich_much_flange_box = new TGeoBBox("rich_much_flange_box", 15.2, 15.2, 1.5);
TGeoTube* rich_much_flange_hole = new TGeoTube("rich_much_flange_hole", 0., 12.55, 1.6);
TGeoCompositeShape* rich_much_flange_composite =
new TGeoCompositeShape("flange_composite_rich", "rich_much_flange_box-rich_much_flange_hole");
TGeoVolume* rich_much_downstream_flange =
new TGeoVolume("rich_much_downstream_flange", rich_much_flange_composite, CF);
rich_much_downstream_flange->SetLineColor(kGray);
// VACUUM IN THE FLANGE----------------------------------------------------------------------------------------------
TGeoTube* vacuum_flange_hole = new TGeoTube("vacuum_flange_hole", 0., 12.5, 1.5);
TGeoVolume* vacuum_downstream_flange =
new TGeoVolume("vacuum_downstream_flange", vacuum_flange_hole, Vacuum);
vacuum_downstream_flange->SetLineColor(kRed);
// CONICAL_BEAM_PIPE----------------------------------------------------------------------------------------------------------
TGeoCone* conus = new TGeoCone("conus", conus_lenght, rmin1, rmax1, rmin2, rmax2);
TGeoVolume* conus_volume = new TGeoVolume("conus_volume", conus, CF);
conus_volume->SetLineColor(kGray);
//-------------------------------VACUUM IN CONE-------------------------------------------------------------------
TGeoCone* vacuum_conus = new TGeoCone("vacuum_conus", conus_lenght, 0, rmin1, 0, rmin2);
TGeoVolume* vacuum_conus_volume = new TGeoVolume("vacuum_conus_volume", vacuum_conus, Vacuum);
vacuum_conus_volume->SetLineColor(kGreen);
// CONNECTING TUBE--------------------------------------------------------------------------------------------------------------------------------------------------------
TGeoCtub* tube_connection = new TGeoCtub("tube_connection", 55. * mm, 56. * mm, 15. * mm, 0., 360., 0.022286009, 0., 0.999751636, 0., 0., 1.);
TGeoVolume* tube_connection_volume = new TGeoVolume("tube_connection_volume", tube_connection, CF);
tube_connection_volume->SetLineColor(kGray);
//------------------------VACUUM IN THE CONNECTING TUBE--------------------------------------------------------------
TGeoCtub* vacuum_tube_connection = new TGeoCtub("vacuum_tube_connection", 0. * mm, 55. * mm, 15. * mm, 0., 360., 0.022286009, 0., 0.999751636, 0., 0., 1.);
TGeoVolume* vacuum_tube_connection_volume = new TGeoVolume("vacuum_tube_connection_volume", vacuum_tube_connection, Vacuum);
vacuum_tube_connection_volume->SetLineColor(kGreen);
// STS tube-----------------------------------------------------------------------------------------------------
TGeoCtub* tube_connection_sts = new TGeoCtub("tube_connection_sts", 55. * mm, 56. * mm, 15. * mm, 0., 360., 0., 0., 1., 0.011143697, 0., 0.999937907);
TGeoVolume* tube_connection_sts_volume = new TGeoVolume("tube_connection_sts_volume", tube_connection_sts, CF);
tube_connection_sts_volume->SetLineColor(kGray);
//-------------------------------BELLOW DEFINITION----------------------------------------------------------------
TGeoCompositeShape* flange_composite = new TGeoCompositeShape("flange_composite", "flange_box-flange_hole");
TGeoVolume* bellow_flange_0 = new TGeoVolume("bellow_flange_0", flange_composite, Stainless);
bellow_flange_0->SetLineColor(kRed);
TGeoCtub* bellow_s1 = new TGeoCtub("bellow_s1", 122.5 * mm, 142.5 * mm, 35 / 2 * mm, 0., 360.,
sin((90 - d139) * (pi / 180)), 0., -cos((90 - d139) * (pi / 180)), //d139-90
sin((90 - d140) * (pi / 180)), 0., cos((90 - d140) * (pi / 180))); //d140-90
TGeoVolume* bellow_1 = new TGeoVolume("bellow_s1", bellow_s1, Stainless);
bellow_1->SetLineColor(kRed);
TGeoCtub* bellow_s2 = new TGeoCtub("bellow_s1", 122.5 * mm, 142.5 * mm, 70 / 2 * mm, 0., 360.,
sin((90 - d140) * (pi / 180)), 0., -cos((90 - d140) * (pi / 180)), //d140-90
sin((90 - d141) * (pi / 180)), 0., cos((90 - d141) * (pi / 180))); //d141-90
TGeoVolume* bellow_2 = new TGeoVolume("bellow_s2", bellow_s2, Stainless);
bellow_2->SetLineColor(kRed);
TGeoCtub* bellow_s3 = new TGeoCtub("bellow_s3", 122.5 * mm, 142.5 * mm, d145 / 2 * mm, 0., 360.,
sin((90 - d141) * (pi / 180)), 0., -cos((90 - d141) * (pi / 180)), //d145
sin((90 - d142) * (pi / 180)), 0., cos((90 - d142) * (pi / 180)));
TGeoVolume* bellow_3 = new TGeoVolume("bellow_s3", bellow_s3, Stainless);
bellow_3->SetLineColor(kRed);
TGeoCtub* bellow_s4 =
new TGeoCtub("bellow_s4", 122.5 * mm, 142.5 * mm, 70 / 2 * mm, 0., 360., sin((90 - d142) * (pi / 180)), 0., -cos((90 - d142) * (pi / 180)), sin((90 - d143) * (pi / 180)), 0., cos((90 - d143) * (pi / 180)));
TGeoVolume* bellow_4 = new TGeoVolume("bellow_s4", bellow_s4, Stainless);
bellow_4->SetLineColor(kRed);
TGeoCtub* bellow_s5 =
new TGeoCtub("bellow_s5", 122.5 * mm, 142.5 * mm, 35 / 2 * mm, 0., 360., sin((90 - d143) * (pi / 180)), 0., -cos((90 - d143) * (pi / 180)), sin((90 - d144) * (pi / 180)), 0., cos((90 - d144) * (pi / 180)));
TGeoVolume* bellow_5 = new TGeoVolume("bellow_s5", bellow_s5, Stainless);
bellow_5->SetLineColor(kRed);
//-------------------------------VACUUM BELLOW DEFINITION----------------------------------------------------------------
TGeoVolume* vacuum_bellow_flange_0 = new TGeoVolume("vacuum_bellow_flange_0", vacuum_flange_hole, Vacuum);
vacuum_bellow_flange_0->SetLineColor(kGreen);
TGeoCtub* vacuum_bellow_s1 = new TGeoCtub("vacuum_bellow_s1", 0 * mm, 122.5 * mm, 35 / 2 * mm, 0., 360.,
sin(-(90 - d139) * (pi / 180)), 0., -cos((90 - d139) * (pi / 180)), //d139-90
sin(-(90 - d140) * (pi / 180)), 0., cos((90 - d140) * (pi / 180))); //d140-90
TGeoVolume* vacuum_bellow_1 = new TGeoVolume("vacuum_bellow_s1", vacuum_bellow_s1, Vacuum);
vacuum_bellow_1->SetLineColor(kGreen);
TGeoCtub* vacuum_bellow_s2 = new TGeoCtub("vacuum_bellow_s1", 0 * mm, 122.5 * mm, 70 / 2 * mm, 0., 360.,
sin(-(90 - d140) * (pi / 180)), 0., -cos((90 - d140) * (pi / 180)), //d140-90
sin(-(90 - d141) * (pi / 180)), 0., cos((90 - d141) * (pi / 180))); //d141-90
TGeoVolume* vacuum_bellow_2 = new TGeoVolume("vacuum_bellow_s2", vacuum_bellow_s2, Vacuum);
vacuum_bellow_2->SetLineColor(kGreen);
TGeoCtub* vacuum_bellow_s3 = new TGeoCtub("vacuum_bellow_s3", 0 * mm, 122.5 * mm, d145 / 2 * mm, 0., 360.,
sin(-(90 - d141) * (pi / 180)), 0., -cos((90 - d141) * (pi / 180)),
sin(-(90 - d142) * (pi / 180)), 0., cos((90 - d142) * (pi / 180)));
TGeoVolume* vacuum_bellow_3 = new TGeoVolume("vacuum_bellow_s3", vacuum_bellow_s3, Vacuum);
vacuum_bellow_3->SetLineColor(kGreen);
TGeoCtub* vacuum_bellow_s4 =
new TGeoCtub("vacuum_bellow_s4", 0 * mm, 122.5 * mm, 70 / 2 * mm, 0., 360., sin(-(90 - d142) * (pi / 180)), 0.,
-cos((90 - d142) * (pi / 180)), sin(-(90 - d143) * (pi / 180)), 0., cos((90 - d143) * (pi / 180)));
TGeoVolume* vacuum_bellow_4 = new TGeoVolume("vacuum_bellow_s4", vacuum_bellow_s4, Vacuum);
vacuum_bellow_4->SetLineColor(kGreen);
TGeoCtub* vacuum_bellow_s5 =
new TGeoCtub("vacuum_bellow_s5", 0 * mm, 122.5 * mm, 35 / 2 * mm, 0., 360., sin(-(90 - d143) * (pi / 180)), 0.,
-cos((90 - d143) * (pi / 180)), sin(-(90 - d144) * (pi / 180)), 0., cos((90 - d144) * (pi / 180)));
TGeoVolume* vacuum_bellow_5 = new TGeoVolume("vacuum_bellow_s5", vacuum_bellow_s5, Vacuum);
vacuum_bellow_5->SetLineColor(kGreen);
TGeoBBox* roll_plate_s = new TGeoBBox("roll_plate_s", 75. * mm, 12.5 * mm, 90. * mm);
TGeoVolume* roll_plate = new TGeoVolume("roll_plate", roll_plate_s, Al);
roll_plate->SetLineColor(kBlue);
TGeoTube* flange_cyl = new TGeoTube("flange_cyl", 0., 15., 1.5);
TGeoTube* flange_cyl_hole = new TGeoTube("flange_cyl_hole", 0., 8.9, 2.5);
TGeoCompositeShape* flange_cyl_composite = new TGeoCompositeShape(
"flange_cyl_composite", "((flange_cyl-flange_cyl_hole)-roll_plate_s:tr_plate_up)-roll_plate_s:tr_plate_down");
TGeoVolume* bellow_flange_1 = new TGeoVolume("bellow_flange_1", flange_cyl_composite, Stainless);
bellow_flange_1->SetLineColor(kRed);
//-------------------------------VACUUM FLANGE BELLOW------------------------------------------------------------------
TGeoTube* vacuum_flange_cyl_hole = new TGeoTube("vacuum_flange_cyl_hole", 0., 8.9, 1.5);
TGeoVolume* vacuum_bellow_flange_1 = new TGeoVolume("vacuum_bellow_flange_1", vacuum_flange_cyl_hole, Vacuum);
vacuum_bellow_flange_1->SetLineColor(kGreen);
TGeoTube* lead_screw_s = new TGeoTube("lead_screw_s", 0. * mm, 6. * mm, 205. * mm);
TGeoTube* nut_small_s = new TGeoTube("nut_small_s", 6. * mm, 14. * mm, 50. * mm);
TGeoTube* nut_big_s = new TGeoTube("nut_big_s", 14. * mm, 24. * mm, 27. * mm);
TGeoCompositeShape* lead_screw_nut_s =
new TGeoCompositeShape("lead_screw_nut_s", "lead_screw_s+nut_small_s:nut_transl+nut_big_s:nut_transl");
TGeoVolume* lead_screw_nut = new TGeoVolume("lead_screw_nut", lead_screw_nut_s, Stainless);
lead_screw_nut->SetLineColor(kRed);
TGeoBBox* motor_s = new TGeoBBox("motor_s", 57.5 * mm, 30. * mm, 30. * mm);
TGeoVolume* motor = new TGeoVolume("motor", motor_s, Stainless);
motor->SetLineColor(kRed);
TGeoTube* psd_tube_s = new TGeoTube("psd_tube_s", 90. * mm, 92. * mm, 3230. * mm);
TGeoVolume* psd_tube = new TGeoVolume("psd_tube", psd_tube_s, CF);
psd_tube->SetLineColor(kGray);
//------------------------------VACUUM PSD TUBE-------------------------------------------------------------------------
TGeoTube* vacuum_psd_tube_s = new TGeoTube("vacuum_psd_tube_s", 0. * mm, 90. * mm, 3230. * mm);
TGeoVolume* vacuum_psd_tube = new TGeoVolume("vacuum_psd_tube", vacuum_psd_tube_s, Vacuum);
vacuum_psd_tube->SetLineColor(kGreen);
//------------------TOP plate------------------------------
bellow_ass->AddNode(sub_t_plate1, 1, tr_top_0a);
bellow_ass->AddNode(sub_t_plate2, 1, tr_top_1a);
bellow_ass->AddNode(sub_t_plate3, 1, tr_top_2a);
bellow_ass->AddNode(sub_t_plate4, 1, tr_top_3a);
bellow_ass->AddNode(sub_t_plate5, 1, tr_top_4a);
bellow_ass->AddNode(sub_t_plate6, 1, tr_top_5a);
//-----------------BOTTOM plate----------------------------
bellow_ass->AddNode(sub_t_plate1, 2, tr_bott_0a);
bellow_ass->AddNode(sub_t_plate2, 2, tr_bott_1a);
bellow_ass->AddNode(sub_t_plate3, 2, tr_bott_2a);
bellow_ass->AddNode(sub_t_plate4, 2, tr_bott_3a);
bellow_ass->AddNode(sub_t_plate5, 2, tr_bott_4a);
bellow_ass->AddNode(sub_t_plate6, 2, tr_bott_5a);
//-----------------LEFT plate------------------------------
bellow_ass->AddNode(sub_s_plate1, 1, tr_side_left_0a);
bellow_ass->AddNode(sub_s_plate2, 1, tr_side_left_1a);
bellow_ass->AddNode(sub_s_plate3, 1, tr_side_left_2a);
bellow_ass->AddNode(sub_s_plate4, 1, tr_side_left_2a);
bellow_ass->AddNode(sub_s_plate5, 1, tr_side_left_3a);
bellow_ass->AddNode(sub_s_plate6, 1, tr_side_left_3a);
bellow_ass->AddNode(sub_s_plate7, 1, tr_side_left_4a);
bellow_ass->AddNode(sub_s_plate8, 1, tr_side_left_4a);
bellow_ass->AddNode(sub_s_plate9, 1, tr_side_left_5a);
bellow_ass->AddNode(sub_s_plate10, 1, tr_side_left_5a);
//---------------RIGHT plate--------------------------------
bellow_ass->AddNode(sub_s_plate1, 2, tr_side_right_0a);
bellow_ass->AddNode(sub_s_plate2, 2, tr_side_right_1a);
bellow_ass->AddNode(sub_s_plate3, 2, tr_side_right_2a);
bellow_ass->AddNode(sub_s_plate4, 2, tr_side_right_2a);
bellow_ass->AddNode(sub_s_plate5, 2, tr_side_right_3a);
bellow_ass->AddNode(sub_s_plate6, 2, tr_side_right_3a);
bellow_ass->AddNode(sub_s_plate7, 2, tr_side_right_4a);
bellow_ass->AddNode(sub_s_plate8, 2, tr_side_right_4a);
bellow_ass->AddNode(sub_s_plate9, 2, tr_side_right_5a);
bellow_ass->AddNode(sub_s_plate10, 2, tr_side_right_5a);
//------------------RAIL-------------------------------------
bellow_ass->AddNode(sub_rail, 1, combi_rail_top);
bellow_ass->AddNode(sub_rail, 2, combi_rail_bott);
//----------------Bellow with flanges-----------------------------
bellow_ass->AddNode(bellow_flange_0, 1, new TGeoTranslation(0, 0, 1.5));
bellow_ass->AddNode(bellow_1, 1, ctr_s1);
bellow_ass->AddNode(bellow_2, 1, ctr_s2);
bellow_ass->AddNode(bellow_3, 1, ctr_s3);
bellow_ass->AddNode(bellow_4, 1, ctr_s4);
bellow_ass->AddNode(bellow_5, 1, ctr_s5);
bellow_ass->AddNode(bellow_flange_1, 1, ctr_s6);
//----------------Vacuum in bellow and flanges-----------------------------
vacuum_bellow_ass->AddNode(vacuum_bellow_flange_0, 1, new TGeoTranslation(0, 0, 1.5));
vacuum_bellow_ass->AddNode(vacuum_bellow_1, 1, ctr_s1);
vacuum_bellow_ass->AddNode(vacuum_bellow_2, 1, ctr_s2);
vacuum_bellow_ass->AddNode(vacuum_bellow_3, 1, ctr_s3);
vacuum_bellow_ass->AddNode(vacuum_bellow_4, 1, ctr_s4);
vacuum_bellow_ass->AddNode(vacuum_bellow_5, 1, ctr_s5);
vacuum_bellow_ass->AddNode(vacuum_bellow_flange_1, 1, ctr_s6);
//------------------DRIVE assembly--------------------------------------
bellow_ass->AddNode(roll_plate, 1, ctr_plate_up);
bellow_ass->AddNode(roll_plate, 2, ctr_plate_down);
bellow_ass->AddNode(lead_screw_nut, 1, ctr_lsn);
bellow_ass->AddNode(motor, 1, mot_transl);
//-------------------CONICAL section--------------------------------------------------
conical_beam_pipe->AddNode(rich_much_downstream_flange, 1, new TGeoTranslation(0, 0, 1570 * mm));
// conical_beam_pipe->AddNode(conical_beam_pipe_volume, 1, new TGeoTranslation(0, 0, -1585 * mm));
conical_beam_pipe->AddNode(conus_volume, 1, new TGeoTranslation(0, 0, 0));
conical_beam_pipe->AddNode(tube_connection_volume, 1, ctr_sts_conus_connection);
//conical_beam_pipe->AddNode(tube_connection_sts_volume, 1, ctr_sts_tube); //unexplained "nonexisting" overlap
//-------------------VACUUM in CONICAL section--------------------------------------------------
//vacuum_conical_beam_pipe->AddNode(vacuum_downstream_flange, 1, new TGeoTranslation(0, 0, 1570 * mm)); // not needed
vacuum_conical_beam_pipe->AddNode(vacuum_conus_volume, 1, new TGeoTranslation(0, 0, 0));
vacuum_conical_beam_pipe->AddNode(vacuum_tube_connection_volume, 1, ctr_sts_conus_connection);
//------------------INSERT into top volume
full_assembly->AddNode(conical_beam_pipe, 1, origin_combi_cone);
full_assembly->AddNode(bellow_ass, 1, origin_combi);
full_assembly->AddNode(psd_tube, 1, ctr_psd_tube);
full_assembly->AddNode(vacuum_conical_beam_pipe, 1, origin_combi_cone);
full_assembly->AddNode(vacuum_bellow_ass, 1, origin_combi);
full_assembly->AddNode(vacuum_psd_tube, 1, ctr_psd_tube);
//beampipe->AddNode(full_assembly,1, new TGeoTranslation(0, 0, 0*mm));
// --- close the geometry
geom->CloseGeometry();
//--- draw the ROOT box
geom->SetVisLevel(4);
full_assembly->Draw();
if (gPad && !gROOT->IsBatch()) gPad->GetViewer3D();
// --------------- Finish -----------------------------------------------
TString geo_bin_filename = "pipe_";
TString geo_name = geo_bin_filename + geoTag;
geo_bin_filename = geo_bin_filename + geoTag + ".geo.root";
TFile* binfile;
binfile = new TFile(geo_bin_filename, "RECREATE");
geom->GetTopVolume()->Write(geo_name); // outputting on the top volume
TGeoTranslation* trans = new TGeoTranslation(0.0, 0.0, 79.5);
trans->Write("trans");
cout << endl;
cout << "Geometry " << geom->GetTopVolume()->GetName() << " written to " << geo_bin_filename << endl;
binfile->Close();
//--- close the geometry
geom->CloseGeometry();
//gGeoManager->CheckOverlaps(0.000000001);
//gGeoManager->GetListOfOverlaps()->Print();
}
Loading