from geometer, with z pointing upwards, via localSND2CCS and then CCS2SNDPhysics Double_t M[9] = {0.999978, 0.0000821516, -0.006606, -0.00660651, -0.0124347, 0.999901, -4.69368*10^-15, 0.999923, 0.0124349}
166{
168
169 TGeoVolume *
top = gGeoManager->GetTopVolume();
171 TGeoMedium *concrete = gGeoManager->GetMedium("Concrete");
173 TGeoMedium *rock = gGeoManager->GetMedium("Rock");
175 TGeoMedium *vacuum = gGeoManager->GetMedium("vacuum");
176
177 TGeoVolume *tunnel= new TGeoVolumeAssembly("Tunnel");
178
179 TGeoVolume *
detector =
new TGeoVolumeAssembly(
"Detector");
185
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};
189
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();
194
198
199
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 = { -522.09173359, 30., 4.6171636594E+04, -99.7891926, 0.0,1954.9587043, 220.0};
212 std::vector<double> tu011_o = { -522.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.};
215
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};
218
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};
221
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};
224
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};
227
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};
230
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 = {
236 {"TI18_o1",TI18_o1},
237 {"TI18_i1",TI18_i1},
238 {"TI18_o2",TI18_o2},
239 {"TI18_i2",TI18_i2},
240 {"TI18_o3",TI18_o3},
241 {"TI18_i3",TI18_i3},
242 {"UJ18_o",UJ18_o},
243 {"UJ18_i",UJ18_i},
244 {"tu010_o",tu010_o},
245 {"tu010_i",tu010_i},
246 {"tu011_o",tu011_o},
247 {"tu011_i",tu011_i},
248 {"tu012_o",tu012_o},
249 {"tu012_i",tu012_i},
250 {"UJ18_x",UJ18_x},
251 {"PM18_ci",PM18_ci},
252 {"PM18_co",PM18_co},
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}
259 };
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}
292 };
293 std::vector<TVector3>
points;
294 std::vector<TVector3> GlobalPoints;
295 Double_t master[3], P1[3], P2[3], P3[3], P4[3];
296#
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];
328 }
329
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]);
340
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);
359
360 }
361 LOG(DEBUG) << "shapes "<<shapes[0]->GetName()<<" "<<shapes[1]->GetName()<<" "<<shapes[2]->GetName();
362
363
364
365 auto vetoPit = new TGeoBBox("vetoPit",
369 auto VetoPit_transl = new TGeoTranslation("VetoPit_transl",
373 VetoPit_transl->RegisterYourself();
374
375
376
377 Double_t dx_0_UJ18 = -2300.0;
378 Double_t dy_0_UJ18 = -273.0;
379 Double_t dz_0_UJ18 = 7346.0;
380 Double_t rot_X = 1.3;
381 Double_t rot_Y = -13.63;
382 Double_t rot_Z = 0;
383
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);
389
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;
394 Double_t twist;
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;
410
411
413 rmax = 506.18;
414 dz_UJ18 = 30;
415 TGeoShape *GDMLTube_001 = new TGeoTube("GDMLTube_001",rmin,rmax,dz_UJ18);
416
417 dx_UJ18 = 600;
418 dy_UJ18 = 200;
419 dz_UJ18 = 40;
420 TGeoShape *GDMLBox_001 = new TGeoBBox("GDMLBox_001", dx_UJ18,dy_UJ18,dz_UJ18);
421
422 dx_UJ18 = 0;
423 dy_UJ18 = -524.94;
424 dz_UJ18 = 0;
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);
428
429 TGeoShape *Cut_001 = new TGeoCompositeShape("Cut_001", Boolean);
430
432 rmax = 506.18;
433 dz_UJ18 = 1799.5;
434 TGeoShape *GDMLTube_002 = new TGeoTube("GDMLTube_002",rmin,rmax,dz_UJ18);
435
437 rmax = 450;
438 dz_UJ18 = 1950;
439 TGeoShape *GDMLTube_003 = new TGeoTube("GDMLTube_003",rmin,rmax,dz_UJ18);
440
441 dx_UJ18 = 500;
442 dy_UJ18 = 200;
443 dz_UJ18 = 2000;
444 TGeoShape *GDMLBox_002 = new TGeoBBox("GDMLBox_002", dx_UJ18,dy_UJ18,dz_UJ18);
445
446 dx_UJ18 = 0;
447 dy_UJ18 = -257.94;
448 dz_UJ18 = 0;
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);
452
453 TGeoShape *Cut_002 = new TGeoCompositeShape("Cut_002", Boolean);
454 Boolean = new TGeoSubtraction(GDMLTube_002,Cut_002,0,0);
455
456 TGeoShape *Cut_003 = new TGeoCompositeShape("Cut_003", Boolean);
457
458 dx_UJ18 = 600;
459 dy_UJ18 = 200;
460 dz_UJ18 = 2000;
461 TGeoShape *GDMLBox_003 = new TGeoBBox("GDMLBox_003", dx_UJ18,dy_UJ18,dz_UJ18);
462
463 dx_UJ18 = 0;
464 dy_UJ18 = -524.94;
465 dz_UJ18 = 0;
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);
469
470 TGeoShape *Cut_004 = new TGeoCompositeShape("Cut_004", Boolean);
471
473 rmax = 506.18;
474 dz_UJ18 = 30;
475 TGeoShape *GDMLTube_004 = new TGeoTube("GDMLTube_004",rmin,rmax,dz_UJ18);
476
477 dx_UJ18 = 600;
478 dy_UJ18 = 200;
479 dz_UJ18 = 40;
480 TGeoShape *GDMLBox_004 = new TGeoBBox("GDMLBox_004", dx_UJ18,dy_UJ18,dz_UJ18);
481
482 dx_UJ18 = 0;
483 dy_UJ18 = -524.94;
484 dz_UJ18 = 0;
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);
488
489 TGeoShape *Cut_005 = new TGeoCompositeShape("Cut_005", Boolean);
490
491 dx_UJ18 = 0;
492 dy_UJ18 = 0;
493 dz_UJ18 = -1829.5;
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);
497
498 TGeoShape *Add_001 = new TGeoCompositeShape("Add_001", Boolean);
499
500 dx_UJ18 = 0;
501 dy_UJ18 = 0;
502 dz_UJ18 = -1829.5;
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);
506
507 TGeoShape *Add_002 = new TGeoCompositeShape("Add_002", Boolean);
508
510 rmax = 175.65;
511 dz_UJ18 = 50;
512 TGeoShape *GDMLTube_005 = new TGeoTube("GDMLTube_005",rmin,rmax,dz_UJ18);
513
514 dx_UJ18 = 250;
515 dy_UJ18 = 100;
516 dz_UJ18 = 60;
517 TGeoShape *GDMLBox_005 = new TGeoBBox("GDMLBox_005", dx_UJ18,dy_UJ18,dz_UJ18);
518
519 dx_UJ18 = 0;
520 dy_UJ18 = -196.2;
521 dz_UJ18 = 0;
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);
525
526 TGeoShape *Cut_006 = new TGeoCompositeShape("Cut_006", Boolean);
527
528 dx_UJ18 = 245.426;
529 dy_UJ18 = 106.189;
530 dz_UJ18 = -3658.834;
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);
534
535 TGeoShape *Cut_007 = new TGeoCompositeShape("Cut_007", Boolean);
536
538 rmax = 220.39;
539 dz_UJ18 = 1900;
540 TGeoShape *GDMLTube_006 = new TGeoTube("GDMLTube_006",rmin,rmax,dz_UJ18);
541
542 dx_UJ18 = 250;
543 dy_UJ18 = 100;
544 dz_UJ18 = 1925;
545 TGeoShape *GDMLBox_006 = new TGeoBBox("GDMLBox_006", dx_UJ18,dy_UJ18,dz_UJ18);
546
547 dx_UJ18 = 0;
548 dy_UJ18 = -224.647;
549 dz_UJ18 = 0;
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);
553
554 TGeoShape *Cut_008 = new TGeoCompositeShape("Cut_008", Boolean);
555
556 dx_UJ18 = -193.584;
557 dy_UJ18 = 55.7;
558 dz_UJ18 = -1829.5;
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);
562
563 TGeoShape *Cut_009 = new TGeoCompositeShape("Cut_009", Boolean);
564
565 dz_UJ18 = 473.8;
568 h1 = 37.375;
569 bl1 = 204.985;
570 tl1 = 204.985;
571 alpha1 = 0;
572 h2 = 0;
573 bl2 = 204.985;
574 tl2 = 204.985;
575 alpha2 = 0;
576 TGeoShape *GDMLTrap_1 = new TGeoTrap("GDMLTrap_1", dz_UJ18,theta,phi,h1,bl1,tl1,alpha1,h2,bl2,tl2,alpha2);
577
578 dx_UJ18 = 236.991;
579 dy_UJ18 = -45.068;
580 dz_UJ18 = -3156.224;
581
582 thx = 90; phx = 0;
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);
589
590
591 TGeoHMatrix * Matrix_setup = new TGeoHMatrix("Matrix_setup");
592 Matrix_setup->Multiply(matA);
593 Matrix_setup->Multiply(trans_11);
594
595
596 const Double_t *tr1 = Matrix_setup->GetTranslation();
597 TGeoRotation *rot2 = new TGeoRotation();
598 rot2->SetMatrix(Matrix_setup->GetRotationMatrix());
599
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();
602
603
605 rmax = 506.18;
606 dz_UJ18 = 30;
607 TGeoShape *GDMLTube_007 = new TGeoTube("GDMLTube_007",rmin,rmax,dz_UJ18);
608
609 dx_UJ18 = 600;
610 dy_UJ18 = 200;
611 dz_UJ18 = 40;
612 TGeoShape *GDMLBox_007 = new TGeoBBox("GDMLBox_007", dx_UJ18,dy_UJ18,dz_UJ18);
613
614 dx_UJ18 = 0;
615 dy_UJ18 = -524.94;
616 dz_UJ18 = 0;
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);
620
621 TGeoShape *Cut_010 = new TGeoCompositeShape("Cut_010", Boolean);
622
624 rmax = 506.18;
625 dz_UJ18 = 1799.5;
626 TGeoShape *GDMLTube_008 = new TGeoTube("GDMLTube_8",rmin,rmax,dz_UJ18);
627
628 dx_UJ18 = 600;
629 dy_UJ18 = 200;
630 dz_UJ18 = 2000;
631 TGeoShape *GDMLBox_008 = new TGeoBBox("GDML_Box008", dx_UJ18,dy_UJ18,dz_UJ18);
632
633 dx_UJ18 = 0;
634 dy_UJ18 = -524.94;
635 dz_UJ18 = 0;
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);
639
640 TGeoShape *Cut_011 = new TGeoCompositeShape("Cut_011", Boolean);
641
643 rmax = 506.18;
644 dz_UJ18 = 30;
645 TGeoShape *GDMLTube_009 = new TGeoTube("GDMLTube_009",rmin,rmax,dz_UJ18);
646
647 dx_UJ18 = 600;
648 dy_UJ18 = 200;
649 dz_UJ18 = 40;
650 TGeoShape *GDMLBox_009 = new TGeoBBox("GDMLBox_009", dx_UJ18,dy_UJ18,dz_UJ18);
651
652 dx_UJ18 = 0;
653 dy_UJ18 = -524.94;
654 dz_UJ18 = 0;
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);
658
659 TGeoShape *Cut_012 = new TGeoCompositeShape("Cut_012", Boolean);
660
661 dx_UJ18 = 0;
662 dy_UJ18 = 0;
663 dz_UJ18 = -1829.5;
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);
667
668 TGeoShape *Add_003 = new TGeoCompositeShape("Add_003", Boolean);
669
670 dx_UJ18 = 0;
671 dy_UJ18 = 0;
672 dz_UJ18 = -1829.5;
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);
677
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";
681 }
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);
686
688 tunnel->AddNode(volT, 1);
689
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);
710 }
711 auto total2 = new TGeoCompositeShape("Stotal2","tu010_:TS_tu010_+tu011_:TS_tu011_");
712 auto Ftotal2 = new TGeoCompositeShape("Ftotal2","Ftu010_:TS_tu010_+Ftu011_:TS_tu011_");
713 auto volT2 = new TGeoVolume("VUJ",total2,concrete);
714 volT2->SetTransparency(0);
715 volT2->SetLineColor(kGray);
716 tunnel->AddNode(volT2, 1);
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746 double zs = 40900.;
747 double dz = (geoParameters["TI18_o1"][2] - zs)/2.;
748 double extended_z = 1860;
749
750 auto bigBox = new TGeoBBox("BigBox", 2000.,1500. , dz+extended_z);
751 auto TR_1 =
new TGeoTranslation(
"TR_1",0.,0.,-dz+extended_z+geoParameters[
"TI18_o1"][2]-
SND_Z - 50.);
752 TR_1->RegisterYourself();
753
754 auto cutOut = new TGeoCompositeShape("cutOut", "BigBox:TR_1-Ftotal2-(TI18_1_Funion+TI18_2_Funion+TI18_3_Funion+Solid_UJ18_shape:new_translation_for_UJ18)");
755 auto volT3 = new TGeoVolume("Vrock",cutOut,rock);
756 volT3->SetTransparency(75);
757 volT3->SetLineColor(kRed);
758 tunnel->AddNode(volT3, 1);
759
760 double z_dim_exitPlane = 1.;
761auto exitPlane = gGeoManager->MakeBox("exitScoringPlane",vacuum,1000.,1000. , z_dim_exitPlane);
762exitPlane->SetLineColor(kGreen);
763exitPlane->SetVisibility(kFALSE);
765tunnel->AddNode(exitPlane,1,
new TGeoTranslation(-1500.0,0,((2*extended_z)+geoParameters[
"TI18_o1"][2]-
SND_Z - 50 + z_dim_exitPlane)));
766
767
769 TGeoMedium *Bor30Poly = gGeoManager->GetMedium("Borated30polyethylene");
771 TGeoMedium *Acrylic = gGeoManager->GetMedium("PMMA");
772 TVector3 displacement;
773
774 Double_t fAcrylicWidth =
conf_floats[
"Floor/Acrylic_width"];
775 Double_t fBPolyWidth =
conf_floats[
"Floor/BPoly_width"];
776 Double_t fCBFrontWallXDim =
conf_floats[
"Floor/CBFrontWall_xdim"];
777 Double_t fCBFrontWallYDim =
conf_floats[
"Floor/CBFrontWall_ydim"];
778 Double_t fCBLatWallZDim =
conf_floats[
"Floor/CBLatWall_zdim"];
779 Double_t fCBTinyZDim =
conf_floats[
"Floor/CBTiny_zdim"];
780 Double_t fCBExtraZDim =
conf_floats[
"Floor/CBExtra_zdim"];
781 Double_t fCBExtraXDim =
conf_floats[
"Floor/CBExtra_xdim"];
782 Double_t fSlopedWallZProj =
conf_floats[
"Floor/SlopedWall_zproj"];
783 Double_t fCBRearWallXDim =
784 fCBFrontWallXDim - fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) - fCBExtraXDim + fAcrylicWidth;
785 Double_t fFeBlockX =
conf_floats[
"Floor/MFeBlockX"];
786 Double_t fFeBlockY =
conf_floats[
"Floor/MFeBlockY"];
787 Double_t fFeBlockZ =
conf_floats[
"Floor/MFeBlockZ"];
788
789
790
791 TGeoBBox *FeBlock_cb = new TGeoBBox("FeBlock_cb", fFeBlockX / 2, fFeBlockY / 2, fFeBlockZ / 2);
792 TGeoBBox *CBFrontWall_a =
793 new TGeoBBox("CBFrontWall_a", fCBFrontWallXDim / 2., fCBFrontWallYDim / 2., fAcrylicWidth / 2.);
794 TGeoBBox *CBLateral_a =
795 new TGeoBBox("CBLateral_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2., (fCBLatWallZDim - 2 * fAcrylicWidth) / 2.);
796 TGeoBBox *CBExtraFront_a =
797 new TGeoBBox("CBExtraFront_a", fCBExtraXDim / 2., fCBFrontWallYDim / 2., fAcrylicWidth / 2.);
798 TGeoBBox *CBExtraLat_a =
799 new TGeoBBox("CBExtraLat_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2., (fCBExtraZDim - 2 * fAcrylicWidth) / 2.);
800 TGeoBBox *CBTiny1_a = new TGeoBBox("CBTiny1_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2.,
801 (fCBTinyZDim - fAcrylicWidth - fBPolyWidth) / 2.);
802 TGeoBBox *CBTiny2_a =
803 new TGeoBBox("CBTiny2_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2., (fCBTinyZDim - fAcrylicWidth) / 2.);
804 TGeoBBox *CBRearWall_a =
805 new TGeoBBox("CBRearWall_a", fCBRearWallXDim / 2., fCBFrontWallYDim / 2., fAcrylicWidth / 2.);
806
807 TGeoTranslation *CBWallpos = new TGeoTranslation("CBWallpos", (fCBRearWallXDim - fFeBlockX) / 2. - 28.5,
808 (fCBFrontWallYDim - fFeBlockY) / 2. - 118., 0);
809 CBWallpos->RegisterYourself();
810
811 TGeoCompositeShape *CBWallDownstream =
812 new TGeoCompositeShape("CBWallDownstream", "CBRearWall_a-(FeBlock_cb:CBWallpos)");
813 TGeoPara *CBWallSlope_a =
814 new TGeoPara("CBWallSlope_a", fAcrylicWidth / 2., fCBFrontWallYDim / 2., fSlopedWallZProj / 2., 0, -15, 0);
815
816
817 Double_t LatCover1_averts[8][2];
818 LatCover1_averts[0][0] = 0.;
819 LatCover1_averts[0][1] = 0.;
820 LatCover1_averts[1][0] = fAcrylicWidth;
821 LatCover1_averts[1][1] = 0;
822 LatCover1_averts[2][0] = fAcrylicWidth;
823 LatCover1_averts[2][1] = -(176.71 - 170.72);
824 LatCover1_averts[3][0] = 0.;
825 LatCover1_averts[3][1] = -(176.71 - 170.72);
826
827 LatCover1_averts[4][0] = 0;
828 LatCover1_averts[4][1] = 0;
829 LatCover1_averts[5][0] = fAcrylicWidth;
830 LatCover1_averts[5][1] = 0;
831 LatCover1_averts[6][0] = fAcrylicWidth;
832 LatCover1_averts[6][1] = -(187.03 - 170.72);
833 LatCover1_averts[7][0] = 0;
834 LatCover1_averts[7][1] = -(187.03 - 170.72);
835 TGeoArb8 *LatCov1_a = new TGeoArb8("LatCov1_a", 176. / 2., (Double_t *)LatCover1_averts);
836
837 Double_t tanalpha = (183.26 - 170.72) / 144.;
838 Double_t LatCover21_averts[8][2];
839 LatCover21_averts[0][0] = 0.;
840 LatCover21_averts[0][1] = 0.;
841 LatCover21_averts[1][0] = fAcrylicWidth;
842 LatCover21_averts[1][1] = 0;
843 LatCover21_averts[2][0] = fAcrylicWidth;
844 LatCover21_averts[2][1] = 0;
845 LatCover21_averts[3][0] = 0.;
846 LatCover21_averts[3][1] = 0;
847
848 LatCover21_averts[4][0] = 0;
849 LatCover21_averts[4][1] = 0;
850 LatCover21_averts[5][0] = fAcrylicWidth;
851 LatCover21_averts[5][1] = 0;
852 LatCover21_averts[6][0] = fAcrylicWidth;
853 LatCover21_averts[6][1] = -fCBTinyZDim * tanalpha;
854 LatCover21_averts[7][0] = 0;
855 LatCover21_averts[7][1] = -fCBTinyZDim * tanalpha;
856 TGeoArb8 *LatCov21_a = new TGeoArb8("LatCov21_a", fCBTinyZDim / 2., (Double_t *)LatCover21_averts);
857
858 Double_t LatCover22_averts[8][2];
859 LatCover22_averts[0][0] = 0.;
860 LatCover22_averts[0][1] = 0.;
861 LatCover22_averts[1][0] = fAcrylicWidth;
862 LatCover22_averts[1][1] = 0;
863 LatCover22_averts[2][0] = fAcrylicWidth;
864 LatCover22_averts[2][1] = -fCBTinyZDim * tanalpha;
865 LatCover22_averts[3][0] = 0.;
866 LatCover22_averts[3][1] = -fCBTinyZDim * tanalpha;
867
868 LatCover22_averts[4][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.);
869 LatCover22_averts[4][1] = 0;
870 LatCover22_averts[5][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) + fAcrylicWidth;
871 LatCover22_averts[5][1] = 0;
872 LatCover22_averts[6][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) + fAcrylicWidth;
873 LatCover22_averts[6][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
874 LatCover22_averts[7][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.);
875 LatCover22_averts[7][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
876 TGeoArb8 *LatCov22_a = new TGeoArb8("LatCov22_a", fSlopedWallZProj / 2., (Double_t *)LatCover22_averts);
877
878 Double_t LatCover23_averts[8][2];
879 LatCover23_averts[0][0] = 0.;
880 LatCover23_averts[0][1] = 0.;
881 LatCover23_averts[1][0] = fAcrylicWidth;
882 LatCover23_averts[1][1] = 0;
883 LatCover23_averts[2][0] = fAcrylicWidth;
884 LatCover23_averts[2][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
885 LatCover23_averts[3][0] = 0.;
886 LatCover23_averts[3][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
887
888 LatCover23_averts[4][0] = 0;
889 LatCover23_averts[4][1] = 0;
890 LatCover23_averts[5][0] = fAcrylicWidth;
891 LatCover23_averts[5][1] = 0;
892 LatCover23_averts[6][0] = fAcrylicWidth;
893 LatCover23_averts[6][1] = -(183.26 - 170.72);
894 LatCover23_averts[7][0] = 0;
895 LatCover23_averts[7][1] = -(183.26 - 170.72);
896 TGeoArb8 *LatCov23_a = new TGeoArb8("LatCov23_a", (fCBTinyZDim - fBPolyWidth) / 2., (Double_t *)LatCover23_averts);
897
898 Double_t tanbeta = (176.74 - 170.72) / 219.0;
899 Double_t FrontCover1_averts[8][2];
900 FrontCover1_averts[0][0] = (fCBFrontWallXDim-2*fAcrylicWidth)/2.;
901 FrontCover1_averts[0][1] = 0.;
902 FrontCover1_averts[1][0] = (fCBFrontWallXDim-2*fAcrylicWidth)/2.;
903 FrontCover1_averts[1][1] = -(fAcrylicWidth)*tanbeta;
904 FrontCover1_averts[2][0] = -(fCBFrontWallXDim-2*fAcrylicWidth)/2.;
905 FrontCover1_averts[2][1] = -(fCBFrontWallXDim-fAcrylicWidth)*tanbeta;
906 FrontCover1_averts[3][0] = -(fCBFrontWallXDim-2*fAcrylicWidth)/2.;
907 FrontCover1_averts[3][1] = 0;
908
909 FrontCover1_averts[4][0] = (fCBFrontWallXDim-2*fAcrylicWidth)/2.;
910 FrontCover1_averts[4][1] = 0;
911 FrontCover1_averts[5][0] = (fCBFrontWallXDim-2*fAcrylicWidth)/2.;
912 FrontCover1_averts[5][1] = -(fAcrylicWidth)*tanbeta;
913 FrontCover1_averts[6][0] = -(fCBFrontWallXDim-2*fAcrylicWidth)/2.;
914 FrontCover1_averts[6][1] = -(fCBFrontWallXDim-fAcrylicWidth)*tanbeta;
915 FrontCover1_averts[7][0] = -(fCBFrontWallXDim-2*fAcrylicWidth)/2.;
916 FrontCover1_averts[7][1] = 0;
917 TGeoArb8 *FrontCov1_a = new TGeoArb8("FrontCov1_a", fAcrylicWidth / 2., (Double_t *)FrontCover1_averts);
918
919 Double_t tangamma = (187.03 - 183.26) / (fCBRearWallXDim - fAcrylicWidth + fCBExtraXDim);
920 Double_t xdim_projected = (187.03 - 170.72) / tangamma;
921 Double_t extra = xdim_projected - (fCBRearWallXDim - fAcrylicWidth + fCBExtraXDim);
922 Double_t RearCover_11_averts[8][2];
923 RearCover_11_averts[0][0] = (fCBRearWallXDim-2*fAcrylicWidth)/2.;
924 RearCover_11_averts[0][1] = 0.;
925 RearCover_11_averts[1][0] = (fCBRearWallXDim-2*fAcrylicWidth)/2.;
926 RearCover_11_averts[1][1] = -(183.26-170.72);
927 RearCover_11_averts[2][0] = -(fCBRearWallXDim-2*fAcrylicWidth)/2.;
928 RearCover_11_averts[2][1] = -(fCBRearWallXDim-fAcrylicWidth+extra)*tangamma;
929 RearCover_11_averts[3][0] = -(fCBRearWallXDim-2*fAcrylicWidth)/2.;
930 RearCover_11_averts[3][1] = 0;
931
932 RearCover_11_averts[4][0] = (fCBRearWallXDim-2*fAcrylicWidth)/2.;
933 RearCover_11_averts[4][1] = 0;
934 RearCover_11_averts[5][0] = (fCBRearWallXDim-2*fAcrylicWidth)/2.;
935 RearCover_11_averts[5][1] = -(183.26-170.72);
936 RearCover_11_averts[6][0] = -(fCBRearWallXDim-2*fAcrylicWidth)/2.;
937 RearCover_11_averts[6][1] = -(fCBRearWallXDim-fAcrylicWidth+extra)*tangamma;
938 RearCover_11_averts[7][0] = -(fCBRearWallXDim-2*fAcrylicWidth)/2.;
939 RearCover_11_averts[7][1] = 0;
940 TGeoArb8 *RearCov11_atot = new TGeoArb8("RearCov11_atot", fAcrylicWidth / 2., (Double_t *)RearCover_11_averts);
941 TGeoTranslation *CBWallpos2 =
942 new TGeoTranslation("CBWallpos2", (fCBRearWallXDim - fFeBlockX) / 2. - 28.5, 0, -fAcrylicWidth / 2.);
943 CBWallpos2->RegisterYourself();
944 TGeoCompositeShape *RearCov11_a = new TGeoCompositeShape("RearCov11_a", "RearCov11_atot-(FeBlock_cb:CBWallpos2)");
945
946 Double_t RearCover_12_averts[8][2];
947 RearCover_12_averts[0][0] = fAcrylicWidth/2.;
948 RearCover_12_averts[0][1] = 0.;
949 RearCover_12_averts[1][0] = fAcrylicWidth/2.;
950 RearCover_12_averts[1][1] = -(fCBRearWallXDim-fAcrylicWidth+extra)*tangamma;
951 RearCover_12_averts[2][0] = -fAcrylicWidth/2.;
952 RearCover_12_averts[2][1] = -(fCBRearWallXDim+extra)*tangamma;
953 RearCover_12_averts[3][0] = -fAcrylicWidth/2.;
954 RearCover_12_averts[3][1] = 0;
955
956 RearCover_12_averts[4][0] = fAcrylicWidth/2.;
957 RearCover_12_averts[4][1] = 0;
958 RearCover_12_averts[5][0] = fAcrylicWidth/2.;
959 RearCover_12_averts[5][1] = -(fCBRearWallXDim-fAcrylicWidth+extra)*tangamma;
960 RearCover_12_averts[6][0] = -fAcrylicWidth/2.;
961 RearCover_12_averts[6][1] = -(fCBRearWallXDim+extra)*tangamma;
962 RearCover_12_averts[7][0] = -fAcrylicWidth/2.;
963 RearCover_12_averts[7][1] = 0;
964 TGeoArb8 *RearCov12_a = new TGeoArb8("RearCov12_a", fCBExtraZDim / 2., (Double_t *)RearCover_12_averts);
965
966 Double_t RearCover_13_averts[8][2];
967 RearCover_13_averts[0][0] = (fCBExtraXDim-2*fAcrylicWidth)/2.;
968 RearCover_13_averts[0][1] = 0.;
969 RearCover_13_averts[1][0] = (fCBExtraXDim-2*fAcrylicWidth)/2.;
970 RearCover_13_averts[1][1] = -(fCBRearWallXDim+extra)*tangamma;
971 RearCover_13_averts[2][0] = -(fCBExtraXDim-2*fAcrylicWidth)/2.;
972 RearCover_13_averts[2][1] = -(187.03-170.72);
973 RearCover_13_averts[3][0] = -(fCBExtraXDim-2*fAcrylicWidth)/2.;
974 RearCover_13_averts[3][1] = 0;
975
976 RearCover_13_averts[4][0] = (fCBExtraXDim-2*fAcrylicWidth)/2.;
977 RearCover_13_averts[4][1] = 0;
978 RearCover_13_averts[5][0] = (fCBExtraXDim-2*fAcrylicWidth)/2.;
979 RearCover_13_averts[5][1] = -(fCBRearWallXDim+extra)*tangamma;
980 RearCover_13_averts[6][0] = -(fCBExtraXDim-2*fAcrylicWidth)/2.;
981 RearCover_13_averts[6][1] = -(187.03-170.72);
982 RearCover_13_averts[7][0] = -(fCBExtraXDim-2*fAcrylicWidth)/2.;
983 RearCover_13_averts[7][1] = 0;
984 TGeoArb8 *RearCov13_a = new TGeoArb8("RearCov13_a", fAcrylicWidth / 2., (Double_t *)RearCover_13_averts);
985
986
987 TGeoTranslation *FrontWallpos =
988 new TGeoTranslation("FrontWallpos", -fCBRearWallXDim / 2. - fCBExtraXDim + fAcrylicWidth + fCBFrontWallXDim / 2.,
989 0, -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fBPolyWidth);
990 FrontWallpos->RegisterYourself();
991 TGeoTranslation *Tiny1pos =
992 new TGeoTranslation("Tiny1pos", (fCBRearWallXDim - fAcrylicWidth) / 2., 0, -fCBTinyZDim / 2. + fBPolyWidth / 2.);
993 Tiny1pos->RegisterYourself();
994 TGeoTranslation *SlopeWallpos =
995 new TGeoTranslation("SlopeWallpos",
996 (fCBRearWallXDim + fAcrylicWidth) / 2. + fAcrylicWidth +
997 fSlopedWallZProj / (2 * TMath::Tan(TMath::DegToRad() * 85.)),
998 0, -fCBTinyZDim - fSlopedWallZProj / 2. + fAcrylicWidth / 2. + fBPolyWidth);
999 SlopeWallpos->RegisterYourself();
1000 TGeoTranslation *Tiny2pos = new TGeoTranslation(
1001 "Tiny2pos",
1002 3 * fAcrylicWidth + fCBRearWallXDim / 2. + fAcrylicWidth / 2. +
1003 fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)),
1004 0, -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. + fBPolyWidth);
1005 Tiny2pos->RegisterYourself();
1006 TGeoTranslation *CBExtraLatpos = new TGeoTranslation("CBExtraLatpos", -fCBRearWallXDim / 2. + fAcrylicWidth / 2., 0,
1007 fAcrylicWidth / 2. + (fCBExtraZDim - 2 * fAcrylicWidth) / 2.);
1008 CBExtraLatpos->RegisterYourself();
1009 TGeoTranslation *CBExtraFrontpos = new TGeoTranslation(
1010 "CBExtraFrontpos", -fCBRearWallXDim / 2. + fAcrylicWidth - fCBExtraXDim / 2., 0, fCBExtraZDim - fAcrylicWidth);
1011 CBExtraFrontpos->RegisterYourself();
1012 TGeoTranslation *CBLateralpos =
1013 new TGeoTranslation("CBLateralpos", -fCBRearWallXDim / 2. - fCBExtraXDim + fAcrylicWidth + fAcrylicWidth / 2., 0,
1014 fCBExtraZDim - fCBLatWallZDim / 2. - fAcrylicWidth / 2.);
1015 CBLateralpos->RegisterYourself();
1016 TGeoTranslation *CBLatCov1pos =
1017 new TGeoTranslation("CBLatCov1pos", -fCBRearWallXDim / 2. - fCBExtraXDim + fAcrylicWidth, -fCBFrontWallYDim / 2.,
1018 fCBExtraZDim - fCBLatWallZDim / 2. - fAcrylicWidth / 2.);
1019 CBLatCov1pos->RegisterYourself();
1020 TGeoTranslation *CBLatCov21pos = new TGeoTranslation(
1021 "CBLatCov21pos",
1022 3 * fAcrylicWidth + fCBRearWallXDim / 2. + fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)),
1023 -fCBFrontWallYDim / 2.,
1024 -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. + fBPolyWidth -
1025 fAcrylicWidth / 2.);
1026 CBLatCov21pos->RegisterYourself();
1027 TGeoTranslation *CBLatCov22pos = new TGeoTranslation(
1028 "CBLatCov22pos",
1029 3 * fAcrylicWidth + fCBRearWallXDim / 2. + fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)),
1030 -fCBFrontWallYDim / 2.,
1031 -(fSlopedWallZProj / 2 + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. + fBPolyWidth -
1032 fAcrylicWidth / 2. + fCBTinyZDim / 2.);
1033 CBLatCov22pos->RegisterYourself();
1034 TGeoTranslation *CBLatCov23pos =
1035 new TGeoTranslation("CBLatCov23pos", (fCBRearWallXDim - fAcrylicWidth) / 2. - fAcrylicWidth / 2.,
1036 -fCBFrontWallYDim / 2., -fCBTinyZDim / 2. + fBPolyWidth + 0.5);
1037 CBLatCov23pos->RegisterYourself();
1038 TGeoTranslation *CBFrontCov1pos = new TGeoTranslation(
1039 "CBFrontCov1pos", -fCBRearWallXDim / 2. - fCBExtraXDim + fAcrylicWidth + fCBFrontWallXDim / 2.,
1040 -fCBFrontWallYDim / 2., -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fBPolyWidth);
1041 CBFrontCov1pos->RegisterYourself();
1042 TGeoTranslation *CBRearCov11pos = new TGeoTranslation("CBRearCov11pos", 0, -fCBFrontWallYDim / 2., 0);
1043 CBRearCov11pos->RegisterYourself();
1044 TGeoTranslation *CBRearCov12pos =
1045 new TGeoTranslation("CBRearCov12pos", -fCBRearWallXDim / 2. + fAcrylicWidth / 2., -fCBFrontWallYDim / 2.,
1046 fAcrylicWidth / 2. + (fCBExtraZDim - 2 * fAcrylicWidth) / 2.);
1047 CBRearCov12pos->RegisterYourself();
1048 TGeoTranslation *CBRearCov13pos =
1049 new TGeoTranslation("CBRearCov13pos", -fCBRearWallXDim / 2. + fAcrylicWidth - fCBExtraXDim / 2.,
1050 -fCBFrontWallYDim / 2., fCBExtraZDim - fAcrylicWidth);
1051 CBRearCov13pos->RegisterYourself();
1052
1053
1054 TGeoCompositeShape *COLDBOXA = new TGeoCompositeShape(
1055 "COLDBOXA",
1056 "CBWallDownstream+(CBFrontWall_a:FrontWallpos)+(CBTiny1_a:Tiny1pos)+(CBWallSlope_a:SlopeWallpos)+(CBTiny2_a:"
1057 "Tiny2pos)+(CBExtraLat_a:CBExtraLatpos)+(CBExtraFront_a:CBExtraFrontpos)+(CBLateral_a:CBLateralpos)+(LatCov1_a:"
1058 "CBLatCov1pos)+(LatCov21_a:CBLatCov21pos)+(LatCov22_a:CBLatCov22pos)+(LatCov23_a:CBLatCov23pos)+(FrontCov1_a:"
1059 "CBFrontCov1pos)+(RearCov11_a:CBRearCov11pos)+(RearCov12_a:CBRearCov12pos)+(RearCov13_a:CBRearCov13pos)");
1060 TGeoVolume *volCOLDBOXA = new TGeoVolume("volCOLDBOXA", COLDBOXA, Acrylic);
1061
1062
1063 Double_t fCBFrontWallXDim_b = fCBFrontWallXDim - 2 * fAcrylicWidth - fBPolyWidth;
1064 Double_t fCBFrontWallYDim_b = fCBFrontWallYDim - fBPolyWidth;
1065 Double_t fCBLatWallZDim_b = fCBLatWallZDim - 2 * fAcrylicWidth;
1066 Double_t fCBExtraXDim_b = fCBExtraXDim - 2 * fAcrylicWidth;
1067 Double_t fCBRearWallXDim_b = fCBRearWallXDim - fAcrylicWidth;
1068
1069 TGeoBBox *CBFrontWall_b = new TGeoBBox(
1070 "CBFrontWall_b", fCBFrontWallXDim_b / 2. + (fAcrylicWidth - fBPolyWidth) / 10., fCBFrontWallYDim_b / 2.,
1071 fBPolyWidth / 2.);
1072 TGeoBBox *CBLateral_b = new TGeoBBox("CBLateral_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2.,
1073 (fCBLatWallZDim - 2 * fBPolyWidth) / 2. - fAcrylicWidth);
1074 TGeoBBox *CBExtraFront_b =
1075 new TGeoBBox("CBExtraFront_b", fCBExtraXDim_b / 2., fCBFrontWallYDim_b / 2., fBPolyWidth / 2.);
1076 TGeoBBox *CBExtraLat_b = new TGeoBBox("CBExtraLat_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2.,
1077 (fCBExtraZDim - fAcrylicWidth - fBPolyWidth) / 2.);
1078 TGeoBBox *CBTiny1_b = new TGeoBBox("CBTiny1_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2.,
1079 (fCBTinyZDim - fAcrylicWidth - fBPolyWidth) / 2.);
1080 TGeoBBox *CBTiny2_b =
1081 new TGeoBBox("CBTiny2_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2., (fCBTinyZDim - fAcrylicWidth) / 2.);
1082 TGeoBBox *CBRearWall_b =
1083 new TGeoBBox("CBRearWall_b", fCBRearWallXDim_b / 2., fCBFrontWallYDim_b / 2., fBPolyWidth / 2.);
1084 TGeoPara *CBWallSlope_b =
1085 new TGeoPara("CBWallSlope_b", fBPolyWidth / 2., fCBFrontWallYDim_b / 2., fSlopedWallZProj / 2., 0, -15, 0);
1086
1087
1088 Double_t tanomega = (187.03 - 176.71) / 176.;
1089 Double_t LatCover1_bverts[8][2];
1090 LatCover1_bverts[0][0] = 0.;
1091 LatCover1_bverts[0][1] = 0.;
1092 LatCover1_bverts[1][0] = fBPolyWidth;
1093 LatCover1_bverts[1][1] = 0;
1094 LatCover1_bverts[2][0] = fBPolyWidth;
1095 LatCover1_bverts[2][1] = -(176.71 - 170.72) - fAcrylicWidth * tanomega;
1096 LatCover1_bverts[3][0] = 0.;
1097 LatCover1_bverts[3][1] = -(176.71 - 170.72) - fAcrylicWidth * tanomega;
1098
1099 LatCover1_bverts[4][0] = 0;
1100 LatCover1_bverts[4][1] = 0;
1101 LatCover1_bverts[5][0] = fBPolyWidth;
1102 LatCover1_bverts[5][1] = 0;
1103 LatCover1_bverts[6][0] = fBPolyWidth;
1104 LatCover1_bverts[6][1] = -(187.03 - 170.72) + fAcrylicWidth * tanomega;
1105 LatCover1_bverts[7][0] = 0;
1106 LatCover1_bverts[7][1] = -(187.03 - 170.72) + fAcrylicWidth * tanomega;
1107 TGeoArb8 *LatCov1_b = new TGeoArb8("LatCov1_b", 176. / 2. - fAcrylicWidth, (Double_t *)LatCover1_bverts);
1108
1109 Double_t LatCover21_bverts[8][2];
1110 LatCover21_bverts[0][0] = 0.;
1111 LatCover21_bverts[0][1] = 0.;
1112 LatCover21_bverts[1][0] = fBPolyWidth;
1113 LatCover21_bverts[1][1] = 0;
1114 LatCover21_bverts[2][0] = fBPolyWidth;
1115 LatCover21_bverts[2][1] = 0.;
1116 LatCover21_bverts[3][0] = 0.;
1117 LatCover21_bverts[3][1] = 0.;
1118
1119 LatCover21_bverts[4][0] = 0;
1120 LatCover21_bverts[4][1] = 0;
1121 LatCover21_bverts[5][0] = fBPolyWidth;
1122 LatCover21_bverts[5][1] = 0;
1123 LatCover21_bverts[6][0] = fBPolyWidth;
1124 LatCover21_bverts[6][1] = -fCBTinyZDim * tanalpha;
1125 LatCover21_bverts[7][0] = 0;
1126 LatCover21_bverts[7][1] = -fCBTinyZDim * tanalpha;
1127 TGeoArb8 *LatCov21_b = new TGeoArb8("LatCov21_b", (fCBTinyZDim - fAcrylicWidth) / 2., (Double_t *)LatCover21_bverts);
1128
1129 Double_t LatCover22_bverts[8][2];
1130 LatCover22_bverts[0][0] = 0.;
1131 LatCover22_bverts[0][1] = 0.;
1132 LatCover22_bverts[1][0] = fBPolyWidth;
1133 LatCover22_bverts[1][1] = 0;
1134 LatCover22_bverts[2][0] = fBPolyWidth;
1135 LatCover22_bverts[2][1] = -fCBTinyZDim * tanalpha;
1136 LatCover22_bverts[3][0] = 0.;
1137 LatCover22_bverts[3][1] = -fCBTinyZDim * tanalpha;
1138
1139 LatCover22_bverts[4][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.);
1140 LatCover22_bverts[4][1] = 0;
1141 LatCover22_bverts[5][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) + fBPolyWidth;
1142 LatCover22_bverts[5][1] = 0;
1143 LatCover22_bverts[6][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.) + fBPolyWidth;
1144 LatCover22_bverts[6][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
1145 LatCover22_bverts[7][0] = -fSlopedWallZProj * TMath::Tan(TMath::DegToRad() * 15.);
1146 LatCover22_bverts[7][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
1147 TGeoArb8 *LatCov22_b = new TGeoArb8("LatCov22_b", fSlopedWallZProj / 2., (Double_t *)LatCover22_bverts);
1148
1149 Double_t LatCover23_bverts[8][2];
1150 LatCover23_bverts[0][0] = 0.;
1151 LatCover23_bverts[0][1] = 0.;
1152 LatCover23_bverts[1][0] = fBPolyWidth;
1153 LatCover23_bverts[1][1] = 0;
1154 LatCover23_bverts[2][0] = fBPolyWidth;
1155 LatCover23_bverts[2][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
1156 LatCover23_bverts[3][0] = 0.;
1157 LatCover23_bverts[3][1] = -(fCBTinyZDim + fSlopedWallZProj) * tanalpha;
1158
1159 LatCover23_bverts[4][0] = 0;
1160 LatCover23_bverts[4][1] = 0;
1161 LatCover23_bverts[5][0] = fBPolyWidth;
1162 LatCover23_bverts[5][1] = 0;
1163 LatCover23_bverts[6][0] = fBPolyWidth;
1164 LatCover23_bverts[6][1] = -(183.26 - 170.72) + fAcrylicWidth * tanalpha;
1165 LatCover23_bverts[7][0] = 0;
1166 LatCover23_bverts[7][1] = -(183.26 - 170.72) + fAcrylicWidth * tanalpha;
1167 TGeoArb8 *LatCov23_b =
1168 new TGeoArb8("LatCov23_b", (fCBTinyZDim - fBPolyWidth - fAcrylicWidth) / 2., (Double_t *)LatCover23_bverts);
1169
1170 Double_t FrontCover1_bverts[8][2];
1171 FrontCover1_bverts[0][0] = (fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1172 FrontCover1_bverts[0][1] = 0.;
1173 FrontCover1_bverts[1][0] = (fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1174 FrontCover1_bverts[1][1] = -(fBPolyWidth)*tanbeta;
1175 FrontCover1_bverts[2][0] = -(fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1176 FrontCover1_bverts[2][1] = -(176.71-170.72)-fAcrylicWidth*tanomega;
1177 FrontCover1_bverts[3][0] = -(fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1178 FrontCover1_bverts[3][1] = 0;
1179
1180 FrontCover1_bverts[4][0] = (fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1181 FrontCover1_bverts[4][1] = 0;
1182 FrontCover1_bverts[5][0] = (fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1183 FrontCover1_bverts[5][1] = -(fBPolyWidth)*tanbeta;
1184 FrontCover1_bverts[6][0] = -(fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1185 FrontCover1_bverts[6][1] = -(176.71-170.72)-fAcrylicWidth*tanomega;
1186 FrontCover1_bverts[7][0] = -(fCBFrontWallXDim_b-2*fBPolyWidth)/2.;
1187 FrontCover1_bverts[7][1] = 0;
1188 TGeoArb8 *FrontCov1_b = new TGeoArb8("FrontCov1_b", fBPolyWidth / 2., (Double_t *)FrontCover1_bverts);
1189
1190 Double_t RearCover_11_bverts[8][2];
1191 RearCover_11_bverts[0][0] = (fCBRearWallXDim_b-2*fBPolyWidth)/2.+fBPolyWidth/2.;
1192 RearCover_11_bverts[0][1] = 0.;
1193 RearCover_11_bverts[1][0] = (fCBRearWallXDim_b-2*fBPolyWidth)/2.+fBPolyWidth/2.;
1194 RearCover_11_bverts[1][1] = -(183.26-170.72)+fAcrylicWidth*tanalpha;
1195 RearCover_11_bverts[2][0] = -(fCBRearWallXDim_b-2*fBPolyWidth)/2.-fBPolyWidth/2.;
1196 RearCover_11_bverts[2][1] = -(fCBRearWallXDim_b-fBPolyWidth+extra)*tangamma;
1197 RearCover_11_bverts[3][0] = -(fCBRearWallXDim_b-2*fBPolyWidth)/2.-fBPolyWidth/2.;
1198 RearCover_11_bverts[3][1] = 0;
1199
1200 RearCover_11_bverts[4][0] = (fCBRearWallXDim_b-2*fBPolyWidth)/2.+fBPolyWidth/2.;
1201 RearCover_11_bverts[4][1] = 0;
1202 RearCover_11_bverts[5][0] = (fCBRearWallXDim_b-2*fBPolyWidth)/2.+fBPolyWidth/2.;
1203 RearCover_11_bverts[5][1] = -(183.26-170.72)+fAcrylicWidth*tanalpha;
1204 RearCover_11_bverts[6][0] = -(fCBRearWallXDim_b-2*fBPolyWidth)/2.-fBPolyWidth/2.;
1205 RearCover_11_bverts[6][1] = -(fCBRearWallXDim_b-fBPolyWidth+extra)*tangamma;
1206 RearCover_11_bverts[7][0] = -(fCBRearWallXDim_b-2*fBPolyWidth)/2.-fBPolyWidth/2.;
1207 RearCover_11_bverts[7][1] = 0;
1208 TGeoArb8 *RearCov11_b = new TGeoArb8("RearCov11_b", fBPolyWidth / 2., (Double_t *)RearCover_11_bverts);
1209
1210 Double_t RearCover_12_bverts[8][2];
1211 RearCover_12_bverts[0][0] = fBPolyWidth/2.;
1212 RearCover_12_bverts[0][1] = 0.;
1213 RearCover_12_bverts[1][0] = fBPolyWidth/2.;
1214 RearCover_12_bverts[1][1] = -(fCBRearWallXDim_b-fBPolyWidth+extra)*tangamma;
1215 RearCover_12_bverts[2][0] = -fBPolyWidth/2.;
1216 RearCover_12_bverts[2][1] = -(fCBRearWallXDim_b+extra)*tangamma;
1217 RearCover_12_bverts[3][0] = -fBPolyWidth/2.;
1218 RearCover_12_bverts[3][1] = 0;
1219
1220 RearCover_12_bverts[4][0] = fBPolyWidth/2.;
1221 RearCover_12_bverts[4][1] = 0;
1222 RearCover_12_bverts[5][0] = fBPolyWidth/2.;
1223 RearCover_12_bverts[5][1] = -(fCBRearWallXDim_b-fAcrylicWidth+extra)*tangamma;
1224 RearCover_12_bverts[6][0] = -fBPolyWidth/2.;
1225 RearCover_12_bverts[6][1] = -(fCBRearWallXDim_b+extra)*tangamma;
1226 RearCover_12_bverts[7][0] = -fBPolyWidth/2.;
1227 RearCover_12_bverts[7][1] = 0;
1228 TGeoArb8 *RearCov12_b =
1229 new TGeoArb8("RearCov12_b", (fCBExtraZDim - fAcrylicWidth + fBPolyWidth) / 2., (Double_t *)RearCover_12_bverts);
1230
1231 Double_t RearCover_13_bverts[8][2];
1232 RearCover_13_bverts[0][0] = (fCBExtraXDim_b-2*fBPolyWidth)/2.;
1233 RearCover_13_bverts[0][1] = 0.;
1234 RearCover_13_bverts[1][0] = (fCBExtraXDim_b-2*fBPolyWidth)/2.;
1235 RearCover_13_bverts[1][1] = -(fCBRearWallXDim_b+extra)*tangamma;
1236 RearCover_13_bverts[2][0] = -(fCBExtraXDim_b-2*fBPolyWidth)/2.;
1237 RearCover_13_bverts[2][1] = -(187.03-170.72)+fAcrylicWidth*tanomega;
1238 RearCover_13_bverts[3][0] = -(fCBExtraXDim_b-2*fBPolyWidth)/2.;
1239 RearCover_13_bverts[3][1] = 0;
1240
1241 RearCover_13_bverts[4][0] = (fCBExtraXDim_b-2*fBPolyWidth)/2.;
1242 RearCover_13_bverts[4][1] = 0;
1243 RearCover_13_bverts[5][0] = (fCBExtraXDim_b-2*fBPolyWidth)/2.;
1244 RearCover_13_bverts[5][1] = -(fCBRearWallXDim_b+extra)*tangamma;
1245 RearCover_13_bverts[6][0] = -(fCBExtraXDim_b-2*fBPolyWidth)/2.;
1246 RearCover_13_bverts[6][1] = -(187.03-170.72)+fAcrylicWidth*tanomega;
1247 RearCover_13_bverts[7][0] = -(fCBExtraXDim_b-2*fBPolyWidth)/2.;
1248 RearCover_13_bverts[7][1] = 0;
1249 TGeoArb8 *RearCov13_b = new TGeoArb8("RearCov13_b", fBPolyWidth / 2., (Double_t *)RearCover_13_bverts);
1250
1251
1252 TGeoTranslation *FrontWallpos_b = new TGeoTranslation(
1253 "FrontWallpos_b", -fCBRearWallXDim_b / 2. - fCBExtraXDim_b + fBPolyWidth + fCBFrontWallXDim_b / 2. + 0.1, 0,
1254 -fSlopedWallZProj - (fCBTinyZDim - fAcrylicWidth + fBPolyWidth));
1255 FrontWallpos_b->RegisterYourself();
1256 TGeoTranslation *Tiny1pos_b =
1257 new TGeoTranslation("Tiny1pos_b", fCBRearWallXDim_b / 2. + fBPolyWidth / 2., 0, -fBPolyWidth / 2.);
1258 Tiny1pos_b->RegisterYourself();
1259 TGeoTranslation *SlopeWallpos_b = new TGeoTranslation(
1260 "SlopeWallpos_b",
1261 fSlopedWallZProj / (2 * TMath::Tan(TMath::DegToRad() * 85.)) + fCBRearWallXDim_b / 2. + 3 * fBPolyWidth, 0,
1262 -fBPolyWidth / 2. - fSlopedWallZProj / 2. - (fCBTinyZDim - fAcrylicWidth - fBPolyWidth) / 2.);
1263 SlopeWallpos_b->RegisterYourself();
1264 TGeoTranslation *Tiny2pos_b = new TGeoTranslation("Tiny2pos_b",
1265 5 * fBPolyWidth + fCBRearWallXDim / 2. +
1266 fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)) -
1267 (fAcrylicWidth - fBPolyWidth) / 2.,
1268 0, -fSlopedWallZProj - (fCBTinyZDim - fAcrylicWidth));
1269 Tiny2pos_b->RegisterYourself();
1270 TGeoTranslation *CBExtraLatpos_b = new TGeoTranslation("CBExtraLatpos_b", -fCBRearWallXDim_b / 2. + fBPolyWidth / 2.,
1271 0, (fCBExtraZDim - fAcrylicWidth) / 2.);
1272 CBExtraLatpos_b->RegisterYourself();
1273 TGeoTranslation *CBExtraFrontpos_b =
1274 new TGeoTranslation("CBExtraFrontpos_b", -fCBRearWallXDim_b / 2. + fBPolyWidth - fCBExtraXDim_b / 2., 0,
1275 fCBExtraZDim - fAcrylicWidth);
1276 CBExtraFrontpos_b->RegisterYourself();
1277 TGeoTranslation *CBLateralpos_b =
1278 new TGeoTranslation("CBLateralpos_b", -fCBRearWallXDim_b / 2. - fCBExtraXDim_b + fBPolyWidth + fBPolyWidth / 2.,
1279 0, fCBExtraZDim - fCBLatWallZDim_b / 2. + fBPolyWidth / 2. - fAcrylicWidth);
1280 CBLateralpos_b->RegisterYourself();
1281 TGeoTranslation *CBLatCov1pos_b = new TGeoTranslation(
1282 "CBLatCov1pos_b", -fCBRearWallXDim / 2. - fCBExtraXDim + 2 * fAcrylicWidth + fBPolyWidth + fAcrylicWidth / 2.,
1283 -fCBFrontWallYDim_b / 2., fCBExtraZDim - fCBLatWallZDim / 2. + fAcrylicWidth / 2 - 0.5);
1284 CBLatCov1pos_b->RegisterYourself();
1285 TGeoTranslation *CBLatCov21pos_b =
1286 new TGeoTranslation("CBLatCov21pos_b",
1287 3 * fAcrylicWidth + fCBRearWallXDim / 2. +
1288 fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)) + fBPolyWidth / 2. + 0.4,
1289 -fCBFrontWallYDim_b / 2.,
1290 -(fSlopedWallZProj + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. +
1291 fBPolyWidth + fAcrylicWidth - 0.5);
1292 CBLatCov21pos_b->RegisterYourself();
1293 TGeoTranslation *CBLatCov22pos_b = new TGeoTranslation(
1294 "CBLatCov22pos_b",
1295 3 * fAcrylicWidth + fCBRearWallXDim / 2. + fSlopedWallZProj / (TMath::Tan(TMath::DegToRad() * 85.)) +
1296 fBPolyWidth / 2. + 0.4,
1297 -fCBFrontWallYDim_b / 2.,
1298 -(fSlopedWallZProj / 2 + 2 * (fCBTinyZDim - fAcrylicWidth) + fAcrylicWidth) + fCBTinyZDim / 2. + fBPolyWidth -
1299 fAcrylicWidth / 2. + fCBTinyZDim / 2. + fAcrylicWidth - 0.5);
1300 CBLatCov22pos_b->RegisterYourself();
1301 TGeoTranslation *CBLatCov23pos_b = new TGeoTranslation(
1302 "CBLatCov23pos_b", (fCBRearWallXDim - fAcrylicWidth) / 2. - fAcrylicWidth / 2. + fBPolyWidth / 2. + 0.5,
1303 -fCBFrontWallYDim_b / 2., -fCBTinyZDim / 2. + fBPolyWidth + fBPolyWidth / 2. + 0.5);
1304 CBLatCov23pos_b->RegisterYourself();
1305 TGeoTranslation *CBFrontCov1pos_b = new TGeoTranslation(
1306 "CBFrontCov1pos_b", -fCBRearWallXDim_b / 2. - fCBExtraXDim_b + fBPolyWidth + fCBFrontWallXDim_b / 2.,
1307 -fCBFrontWallYDim_b / 2., -fSlopedWallZProj - (fCBTinyZDim - fAcrylicWidth + fBPolyWidth));
1308 CBFrontCov1pos_b->RegisterYourself();
1309 TGeoTranslation *CBRearCov11pos_b =
1310 new TGeoTranslation("CBRearCov11pos_b", +fBPolyWidth / 2., -fCBFrontWallYDim_b / 2., 0);
1311 CBRearCov11pos_b->RegisterYourself();
1312 TGeoTranslation *CBRearCov12pos_b =
1313 new TGeoTranslation("CBRearCov12pos_b", -fCBRearWallXDim_b / 2. + fAcrylicWidth / 2. - 0.5,
1314 -fCBFrontWallYDim_b / 2., fAcrylicWidth / 2. + (fCBExtraZDim - 2 * fAcrylicWidth) / 2.);
1315 CBRearCov12pos_b->RegisterYourself();
1316 TGeoTranslation *CBRearCov13pos_b =
1317 new TGeoTranslation("CBRearCov13pos_b", -fCBRearWallXDim_b / 2. + fAcrylicWidth - fCBExtraXDim / 2 + fBPolyWidth,
1318 -fCBFrontWallYDim_b / 2., fCBExtraZDim - fAcrylicWidth);
1319 CBRearCov13pos_b->RegisterYourself();
1320
1321
1322 TGeoCompositeShape *COLDBOXB = new TGeoCompositeShape(
1323 "COLDBOXB", "CBRearWall_b+(CBTiny1_b:Tiny1pos_b)+(CBExtraLat_b:CBExtraLatpos_b)+(CBWallSlope_b:SlopeWallpos_b)+("
1324 "CBTiny2_b:Tiny2pos_b)+(CBExtraFront_b:CBExtraFrontpos_b)+(CBLateral_b:CBLateralpos_b)+(CBFrontWall_"
1325 "b:FrontWallpos_b)+(LatCov1_b:CBLatCov1pos_b)+(LatCov21_b:CBLatCov21pos_b)+(LatCov22_b:CBLatCov22pos_"
1326 "b)+(LatCov23_b:CBLatCov23pos_b)+(FrontCov1_b:CBFrontCov1pos_b)+(RearCov11_b:CBRearCov11pos_b)+("
1327 "RearCov12_b:CBRearCov12pos_b)+(RearCov13_b:CBRearCov13pos_b)");
1328 TGeoVolume *volCOLDBOXB = new TGeoVolume("volCOLDBOXB", COLDBOXB, Bor30Poly);
1329
1330
1331 Double_t Roof4_averts[8][2];
1332 Roof4_averts[0][0] = 0.;
1333 Roof4_averts[0][1] = 0.;
1334 Roof4_averts[1][0] = 0.;
1335 Roof4_averts[1][1] = fAcrylicWidth;
1336 Roof4_averts[2][0] = fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.));
1337 Roof4_averts[2][1] = fAcrylicWidth;
1338 Roof4_averts[3][0] = fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.));
1339 Roof4_averts[3][1] = 0;
1340 Roof4_averts[4][0] = 0;
1341 Roof4_averts[4][1] = 0;
1342 Roof4_averts[5][0] = 0;
1343 Roof4_averts[5][1] = fAcrylicWidth;
1344 Roof4_averts[6][0] = 0;
1345 Roof4_averts[6][1] = fAcrylicWidth;
1346 Roof4_averts[7][0] = 0;
1347 Roof4_averts[7][1] = 0;
1348
1349 TGeoBBox *CBRoof1_a = new TGeoBBox("CBRoof1_a", fCBExtraXDim / 2., fAcrylicWidth / 2., fCBLatWallZDim / 2.);
1350 TGeoBBox *CBRoof2_a = new TGeoBBox("CBRoof2_a", (fCBRearWallXDim - fAcrylicWidth) / 2., fAcrylicWidth / 2.,
1351 (fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2.);
1352 TGeoBBox *CBRoof3_a = new TGeoBBox("CBRoof3_a", (fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.))) / 2.,
1353 fAcrylicWidth / 2., fCBTinyZDim / 2.);
1354 TGeoArb8 *CBRoof4_a = new TGeoArb8("CBRoof4_a", fSlopedWallZProj / 2., (Double_t *)Roof4_averts);
1355
1356 TGeoTranslation *Roof1_apos =
1357 new TGeoTranslation("Roof1_apos", -(fCBRearWallXDim - fAcrylicWidth) / 2. - fCBExtraXDim / 2., 0,
1358 fCBExtraZDim / 2. - fAcrylicWidth / 2.);
1359 Roof1_apos->RegisterYourself();
1360 TGeoTranslation *Roof3_apos = new TGeoTranslation(
1361 "Roof3_apos",
1362 (fCBRearWallXDim - fAcrylicWidth) / 2. + (fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.))) / 2., 0,
1363 -(fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2. + fCBTinyZDim / 2.);
1364 Roof3_apos->RegisterYourself();
1365 TGeoTranslation *Roof4_apos =
1366 new TGeoTranslation("Roof4_apos", (fCBRearWallXDim - fAcrylicWidth) / 2., -fAcrylicWidth / 2.,
1367 -(fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2. + fCBTinyZDim + fSlopedWallZProj / 2.);
1368 Roof4_apos->RegisterYourself();
1369
1370
1371 TGeoCompositeShape *CBRoof_a = new TGeoCompositeShape(
1372 "CBRoof_a", "CBRoof2_a+(CBRoof1_a:Roof1_apos)+(CBRoof3_a:Roof3_apos)+(CBRoof4_a:Roof4_apos)");
1373 TGeoVolume *volCBRoof_a = new TGeoVolume("volCBRoof_a", CBRoof_a, Acrylic);
1374
1375
1376 Double_t Roof4_bverts[8][2];
1377 Roof4_bverts[0][0] = 0.;
1378 Roof4_bverts[0][1] = 0.;
1379 Roof4_bverts[1][0] = 0.;
1380 Roof4_bverts[1][1] = fBPolyWidth;
1381 Roof4_bverts[2][0] = fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.));
1382 Roof4_bverts[2][1] = fBPolyWidth;
1383 Roof4_bverts[3][0] = fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.));
1384 Roof4_bverts[3][1] = 0;
1385 Roof4_bverts[4][0] = 0;
1386 Roof4_bverts[4][1] = 0;
1387 Roof4_bverts[5][0] = 0;
1388 Roof4_bverts[5][1] = fBPolyWidth;
1389 Roof4_bverts[6][0] = 0;
1390 Roof4_bverts[6][1] = fBPolyWidth;
1391 Roof4_bverts[7][0] = 0;
1392 Roof4_bverts[7][1] = 0;
1393
1394 TGeoBBox *CBRoof1_b = new TGeoBBox("CBRoof1_b", fCBExtraXDim_b / 2., fBPolyWidth / 2., fCBLatWallZDim_b / 2.);
1395 TGeoBBox *CBRoof2_b = new TGeoBBox("CBRoof2_b", (fCBRearWallXDim_b - fBPolyWidth) / 2. + fBPolyWidth / 2.,
1396 fBPolyWidth / 2., (fCBLatWallZDim_b - fCBExtraZDim + fAcrylicWidth) / 2.);
1397 TGeoBBox *CBRoof3_b = new TGeoBBox("CBRoof3_b", (fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.))) / 2.,
1398 fBPolyWidth / 2., (fCBTinyZDim - fAcrylicWidth) / 2.);
1399 TGeoArb8 *CBRoof4_b = new TGeoArb8("CBRoof4_b", fSlopedWallZProj / 2., (Double_t *)Roof4_bverts);
1400
1401 TGeoTranslation *Roof1_bpos =
1402 new TGeoTranslation("Roof1_bpos", -(fCBRearWallXDim - fAcrylicWidth) / 2. - fCBExtraXDim_b / 2., 0,
1403 fCBExtraZDim / 2. - fAcrylicWidth / 2.);
1404 Roof1_bpos->RegisterYourself();
1405 TGeoTranslation *Roof3_bpos = new TGeoTranslation(
1406 "Roof3_bpos",
1407 (fCBRearWallXDim - fAcrylicWidth) / 2. + (fSlopedWallZProj * (TMath::Tan(TMath::DegToRad() * 15.))) / 2., 0,
1408 -(fCBLatWallZDim_b - fCBExtraZDim + fAcrylicWidth) / 2. + (fCBTinyZDim - fAcrylicWidth) / 2.);
1409 Roof3_bpos->RegisterYourself();
1410 TGeoTranslation *Roof4_bpos = new TGeoTranslation(
1411 "Roof4_bpos", (fCBRearWallXDim - fAcrylicWidth) / 2., -fBPolyWidth / 2.,
1412 -(fCBLatWallZDim_b - fCBExtraZDim + fAcrylicWidth) / 2. + fCBTinyZDim - fAcrylicWidth + fSlopedWallZProj / 2.);
1413 Roof4_bpos->RegisterYourself();
1414
1415
1416 TGeoCompositeShape *CBRoof_b = new TGeoCompositeShape(
1417 "CBRoof_b", "CBRoof2_b+(CBRoof1_b:Roof1_bpos)+(CBRoof3_b:Roof3_bpos)+(CBRoof4_b:Roof4_bpos)");
1418 TGeoVolume *volCBRoof_b = new TGeoVolume("volCBRoof_b", CBRoof_b, Bor30Poly);
1419
1420
1421 TGeoVolumeAssembly *volColdBox = new TGeoVolumeAssembly("volColdBox");
1422 volCOLDBOXA->SetLineColor(kGray - 1);
1423 volCOLDBOXA->SetTransparency(60);
1424 volCOLDBOXB->SetLineColor(kGray - 1);
1425 volCOLDBOXB->SetTransparency(60);
1426 volCBRoof_a->SetLineColor(kGray - 1);
1427 volCBRoof_a->SetTransparency(60);
1428 volCBRoof_b->SetLineColor(kGray - 1);
1429 volCBRoof_b->SetTransparency(60);
1430
1431 volColdBox->AddNode(volCOLDBOXA, 0, 0);
1432 volColdBox->AddNode(volCOLDBOXB, 0,
1433 new TGeoTranslation(-fBPolyWidth - fAcrylicWidth / 2., -fBPolyWidth / 2.,
1434 -fAcrylicWidth / 2. - fBPolyWidth / 2.));
1435 volColdBox->AddNode(volCBRoof_a, 0,
1436 new TGeoTranslation(fAcrylicWidth / 2., fCBFrontWallYDim / 2. + fAcrylicWidth / 2.,
1437 -(fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2. + fAcrylicWidth / 2.));
1438 volColdBox->AddNode(volCBRoof_b, 0,
1439 new TGeoTranslation(-fAcrylicWidth / 2., fCBFrontWallYDim / 2. - fBPolyWidth / 2.,
1440 -(fCBLatWallZDim - fCBExtraZDim + fAcrylicWidth) / 2. + fAcrylicWidth / 2.));
1441
1442 displacement =
1443 TVector3(-37.79 - 1.40082, 44.66,
1444 368.11);
1445 tunnel->AddNode(volColdBox, 0,
1446 new TGeoTranslation(displacement.X() - (fCBRearWallXDim - fFeBlockX) / 2. + 28.5,
1447 displacement.Y() - (fCBFrontWallYDim - fFeBlockY) / 2. + 121,
1448 displacement.Z() + fAcrylicWidth - fFeBlockZ / 2. - fBPolyWidth + 1.));
1449
1451 top->AddNode(detector, 0);
1452 }else{
1453 top->AddNode(detector, 0,localSND_physCS_comb);
1454 top->AddNode(tunnel , 1,
new TGeoTranslation(fTunnelDX,fTunnelDY,fTunnelDZ));
1455 }
1456
1457}
std::map< TString, Float_t > conf_floats
TVector3 crossing(TVector3 H1, TVector3 H2, TVector3 H3, TVector3 P1, TVector3 P2, TVector3 P3)
Int_t InitMedium(const char *name)
subroutine loop1
First data loop (get global labels).
subroutine loop2
Second data loop (number of derivatives, global label pairs).