27 #include<FairGeoLoader.h>
28 #include<FairGeoInterface.h>
29 #include<FairGeoBuilder.h>
30 #include<FairGeoPcon.h>
31 #include<FairGeoMedia.h>
32 #include<TGeoCompositeShape.h>
33 #include<TGeoMatrix.h>
34 #include<TGeoVolume.h>
39 #include<TGeoManager.h>
55 const double bend_begin = 361.;
56 const double bend_radius = 5700.;
57 const double bend_angle = 40.e-3;
58 const double bend_end = bend_begin+
sin(bend_angle)*bend_radius;
60 cout <<
" ******************************************* " << endl;
61 cout <<
" * beam pipe creator * " << endl;
62 cout <<
" ******************************************* " << endl;
63 cout <<
"\n\n\t\t 16.09.13 \n " << endl;
64 cout <<
" \t modified by P.Jasinski \n " << endl;
66 cout <<
" basic beam pipe parameters: " << endl;
67 cout <<
" \t bending start " << bend_begin <<
" cm" << endl;
68 cout <<
" \t bending end " << bend_end <<
" cm" << endl;
69 cout <<
" \t bending angle " << bend_angle <<
" rad" << endl;
70 cout <<
" \t bending radius " << bend_radius <<
" cm \n" << endl;
72 cout <<
" \t taking the pressure profile into account " << endl;
75 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
76 TString vmcWorkdir = gSystem->Getenv(
"VMCWORKDIR");
81 bool create_sensors =
true;
82 bool create_vacuum =
false;
84 bool create_target =
true;
85 bool create_pipe =
false;
87 std::vector< double > sensor_positions;
90 FairGeoLoader*
geoLoad =
new FairGeoLoader(
"TGeo",
"FairGeoLoader");
91 FairGeoInterface*
geoFace = geoLoad->getGeoInterface();
92 geoFace->setMediaFile(vmcWorkdir +
"/geometry/media_pnd.geo");
95 FairGeoMedia*
geoMedia = geoFace->getMedia();
96 FairGeoBuilder*
geoBuild = geoLoad->getGeoBuilder();
98 std::string str_ti =
"titanium";
100 FairGeoMedium* FairMediumSteel = geoMedia->getMedium(
"steel");
101 FairGeoMedium* FairMediumTi = geoMedia->getMedium(str_ti.c_str());
102 FairGeoMedium* FairMediumKapton = geoMedia->getMedium(
"mylar");
103 FairGeoMedium* FairMediumAu = geoMedia->getMedium(
"gold_target");
125 FairGeoMedium* FairMediumVac4 = geoMedia->getMedium(
"vacuum4");
126 FairGeoMedium* FairMediumVac5 = geoMedia->getMedium(
"vacuum5");
127 FairGeoMedium* FairMediumVac6 = geoMedia->getMedium(
"vacuum6");
128 FairGeoMedium* FairMediumVac7 = geoMedia->getMedium(
"vacuum7");
129 FairGeoMedium* FairMediumVac8 = geoMedia->getMedium(
"vacuum8");
133 if (!FairMediumAir || !FairMediumSteel || !FairMediumTi || !FairMediumKapton ||
134 !FairMediumVac4 ||!FairMediumVac5 ||!FairMediumVac6 ||!FairMediumVac7 ||!FairMediumVac8) {
135 std::cout <<
" warning: not all media found " << std::endl;
138 geoBuild->createMedium(FairMediumAir);
139 geoBuild->createMedium(FairMediumSteel);
140 geoBuild->createMedium(FairMediumTi);
141 geoBuild->createMedium(FairMediumKapton);
142 geoBuild->createMedium(FairMediumVac4);
143 geoBuild->createMedium(FairMediumVac5);
144 geoBuild->createMedium(FairMediumVac6);
145 geoBuild->createMedium(FairMediumVac7);
146 geoBuild->createMedium(FairMediumVac8);
147 std::cout <<
" done " << std::endl;
152 fGeoFile =
"beampipe_201309_active.root";
155 fGeoFile =
"beampipe_201309.root";
157 fi =
new TFile(fGeoFile,
"RECREATE");
167 TGeoVolume *
cave =
new TGeoVolumeAssembly(
"pipeassembly");
181 Double_t const rad = 3.1415926 / 180.;
184 TGeoRotation*
r1 =
new TGeoRotation(
"r1", 0., 0., 0.);
185 TGeoRotation*
r2 =
new TGeoRotation(
"r2", 0., 90., 180.);
186 TGeoRotation* r3 =
new TGeoRotation(
"r3", 0., -90., 0);
187 TGeoRotation* r4 =
new TGeoRotation(
"r4", 90., 0., 0);
189 TGeoCombiTrans* tr0 =
new TGeoCombiTrans(
"tra0", 0., 0., z0, r1);
190 tr0->RegisterYourself();
195 TGeoCombiTrans* trv1 =
new TGeoCombiTrans(
"trv1", 0., 0., 1.075, r1);
196 trv1->RegisterYourself();
197 TGeoCombiTrans* trv2 =
new TGeoCombiTrans(
"trv2", 0., 0., 3.53875, r1);
198 trv2->RegisterYourself();
199 TGeoCombiTrans* trv3 =
new TGeoCombiTrans(
"trv3", 0., 0., 6.0075, r1);
200 trv3->RegisterYourself();
205 TGeoBBox* VATvalve63a =
new TGeoBBox(
"VATvalve63a", 5.6, 12.45, 1.35, ov1);
206 TGeoTube* VATvalve63b =
new TGeoTube(
"VATvalve63b", 3.5, 6.5, 1.075);
207 TGeoTube* tv1 =
new TGeoTube(
"tv1", 0., 3.5, 1.35 + delta);
209 TGeoCompositeShape *SVATvalve630 =
new TGeoCompositeShape(
"VATvalve630",
211 TGeoCompositeShape *SVATvalve63 =
new TGeoCompositeShape(
"VATvalve63",
212 "VATvalve63b:trv1+VATvalve63b:trv3");
214 TGeoTube* VATvalve630_vac =
new TGeoTube(
"VATvalve630_vac",0., 3.5+delta, 1.35+(1.075+0.01987)*2);
215 TGeoCompositeShape *SVATvalve63_vac =
new TGeoCompositeShape(
"VATvalve63_vac",
216 "VATvalve630_vac:trv2-VATvalve63");
221 TGeoBBox* VATvalve100a =
new TGeoBBox(
"VATvalve100a", 7.2, 16.0, 1.35, ov2);
222 TGeoTube* VATvalve100b =
new TGeoTube(
"VATvalve100b", 5.0, 8.25, 1.0);
223 TGeoTube* tv2 =
new TGeoTube(
"tv2", 0., 5.0, 1.35 + delta);
225 TGeoCompositeShape *SVATvalve1000 =
new TGeoCompositeShape(
"VATvalve1000",
227 TGeoCompositeShape *SVATvalve100 =
new TGeoCompositeShape(
"VATvalve100",
228 "VATvalve100b:trv1+VATvalve100b:trv3");
230 TGeoTube* VATvalve1000_vac =
new TGeoTube(
"VATvalve1000_vac",0., 5.0+delta, 1.35+(2.19)*2);
231 TGeoCompositeShape *SVATvalve100_vac =
new TGeoCompositeShape(
"VATvalve100_vac",
232 "VATvalve1000_vac:trv2-VATvalve100");
236 TGeoTube* tv55 =
new TGeoTube(
"tv55", 0., 5.5+ delta, 1.35 + delta);
237 TGeoCompositeShape *SVATvalve110 =
new TGeoCompositeShape(
"VATvalve110",
238 "VATvalve100-tv55:trv2-tv55:trv1-tv55:trv3");
240 TGeoTube* SVATvalve1100_vac =
new TGeoTube(
"VATvalve1100_vac", 0., 5.5, 1.35+(2.)*2.);
241 TGeoCompositeShape *SVATvalve110_vac =
new TGeoCompositeShape(
"VATvalve110_vac",
242 "VATvalve1100_vac:trv2-VATvalve110");
248 TGeoBBox* VATvalve160a =
249 new TGeoBBox(
"VATvalve160a", 9.1, 21.75, 1.35, ov3);
250 TGeoTube* VATvalve160b =
new TGeoTube(
"VATvalve160b", 7.5, 11.25, 1.075);
251 TGeoTube* tv3 =
new TGeoTube(
"tv3", 0., 7.5, 1.35 + delta);
253 TGeoCompositeShape *SVATvalve1600 =
new TGeoCompositeShape(
"VATvalve1600",
255 TGeoCompositeShape *SVATvalve160 =
new TGeoCompositeShape(
"VATvalve160",
256 "VATvalve160b:trv1+VATvalve1600:trv2+VATvalve160b:trv3");
259 Double_t psv1[27] = { 0., 360., 8, .0, 6.0, 10.85, 7.6, 6.0, 10.85, 7.6,
260 6.0, 10.15, 16.6, 6.0, 10.15, 16.6, 6.0, 9.0, 24.0, 6.0, 9.0, 24.0,
261 0., 9.0, 24.2, 0., 9.0 };
262 TGeoPcon* TVP700 =
new TGeoPcon(
"TVP700", 0., 360., 8);
263 TVP700->SetDimensions(psv1);
266 Double_t psv2[39] = { 0., 360., 12, 0.0, 7.5, 11.25, 2.45, 7.5, 11.25,
267 2.45, 7.5, 7.965, 3.45, 7.5, 7.965, 6.45, 7.5, 12.9, 8.45, 0.,
268 12.9, 8.45, 0., 12.05, 24.00, 0., 12.05, 24.00, 0., 12.9, 26.00,
269 0., 12.9, 26.00, 0., 7.5, 36.85, 0., 7.5 };
270 TGeoPcon* TVP1000 =
new TGeoPcon(
"TVP1000", 0., 360., 12);
271 TVP1000->SetDimensions(psv2);
275 Double_t psv3[21] = { 0., 360., 6, 0., 7.5, 10.125, 2.0, 7.5, 10.125, 2.0,
276 7.5, 7.7, 10.0, 7.5, 7.7, 10.0, 0., 20.0, 60.7, 0., 20.0 };
277 TGeoPcon* IGP1000 =
new TGeoPcon(
"IGP1000", 0., 360., 6);
278 IGP1000->SetDimensions(psv3);
289 TGeoVolume *Vgvhesr =
new TGeoVolume(
"gvhesr", SVATvalve100,
291 Vgvhesr->SetLineColor(30);
294 currentz += 7. + delta;
295 fprintf(stderr,
"currentz a: %f\n", currentz);
300 Double_t psb1[27] = { 0., 360., 8, 0., 4.35, 7.58, 2.0, 4.35, 7.58, 2.0,
301 4.35, 4.45, 20.0, 4.35, 4.45, 31.3328, 7.50, 7.60, 156.0328, 7.50,
302 7.60, 156.0328, 7.50, 10.125, 158.2328, 7.50, 10.125 };
303 TGeoPcon* pipeup =
new TGeoPcon(
"pipeup", 0., 360., 8);
304 pipeup->SetDimensions(psb1);
306 Double_t psb1_vac[27] = { 0., 360., 8,
314 158.2328, 0.0, 7.50};
315 TGeoPcon* pipeup_vac =
new TGeoPcon(
"pipeup_vac", 0., 360., 8);
316 pipeup_vac->SetDimensions(psb1_vac);
318 TGeoCombiTrans* trb1 =
319 new TGeoCombiTrans(
"trb1", 0., 0., z0 + currentz, r1);
320 trb1->RegisterYourself();
323 TGeoVolume *Vpipeup =
new TGeoVolume(
"pipeup", pipeup,
325 Vpipeup->SetLineColor(31);
326 TGeoVolume *Vpipeup_vac =
new TGeoVolume(
"pipeup_vac", pipeup_vac,
328 Vpipeup_vac->SetLineColor(2);
329 Vpipeup_vac->SetTransparency(80);
332 currentz += 158.2328;
333 fprintf(stderr,
"currentz b: %f\n", currentz);
339 Double_t psc1[21] = { 0., 360., 6, -16.7, 7.50, 10.125, -14.5, 7.50,
340 10.125, -14.5, 7.50, 7.70, 14.5, 7.50, 7.70, 14.5, 7.50, 10.125,
341 16.7, 7.50, 10.125 };
342 TGeoPcon* ktmpump0 =
new TGeoPcon(
"ktmpump0", 0., 360., 6);
343 ktmpump0->SetDimensions(psc1);
346 Double_t psc1_vac[12] = { 0., 360., 3,
350 TGeoPcon* ktmpump0_vac =
new TGeoPcon(
"ktmpump0_vac", 0., 360., 3);
351 ktmpump0_vac->SetDimensions(psc1_vac);
353 TGeoTube* tc1 =
new TGeoTube(
"tc1", 0., 7.7, 7.7);
355 TGeoCombiTrans*
trc1 =
new TGeoCombiTrans(
"trc1", 0., 0., 0, r2);
356 trc1->RegisterYourself();
357 TGeoCombiTrans*
trc2 =
new TGeoCombiTrans(
"trc2", 0., 0.,
358 z0 + currentz + 16.7, r1);
359 trc2->RegisterYourself();
361 TGeoCompositeShape *csc1 =
new TGeoCompositeShape(
"csc1",
362 "(ktmpump0-tc1:trc1)");
363 TGeoCompositeShape *Sktmpump =
new TGeoCompositeShape(
"ktmpump",
366 TGeoVolume *Vktmpump =
new TGeoVolume(
"ktmpump", Sktmpump,
368 Vktmpump->SetLineColor(32);
370 TGeoVolume *Vktmpump_vac =
new TGeoVolume(
"ktmpump_vac", ktmpump0_vac,
372 Vktmpump_vac->SetLineColor(2);
373 Vktmpump_vac->SetTransparency(80);
378 fprintf(stderr,
"currentz c1: %f\n", currentz);
383 TGeoCombiTrans*
trc3 =
new TGeoCombiTrans(
"trc3", 0., 0., 7.0, r1);
384 trc3->RegisterYourself();
385 TGeoCombiTrans* trc4 =
new TGeoCombiTrans(
"trc4", 0., -16.7, currentz, r2);
386 trc4->RegisterYourself();
387 TGeoCombiTrans* trc5 =
new TGeoCombiTrans(
"trc5", 0., 16.7, currentz, r3);
388 trc5->RegisterYourself();
390 TGeoCompositeShape *STVPwValve =
new TGeoCompositeShape(
"TVPwValve",
391 "(VATvalve160+TVP1000:trc3)");
392 TGeoCompositeShape *STpumps =
new TGeoCompositeShape(
"Tpumps",
393 "TVPwValve:trc4+TVPwValve:trc5");
395 TGeoVolume *VTpumps =
new TGeoVolume(
"Tpump", STpumps,
397 VTpumps->SetLineColor(33);
402 fprintf(stderr,
"currentz c2: %f\n", currentz);
407 Double_t psd1[27] = { 0., 360., 8, 0.0, 7.5, 10.125, 2.20, 7.5, 10.125,
408 2.20, 7.5, 7.70, 148.80, 7.5, 7.70, 148.80, 7.5, 10.125, 153.80,
409 7.5, 10.125, 153.80, 7.5, 7.70, 231.30, 7.5, 7.70 };
410 TGeoPcon* pipeTSup =
new TGeoPcon(
"pipeTSup", 0., 360., 8);
411 pipeTSup->SetDimensions(psd1);
413 Double_t psd1_vac[27] = { 0., 360., 3,
417 TGeoPcon* pipeTSup_vac =
new TGeoPcon(
"pipeTSup_vac", 0., 360., 3);
418 pipeTSup_vac->SetDimensions(psd1_vac);
420 TGeoCombiTrans* trd1 =
421 new TGeoCombiTrans(
"trd1", 0., 0., z0 + currentz, r1);
422 trd1->RegisterYourself();
424 TGeoVolume *VpipeTSup =
new TGeoVolume(
"pipeTSup", pipeTSup,
426 VpipeTSup->SetLineColor(34);
428 TGeoVolume *VpipeTSup_vac =
new TGeoVolume(
"pipeTSup_vac", pipeTSup_vac,
430 VpipeTSup_vac->SetLineColor(2);
431 VpipeTSup_vac->SetTransparency(70);
436 fprintf(stderr,
"currentz d: %f\n", currentz);
443 fprintf(stderr,
"Target position: 0 / 0 / %f\n", z0 + currentz + tz);
454 TGeoPcon* Tcross1 =
new TGeoPcon(
"Tcross1", 0., 360., 7);
455 Tcross1->SetDimensions(pse1);
458 Double_t pse1_vac[24] = { 0., 360., 7,
466 TGeoPcon* Tcross1_vac =
new TGeoPcon(
"Tcross1_vac", 0., 360., 7);
467 Tcross1_vac->SetDimensions(pse1_vac);
469 TGeoTube* Tcross2 =
new TGeoTube(
"Tcross2", 1.0, 1.02, 11.5);
471 TGeoTube* Tcross2_vac =
new TGeoTube(
"Tcross2_vac", 0.0, 1.0, 11.5);
474 Double_t pse2[63] = { 0., 360., 20, -182.0, 7.5, 7.7, -135.5, 7.5, 7.7,
475 -125.5, 4.5, 4.6, -95.5, 4.5, 4.6, -95.5, 3.0, 3.1, -54.0, 3.0,
476 3.1, -54.0, 2.0, 2.1, -42.1, 2.0, 2.1, -17.0, 2.0, 2.1, -17.0, 1.0,
477 1.02, 17.0, 1.0, 1.02, 17.0, 2.0, 2.1, 42.1, 2.0, 2.1, 54.0, 2.0,
478 2.1, 54.0, 3.0, 3.1, 95.5, 3.0, 3.1, 95.5, 4.5, 4.6, 133.5, 4.5,
479 4.6, 143.5, 7.85, 7.95, 168.69, 7.85, 7.95
481 TGeoPcon* Tcross3 =
new TGeoPcon(
"Tcross3", 0., 360., 20);
482 Tcross3->SetDimensions(pse2);
484 TGeoTube* te1 =
new TGeoTube(
"te1", 0., 1.25, 0.51 + delta);
485 TGeoTube* te2 =
new TGeoTube(
"te2", 0., 1.00, 0.51 + delta);
486 TGeoTube* te3 =
new TGeoTube(
"te3", 0., 1.00, 1.27 + delta);
487 TGeoTube* te4 =
new TGeoTube(
"te4", 0., 1.00, 1.02 + delta);
489 TGeoCombiTrans* tre1 =
new TGeoCombiTrans(
"tre1", 0., 0., tz, r2);
490 tre1->RegisterYourself();
491 TGeoCombiTrans* tre2 =
new TGeoCombiTrans(
"tre2", 0., 0., -11.5, r2);
492 tre2->RegisterYourself();
493 TGeoCombiTrans* tre3 =
new TGeoCombiTrans(
"tre3", 0., 0., 0., r2);
494 tre3->RegisterYourself();
495 TGeoCombiTrans* tre4 =
new TGeoCombiTrans(
"tre4", 0., 0., -0.51, r1);
496 tre4->RegisterYourself();
497 TGeoCombiTrans* tre5 =
new TGeoCombiTrans(
"tre5", 0., 0., 0.51, r1);
498 tre5->RegisterYourself();
499 TGeoCombiTrans* tre6 =
new TGeoCombiTrans(
"tre6", 0., 0., 41.5, r1);
500 tre6->RegisterYourself();
501 TGeoCombiTrans* tre7 =
new TGeoCombiTrans(
"tre7", 0., 0., tz, r1);
502 tre7->RegisterYourself();
503 TGeoCombiTrans* tre8 =
new TGeoCombiTrans(
"tre8", 0., -175.0, tz, r3);
504 tre8->RegisterYourself();
506 TGeoCombiTrans* tre9 =
507 new TGeoCombiTrans(
"tre9", 0., 0., z0 + currentz, r1);
508 tre9->RegisterYourself();
510 TGeoCompositeShape *STcross0a =
new TGeoCompositeShape(
"Tcross0a",
512 TGeoCompositeShape *STcross0b =
new TGeoCompositeShape(
"Tcross0b",
514 TGeoCompositeShape *STcross0c =
new TGeoCompositeShape(
"Tcross0c",
515 "Tcross3:tre3-te1:tre4-te2:tre5");
517 TGeoCompositeShape *STcross =
new TGeoCompositeShape(
"Tcross",
518 "Tcross0a+Tcross0b:tre6+Tcross0c:tre7+VATvalve160:tre8");
520 TGeoCompositeShape *STcross_vac =
new TGeoCompositeShape(
"Tcross_vac",
521 "Tcross1_vac+Tcross2_vac:tre6");
523 TGeoTube* shape_target =
new TGeoTube(
"shape_target", 0., 0., 1.);
524 TGeoVolume* vol_target =
new TGeoVolume(
"shape_target", STcross,
gGeoManager->GetMedium(
"gold_target"));
525 vol_target->SetLineColor(35);
527 TGeoVolume *VTcross =
new TGeoVolume(
"Tcross", STcross,
529 VTcross->SetLineColor(35);
531 TGeoVolume *VTcross_vac =
new TGeoVolume(
"Tcross_vac", STcross_vac,
533 VTcross_vac->SetLineColor(2);
534 VTcross_vac->SetTransparency(50);
539 fprintf(stderr,
"currentz e: %f\n", currentz);
544 Double_t psf1[51] = { 0., 360., 16, 0.000, 1.0, 1.02, 3.7321, 2.0, 2.02,
545 3.7321, 2.0, 2.05, 93.0000, 2.0, 2.05, 97.4785, 3.2, 3.25,
546 101.0000, 3.2, 3.25, 101.0000, 3.2, 3.4, 106.0225, 3.2, 3.4,
547 106.0225, 3.2, 3.27, 241.8225, 3.2, 3.27, 241.8225, 3.2, 3.35,
548 244.8225, 3.2, 3.35, 244.8225, 3.2, 3.27, 261.0725, 3.2, 3.27,
549 261.0725, 3.2, 5.675, 262.8225, 3.2, 5.675 };
550 TGeoPcon* pipeTSdown =
new TGeoPcon(
"pipeTSdown", 0., 360., 16);
551 pipeTSdown->SetDimensions(psf1);
554 Double_t psf1_vac[51] = { 0., 360., 16,
571 TGeoPcon* pipeTSdown_vac =
new TGeoPcon(
"pipeTSdown_vac", 0., 360., 16);
572 pipeTSdown_vac->SetDimensions(psf1_vac);
574 TGeoCombiTrans* trf1 =
575 new TGeoCombiTrans(
"trf1", 0., 0., z0 + currentz, r1);
576 trf1->RegisterYourself();
578 TGeoVolume *VpipeTSdown =
new TGeoVolume(
"pipeTSdown", pipeTSdown,
580 VpipeTSdown->SetLineColor(36);
582 TGeoVolume *VpipeTSdown_vac =
new TGeoVolume(
"pipeTSdown_vac", pipeTSdown_vac,
584 VpipeTSdown_vac->SetLineColor(2);
585 VpipeTSdown_vac->SetTransparency(60);
589 currentz += 262.8225;
590 fprintf(stderr,
"currentz f: %f\n", currentz);
596 Double_t psg1[27] = { 0., 360., 8, 0.000, 3.2, 5.675, 1.7200, 3.2, 5.675,
597 1.7200, 3.2, 3.27, 3.3653, 3.2, 3.27, 10.0830, 5.0, 5.07, 51.0,
598 5.0, 5.07, 51.0, 5.0, 7.60, 53.0, 5.0, 7.60 };
599 TGeoPcon* crossTS1 =
new TGeoPcon(
"crossTS1", 0., 360., 8);
600 crossTS1->SetDimensions(psg1);
603 Double_t psg1_vac[27] = { 0., 360., 8,
612 TGeoPcon* crossTS1_vac =
new TGeoPcon(
"crossTS1_vac", 0., 360., 8);
613 crossTS1_vac->SetDimensions(psg1_vac);
615 TGeoTube* tg1 =
new TGeoTube(
"tg1", 0., 6.07, 5.07 + delta);
616 TGeoCombiTrans* trg1 =
new TGeoCombiTrans(
"trg1", 0., 0., 26.0, r2);
617 trg1->RegisterYourself();
618 TGeoCompositeShape *ScrossTSa =
new TGeoCompositeShape(
"crossTSa",
619 "crossTS1-tg1:trg1");
622 Double_t psg2[21] = { 0., 360., 6, -55.0, 6.0, 10.125, -52.8, 6.0, 10.125,
623 -52.8, 6.0, 6.07, 52.8, 6.0, 6.07, 52.8, 6.0, 10.125, 55.0, 6.0,
625 TGeoPcon* crossTS2 =
new TGeoPcon(
"crossTS2", 0., 360., 22);
626 crossTS2->SetDimensions(psg2);
628 TGeoTube* tg2 =
new TGeoTube(
"tg2", 0., 5.07, 6.07 + delta);
629 TGeoCombiTrans* trg2 =
new TGeoCombiTrans(
"trg2", 0., -55.0, 0., r2);
630 trg2->RegisterYourself();
631 TGeoCombiTrans* trg3 =
new TGeoCombiTrans(
"trg3", 0., 55.0, 0., r3);
632 trg3->RegisterYourself();
633 TGeoCombiTrans* trg4 =
new TGeoCombiTrans(
"trg4", 0., 0., 7.0775, r1);
634 trg4->RegisterYourself();
635 TGeoCombiTrans* trg5 =
new TGeoCombiTrans(
"trg5", 0., 0., 33.0775, r1);
636 trg5->RegisterYourself();
639 TGeoCompositeShape *ScrossTSb =
new TGeoCompositeShape(
"crossTSb",
640 "crossTS2:r2-tg2+TVP700:trg2+TVP700:trg3");
641 TGeoCompositeShape *ScrossTS =
new TGeoCompositeShape(
"crossTS",
642 "crossTSa:trg4+crossTSb:trg5");
644 TGeoCombiTrans* trg6 =
new TGeoCombiTrans(
"trg6", 0., 0., 60.0775, r1);
645 trg6->RegisterYourself();
646 TGeoCombiTrans* trg7 =
647 new TGeoCombiTrans(
"trg7", 0., 0., z0 + currentz, r1);
648 trg7->RegisterYourself();
651 TGeoCompositeShape *ScrossTSTMPs =
new TGeoCompositeShape(
"crossTSTMPs",
652 "VATvalve63+crossTS+VATvalve100:trg6");
654 TGeoCompositeShape *ScrossTS_vac =
new TGeoCompositeShape(
"crossTS_vac",
655 "VATvalve63_vac+crossTS1_vac:trg4+VATvalve100_vac:trg6");
657 TGeoVolume *VcrossTSTMPs =
new TGeoVolume(
"crossTSTMPs", ScrossTSTMPs,
659 VcrossTSTMPs->SetLineColor(37);
661 TGeoVolume *VcrossTSTMPs_vac =
new TGeoVolume(
"crossTSTMPs_vac", ScrossTS_vac,
663 VcrossTSTMPs_vac->SetLineColor(2);
664 VcrossTSTMPs_vac->SetTransparency(70);
669 fprintf(stderr,
"currentz g: %f\n", currentz);
681 TGeoRotation *dipolerot =
new TGeoRotation(
"dipolerot", 90., dphi / rad,
683 fprintf(stderr,
"Rotation due to dipole magnet: %f\n", dphi / rad);
684 cout <<
" corresponds to " << dphi <<
" degree " << endl;
694 Double_t psh1[15] = { 0., 360., 4, 0., 5.0, 7.6, 2.2, 5.0, 7.6, 2.2, 5.0,
695 5.2, 7.2, 5.5, 5.7 };
696 TGeoPcon* Dippip1 =
new TGeoPcon(
"Dippip1", 0., 360., 4);
697 Dippip1->SetDimensions(psh1);
700 Double_t psh1_vac[15] = { 0., 360., 4,
705 TGeoPcon* Dippip1_vac =
new TGeoPcon(
"Dippip1_vac", 0., 360., 4);
706 Dippip1_vac->SetDimensions(psh1_vac);
709 TGeoTorus *Dippip2 =
new TGeoTorus(
"Dippip2", R, 5.5, 5.7, 0., dphi / rad);
711 TGeoTorus *Dippip2_vac =
new TGeoTorus(
"Dippip2_vac", R, 0.0, 5.49, 0., dphi / rad);
714 Double_t psh21[15] = { 0., 360., 4, 0., 5.5, 5.7, 11., 5.5, 5.7,
715 11., 5.5, 7.6, 13., 5.5, 7.6 };
716 TGeoPcon* Dippip21 =
new TGeoPcon(
"Dippip21", 0., 360., 4);
717 Dippip21->SetDimensions(psh21);
720 Double_t psh21_vac[12] = { 0., 360., 3,
724 TGeoPcon* Dippip21_vac =
new TGeoPcon(
"Dippip21_vac", 0., 360., 3);
725 Dippip21_vac->SetDimensions(psh21_vac);
737 340.5+98.9, 10., 10.3,
739 340.5+101.5, 10., 12};
740 TGeoPcon* Dippip3 =
new TGeoPcon(
"Dippip3", 0., 360., 10);
741 Dippip3->SetDimensions(psh2);
744 Double_t psh2_vac[30] = { 0., 360., 9,
752 340.5+98.9, 0.0, 10.,
753 340.5+101.5+0.252, 0.0, 10.};
754 TGeoPcon* Dippip3_vac =
new TGeoPcon(
"Dippip3_vac", 0., 360., 9);
755 Dippip3_vac->SetDimensions(psh2_vac);
757 TGeoCombiTrans* trh1 =
new TGeoCombiTrans(
"trh1", R, 0., 7.1225,
758 new TGeoRotation(
"a", 0., -90., 180.));
759 trh1->RegisterYourself();
760 TGeoCombiTrans* trh2 =
new TGeoCombiTrans(
"trh2", dx0, .0, 7.1225 + dz0,
763 trh2->RegisterYourself();
765 TGeoCombiTrans* trh21 =
new TGeoCombiTrans(
"trh21", dx0 + s *
sin(dphi), 0.,
766 7.1225 + dz0 + s *
cos(dphi), dipolerot);
767 trh21->RegisterYourself();
769 TGeoCombiTrans* trh3 =
new TGeoCombiTrans(
"trh3", dx0 + s *
sin(dphi), 0.,
770 7.1225 + dz0 + s *
cos(dphi), dipolerot);
771 trh3->RegisterYourself();
773 TGeoCombiTrans* trh4 =
774 new TGeoCombiTrans(
"trh4", 0., 0., z0 + currentz, r1);
775 trh4->RegisterYourself();
778 TGeoCompositeShape *SDippip =
new TGeoCompositeShape(
"Dippip",
779 "Dippip1+Dippip2:trh1+Dippip21:trh2+VATvalve110:trh21+Dippip3:trh3");
781 TGeoCompositeShape *SDippip_vac =
new TGeoCompositeShape(
"Dippip_vac",
782 "Dippip1_vac+Dippip2_vac:trh1+Dippip21_vac:trh2+VATvalve110_vac:trh21+Dippip3_vac:trh3");
785 TGeoVolume *VDipolePip =
new TGeoVolume(
"DipolePip", SDippip,
787 VDipolePip->SetLineColor(38);
789 TGeoVolume *VDipolePip_vac =
new TGeoVolume(
"DipolePip_vac", SDippip_vac,
791 VDipolePip_vac->SetLineColor(2);
792 VDipolePip_vac->SetTransparency(80);
795 currentz += 7.1225 + dz0 + s *
cos(dphi);
796 fprintf(stderr,
"currentz/s h: %f %f\n", currentz, s);
797 std::cout <<
" luminosity monitor starts at " << currentz + z0 << std::endl;
802 TGeoTube* lmd_beampipe_upstr =
new TGeoTube(
803 "lmd_beampipe_upstr", 9., 9.2, 25.);
804 TGeoCombiTrans* lmd_trans_b_up =
new TGeoCombiTrans(
"lmd_trans_b_up", 0., 0., 25.+delta, r1);
805 lmd_trans_b_up->RegisterYourself();
806 TGeoTube* lmd_flange_upstr =
new TGeoTube(
807 "lmd_flange_upstr", 9.2, 25.3/2., 1.2);
808 TGeoCombiTrans* lmd_trans_fl_up =
new TGeoCombiTrans(
"lmd_trans_fl_up", 0., 0., 1.2+delta, r1);
809 lmd_trans_fl_up->RegisterYourself();
811 TGeoTube* lmd_cone_flange_upstr =
new TGeoTube(
812 "lmd_cone_flange_upstr", 9.2, 25.3/2., 1.5);
813 TGeoCombiTrans* lmd_trans_co_fl_up =
new TGeoCombiTrans(
"lmd_trans_co_fl_up", 0., 0., -1.5+50.-delta, r1);
814 lmd_trans_co_fl_up->RegisterYourself();
817 TGeoCone* lmd_capton_cone =
new TGeoCone(
"lmd_capton_cone", 23.386/2., 20.4/2., 20.4/2.+0.002/2., 7./2., 7./2.+0.002/2.);
818 TGeoCombiTrans* lmd_trans_cap_co =
new TGeoCombiTrans(
"lmd_trans_cap_co", 0., 0., 50.+23.386/2., r1);
819 lmd_trans_cap_co->RegisterYourself();
822 TGeoCone* lmd_cone_flange_downstr =
new TGeoCone(
"lmd_cone_flange_downstr", 3.12/2., 3.1, 8.6/2., 3.1, 3.2);
823 TGeoCombiTrans* lmd_trans_co_fl_do =
new TGeoCombiTrans(
"lmd_trans_co_fl_do", 0., 0., 50.+23.386+3.12/2., r1);
824 lmd_trans_co_fl_do->RegisterYourself();
826 TGeoTube* lmd_beam_pipe =
new TGeoTube(
"lmd_beam_pipe", 3.5, 3.6, 50./2.);
827 TGeoCombiTrans* lmd_trans_p =
new TGeoCombiTrans(
"lmd_trans_p", 0., 0., 50.+23.386+50./2., r1);
828 lmd_trans_p->RegisterYourself();
830 TGeoCone* lmd_cone_downstr =
new TGeoCone(
"lmd_cone_downstr", 20./2., 3.5, 3.7, 9./2., 9.2/2.);
831 TGeoCombiTrans* lmd_trans_co_do =
new TGeoCombiTrans(
"lmd_trans_co_do", 0., 0., 50.+23.386+50.+20./2., r1);
832 lmd_trans_co_do->RegisterYourself();
834 TGeoTube* lmd_beam_pipe_downstream =
new TGeoTube(
"lmd_beam_pipe_downstream", 9./2., 9.2/2., 56./2.);
835 TGeoCombiTrans* lmd_trans_p_down =
new TGeoCombiTrans(
"lmd_trans_p_down", 0., 0., 50.+23.386+50.+20.+56./2., r1);
836 lmd_trans_p_down->RegisterYourself();
874 TGeoCompositeShape *slum_beampipe_upstream =
new TGeoCompositeShape(
"slum_beampipe_upstream",
875 "lmd_flange_upstr:lmd_trans_fl_up+lmd_beampipe_upstr:lmd_trans_b_up+lmd_cone_flange_upstr:lmd_trans_co_fl_up");
876 TGeoCompositeShape *slum_CaptonCone =
new TGeoCompositeShape(
"slum_CaptonCone",
"lmd_capton_cone:lmd_trans_cap_co-lmd_cone_flange_downstr:lmd_trans_co_fl_do-lmd_cone_flange_upstr:lmd_trans_co_fl_up");
877 TGeoCompositeShape *slum_beampipe_downstream =
new TGeoCompositeShape(
"slum_beampipe_downstream",
878 "lmd_beam_pipe:lmd_trans_p+lmd_cone_downstr:lmd_trans_co_do+lmd_beam_pipe_downstream:lmd_trans_p_down");
881 TGeoCombiTrans* tri6 =
new TGeoCombiTrans(
"tri6", dx0 + s *
sin(dphi), 0.,
882 z0 + currentz, dipolerot);
887 tri6->RegisterYourself();
890 TGeoVolume *vlum_beampipe_upstream =
new TGeoVolume(
"vlum_beampipe_upstream", slum_beampipe_upstream,
892 vlum_beampipe_upstream->SetLineColor(39);
893 TGeoVolume *vlum_CaptonCone =
new TGeoVolume(
"vlum_CaptonCone", slum_CaptonCone,
895 vlum_CaptonCone->SetLineColor(kRed);
896 TGeoVolume *vlum_beampipe_downstream =
new TGeoVolume(
"vlum_beampipe_downstream", slum_beampipe_downstream,
898 vlum_beampipe_downstream->SetLineColor(39);
902 currentz += 200.00 *
cos(dphi);
903 fprintf(stderr,
"currentz/s i: %f %f\n", currentz, s);
909 Double_t psj1[15] = { 0., 360., 4, 0., 7.5, 10.125, 2.0, 7.5, 10.125, 2.0,
910 7.5, 7.7, 16.7, 7.5, 7.7 };
911 TGeoPcon* EndCross0a =
new TGeoPcon(
"EndCross0a", 0., 360., 4);
912 EndCross0a->SetDimensions(psj1);
915 Double_t psj2[15] = { 0., 360., 4, 16.7, 4.5, 4.7, 34.7, 4.5, 4.7, 34.7,
916 4.5, 7.6, 36.7, 4.5, 7.6 };
917 TGeoPcon* EndCross0b =
new TGeoPcon(
"EndCross0b", 0., 360., 4);
918 EndCross0b->SetDimensions(psj2);
921 Double_t psj3[21] = { 0., 360., 6, -16.7, 7.5, 10.125, -14.7, 7.5, 10.125,
922 -14.7, 7.5, 7.7, 14.7, 7.5, 7.7, 14.7, 7.5, 10.125, 16.7, 7.5,
924 TGeoPcon* EndCross1 =
new TGeoPcon(
"EndCross1", 0., 360., 6);
925 EndCross1->SetDimensions(psj3);
927 TGeoTube* tj1 =
new TGeoTube(
"tj1", 0., 7.7, 10.125 + delta);
928 TGeoTube* tj2 =
new TGeoTube(
"tj2", 0., 7.7, 3.85 + delta);
929 TGeoTube* tj3 =
new TGeoTube(
"tj3", 0., 4.7, 3.85 + delta);
931 TGeoCombiTrans* trj1 =
new TGeoCombiTrans(
"trj1", 0., 0., 16.7, r2);
932 trj1->RegisterYourself();
933 TGeoCombiTrans* trj2 =
934 new TGeoCombiTrans(
"trj2", 0., 0., 12.85 - delta, r1);
935 trj2->RegisterYourself();
936 TGeoCombiTrans* trj3 =
937 new TGeoCombiTrans(
"trj3", 0., 0., 20.55 + delta, r1);
938 trj3->RegisterYourself();
939 TGeoCombiTrans* trj4 =
new TGeoCombiTrans(
"trj4", 0., 0., 36.7, r1);
940 trj4->RegisterYourself();
941 TGeoCombiTrans* trj5 =
new TGeoCombiTrans(
"trj5", 0., 16.7, 16.7, r3);
942 trj5->RegisterYourself();
943 TGeoCombiTrans* trj6 =
new TGeoCombiTrans(
"trj6", 0., -23.7, 16.7, r3);
944 trj6->RegisterYourself();
945 TGeoCombiTrans* trj7 =
new TGeoCombiTrans(
"trj7", 0., -23.7, 16.7, r2);
946 trj7->RegisterYourself();
949 TGeoCompositeShape *EndCross2 =
new TGeoCompositeShape(
"EndCross2",
950 "EndCross0a+EndCross0b-tj1:trj1");
951 TGeoCompositeShape *EndCross3 =
new TGeoCompositeShape(
"EndCross3",
952 "EndCross1:trj1-tj2:trj2-tj3:trj3");
953 TGeoCompositeShape *EndCross4 =
new TGeoCompositeShape(
"EndCross4",
954 "TVPwValve:trj5+VATvalve160:trj6+IGP1000:trj7");
955 TGeoCompositeShape *EndCross =
new TGeoCompositeShape(
"EndCross",
956 "EndCross2+EndCross3+EndCross4+VATvalve100:trj4");
957 TGeoCombiTrans* trj8 =
new TGeoCombiTrans(
"trj8", dx0 + s *
sin(dphi), 0.,
958 z0 + currentz, dipolerot);
959 trj8->RegisterYourself();
962 TGeoVolume *VEndCross =
new TGeoVolume(
"EndCross", EndCross,
964 VEndCross->SetLineColor(40);
968 currentz += 43.7 *
cos(dphi);
969 fprintf(stderr,
"currentz/s j: %f %f\n", currentz, s);
974 TGeoVolume *beamPipe =
new TGeoVolumeAssembly(
"BeamPipe");
977 if (create_pipe) beamPipe->AddNode(Vpipeup, 0, trb1);
978 if (create_vacuum) beamPipe->AddNode(Vpipeup_vac, 0, trb1);
980 if (create_pipe) beamPipe->AddNode(Vktmpump, 0, trc2);
981 if (create_vacuum) beamPipe->AddNode(Vktmpump_vac, 0, trc2);
983 if (create_pipe) beamPipe->AddNode(VTpumps, 0, tr0);
985 if (create_pipe) beamPipe->AddNode(VpipeTSup, 0, trd1);
986 if (create_vacuum) beamPipe->AddNode(VpipeTSup_vac, 0, trd1);
988 if (create_target) VTcross->AddNode(vol_target, 0, tre9);
990 if (create_pipe) beamPipe->AddNode(VTcross, 0, tre9);
991 if (create_vacuum) beamPipe->AddNode(VTcross_vac, 0, tre9);
993 if (create_pipe) beamPipe->AddNode(VpipeTSdown, 0, trf1);
994 if (create_vacuum) beamPipe->AddNode(VpipeTSdown_vac, 0, trf1);
996 if (create_pipe) beamPipe->AddNode(VcrossTSTMPs, 0, trg7);
997 if (create_vacuum) beamPipe->AddNode(VcrossTSTMPs_vac, 0, trg7);
1000 if (create_pipe) beamPipe->AddNode(VDipolePip, 0, trh4);
1001 if (create_vacuum) beamPipe->AddNode(VDipolePip_vac, 0, trh4);
1010 for (
int iposz = 0; iposz < 1200; iposz+=10) sensor_positions.push_back(iposz);
1012 if (create_sensors){
1013 for (
unsigned int isensor = 1; isensor < sensor_positions.size(); isensor++){
1014 std::stringstream volume_name;
1015 volume_name <<
"_" << isensor;
1017 TGeoTube* disc =
new TGeoTube((
"disc"+volume_name.str()).c_str(), 0., 40., 0.0000001);
1018 TGeoVolume* Vdisc =
new TGeoVolume((
"LumActive_pipe_sensor_"+volume_name.str()).c_str(), disc,
1020 TGeoCombiTrans* tre_disc =
1021 new TGeoCombiTrans((
"tre_"+volume_name.str()).c_str(), 0., 0., sensor_positions[isensor],
r1);
1022 tre_disc->RegisterYourself();
1023 Vdisc->SetLineColor(2);
1024 beamPipe->AddNode(Vdisc, 0, tre_disc);
1035 cave->AddNode(beamPipe, 1);
1060 fprintf(stderr,
"\n");
1061 fprintf(stderr,
"<I> Geometry of PANDA beam pipe written to %s\n",
1063 fprintf(stderr,
"\n");
1068 #include<TApplication.h>
1071 TApplication myapp(
"myapp",0,0);
int createRootGeometry_beampipe()
friend F32vec4 cos(const F32vec4 &a)
friend F32vec4 sin(const F32vec4 &a)
TGeoManager * gGeoManager
FairGeoMedium * FairMediumAir
FairGeoInterface * geoFace
FairGeoBuilder * geoBuild