169 TGeoVolume *top = gGeoManager->GetTopVolume();
171 TGeoMedium *concrete = gGeoManager->GetMedium(
"Concrete");
173 TGeoMedium *rock = gGeoManager->GetMedium(
"Rock");
175 TGeoMedium *vacuum = gGeoManager->GetMedium(
"vacuum");
177 TGeoVolume *tunnel=
new TGeoVolumeAssembly(
"Tunnel");
179 TGeoVolume *detector =
new TGeoVolumeAssembly(
"Detector");
186 Double_t M[9] = {0.999978, -0.006606, 0.0000821516,
187 0.00660651, 0.999901, -0.0124347,
188 4.69368E-15, 0.0124349, 0.999923};
190 auto localSND_physCS_rot =
new TGeoRotation(
"localSND_physCS_rot");
191 localSND_physCS_rot ->SetMatrix(M);
192 auto localSND_physCS_comb =
new TGeoCombiTrans(
"localSND_physCS",0.,0.,0.,localSND_physCS_rot);
193 localSND_physCS_comb->RegisterYourself();
200 std::vector<double> TI18_o1 = {-221.4191473578 , 76.66172460057, 48820.152816717, 131.72892289383, 33.003800302801, -543.2846767937, 200.28612174928};
201 std::vector<double> TI18_i1 = {-221.4191473578 , 76.66172460057, 48820.152816717, 131.72892289383, 33.003800302801, -543.2846767937, 175.0};
202 std::vector<double> TI18_o2 = {-92.57914735775, 108.94172460057, 48288.782816717, 130.14367334394, 56.877589206698, -479.4033418058, 200.0};
203 std::vector<double> TI18_i2 = {-92.57914735775, 108.94172460057, 48288.782816717, 130.14367334394, 56.877589206698, -479.4033418058, 175.0};
204 std::vector<double> TI18_o3 = {14.66085264225, 155.81172460057, 47893.742816717, 1387.8506462618, 818.72395745673, -4733.240081082, 200.0};
205 std::vector<double> TI18_i3 = {14.66085264225, 155.81172460057, 47893.742816717, 1387.8506462618, 818.72395745673, -4733.240081082, 175.0};
206 std::vector<double> UJ18_o = {-471.0, 25.5, 48750.0, -201.8536100583633, 0.0, 3594.3365340638884, 495.0};
207 std::vector<double> UJ18_i = {-471.0,25.5, 48800.39, -201.8536100583633, 0.0, 3494.4938525621, 445.0};
208 std::vector<double> UJ18_x = {-92.57914735775,108.94172460057,48288.782816717,-141.138131672,-35.36121461014,582.09072513608,175.0};
209 std::vector<double> tu012_i = { -596.38194369, 30., 47654.730979, -155.10509191, 0.0,2761.9020453, 220.0};
210 std::vector<double> tu012_o = { -596.38194369, 30., 4.7654730979E+04, -155.10509191, 0.0,2761.9020453, 250.0};
211 std::vector<double> tu011_i = { -552.09173359, 30., 4.6171636594E+04, -99.7891926, 0.0,1954.9587043, 220.0};
212 std::vector<double> tu011_o = { -552.09173359, 30., 4.6171636594E+04, -99.7891926, 0.0,1954.9587043, 250.0,360.,850.};
213 std::vector<double> tu010_i = { -451.24339295, 30., 4.4607412772E+04, -89.817671994, 0.0,1955.4422017, 220.0};
214 std::vector<double> tu010_o = { -451.24339295, 30., 4.4607412772E+04, -89.817671994, 0.0,1955.4422017, 250.0,750.,1100.};
216 std::vector<double> TI18_1_bot = { 0.67644808637366, -74.85571453913, -4.530940169849, -221.4171473578, -18.33127539943,48818.967816717,
217 0.63027909276104 ,-74.86684394728, -4.35010639392, -221.4171473578, -93.32587539943,48818.036016717};
219 std::vector<double> TI18_1_sid = { -95.08832719702, 21.886725033285, -21.89021009926, -39.11837578468,3.7557255037298,48858.930618475,
220 -94.65075310463, -21.38126814052, -24.16767074894,-402.3825398293, 5.6093808446198,48770.79950338};
222 std::vector<double> TI18_2_bot = { 1.590393176461, -74.48871190132, -8.55964069504, -92.6293750264, 13.94692460057, 48287.934643717,
223 1.12692975448, -74.65145228529, -7.089125547405, -92.57914735775, -61.04827539943, 48286.672816717};
225 std::vector<double> TI18_2_sid = { 9.5229226656561, -2.052234306283, 2.2588218587662, 119.6722824853, -43.26523379053, 48132.959403311,
226 0.9420958238706, 0.1874442034604, 0.2780649358884, -220.8962283082, 57.49004938073, 48051.134027534};
228 std::vector<double> TI18_3_bot = { 2.6719179804842, -74.62099192635, -12.16834081665, 237.27547988904, 188.51303030346, 47133.251503475,
229 2.2386457107868, -74.59695305235, -12.40093386351, 14.844992780245, -22.78799545647, 47890.126221505};
231 std::vector<double> TI18_3_sid = { 9.4281652604622, -2.374007701455, 2.3396124281475, 399.46744859669, 116.81598987751, 47153.021981939,
232 9.332746336299, 1.9001431836442, 3.0478354225656, 88.79276895539223, 130.4393658272924, 47064.80229883217};
233 std::vector<double> PM18_ci = {50660.2873, -1256.8854,700.0,500.};
234 std::vector<double> PM18_co = {50660.2873, -1256.8854, 750.,500.};
235 std::map<TString,std::vector<double>> geoParameters = {
253 {
"TI18_1_bot",TI18_1_bot},
254 {
"TI18_1_sid",TI18_1_sid},
255 {
"TI18_2_bot",TI18_2_bot},
256 {
"TI18_2_sid",TI18_2_sid},
257 {
"TI18_3_bot",TI18_3_bot},
258 {
"TI18_3_sid",TI18_3_sid}
260 std::vector<TString>
loop1 = {
"TI18_1",
"TI18_2",
"TI18_3"};
261 std::vector<TGeoCompositeShape*> shapes;
262 std::vector<TGeoCombiTrans*> trans;
263 for(
auto it = std::begin(
loop1); it != std::end(
loop1); ++it) {
264 LOG(DEBUG)<<
"Floor: DEBUG start" << *it;
265 auto name = TString(*it);
266 TString name_i = TString(*it).ReplaceAll(
"_",
"_i");
267 TString name_o = TString(*it).ReplaceAll(
"_",
"_o");
268 TString name_bot = name+
"_bot";
269 TString name_sid = name+
"_sid";
270 LOG(DEBUG)<<
"Floor: " << geoParameters[name_i.Data()][0]<<
" "<< geoParameters[name_i.Data()][1]<<
" "<< geoParameters[name_i.Data()][2]<<
" "<<name_i;
271 TVector3 P = TVector3(geoParameters[name_i.Data()][0],geoParameters[name_i.Data()][1],geoParameters[name_i.Data()][2] -
SND_Z);
272 TVector3 H = TVector3(geoParameters[name_i.Data()][3],geoParameters[name_i.Data()][4],geoParameters[name_i.Data()][5]);
274 double rotBeta = TMath::ACos(H[2]/H.Mag());
275 double rotAlpha = TMath::ATan2(H[0]/H.Mag(), -H[1]/H.Mag());
276 double rotGamma = TMath::ACos(H[1]/H.Mag()/TMath::Sqrt(1-pow(H[2]/H.Mag(),2)));
277 auto R =
new TGeoRotation(
"R_"+name,rotAlpha*180./TMath::Pi(),rotBeta*180./TMath::Pi(),rotGamma*180./TMath::Pi());
278 auto CombiTrans =
new TGeoCombiTrans(
"T_"+name,T[0],T[1],T[2],R);
279 CombiTrans->RegisterYourself();
280 auto X = geoParameters[name_bot.Data()];
281 TVector3 Ptop(X[3],X[4], X[5] -
SND_Z);
282 TVector3 Pbot(X[9],X[10], X[11]-
SND_Z);
283 TVector3 Htop(X[0], X[1],X[2]);
284 TVector3 Hbot(X[6], X[7],X[8]);
285 X = geoParameters[name_sid.Data()];
286 TVector3 Pleft(X[9],X[10], X[11] -
SND_Z);
287 TVector3 Prigh(X[3],X[4], X[5]-
SND_Z);
288 TVector3 Hleft(X[6], X[7],X[8]);
289 TVector3 Hrigh(X[0], X[1],X[2]);
290 std::map<TString,TVector3> face = {
291 {
"front",P},{
"back",P+H}
293 std::vector<TVector3> points;
294 std::vector<TVector3> GlobalPoints;
295 Double_t master[3], P1[3], P2[3], P3[3], P4[3];
297 rotBeta = TMath::ACos(Htop[2]/Htop.Mag());
298 rotAlpha = TMath::ATan2(Htop[0]/H.Mag(), -Htop[1]/H.Mag()) ;
299 rotGamma = TMath::ACos(Htop[1]/Htop.Mag()/TMath::Sqrt(1-pow(Htop[2]/Htop.Mag(),2)));
300 auto RF =
new TGeoRotation(
"R_tube_"+name,rotAlpha*180./TMath::Pi(),rotBeta*180./TMath::Pi(),rotGamma*180./TMath::Pi());
301 Double_t dY = (Htop.Dot(Ptop)-Htop.Dot(Pbot))/Htop.Mag();
302 std::vector<TString> loopF = {
"front",
"back"};
303 for(
auto il = std::begin(loopF); il != std::end(loopF); ++il) {
304 auto X0 =
crossing(Hleft,Htop,H,Pleft,Ptop,face[*il]);
305 for(
int i = 0;i<3;i+=1) { master[i]=X0[i];}
306 GlobalPoints .push_back(X0);
307 RF->MasterToLocal(master,P1);
308 points.push_back(TVector3(P1[0],P1[1],P1[2]));
309 LOG(DEBUG) <<
"top left "<<X0[0]<<
","<<X0[1]<<
","<<X0[2]<<
"; "<<P1[0]<<
","<<P1[1]<<
","<<P1[2];
310 X0 =
crossing(Hrigh,Htop,H,Prigh,Ptop,face[*il]);
311 for(
int i = 0;i<3;i+=1) { master[i]=X0[i];}
312 GlobalPoints .push_back(X0);
313 RF->MasterToLocal(master,P2);
314 points.push_back(TVector3(P2[0],P2[1],P2[2]));
315 LOG(DEBUG) <<
"top right "<<X0[0]<<
","<<X0[1]<<
","<<X0[2]<<
"; "<<P2[0]<<
","<<P2[1]<<
","<<P2[2];
316 X0 =
crossing(Hrigh,Htop,H,Prigh,Pbot,face[*il]);
317 for(
int i = 0;i<3;i+=1) { master[i]=X0[i];}
318 GlobalPoints .push_back(X0);
319 RF->MasterToLocal(master,P3);
320 points.push_back(TVector3(P3[0],P3[1],P3[2]));
321 LOG(DEBUG) <<
"bottom right "<<X0[0]<<
","<<X0[1]<<
","<<X0[2]<<
"; "<<P3[0]<<
","<<P3[1]<<
","<<P3[2];
322 X0 =
crossing(Hleft,Htop,H,Pleft,Pbot,face[*il]);
323 for(
int i = 0;i<3;i+=1) { master[i]=X0[i];}
324 GlobalPoints .push_back(X0);
325 RF->MasterToLocal(master,P4);
326 points.push_back(TVector3(P4[0],P4[1],P4[2]));
327 LOG(DEBUG) <<
"bottom left "<<X0[0]<<
","<<X0[1]<<
","<<X0[2]<<
"; "<<P4[0]<<
","<<P4[1]<<
","<<P4[2];
330 Double_t dZ = (P3[2]-P1[2])/2.;
331 auto arb =
new TGeoArb8(name+
"_arb8",dZ);
332 arb->SetVertex(0, points[1][0], points[1][1]);
333 arb->SetVertex(1, points[5][0], points[5][1]);
334 arb->SetVertex(2, points[4][0], points[4][1]);
335 arb->SetVertex(3, points[0][0], points[0][1]);
336 arb->SetVertex(4, points[2][0], points[2][1]);
337 arb->SetVertex(5, points[6][0], points[6][1]);
338 arb->SetVertex(6, points[7][0], points[7][1]);
339 arb->SetVertex(7, points[3][0], points[3][1]);
341 Double_t local[3] = {points[1][0],points[1][1],-dZ};
342 RF->LocalToMaster(local,master);
343 TVector3 Tf(GlobalPoints[1][0]-master[0],GlobalPoints[1][1]-master[1],GlobalPoints[1][2]-master[2]);
344 auto CombiTransF =
new TGeoCombiTrans(
"T_floor_"+name,Tf[0],Tf[1],Tf[2],RF);
345 CombiTransF->RegisterYourself();
346 auto tube = gGeoManager->MakeTube(name+
"_tube", concrete, geoParameters[name_i.Data()][6], geoParameters[name_o.Data()][6],H.Mag()/2.);
347 auto Fulltube = gGeoManager->MakeTube(name+
"_fulltube", concrete, 0., geoParameters[name_o.Data()][6],H.Mag()/2.);
348 LOG(DEBUG)<<name<<
" "<<Tf[0]<<
" "<<Tf[1]<<
" "<<Tf[2];
349 auto CombiTransF1 =
new TGeoCombiTrans(
"T_floorS1_"+name,Tf[0],Tf[1]-2*dZ,Tf[2],RF);
350 auto CombiTransF2 =
new TGeoCombiTrans(
"T_floorS2_"+name,Tf[0],Tf[1]-2*dZ,Tf[2]-20,RF);
351 CombiTransF1->RegisterYourself();
352 CombiTransF2->RegisterYourself();
353 auto sunion =
new TGeoCompositeShape(name+
"_union",
"("+name+
"_tube:T_"+name+
"+"+name+
"_arb8:T_floor_"+name+
"-"+
354 name+
"_arb8:T_floorS1_"+name+
"-"+name+
"_arb8:T_floorS2_"+name+
")");
355 shapes.push_back(sunion);
356 auto Fsunion =
new TGeoCompositeShape(name+
"_Funion",
"("+name+
"_fulltube:T_"+name+
"+"+name+
"_arb8:T_floor_"+name+
"-"+
357 name+
"_arb8:T_floorS1_"+name+
"-"+name+
"_arb8:T_floorS2_"+name+
")");
358 shapes.push_back(Fsunion);
361 LOG(DEBUG) <<
"shapes "<<shapes[0]->GetName()<<
" "<<shapes[1]->GetName()<<
" "<<shapes[2]->GetName();
365 auto vetoPit =
new TGeoBBox(
"vetoPit",
369 auto VetoPit_transl =
new TGeoTranslation(
"VetoPit_transl",
373 VetoPit_transl->RegisterYourself();
377 Double_t dx_0_UJ18 = -2302.0;
378 Double_t dy_0_UJ18 = -117.0;
379 Double_t dz_0_UJ18 = 7346.0;
381 Double_t rot_Y = -13.63;
384 TGeoRotation *rotA =
new TGeoRotation(
"rotA");
385 rotA->RotateX(rot_X);
386 rotA->RotateY(rot_Y);
387 rotA->RotateZ(rot_Z);
388 TGeoCombiTrans *matA =
new TGeoCombiTrans(
"matA",dx_0_UJ18, dy_0_UJ18, dz_0_UJ18, rotA);
390 Double_t dx_UJ18, dy_UJ18, dz_UJ18;
391 Double_t dx_UJ181, dx_UJ182, dy_UJ181, dy_UJ182;
392 Double_t vert[20], par[20];
393 Double_t theta, phi, h1, bl1, tl1, alpha1, h2, bl2, tl2, alpha2;
396 Double_t rmin, rmax, rmin1, rmax1, rmin2, rmax2;
397 Double_t r, rlo, rhi;
399 Double_t point[3], norm[3];
400 Double_t rin, stin, rout, stout;
401 Double_t thx, phx, thy, phy, thz, phz;
402 Double_t alpha, theta1, theta2, phi1, phi2, dphi;
403 Double_t tr[3], rot[9];
404 Double_t z, density, radl, absl, w;
405 Double_t lx, ly, lz, tx, ty, tz;
406 Double_t xvert[50], yvert[50];
407 Double_t zsect, x0, y0, scale0;
408 Int_t nel, numed, nz, nedges, nvert;
409 TGeoBoolNode *Boolean =
nullptr;
415 TGeoShape *GDMLTube_001 =
new TGeoTube(
"GDMLTube_001",rmin,rmax,dz_UJ18);
420 TGeoShape *GDMLBox_001 =
new TGeoBBox(
"GDMLBox_001", dx_UJ18,dy_UJ18,dz_UJ18);
425 auto trans_1 =
new TGeoCombiTrans(
"trans_1");
426 trans_1->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
427 Boolean =
new TGeoSubtraction(GDMLTube_001,GDMLBox_001,0,trans_1);
429 TGeoShape *Cut_001 =
new TGeoCompositeShape(
"Cut_001", Boolean);
434 TGeoShape *GDMLTube_002 =
new TGeoTube(
"GDMLTube_002",rmin,rmax,dz_UJ18);
439 TGeoShape *GDMLTube_003 =
new TGeoTube(
"GDMLTube_003",rmin,rmax,dz_UJ18);
444 TGeoShape *GDMLBox_002 =
new TGeoBBox(
"GDMLBox_002", dx_UJ18,dy_UJ18,dz_UJ18);
449 auto trans_2 =
new TGeoCombiTrans(
"trans_2");
450 trans_2->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
451 Boolean =
new TGeoSubtraction(GDMLTube_003,GDMLBox_002,0,trans_2);
453 TGeoShape *Cut_002 =
new TGeoCompositeShape(
"Cut_002", Boolean);
454 Boolean =
new TGeoSubtraction(GDMLTube_002,Cut_002,0,0);
456 TGeoShape *Cut_003 =
new TGeoCompositeShape(
"Cut_003", Boolean);
461 TGeoShape *GDMLBox_003 =
new TGeoBBox(
"GDMLBox_003", dx_UJ18,dy_UJ18,dz_UJ18);
466 auto trans_3 =
new TGeoCombiTrans(
"trans_3");
467 trans_3->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
468 Boolean =
new TGeoSubtraction(Cut_003,GDMLBox_003,0,trans_3);
470 TGeoShape *Cut_004 =
new TGeoCompositeShape(
"Cut_004", Boolean);
475 TGeoShape *GDMLTube_004 =
new TGeoTube(
"GDMLTube_004",rmin,rmax,dz_UJ18);
480 TGeoShape *GDMLBox_004 =
new TGeoBBox(
"GDMLBox_004", dx_UJ18,dy_UJ18,dz_UJ18);
485 auto trans_4 =
new TGeoCombiTrans(
"trans_4");
486 trans_4->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
487 Boolean =
new TGeoSubtraction(GDMLTube_004,GDMLBox_004,0,trans_4);
489 TGeoShape *Cut_005 =
new TGeoCompositeShape(
"Cut_005", Boolean);
494 auto trans_5 =
new TGeoCombiTrans(
"trans_5");
495 trans_5->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
496 Boolean =
new TGeoUnion(Cut_004,Cut_005,0,trans_5);
498 TGeoShape *Add_001 =
new TGeoCompositeShape(
"Add_001", Boolean);
503 auto trans_6 =
new TGeoCombiTrans(
"trans_6");
504 trans_6->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
505 Boolean =
new TGeoUnion(Cut_001,Add_001,0,trans_6);
507 TGeoShape *Add_002 =
new TGeoCompositeShape(
"Add_002", Boolean);
512 TGeoShape *GDMLTube_005 =
new TGeoTube(
"GDMLTube_005",rmin,rmax,dz_UJ18);
517 TGeoShape *GDMLBox_005 =
new TGeoBBox(
"GDMLBox_005", dx_UJ18,dy_UJ18,dz_UJ18);
522 auto trans_7 =
new TGeoCombiTrans(
"trans_7");
523 trans_7->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
524 Boolean =
new TGeoSubtraction(GDMLTube_005,GDMLBox_005,0,trans_7);
526 TGeoShape *Cut_006 =
new TGeoCompositeShape(
"Cut_006", Boolean);
531 auto trans_8 =
new TGeoCombiTrans(
"trans_8");
532 trans_8->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
533 Boolean =
new TGeoSubtraction(Add_002,Cut_006,0,trans_8);
535 TGeoShape *Cut_007 =
new TGeoCompositeShape(
"Cut_007", Boolean);
540 TGeoShape *GDMLTube_006 =
new TGeoTube(
"GDMLTube_006",rmin,rmax,dz_UJ18);
545 TGeoShape *GDMLBox_006 =
new TGeoBBox(
"GDMLBox_006", dx_UJ18,dy_UJ18,dz_UJ18);
550 auto trans_9 =
new TGeoCombiTrans(
"trans_9");
551 trans_9->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
552 Boolean =
new TGeoSubtraction(GDMLTube_006,GDMLBox_006,0,trans_9);
554 TGeoShape *Cut_008 =
new TGeoCompositeShape(
"Cut_008", Boolean);
559 auto trans_10 =
new TGeoCombiTrans(
"trans_10");
560 trans_10->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
561 Boolean =
new TGeoSubtraction(Cut_007,Cut_008,0,trans_10);
563 TGeoShape *Cut_009 =
new TGeoCompositeShape(
"Cut_009", Boolean);
576 TGeoShape *GDMLTrap_1 =
new TGeoTrap(
"GDMLTrap_1", dz_UJ18,theta,phi,h1,bl1,tl1,alpha1,h2,bl2,tl2,alpha2);
583 thy = 87.92; phy = 90;
584 thz = 2.08; phz = 270;
585 TGeoRotation *rot_1 =
new TGeoRotation(
"rot_1",thx,phx,thy,phy,thz,phz);
586 auto trans_11 =
new TGeoCombiTrans(
"trans_11", dx_UJ18, dy_UJ18, dz_UJ18, rot_1);
587 Boolean =
new TGeoUnion(Cut_009,GDMLTrap_1,0,trans_11);
588 TGeoShape *pUJ18_shape_25 =
new TGeoCompositeShape(
"UJ18_shape", Boolean);
591 TGeoHMatrix * Matrix_setup =
new TGeoHMatrix(
"Matrix_setup");
592 Matrix_setup->Multiply(matA);
593 Matrix_setup->Multiply(trans_11);
596 const Double_t *tr1 = Matrix_setup->GetTranslation();
597 TGeoRotation *rot2 =
new TGeoRotation();
598 rot2->SetMatrix(Matrix_setup->GetRotationMatrix());
600 auto new_translation_for_UJ18 =
new TGeoCombiTrans(
"new_translation_for_UJ18", tr1[0], tr1[1], tr1[2], rot2);
601 new_translation_for_UJ18->RegisterYourself();
607 TGeoShape *GDMLTube_007 =
new TGeoTube(
"GDMLTube_007",rmin,rmax,dz_UJ18);
612 TGeoShape *GDMLBox_007 =
new TGeoBBox(
"GDMLBox_007", dx_UJ18,dy_UJ18,dz_UJ18);
617 auto trans_12 =
new TGeoCombiTrans(
"trans_12");
618 trans_12->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
619 Boolean =
new TGeoSubtraction(GDMLTube_007,GDMLBox_007,0,trans_12);
621 TGeoShape *Cut_010 =
new TGeoCompositeShape(
"Cut_010", Boolean);
626 TGeoShape *GDMLTube_008 =
new TGeoTube(
"GDMLTube_8",rmin,rmax,dz_UJ18);
631 TGeoShape *GDMLBox_008 =
new TGeoBBox(
"GDML_Box008", dx_UJ18,dy_UJ18,dz_UJ18);
636 auto trans_13 =
new TGeoCombiTrans(
"trans_13");
637 trans_13->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
638 Boolean =
new TGeoSubtraction(GDMLTube_008,GDMLBox_008,0,trans_13);
640 TGeoShape *Cut_011 =
new TGeoCompositeShape(
"Cut_011", Boolean);
645 TGeoShape *GDMLTube_009 =
new TGeoTube(
"GDMLTube_009",rmin,rmax,dz_UJ18);
650 TGeoShape *GDMLBox_009 =
new TGeoBBox(
"GDMLBox_009", dx_UJ18,dy_UJ18,dz_UJ18);
655 auto trans_14 =
new TGeoCombiTrans(
"trans_14");
656 trans_14->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
657 Boolean =
new TGeoSubtraction(GDMLTube_009,GDMLBox_009,0,trans_14);
659 TGeoShape *Cut_012 =
new TGeoCompositeShape(
"Cut_012", Boolean);
664 auto trans_15 =
new TGeoCombiTrans(
"trans_15");
665 trans_15->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
666 Boolean =
new TGeoUnion(Cut_011,Cut_012,0,trans_15);
668 TGeoShape *Add_003 =
new TGeoCompositeShape(
"Add_003", Boolean);
673 auto trans_16 =
new TGeoCombiTrans(
"trans_16");
674 trans_16->SetTranslation(dx_UJ18, dy_UJ18, dz_UJ18);
675 Boolean =
new TGeoUnion(Cut_010,Add_003,0,trans_16);
676 TGeoShape *Solid_UJ18_shape =
new TGeoCompositeShape(
"Solid_UJ18_shape", Boolean);
678 std::string tunnel_shape_name =
"(UJ18_shape:new_translation_for_UJ18+TI18_1_union+TI18_2_union+TI18_3_union)";
680 tunnel_shape_name+=
"-vetoPit:VetoPit_transl";
682 auto total =
new TGeoCompositeShape(
"Stotal",tunnel_shape_name.c_str());
683 auto volT =
new TGeoVolume(
"VTI18",total,concrete);
684 volT->SetTransparency(0);
685 volT->SetLineColor(kGray);
688 tunnel->AddNode(volT, 1);
690 std::vector<TString>
loop2 = {
"UJ18_",
"tu010_",
"tu011_",
"tu012_"};
691 for(
auto it = std::begin(
loop2); it != std::end(
loop2); ++it) {
692 TString name_i = TString(*it).ReplaceAll(
"_",
"_i");
693 TString name_o= TString(*it).ReplaceAll(
"_",
"_o");
694 TString name_F =
"F"+TString(*it);
695 TVector3 P = TVector3(geoParameters[name_i.Data()][0],geoParameters[name_i.Data()][1],geoParameters[name_i.Data()][2] -
SND_Z);
696 TVector3 H = TVector3(geoParameters[name_i.Data()][3],geoParameters[name_i.Data()][4],geoParameters[name_i.Data()][5]);
697 auto vol = gGeoManager->MakeTube(*it, concrete, geoParameters[name_i.Data()][6], geoParameters[name_o.Data()][6],H.Mag()/2.-5.);
698 auto Fvol = gGeoManager->MakeTube(name_F, concrete, 0., geoParameters[name_o.Data()][6],H.Mag()/2.-5.);
699 vol->SetTransparency(0);
700 vol->SetLineColor(kGray);
702 double rotBeta = TMath::ACos(H[2]/H.Mag());
703 double rotAlpha = TMath::ATan2(H[0]/H.Mag(), -H[1]/H.Mag());
704 double rotGamma = TMath::ACos(H[1]/H.Mag()/TMath::Sqrt(1-pow(H[2]/H.Mag(),2)));
705 TString name =
"R_"+TString(*it);
706 auto R =
new TGeoRotation(name,rotAlpha*180./TMath::Pi(),rotBeta*180./TMath::Pi(),rotGamma*180./TMath::Pi());
707 auto CombiTrans =
new TGeoCombiTrans(
"TS_"+TString(*it),T[0],T[1],T[2],R);
708 CombiTrans->RegisterYourself();
709 trans.push_back(CombiTrans);
713 Double_t dx_0_LHC = -336.0;
714 Double_t dy_0_LHC = 258.0;
715 Double_t dz_0_LHC = -590.0;
716 Double_t rot_X_LHC = 0.0 ;
717 Double_t rot_Y_LHC = -13.63;
718 Double_t rot_Z_LHC = 0.0 ;
720 TGeoRotation *rotB =
new TGeoRotation(
"rotB");
721 rotB->RotateX(rot_X_LHC);
722 rotB->RotateY(rot_Y_LHC);
723 rotB->RotateZ(rot_Z_LHC);
724 TGeoCombiTrans *matB =
new TGeoCombiTrans(
"matB",dx_0_LHC, dy_0_LHC, dz_0_LHC, rotB);
726 Double_t dx_LHC, dy_LHC, dz_LHC;
727 Double_t dx_LHC1, dx_LHC2, dy_LHC1, dy_LHC2;
728 Double_t rmin_LHC, rmax_LHC, rmin_LHC1, rmax_LHC1, rmin_LHC2, rmax_LHC2;
733 TGeoShape *Tube_LHC_001 =
new TGeoTube(
"Tube_LHC_001",rmin_LHC,rmax_LHC,dz_LHC);
738 TGeoShape *Box_LHC_001 =
new TGeoBBox(
"Box_LHC_001", dx_LHC,dy_LHC,dz_LHC);
743 auto LHC_trans_001 =
new TGeoCombiTrans(
"LHC_trans_001");
744 LHC_trans_001->SetTranslation(dx_LHC, dy_LHC, dz_LHC);
745 Boolean =
new TGeoIntersection(Tube_LHC_001,Box_LHC_001,0,LHC_trans_001);
746 TGeoShape *Intersect_LHC_001 =
new TGeoCompositeShape(
"Intersect_LHC_001", Boolean);
751 TGeoShape *Tube_LHC_002 =
new TGeoTube(
"Tube_LHC_002",rmin_LHC,rmax_LHC,dz_LHC);
752 Boolean =
new TGeoUnion(Intersect_LHC_001,Tube_LHC_002,0,0);
753 TGeoShape *Add_LHC_001 =
new TGeoCompositeShape(
"Add_LHC_001", Boolean);
758 TGeoShape *Box_LHC_002 =
new TGeoBBox(
"Box_LHC_002", dx_LHC,dy_LHC,dz_LHC);
763 auto LHC_trans_002 =
new TGeoCombiTrans(
"LHC_trans_002");
764 LHC_trans_002->SetTranslation(dx_LHC, dy_LHC, dz_LHC);
765 Boolean =
new TGeoSubtraction(Add_LHC_001,Box_LHC_002,0,LHC_trans_002);
766 TGeoShape *Cut_LHC_001 =
new TGeoCompositeShape(
"Cut_LHC_001", Boolean);
769 TGeoHMatrix * Matrix_setup_LHC =
new TGeoHMatrix(
"Matrix_setup_LHC");
770 Matrix_setup_LHC->Multiply(matB);
771 Matrix_setup_LHC->Multiply(LHC_trans_002);
773 Matrix_setup_LHC->RegisterYourself();
775 auto total2 =
new TGeoCompositeShape(
"Stotal2",
"Cut_LHC_001:Matrix_setup_LHC-Solid_UJ18_shape:new_translation_for_UJ18");
776 auto volT2 =
new TGeoVolume(
"VUJ",total2,concrete);
777 volT2->SetTransparency(0);
778 volT2->SetLineColor(kGray);
779 tunnel->AddNode(volT2, 1);
785 TGeoShape *Tube_LHC_solid_001 =
new TGeoTube(
"Tube_LHC_solid_001",rmin_LHC,rmax_LHC,dz_LHC);
790 TGeoShape *Box_LHC_solid_001 =
new TGeoBBox(
"Box_LHC_solid_001", dx_LHC,dy_LHC,dz_LHC);
795 auto LHC_solid_trans_001 =
new TGeoCombiTrans(
"LHC_solid_trans_001");
796 LHC_solid_trans_001->SetTranslation(dx_LHC, dy_LHC, dz_LHC);
797 Boolean =
new TGeoSubtraction(Tube_LHC_solid_001,Box_LHC_solid_001,0,LHC_solid_trans_001);
798 TGeoShape *Cut_solid_LHC_001 =
new TGeoCompositeShape(
"Cut_solid_LHC_001", Boolean);
829 double dz = (geoParameters[
"TI18_o1"][2] - zs)/2.;
830 double extended_z = 1860;
832 auto bigBox =
new TGeoBBox(
"BigBox", 2000.,1500. , dz+extended_z);
833 auto TR_1 =
new TGeoTranslation(
"TR_1",0.,0.,-dz+extended_z+geoParameters[
"TI18_o1"][2]-
SND_Z - 50.);
834 TR_1->RegisterYourself();
836 auto cutOut =
new TGeoCompositeShape(
838 "BigBox:TR_1-(Cut_solid_LHC_001:Matrix_setup_LHC)-(TI18_1_Funion+TI18_2_Funion+TI18_3_Funion+Solid_UJ18_shape:new_translation_for_UJ18)");
840 auto volT3 =
new TGeoVolume(
"Vrock",cutOut,rock);
841 volT3->SetTransparency(75);
842 volT3->SetLineColor(kRed);
843 tunnel->AddNode(volT3, 1);
845 double z_dim_exitPlane = 1.;
846auto exitPlane = gGeoManager->MakeBox(
"exitScoringPlane",vacuum,1000.,1000. , z_dim_exitPlane);
847exitPlane->SetLineColor(kGreen);
848exitPlane->SetVisibility(kFALSE);
850tunnel->AddNode(exitPlane,1,
new TGeoTranslation(-1500.0,0,((2*extended_z)+geoParameters[
"TI18_o1"][2]-
SND_Z - 50 + z_dim_exitPlane)));
854 TGeoMedium *Bor30Poly = gGeoManager->GetMedium(
"Borated30polyethylene");
856 TGeoMedium *Acrylic = gGeoManager->GetMedium(
"PMMA");
857 TVector3 displacement;
859 Double_t fAcrylicWidth =
conf_floats[
"Floor/Acrylic_width"];
860 Double_t fBPolyWidth =
conf_floats[
"Floor/BPoly_width"];
861 Double_t fCBFrontWallXDim =
conf_floats[
"Floor/CBFrontWall_xdim"];
862 Double_t fCBFrontWallYDim =
conf_floats[
"Floor/CBFrontWall_ydim"];
863 Double_t fCBLatWallZDim =
conf_floats[
"Floor/CBLatWall_zdim"];
864 Double_t fCBTinyZDim =
conf_floats[
"Floor/CBTiny_zdim"];
865 Double_t fCBExtraZDim =
conf_floats[
"Floor/CBExtra_zdim"];
866 Double_t fCBExtraXDim =
conf_floats[
"Floor/CBExtra_xdim"];
867 Double_t fSlopedWallZProj =
conf_floats[
"Floor/SlopedWall_zproj"];
868 Double_t fCBRearWallXDim =
869 fCBFrontWallXDim - fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) - fCBExtraXDim + fAcrylicWidth;
870 Double_t fFeBlockX =
conf_floats[
"Floor/MFeBlockX"];
871 Double_t fFeBlockY =
conf_floats[
"Floor/MFeBlockY"];
872 Double_t fFeBlockZ =
conf_floats[
"Floor/MFeBlockZ"];
876 TGeoBBox *FeBlock_cb =
new TGeoBBox(
"FeBlock_cb", fFeBlockX / 2, fFeBlockY / 2, fFeBlockZ / 2);
877 TGeoBBox *CBFrontWall_a =
878 new TGeoBBox(
"CBFrontWall_a", fCBFrontWallXDim / 2., fCBFrontWallYDim / 2., fAcrylicWidth / 2.);
879 TGeoBBox *CBLateral_a =
880 new TGeoBBox(
"CBLateral_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2., (fCBLatWallZDim - 2 * fAcrylicWidth) / 2.);
881 TGeoBBox *CBExtraFront_a =
882 new TGeoBBox(
"CBExtraFront_a", fCBExtraXDim / 2., fCBFrontWallYDim / 2., fAcrylicWidth / 2.);
883 TGeoBBox *CBExtraLat_a =
884 new TGeoBBox(
"CBExtraLat_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2., (fCBExtraZDim - 2 * fAcrylicWidth) / 2.);
885 TGeoBBox *CBTiny1_a =
new TGeoBBox(
"CBTiny1_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2.,
886 (fCBTinyZDim - fAcrylicWidth - fBPolyWidth) / 2.);
887 TGeoBBox *CBTiny2_a =
888 new TGeoBBox(
"CBTiny2_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2., (fCBTinyZDim - fAcrylicWidth) / 2.);
889 TGeoBBox *CBRearWall_a =
890 new TGeoBBox(
"CBRearWall_a", fCBRearWallXDim / 2., fCBFrontWallYDim / 2., fAcrylicWidth / 2.);
892 TGeoTranslation *CBWallpos =
new TGeoTranslation(
"CBWallpos", (fCBRearWallXDim - fFeBlockX) / 2. - 28.5,
893 (fCBFrontWallYDim - fFeBlockY) / 2. - 118., 0);
894 CBWallpos->RegisterYourself();
896 TGeoCompositeShape *CBWallDownstream =
897 new TGeoCompositeShape(
"CBWallDownstream",
"CBRearWall_a-(FeBlock_cb:CBWallpos)");
898 TGeoPara *CBWallSlope_a =
899 new TGeoPara(
"CBWallSlope_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2., fSlopedWallZProj / 2., 0, -15, 0);
902 Double_t LatCover1_averts[8][2];
903 LatCover1_averts[0][0] = 0.;
904 LatCover1_averts[0][1] = 0.;
905 LatCover1_averts[1][0] = fAcrylicWidth;
906 LatCover1_averts[1][1] = 0;
907 LatCover1_averts[2][0] = fAcrylicWidth;
908 LatCover1_averts[2][1] = -(176.71 - 170.72);
909 LatCover1_averts[3][0] = 0.;
910 LatCover1_averts[3][1] = -(176.71 - 170.72);
912 LatCover1_averts[4][0] = 0;
913 LatCover1_averts[4][1] = 0;
914 LatCover1_averts[5][0] = fAcrylicWidth;
915 LatCover1_averts[5][1] = 0;
916 LatCover1_averts[6][0] = fAcrylicWidth;
917 LatCover1_averts[6][1] = -(187.03 - 170.72);
918 LatCover1_averts[7][0] = 0;
919 LatCover1_averts[7][1] = -(187.03 - 170.72);
920 TGeoArb8 *LatCov1_a =
new TGeoArb8(
"LatCov1_a", 176. / 2., (Double_t *)LatCover1_averts);
922 Double_t tanalpha = (183.26 - 170.72) / 144.;
923 Double_t LatCover21_averts[8][2];
924 LatCover21_averts[0][0] = 0.;
925 LatCover21_averts[0][1] = 0.;
926 LatCover21_averts[1][0] = fAcrylicWidth;
927 LatCover21_averts[1][1] = 0;
928 LatCover21_averts[2][0] = fAcrylicWidth;
929 LatCover21_averts[2][1] = 0;
930 LatCover21_averts[3][0] = 0.;
931 LatCover21_averts[3][1] = 0;
933 LatCover21_averts[4][0] = 0;
934 LatCover21_averts[4][1] = 0;
935 LatCover21_averts[5][0] = fAcrylicWidth;
936 LatCover21_averts[5][1] = 0;
937 LatCover21_averts[6][0] = fAcrylicWidth;
938 LatCover21_averts[6][1] = -fCBTinyZDim * tanalpha;
939 LatCover21_averts[7][0] = 0;
940 LatCover21_averts[7][1] = -fCBTinyZDim * tanalpha;
941 TGeoArb8 *LatCov21_a =
new TGeoArb8(
"LatCov21_a", fCBTinyZDim / 2., (Double_t *)LatCover21_averts);
943 Double_t LatCover22_averts[8][2];
944 LatCover22_averts[0][0] = 0.;
945 LatCover22_averts[0][1] = 0.;
946 LatCover22_averts[1][0] = fAcrylicWidth;
947 LatCover22_averts[1][1] = 0;
948 LatCover22_averts[2][0] = fAcrylicWidth;
949 LatCover22_averts[2][1] = -fCBTinyZDim * tanalpha;
950 LatCover22_averts[3][0] = 0.;
951 LatCover22_averts[3][1] = -fCBTinyZDim * tanalpha;
953 LatCover22_averts[4][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.);
954 LatCover22_averts[4][1] = 0;
955 LatCover22_averts[5][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) + fAcrylicWidth;
956 LatCover22_averts[5][1] = 0;
957 LatCover22_averts[6][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) + fAcrylicWidth;
958 LatCover22_averts[6][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
959 LatCover22_averts[7][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.);
960 LatCover22_averts[7][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
961 TGeoArb8 *LatCov22_a =
new TGeoArb8(
"LatCov22_a", fSlopedWallZProj / 2., (Double_t *)LatCover22_averts);
963 Double_t LatCover23_averts[8][2];
964 LatCover23_averts[0][0] = 0.;
965 LatCover23_averts[0][1] = 0.;
966 LatCover23_averts[1][0] = fAcrylicWidth;
967 LatCover23_averts[1][1] = 0;
968 LatCover23_averts[2][0] = fAcrylicWidth;
969 LatCover23_averts[2][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
970 LatCover23_averts[3][0] = 0.;
971 LatCover23_averts[3][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
973 LatCover23_averts[4][0] = 0;
974 LatCover23_averts[4][1] = 0;
975 LatCover23_averts[5][0] = fAcrylicWidth;
976 LatCover23_averts[5][1] = 0;
977 LatCover23_averts[6][0] = fAcrylicWidth;
978 LatCover23_averts[6][1] = -(183.26 - 170.72);
979 LatCover23_averts[7][0] = 0;
980 LatCover23_averts[7][1] = -(183.26 - 170.72);
981 TGeoArb8 *LatCov23_a =
new TGeoArb8(
"LatCov23_a", (fCBTinyZDim - fBPolyWidth) / 2., (Double_t *)LatCover23_averts);
983 Double_t tanbeta = (176.74 - 170.72) / 219.0;
984 Double_t FrontCover1_averts[8][2];
985 FrontCover1_averts[0][0] = (fCBFrontWallXDim-2*fAcrylicWidth)/2.;
986 FrontCover1_averts[0][1] = 0.;
987 FrontCover1_averts[1][0] = (fCBFrontWallXDim-2*fAcrylicWidth)/2.;
988 FrontCover1_averts[1][1] = -(fAcrylicWidth)*tanbeta;
989 FrontCover1_averts[2][0] = -(fCBFrontWallXDim-2*fAcrylicWidth)/2.;
990 FrontCover1_averts[2][1] = -(fCBFrontWallXDim-fAcrylicWidth)*tanbeta;
991 FrontCover1_averts[3][0] = -(fCBFrontWallXDim-2*fAcrylicWidth)/2.;
992 FrontCover1_averts[3][1] = 0;
994 FrontCover1_averts[4][0] = (fCBFrontWallXDim-2*fAcrylicWidth)/2.;
995 FrontCover1_averts[4][1] = 0;
996 FrontCover1_averts[5][0] = (fCBFrontWallXDim-2*fAcrylicWidth)/2.;
997 FrontCover1_averts[5][1] = -(fAcrylicWidth)*tanbeta;
998 FrontCover1_averts[6][0] = -(fCBFrontWallXDim-2*fAcrylicWidth)/2.;
999 FrontCover1_averts[6][1] = -(fCBFrontWallXDim-fAcrylicWidth)*tanbeta;
1000 FrontCover1_averts[7][0] = -(fCBFrontWallXDim-2*fAcrylicWidth)/2.;
1001 FrontCover1_averts[7][1] = 0;
1002 TGeoArb8 *FrontCov1_a =
new TGeoArb8(
"FrontCov1_a", fAcrylicWidth / 2., (Double_t *)FrontCover1_averts);
1004 Double_t tangamma = (187.03 - 183.26) / (fCBRearWallXDim - fAcrylicWidth + fCBExtraXDim);
1005 Double_t xdim_projected = (187.03 - 170.72) / tangamma;
1006 Double_t extra = xdim_projected - (fCBRearWallXDim - fAcrylicWidth + fCBExtraXDim);
1007 Double_t RearCover_11_averts[8][2];
1008 RearCover_11_averts[0][0] = (fCBRearWallXDim-2*fAcrylicWidth)/2.;
1009 RearCover_11_averts[0][1] = 0.;
1010 RearCover_11_averts[1][0] = (fCBRearWallXDim-2*fAcrylicWidth)/2.;
1011 RearCover_11_averts[1][1] = -(183.26-170.72);
1012 RearCover_11_averts[2][0] = -(fCBRearWallXDim-2*fAcrylicWidth)/2.;
1013 RearCover_11_averts[2][1] = -(fCBRearWallXDim-fAcrylicWidth+extra)*tangamma;
1014 RearCover_11_averts[3][0] = -(fCBRearWallXDim-2*fAcrylicWidth)/2.;
1015 RearCover_11_averts[3][1] = 0;
1017 RearCover_11_averts[4][0] = (fCBRearWallXDim-2*fAcrylicWidth)/2.;
1018 RearCover_11_averts[4][1] = 0;
1019 RearCover_11_averts[5][0] = (fCBRearWallXDim-2*fAcrylicWidth)/2.;
1020 RearCover_11_averts[5][1] = -(183.26-170.72);
1021 RearCover_11_averts[6][0] = -(fCBRearWallXDim-2*fAcrylicWidth)/2.;
1022 RearCover_11_averts[6][1] = -(fCBRearWallXDim-fAcrylicWidth+extra)*tangamma;
1023 RearCover_11_averts[7][0] = -(fCBRearWallXDim-2*fAcrylicWidth)/2.;
1024 RearCover_11_averts[7][1] = 0;
1025 TGeoArb8 *RearCov11_atot =
new TGeoArb8(
"RearCov11_atot", fAcrylicWidth / 2., (Double_t *)RearCover_11_averts);
1026 TGeoTranslation *CBWallpos2 =
1027 new TGeoTranslation(
"CBWallpos2", (fCBRearWallXDim - fFeBlockX) / 2. - 28.5, 0, -fAcrylicWidth / 2.);
1028 CBWallpos2->RegisterYourself();
1029 TGeoCompositeShape *RearCov11_a =
new TGeoCompositeShape(
"RearCov11_a",
"RearCov11_atot-(FeBlock_cb:CBWallpos2)");
1031 Double_t RearCover_12_averts[8][2];
1032 RearCover_12_averts[0][0] = fAcrylicWidth/2.;
1033 RearCover_12_averts[0][1] = 0.;
1034 RearCover_12_averts[1][0] = fAcrylicWidth/2.;
1035 RearCover_12_averts[1][1] = -(fCBRearWallXDim-fAcrylicWidth+extra)*tangamma;
1036 RearCover_12_averts[2][0] = -fAcrylicWidth/2.;
1037 RearCover_12_averts[2][1] = -(fCBRearWallXDim+extra)*tangamma;
1038 RearCover_12_averts[3][0] = -fAcrylicWidth/2.;
1039 RearCover_12_averts[3][1] = 0;
1041 RearCover_12_averts[4][0] = fAcrylicWidth/2.;
1042 RearCover_12_averts[4][1] = 0;
1043 RearCover_12_averts[5][0] = fAcrylicWidth/2.;
1044 RearCover_12_averts[5][1] = -(fCBRearWallXDim-fAcrylicWidth+extra)*tangamma;
1045 RearCover_12_averts[6][0] = -fAcrylicWidth/2.;
1046 RearCover_12_averts[6][1] = -(fCBRearWallXDim+extra)*tangamma;
1047 RearCover_12_averts[7][0] = -fAcrylicWidth/2.;
1048 RearCover_12_averts[7][1] = 0;
1049 TGeoArb8 *RearCov12_a =
new TGeoArb8(
"RearCov12_a", fCBExtraZDim / 2., (Double_t *)RearCover_12_averts);
1051 Double_t RearCover_13_averts[8][2];
1052 RearCover_13_averts[0][0] = (fCBExtraXDim-2*fAcrylicWidth)/2.;
1053 RearCover_13_averts[0][1] = 0.;
1054 RearCover_13_averts[1][0] = (fCBExtraXDim-2*fAcrylicWidth)/2.;
1055 RearCover_13_averts[1][1] = -(fCBRearWallXDim+extra)*tangamma;
1056 RearCover_13_averts[2][0] = -(fCBExtraXDim-2*fAcrylicWidth)/2.;
1057 RearCover_13_averts[2][1] = -(187.03-170.72);
1058 RearCover_13_averts[3][0] = -(fCBExtraXDim-2*fAcrylicWidth)/2.;
1059 RearCover_13_averts[3][1] = 0;
1061 RearCover_13_averts[4][0] = (fCBExtraXDim-2*fAcrylicWidth)/2.;
1062 RearCover_13_averts[4][1] = 0;
1063 RearCover_13_averts[5][0] = (fCBExtraXDim-2*fAcrylicWidth)/2.;
1064 RearCover_13_averts[5][1] = -(fCBRearWallXDim+extra)*tangamma;
1065 RearCover_13_averts[6][0] = -(fCBExtraXDim-2*fAcrylicWidth)/2.;
1066 RearCover_13_averts[6][1] = -(187.03-170.72);
1067 RearCover_13_averts[7][0] = -(fCBExtraXDim-2*fAcrylicWidth)/2.;
1068 RearCover_13_averts[7][1] = 0;
1069 TGeoArb8 *RearCov13_a =
new TGeoArb8(
"RearCov13_a", fAcrylicWidth / 2., (Double_t *)RearCover_13_averts);
1072 TGeoTranslation *FrontWallpos =
1073 new TGeoTranslation(
"FrontWallpos", -fCBRearWallXDim / 2. - fCBExtraXDim + fAcrylicWidth + fCBFrontWallXDim / 2.,
1074 0, -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fBPolyWidth);
1075 FrontWallpos->RegisterYourself();
1076 TGeoTranslation *Tiny1pos =
1077 new TGeoTranslation(
"Tiny1pos", (fCBRearWallXDim - fAcrylicWidth) / 2., 0, -fCBTinyZDim / 2. + fBPolyWidth / 2.);
1078 Tiny1pos->RegisterYourself();
1079 TGeoTranslation *SlopeWallpos =
1080 new TGeoTranslation(
"SlopeWallpos",
1081 (fCBRearWallXDim + fAcrylicWidth) / 2. + fAcrylicWidth +
1082 fSlopedWallZProj / (2 * TMath::Tan(TMath::DegToRad() * 85.)),
1083 0, -fCBTinyZDim - fSlopedWallZProj / 2. + fAcrylicWidth / 2. + fBPolyWidth);
1084 SlopeWallpos->RegisterYourself();
1085 TGeoTranslation *Tiny2pos =
new TGeoTranslation(
1087 3 * fAcrylicWidth + fCBRearWallXDim / 2. + fAcrylicWidth / 2. +
1088 fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)),
1089 0, -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. + fBPolyWidth);
1090 Tiny2pos->RegisterYourself();
1091 TGeoTranslation *CBExtraLatpos =
new TGeoTranslation(
"CBExtraLatpos", -fCBRearWallXDim / 2. + fAcrylicWidth / 2., 0,
1092 fAcrylicWidth / 2. + (fCBExtraZDim - 2 * fAcrylicWidth) / 2.);
1093 CBExtraLatpos->RegisterYourself();
1094 TGeoTranslation *CBExtraFrontpos =
new TGeoTranslation(
1095 "CBExtraFrontpos", -fCBRearWallXDim / 2. + fAcrylicWidth - fCBExtraXDim / 2., 0, fCBExtraZDim - fAcrylicWidth);
1096 CBExtraFrontpos->RegisterYourself();
1097 TGeoTranslation *CBLateralpos =
1098 new TGeoTranslation(
"CBLateralpos", -fCBRearWallXDim / 2. - fCBExtraXDim + fAcrylicWidth + fAcrylicWidth / 2., 0,
1099 fCBExtraZDim - fCBLatWallZDim / 2. - fAcrylicWidth / 2.);
1100 CBLateralpos->RegisterYourself();
1101 TGeoTranslation *CBLatCov1pos =
1102 new TGeoTranslation(
"CBLatCov1pos", -fCBRearWallXDim / 2. - fCBExtraXDim + fAcrylicWidth, -fCBFrontWallYDim / 2.,
1103 fCBExtraZDim - fCBLatWallZDim / 2. - fAcrylicWidth / 2.);
1104 CBLatCov1pos->RegisterYourself();
1105 TGeoTranslation *CBLatCov21pos =
new TGeoTranslation(
1107 3 * fAcrylicWidth + fCBRearWallXDim / 2. + fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)),
1108 -fCBFrontWallYDim / 2.,
1109 -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. + fBPolyWidth -
1110 fAcrylicWidth / 2.);
1111 CBLatCov21pos->RegisterYourself();
1112 TGeoTranslation *CBLatCov22pos =
new TGeoTranslation(
1114 3 * fAcrylicWidth + fCBRearWallXDim / 2. + fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)),
1115 -fCBFrontWallYDim / 2.,
1116 -(fSlopedWallZProj / 2 + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. + fBPolyWidth -
1117 fAcrylicWidth / 2. + fCBTinyZDim / 2.);
1118 CBLatCov22pos->RegisterYourself();
1119 TGeoTranslation *CBLatCov23pos =
1120 new TGeoTranslation(
"CBLatCov23pos", (fCBRearWallXDim - fAcrylicWidth) / 2. - fAcrylicWidth / 2.,
1121 -fCBFrontWallYDim / 2., -fCBTinyZDim / 2. + fBPolyWidth + 0.5);
1122 CBLatCov23pos->RegisterYourself();
1123 TGeoTranslation *CBFrontCov1pos =
new TGeoTranslation(
1124 "CBFrontCov1pos", -fCBRearWallXDim / 2. - fCBExtraXDim + fAcrylicWidth + fCBFrontWallXDim / 2.,
1125 -fCBFrontWallYDim / 2., -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fBPolyWidth);
1126 CBFrontCov1pos->RegisterYourself();
1127 TGeoTranslation *CBRearCov11pos =
new TGeoTranslation(
"CBRearCov11pos", 0, -fCBFrontWallYDim / 2., 0);
1128 CBRearCov11pos->RegisterYourself();
1129 TGeoTranslation *CBRearCov12pos =
1130 new TGeoTranslation(
"CBRearCov12pos", -fCBRearWallXDim / 2. + fAcrylicWidth / 2., -fCBFrontWallYDim / 2.,
1131 fAcrylicWidth / 2. + (fCBExtraZDim - 2 * fAcrylicWidth) / 2.);
1132 CBRearCov12pos->RegisterYourself();
1133 TGeoTranslation *CBRearCov13pos =
1134 new TGeoTranslation(
"CBRearCov13pos", -fCBRearWallXDim / 2. + fAcrylicWidth - fCBExtraXDim / 2.,
1135 -fCBFrontWallYDim / 2., fCBExtraZDim - fAcrylicWidth);
1136 CBRearCov13pos->RegisterYourself();
1139 TGeoCompositeShape *COLDBOXA =
new TGeoCompositeShape(
1141 "CBWallDownstream+(CBFrontWall_a:FrontWallpos)+(CBTiny1_a:Tiny1pos)+(CBWallSlope_a:SlopeWallpos)+(CBTiny2_a:"
1142 "Tiny2pos)+(CBExtraLat_a:CBExtraLatpos)+(CBExtraFront_a:CBExtraFrontpos)+(CBLateral_a:CBLateralpos)+(LatCov1_a:"
1143 "CBLatCov1pos)+(LatCov21_a:CBLatCov21pos)+(LatCov22_a:CBLatCov22pos)+(LatCov23_a:CBLatCov23pos)+(FrontCov1_a:"
1144 "CBFrontCov1pos)+(RearCov11_a:CBRearCov11pos)+(RearCov12_a:CBRearCov12pos)+(RearCov13_a:CBRearCov13pos)");
1145 TGeoVolume *volCOLDBOXA =
new TGeoVolume(
"volCOLDBOXA", COLDBOXA, Acrylic);
1148 Double_t fCBFrontWallXDim_b = fCBFrontWallXDim - 2 * fAcrylicWidth - fBPolyWidth;
1149 Double_t fCBFrontWallYDim_b = fCBFrontWallYDim - fBPolyWidth;
1150 Double_t fCBLatWallZDim_b = fCBLatWallZDim - 2 * fAcrylicWidth;
1151 Double_t fCBExtraXDim_b = fCBExtraXDim - 2 * fAcrylicWidth;
1152 Double_t fCBRearWallXDim_b = fCBRearWallXDim - fAcrylicWidth;
1154 TGeoBBox *CBFrontWall_b =
new TGeoBBox(
1155 "CBFrontWall_b", fCBFrontWallXDim_b / 2. + (fAcrylicWidth - fBPolyWidth) / 10., fCBFrontWallYDim_b / 2.,
1157 TGeoBBox *CBLateral_b =
new TGeoBBox(
"CBLateral_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2.,
1158 (fCBLatWallZDim - 2 * fBPolyWidth) / 2. - fAcrylicWidth);
1159 TGeoBBox *CBExtraFront_b =
1160 new TGeoBBox(
"CBExtraFront_b", fCBExtraXDim_b / 2., fCBFrontWallYDim_b / 2., fBPolyWidth / 2.);
1161 TGeoBBox *CBExtraLat_b =
new TGeoBBox(
"CBExtraLat_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2.,
1162 (fCBExtraZDim - fAcrylicWidth - fBPolyWidth) / 2.);
1163 TGeoBBox *CBTiny1_b =
new TGeoBBox(
"CBTiny1_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2.,
1164 (fCBTinyZDim - fAcrylicWidth - fBPolyWidth) / 2.);
1165 TGeoBBox *CBTiny2_b =
1166 new TGeoBBox(
"CBTiny2_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2., (fCBTinyZDim - fAcrylicWidth) / 2.);
1167 TGeoBBox *CBRearWall_b =
1168 new TGeoBBox(
"CBRearWall_b", fCBRearWallXDim_b / 2., fCBFrontWallYDim_b / 2., fBPolyWidth / 2.);
1169 TGeoPara *CBWallSlope_b =
1170 new TGeoPara(
"CBWallSlope_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2., fSlopedWallZProj / 2., 0, -15, 0);
1173 Double_t tanomega = (187.03 - 176.71) / 176.;
1174 Double_t LatCover1_bverts[8][2];
1175 LatCover1_bverts[0][0] = 0.;
1176 LatCover1_bverts[0][1] = 0.;
1177 LatCover1_bverts[1][0] = fBPolyWidth;
1178 LatCover1_bverts[1][1] = 0;
1179 LatCover1_bverts[2][0] = fBPolyWidth;
1180 LatCover1_bverts[2][1] = -(176.71 - 170.72) - fAcrylicWidth * tanomega;
1181 LatCover1_bverts[3][0] = 0.;
1182 LatCover1_bverts[3][1] = -(176.71 - 170.72) - fAcrylicWidth * tanomega;
1184 LatCover1_bverts[4][0] = 0;
1185 LatCover1_bverts[4][1] = 0;
1186 LatCover1_bverts[5][0] = fBPolyWidth;
1187 LatCover1_bverts[5][1] = 0;
1188 LatCover1_bverts[6][0] = fBPolyWidth;
1189 LatCover1_bverts[6][1] = -(187.03 - 170.72) + fAcrylicWidth * tanomega;
1190 LatCover1_bverts[7][0] = 0;
1191 LatCover1_bverts[7][1] = -(187.03 - 170.72) + fAcrylicWidth * tanomega;
1192 TGeoArb8 *LatCov1_b =
new TGeoArb8(
"LatCov1_b", 176. / 2. - fAcrylicWidth, (Double_t *)LatCover1_bverts);
1194 Double_t LatCover21_bverts[8][2];
1195 LatCover21_bverts[0][0] = 0.;
1196 LatCover21_bverts[0][1] = 0.;
1197 LatCover21_bverts[1][0] = fBPolyWidth;
1198 LatCover21_bverts[1][1] = 0;
1199 LatCover21_bverts[2][0] = fBPolyWidth;
1200 LatCover21_bverts[2][1] = 0.;
1201 LatCover21_bverts[3][0] = 0.;
1202 LatCover21_bverts[3][1] = 0.;
1204 LatCover21_bverts[4][0] = 0;
1205 LatCover21_bverts[4][1] = 0;
1206 LatCover21_bverts[5][0] = fBPolyWidth;
1207 LatCover21_bverts[5][1] = 0;
1208 LatCover21_bverts[6][0] = fBPolyWidth;
1209 LatCover21_bverts[6][1] = -fCBTinyZDim * tanalpha;
1210 LatCover21_bverts[7][0] = 0;
1211 LatCover21_bverts[7][1] = -fCBTinyZDim * tanalpha;
1212 TGeoArb8 *LatCov21_b =
new TGeoArb8(
"LatCov21_b", (fCBTinyZDim - fAcrylicWidth) / 2., (Double_t *)LatCover21_bverts);
1214 Double_t LatCover22_bverts[8][2];
1215 LatCover22_bverts[0][0] = 0.;
1216 LatCover22_bverts[0][1] = 0.;
1217 LatCover22_bverts[1][0] = fBPolyWidth;
1218 LatCover22_bverts[1][1] = 0;
1219 LatCover22_bverts[2][0] = fBPolyWidth;
1220 LatCover22_bverts[2][1] = -fCBTinyZDim * tanalpha;
1221 LatCover22_bverts[3][0] = 0.;
1222 LatCover22_bverts[3][1] = -fCBTinyZDim * tanalpha;
1224 LatCover22_bverts[4][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.);
1225 LatCover22_bverts[4][1] = 0;
1226 LatCover22_bverts[5][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) + fBPolyWidth;
1227 LatCover22_bverts[5][1] = 0;
1228 LatCover22_bverts[6][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) + fBPolyWidth;
1229 LatCover22_bverts[6][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
1230 LatCover22_bverts[7][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.);
1231 LatCover22_bverts[7][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
1232 TGeoArb8 *LatCov22_b =
new TGeoArb8(
"LatCov22_b", fSlopedWallZProj / 2., (Double_t *)LatCover22_bverts);
1234 Double_t LatCover23_bverts[8][2];
1235 LatCover23_bverts[0][0] = 0.;
1236 LatCover23_bverts[0][1] = 0.;
1237 LatCover23_bverts[1][0] = fBPolyWidth;
1238 LatCover23_bverts[1][1] = 0;
1239 LatCover23_bverts[2][0] = fBPolyWidth;
1240 LatCover23_bverts[2][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
1241 LatCover23_bverts[3][0] = 0.;
1242 LatCover23_bverts[3][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
1244 LatCover23_bverts[4][0] = 0;
1245 LatCover23_bverts[4][1] = 0;
1246 LatCover23_bverts[5][0] = fBPolyWidth;
1247 LatCover23_bverts[5][1] = 0;
1248 LatCover23_bverts[6][0] = fBPolyWidth;
1249 LatCover23_bverts[6][1] = -(183.26 - 170.72) + fAcrylicWidth * tanalpha;
1250 LatCover23_bverts[7][0] = 0;
1251 LatCover23_bverts[7][1] = -(183.26 - 170.72) + fAcrylicWidth * tanalpha;
1252 TGeoArb8 *LatCov23_b =
1253 new TGeoArb8(
"LatCov23_b", (fCBTinyZDim - fBPolyWidth - fAcrylicWidth) / 2., (Double_t *)LatCover23_bverts);
1255 Double_t FrontCover1_bverts[8][2];
1256 FrontCover1_bverts[0][0] = (fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1257 FrontCover1_bverts[0][1] = 0.;
1258 FrontCover1_bverts[1][0] = (fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1259 FrontCover1_bverts[1][1] = -(fBPolyWidth)*tanbeta;
1260 FrontCover1_bverts[2][0] = -(fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1261 FrontCover1_bverts[2][1] = -(176.71-170.72)-fAcrylicWidth*tanomega;
1262 FrontCover1_bverts[3][0] = -(fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1263 FrontCover1_bverts[3][1] = 0;
1265 FrontCover1_bverts[4][0] = (fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1266 FrontCover1_bverts[4][1] = 0;
1267 FrontCover1_bverts[5][0] = (fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1268 FrontCover1_bverts[5][1] = -(fBPolyWidth)*tanbeta;
1269 FrontCover1_bverts[6][0] = -(fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1270 FrontCover1_bverts[6][1] = -(176.71-170.72)-fAcrylicWidth*tanomega;
1271 FrontCover1_bverts[7][0] = -(fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1272 FrontCover1_bverts[7][1] = 0;
1273 TGeoArb8 *FrontCov1_b =
new TGeoArb8(
"FrontCov1_b", fBPolyWidth / 2., (Double_t *)FrontCover1_bverts);
1275 Double_t RearCover_11_bverts[8][2];
1276 RearCover_11_bverts[0][0] = (fCBRearWallXDim_b-2*fBPolyWidth)/2.+fBPolyWidth/2.;
1277 RearCover_11_bverts[0][1] = 0.;
1278 RearCover_11_bverts[1][0] = (fCBRearWallXDim_b-2*fBPolyWidth)/2.+fBPolyWidth/2.;
1279 RearCover_11_bverts[1][1] = -(183.26-170.72)+fAcrylicWidth*tanalpha;
1280 RearCover_11_bverts[2][0] = -(fCBRearWallXDim_b-2*fBPolyWidth)/2.-fBPolyWidth/2.;
1281 RearCover_11_bverts[2][1] = -(fCBRearWallXDim_b-fBPolyWidth+extra)*tangamma;
1282 RearCover_11_bverts[3][0] = -(fCBRearWallXDim_b-2*fBPolyWidth)/2.-fBPolyWidth/2.;
1283 RearCover_11_bverts[3][1] = 0;
1285 RearCover_11_bverts[4][0] = (fCBRearWallXDim_b-2*fBPolyWidth)/2.+fBPolyWidth/2.;
1286 RearCover_11_bverts[4][1] = 0;
1287 RearCover_11_bverts[5][0] = (fCBRearWallXDim_b-2*fBPolyWidth)/2.+fBPolyWidth/2.;
1288 RearCover_11_bverts[5][1] = -(183.26-170.72)+fAcrylicWidth*tanalpha;
1289 RearCover_11_bverts[6][0] = -(fCBRearWallXDim_b-2*fBPolyWidth)/2.-fBPolyWidth/2.;
1290 RearCover_11_bverts[6][1] = -(fCBRearWallXDim_b-fBPolyWidth+extra)*tangamma;
1291 RearCover_11_bverts[7][0] = -(fCBRearWallXDim_b-2*fBPolyWidth)/2.-fBPolyWidth/2.;
1292 RearCover_11_bverts[7][1] = 0;
1293 TGeoArb8 *RearCov11_b =
new TGeoArb8(
"RearCov11_b", fBPolyWidth / 2., (Double_t *)RearCover_11_bverts);
1295 Double_t RearCover_12_bverts[8][2];
1296 RearCover_12_bverts[0][0] = fBPolyWidth/2.;
1297 RearCover_12_bverts[0][1] = 0.;
1298 RearCover_12_bverts[1][0] = fBPolyWidth/2.;
1299 RearCover_12_bverts[1][1] = -(fCBRearWallXDim_b-fBPolyWidth+extra)*tangamma;
1300 RearCover_12_bverts[2][0] = -fBPolyWidth/2.;
1301 RearCover_12_bverts[2][1] = -(fCBRearWallXDim_b+extra)*tangamma;
1302 RearCover_12_bverts[3][0] = -fBPolyWidth/2.;
1303 RearCover_12_bverts[3][1] = 0;
1305 RearCover_12_bverts[4][0] = fBPolyWidth/2.;
1306 RearCover_12_bverts[4][1] = 0;
1307 RearCover_12_bverts[5][0] = fBPolyWidth/2.;
1308 RearCover_12_bverts[5][1] = -(fCBRearWallXDim_b-fAcrylicWidth+extra)*tangamma;
1309 RearCover_12_bverts[6][0] = -fBPolyWidth/2.;
1310 RearCover_12_bverts[6][1] = -(fCBRearWallXDim_b+extra)*tangamma;
1311 RearCover_12_bverts[7][0] = -fBPolyWidth/2.;
1312 RearCover_12_bverts[7][1] = 0;
1313 TGeoArb8 *RearCov12_b =
1314 new TGeoArb8(
"RearCov12_b", (fCBExtraZDim - fAcrylicWidth + fBPolyWidth) / 2., (Double_t *)RearCover_12_bverts);
1316 Double_t RearCover_13_bverts[8][2];
1317 RearCover_13_bverts[0][0] = (fCBExtraXDim_b-2*fBPolyWidth)/2.;
1318 RearCover_13_bverts[0][1] = 0.;
1319 RearCover_13_bverts[1][0] = (fCBExtraXDim_b-2*fBPolyWidth)/2.;
1320 RearCover_13_bverts[1][1] = -(fCBRearWallXDim_b+extra)*tangamma;
1321 RearCover_13_bverts[2][0] = -(fCBExtraXDim_b-2*fBPolyWidth)/2.;
1322 RearCover_13_bverts[2][1] = -(187.03-170.72)+fAcrylicWidth*tanomega;
1323 RearCover_13_bverts[3][0] = -(fCBExtraXDim_b-2*fBPolyWidth)/2.;
1324 RearCover_13_bverts[3][1] = 0;
1326 RearCover_13_bverts[4][0] = (fCBExtraXDim_b-2*fBPolyWidth)/2.;
1327 RearCover_13_bverts[4][1] = 0;
1328 RearCover_13_bverts[5][0] = (fCBExtraXDim_b-2*fBPolyWidth)/2.;
1329 RearCover_13_bverts[5][1] = -(fCBRearWallXDim_b+extra)*tangamma;
1330 RearCover_13_bverts[6][0] = -(fCBExtraXDim_b-2*fBPolyWidth)/2.;
1331 RearCover_13_bverts[6][1] = -(187.03-170.72)+fAcrylicWidth*tanomega;
1332 RearCover_13_bverts[7][0] = -(fCBExtraXDim_b-2*fBPolyWidth)/2.;
1333 RearCover_13_bverts[7][1] = 0;
1334 TGeoArb8 *RearCov13_b =
new TGeoArb8(
"RearCov13_b", fBPolyWidth / 2., (Double_t *)RearCover_13_bverts);
1337 TGeoTranslation *FrontWallpos_b =
new TGeoTranslation(
1338 "FrontWallpos_b", -fCBRearWallXDim_b / 2. - fCBExtraXDim_b + fBPolyWidth + fCBFrontWallXDim_b / 2. + 0.1, 0,
1339 -fSlopedWallZProj - (fCBTinyZDim - fAcrylicWidth + fBPolyWidth));
1340 FrontWallpos_b->RegisterYourself();
1341 TGeoTranslation *Tiny1pos_b =
1342 new TGeoTranslation(
"Tiny1pos_b", fCBRearWallXDim_b / 2. + fBPolyWidth / 2., 0, -fBPolyWidth / 2.);
1343 Tiny1pos_b->RegisterYourself();
1344 TGeoTranslation *SlopeWallpos_b =
new TGeoTranslation(
1346 fSlopedWallZProj / (2 * TMath::Tan(TMath::DegToRad() * 85.)) + fCBRearWallXDim_b / 2. + 3 * fBPolyWidth, 0,
1347 -fBPolyWidth / 2. - fSlopedWallZProj / 2. - (fCBTinyZDim - fAcrylicWidth - fBPolyWidth) / 2.);
1348 SlopeWallpos_b->RegisterYourself();
1349 TGeoTranslation *Tiny2pos_b =
new TGeoTranslation(
"Tiny2pos_b",
1350 5 * fBPolyWidth + fCBRearWallXDim / 2. +
1351 fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)) -
1352 (fAcrylicWidth - fBPolyWidth) / 2.,
1353 0, -fSlopedWallZProj - (fCBTinyZDim - fAcrylicWidth));
1354 Tiny2pos_b->RegisterYourself();
1355 TGeoTranslation *CBExtraLatpos_b =
new TGeoTranslation(
"CBExtraLatpos_b", -fCBRearWallXDim_b / 2. + fBPolyWidth / 2.,
1356 0, (fCBExtraZDim - fAcrylicWidth) / 2.);
1357 CBExtraLatpos_b->RegisterYourself();
1358 TGeoTranslation *CBExtraFrontpos_b =
1359 new TGeoTranslation(
"CBExtraFrontpos_b", -fCBRearWallXDim_b / 2. + fBPolyWidth - fCBExtraXDim_b / 2., 0,
1360 fCBExtraZDim - fAcrylicWidth);
1361 CBExtraFrontpos_b->RegisterYourself();
1362 TGeoTranslation *CBLateralpos_b =
1363 new TGeoTranslation(
"CBLateralpos_b", -fCBRearWallXDim_b / 2. - fCBExtraXDim_b + fBPolyWidth + fBPolyWidth / 2.,
1364 0, fCBExtraZDim - fCBLatWallZDim_b / 2. + fBPolyWidth / 2. - fAcrylicWidth);
1365 CBLateralpos_b->RegisterYourself();
1366 TGeoTranslation *CBLatCov1pos_b =
new TGeoTranslation(
1367 "CBLatCov1pos_b", -fCBRearWallXDim / 2. - fCBExtraXDim + 2 * fAcrylicWidth + fBPolyWidth + fAcrylicWidth / 2.,
1368 -fCBFrontWallYDim_b / 2., fCBExtraZDim - fCBLatWallZDim / 2. + fAcrylicWidth / 2 - 0.5);
1369 CBLatCov1pos_b->RegisterYourself();
1370 TGeoTranslation *CBLatCov21pos_b =
1371 new TGeoTranslation(
"CBLatCov21pos_b",
1372 3 * fAcrylicWidth + fCBRearWallXDim / 2. +
1373 fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)) + fBPolyWidth / 2. + 0.4,
1374 -fCBFrontWallYDim_b / 2.,
1375 -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. +
1376 fBPolyWidth + fAcrylicWidth - 0.5);
1377 CBLatCov21pos_b->RegisterYourself();
1378 TGeoTranslation *CBLatCov22pos_b =
new TGeoTranslation(
1380 3 * fAcrylicWidth + fCBRearWallXDim / 2. + fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)) +
1381 fBPolyWidth / 2. + 0.4,
1382 -fCBFrontWallYDim_b / 2.,
1383 -(fSlopedWallZProj / 2 + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. + fBPolyWidth -
1384 fAcrylicWidth / 2. + fCBTinyZDim / 2. + fAcrylicWidth - 0.5);
1385 CBLatCov22pos_b->RegisterYourself();
1386 TGeoTranslation *CBLatCov23pos_b =
new TGeoTranslation(
1387 "CBLatCov23pos_b", (fCBRearWallXDim - fAcrylicWidth) / 2. - fAcrylicWidth / 2. + fBPolyWidth / 2. + 0.5,
1388 -fCBFrontWallYDim_b / 2., -fCBTinyZDim / 2. + fBPolyWidth + fBPolyWidth / 2. + 0.5);
1389 CBLatCov23pos_b->RegisterYourself();
1390 TGeoTranslation *CBFrontCov1pos_b =
new TGeoTranslation(
1391 "CBFrontCov1pos_b", -fCBRearWallXDim_b / 2. - fCBExtraXDim_b + fBPolyWidth + fCBFrontWallXDim_b / 2.,
1392 -fCBFrontWallYDim_b / 2., -fSlopedWallZProj - (fCBTinyZDim - fAcrylicWidth + fBPolyWidth));
1393 CBFrontCov1pos_b->RegisterYourself();
1394 TGeoTranslation *CBRearCov11pos_b =
1395 new TGeoTranslation(
"CBRearCov11pos_b", +fBPolyWidth / 2., -fCBFrontWallYDim_b / 2., 0);
1396 CBRearCov11pos_b->RegisterYourself();
1397 TGeoTranslation *CBRearCov12pos_b =
1398 new TGeoTranslation(
"CBRearCov12pos_b", -fCBRearWallXDim_b / 2. + fAcrylicWidth / 2. - 0.5,
1399 -fCBFrontWallYDim_b / 2., fAcrylicWidth / 2. + (fCBExtraZDim - 2 * fAcrylicWidth) / 2.);
1400 CBRearCov12pos_b->RegisterYourself();
1401 TGeoTranslation *CBRearCov13pos_b =
1402 new TGeoTranslation(
"CBRearCov13pos_b", -fCBRearWallXDim_b / 2. + fAcrylicWidth - fCBExtraXDim / 2 + fBPolyWidth,
1403 -fCBFrontWallYDim_b / 2., fCBExtraZDim - fAcrylicWidth);
1404 CBRearCov13pos_b->RegisterYourself();
1407 TGeoCompositeShape *COLDBOXB =
new TGeoCompositeShape(
1408 "COLDBOXB",
"CBRearWall_b+(CBTiny1_b:Tiny1pos_b)+(CBExtraLat_b:CBExtraLatpos_b)+(CBWallSlope_b:SlopeWallpos_b)+("
1409 "CBTiny2_b:Tiny2pos_b)+(CBExtraFront_b:CBExtraFrontpos_b)+(CBLateral_b:CBLateralpos_b)+(CBFrontWall_"
1410 "b:FrontWallpos_b)+(LatCov1_b:CBLatCov1pos_b)+(LatCov21_b:CBLatCov21pos_b)+(LatCov22_b:CBLatCov22pos_"
1411 "b)+(LatCov23_b:CBLatCov23pos_b)+(FrontCov1_b:CBFrontCov1pos_b)+(RearCov11_b:CBRearCov11pos_b)+("
1412 "RearCov12_b:CBRearCov12pos_b)+(RearCov13_b:CBRearCov13pos_b)");
1413 TGeoVolume *volCOLDBOXB =
new TGeoVolume(
"volCOLDBOXB", COLDBOXB, Bor30Poly);
1416 Double_t Roof4_averts[8][2];
1417 Roof4_averts[0][0] = 0.;
1418 Roof4_averts[0][1] = 0.;
1419 Roof4_averts[1][0] = 0.;
1420 Roof4_averts[1][1] = fAcrylicWidth;
1421 Roof4_averts[2][0] = fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.));
1422 Roof4_averts[2][1] = fAcrylicWidth;
1423 Roof4_averts[3][0] = fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.));
1424 Roof4_averts[3][1] = 0;
1425 Roof4_averts[4][0] = 0;
1426 Roof4_averts[4][1] = 0;
1427 Roof4_averts[5][0] = 0;
1428 Roof4_averts[5][1] = fAcrylicWidth;
1429 Roof4_averts[6][0] = 0;
1430 Roof4_averts[6][1] = fAcrylicWidth;
1431 Roof4_averts[7][0] = 0;
1432 Roof4_averts[7][1] = 0;
1434 TGeoBBox *CBRoof1_a =
new TGeoBBox(
"CBRoof1_a", fCBExtraXDim / 2., fAcrylicWidth / 2., fCBLatWallZDim / 2.);
1435 TGeoBBox *CBRoof2_a =
new TGeoBBox(
"CBRoof2_a", (fCBRearWallXDim - fAcrylicWidth) / 2., fAcrylicWidth / 2.,
1436 (fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2.);
1437 TGeoBBox *CBRoof3_a =
new TGeoBBox(
"CBRoof3_a", (fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.))) / 2.,
1438 fAcrylicWidth / 2., fCBTinyZDim / 2.);
1439 TGeoArb8 *CBRoof4_a =
new TGeoArb8(
"CBRoof4_a", fSlopedWallZProj / 2., (Double_t *)Roof4_averts);
1441 TGeoTranslation *Roof1_apos =
1442 new TGeoTranslation(
"Roof1_apos", -(fCBRearWallXDim - fAcrylicWidth) / 2. - fCBExtraXDim / 2., 0,
1443 fCBExtraZDim / 2. - fAcrylicWidth / 2.);
1444 Roof1_apos->RegisterYourself();
1445 TGeoTranslation *Roof3_apos =
new TGeoTranslation(
1447 (fCBRearWallXDim - fAcrylicWidth) / 2. + (fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.))) / 2., 0,
1448 -(fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2. + fCBTinyZDim / 2.);
1449 Roof3_apos->RegisterYourself();
1450 TGeoTranslation *Roof4_apos =
1451 new TGeoTranslation(
"Roof4_apos", (fCBRearWallXDim - fAcrylicWidth) / 2., -fAcrylicWidth / 2.,
1452 -(fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2. + fCBTinyZDim + fSlopedWallZProj / 2.);
1453 Roof4_apos->RegisterYourself();
1456 TGeoCompositeShape *CBRoof_a =
new TGeoCompositeShape(
1457 "CBRoof_a",
"CBRoof2_a+(CBRoof1_a:Roof1_apos)+(CBRoof3_a:Roof3_apos)+(CBRoof4_a:Roof4_apos)");
1458 TGeoVolume *volCBRoof_a =
new TGeoVolume(
"volCBRoof_a", CBRoof_a, Acrylic);
1461 Double_t Roof4_bverts[8][2];
1462 Roof4_bverts[0][0] = 0.;
1463 Roof4_bverts[0][1] = 0.;
1464 Roof4_bverts[1][0] = 0.;
1465 Roof4_bverts[1][1] = fBPolyWidth;
1466 Roof4_bverts[2][0] = fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.));
1467 Roof4_bverts[2][1] = fBPolyWidth;
1468 Roof4_bverts[3][0] = fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.));
1469 Roof4_bverts[3][1] = 0;
1470 Roof4_bverts[4][0] = 0;
1471 Roof4_bverts[4][1] = 0;
1472 Roof4_bverts[5][0] = 0;
1473 Roof4_bverts[5][1] = fBPolyWidth;
1474 Roof4_bverts[6][0] = 0;
1475 Roof4_bverts[6][1] = fBPolyWidth;
1476 Roof4_bverts[7][0] = 0;
1477 Roof4_bverts[7][1] = 0;
1479 TGeoBBox *CBRoof1_b =
new TGeoBBox(
"CBRoof1_b", fCBExtraXDim_b / 2., fBPolyWidth / 2., fCBLatWallZDim_b / 2.);
1480 TGeoBBox *CBRoof2_b =
new TGeoBBox(
"CBRoof2_b", (fCBRearWallXDim_b - fBPolyWidth) / 2. + fBPolyWidth / 2.,
1481 fBPolyWidth / 2., (fCBLatWallZDim_b - fCBExtraZDim + fAcrylicWidth) / 2.);
1482 TGeoBBox *CBRoof3_b =
new TGeoBBox(
"CBRoof3_b", (fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.))) / 2.,
1483 fBPolyWidth / 2., (fCBTinyZDim - fAcrylicWidth) / 2.);
1484 TGeoArb8 *CBRoof4_b =
new TGeoArb8(
"CBRoof4_b", fSlopedWallZProj / 2., (Double_t *)Roof4_bverts);
1486 TGeoTranslation *Roof1_bpos =
1487 new TGeoTranslation(
"Roof1_bpos", -(fCBRearWallXDim - fAcrylicWidth) / 2. - fCBExtraXDim_b / 2., 0,
1488 fCBExtraZDim / 2. - fAcrylicWidth / 2.);
1489 Roof1_bpos->RegisterYourself();
1490 TGeoTranslation *Roof3_bpos =
new TGeoTranslation(
1492 (fCBRearWallXDim - fAcrylicWidth) / 2. + (fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.))) / 2., 0,
1493 -(fCBLatWallZDim_b - fCBExtraZDim + fAcrylicWidth) / 2. + (fCBTinyZDim - fAcrylicWidth) / 2.);
1494 Roof3_bpos->RegisterYourself();
1495 TGeoTranslation *Roof4_bpos =
new TGeoTranslation(
1496 "Roof4_bpos", (fCBRearWallXDim - fAcrylicWidth) / 2., -fBPolyWidth / 2.,
1497 -(fCBLatWallZDim_b - fCBExtraZDim + fAcrylicWidth) / 2. + fCBTinyZDim - fAcrylicWidth + fSlopedWallZProj / 2.);
1498 Roof4_bpos->RegisterYourself();
1501 TGeoCompositeShape *CBRoof_b =
new TGeoCompositeShape(
1502 "CBRoof_b",
"CBRoof2_b+(CBRoof1_b:Roof1_bpos)+(CBRoof3_b:Roof3_bpos)+(CBRoof4_b:Roof4_bpos)");
1503 TGeoVolume *volCBRoof_b =
new TGeoVolume(
"volCBRoof_b", CBRoof_b, Bor30Poly);
1506 TGeoVolumeAssembly *volColdBox =
new TGeoVolumeAssembly(
"volColdBox");
1507 volCOLDBOXA->SetLineColor(kGray - 1);
1508 volCOLDBOXA->SetTransparency(60);
1509 volCOLDBOXB->SetLineColor(kGray - 1);
1510 volCOLDBOXB->SetTransparency(60);
1511 volCBRoof_a->SetLineColor(kGray - 1);
1512 volCBRoof_a->SetTransparency(60);
1513 volCBRoof_b->SetLineColor(kGray - 1);
1514 volCBRoof_b->SetTransparency(60);
1516 volColdBox->AddNode(volCOLDBOXA, 0, 0);
1517 volColdBox->AddNode(volCOLDBOXB, 0,
1518 new TGeoTranslation(-fBPolyWidth - fAcrylicWidth / 2., -fBPolyWidth / 2.,
1519 -fAcrylicWidth / 2. - fBPolyWidth / 2.));
1520 volColdBox->AddNode(volCBRoof_a, 0,
1521 new TGeoTranslation(fAcrylicWidth / 2., fCBFrontWallYDim / 2. + fAcrylicWidth / 2.,
1522 -(fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2. + fAcrylicWidth / 2.));
1523 volColdBox->AddNode(volCBRoof_b, 0,
1524 new TGeoTranslation(-fAcrylicWidth / 2., fCBFrontWallYDim / 2. - fBPolyWidth / 2.,
1525 -(fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2. + fAcrylicWidth / 2.));
1528 TVector3(-37.79 - 1.40082, 44.66,
1530 tunnel->AddNode(volColdBox, 0,
1531 new TGeoTranslation(displacement.X() - (fCBRearWallXDim - fFeBlockX) / 2. + 28.5,
1532 displacement.Y() - (fCBFrontWallYDim - fFeBlockY) / 2. + 121,
1533 displacement.Z() + fAcrylicWidth - fFeBlockZ / 2. - fBPolyWidth + 1.));
1536 top->AddNode(detector, 0);
1538 top->AddNode(detector, 0,localSND_physCS_comb);
1539 top->AddNode(tunnel , 1,
new TGeoTranslation(fTunnelDX,fTunnelDY,fTunnelDZ));