17 gROOT->Macro(
"$VMCWORKDIR/gconfig/rootlogon.C");
18 TString vmcWorkdir = getenv(
"VMCWORKDIR");
21 FairGeoLoader*
geoLoad =
new FairGeoLoader(
"TGeo",
"FairGeoLoader");
22 FairGeoInterface*
geoFace = geoLoad->getGeoInterface();
23 geoFace->setMediaFile(vmcWorkdir+
"/geometry/media_pnd.geo");
25 FairGeoMedia*
geoMedia = geoFace->getMedia();
26 FairGeoBuilder*
geoBuild = geoLoad->getGeoBuilder();
29 FairGeoMedium* FairMediumSteel = geoMedia->getMedium(
"steel");
30 FairGeoMedium* FairMediumTi = geoMedia->getMedium(
"titanium");
31 geoBuild->createMedium(FairMediumAir);
32 geoBuild->createMedium(FairMediumSteel);
33 geoBuild->createMedium(FairMediumTi);
37 TFile*
fi =
new TFile(fGeoFile,
"RECREATE");
41 TGeoBBox* lTop =
new TGeoBBox(200,200,300);
42 cave =
new TGeoVolume(
"BeamPipe", lTop,
gGeoManager->GetMedium(
"air"));
59 TGeoRotation*
r1 =
new TGeoRotation(
"r1",0.,0.,0.);
60 TGeoRotation*
r2 =
new TGeoRotation(
"r2", 0., 90., 180.);
61 TGeoRotation* r3 =
new TGeoRotation(
"r3", 0.,-90., 0);
62 TGeoRotation* r4 =
new TGeoRotation(
"r4", 90., 0., 0);
64 TGeoCombiTrans* tr0 =
new TGeoCombiTrans(
"tra0",0.,0.,z0,r1); tr0->RegisterYourself();
69 TGeoCombiTrans* trv1 =
new TGeoCombiTrans(
"trv1",0.,0.,1.075, r1); trv1->RegisterYourself();
70 TGeoCombiTrans* trv2 =
new TGeoCombiTrans(
"trv2",0.,0.,3.53875, r1); trv2->RegisterYourself();
71 TGeoCombiTrans* trv3 =
new TGeoCombiTrans(
"trv3",0.,0.,6.0075, r1); trv3->RegisterYourself();
76 TGeoBBox* VATvalve63a =
new TGeoBBox(
"VATvalve63a",5.6,12.45,1.35,ov1);
77 TGeoTube* VATvalve63b =
new TGeoTube(
"VATvalve63b",3.5,6.5,1.075);
78 TGeoTube* tv1 =
new TGeoTube(
"tv1",0.,3.5,1.35+delta);
80 TGeoCompositeShape *SVATvalve630 =
new TGeoCompositeShape(
"VATvalve630",
"VATvalve63a-tv1");
81 TGeoCompositeShape *SVATvalve63 =
new TGeoCompositeShape(
"VATvalve63",
"VATvalve63b:trv1+VATvalve630:trv2+VATvalve63b:trv3");
87 TGeoBBox* VATvalve100a =
new TGeoBBox(
"VATvalve100a",7.2,16.0,1.35,ov2);
88 TGeoTube* VATvalve100b =
new TGeoTube(
"VATvalve100b",5.0,8.25,1.075);
89 TGeoTube* tv2 =
new TGeoTube(
"tv2",0.,5.0,1.35+delta);
91 TGeoCompositeShape *SVATvalve1000 =
new TGeoCompositeShape(
"VATvalve1000",
"VATvalve100a-tv2");
92 TGeoCompositeShape *SVATvalve100 =
new TGeoCompositeShape(
"VATvalve100",
"VATvalve100b:trv1+VATvalve1000:trv2+VATvalve100b:trv3");
98 TGeoBBox* VATvalve160a =
new TGeoBBox(
"VATvalve160a",9.1,21.75,1.35,ov3);
99 TGeoTube* VATvalve160b =
new TGeoTube(
"VATvalve160b",7.5,11.25,1.075);
100 TGeoTube* tv3 =
new TGeoTube(
"tv3",0.,7.5,1.35+delta);
102 TGeoCompositeShape *SVATvalve1000 =
new TGeoCompositeShape(
"VATvalve1600",
"VATvalve160a-tv3");
103 TGeoCompositeShape *SVATvalve100 =
new TGeoCompositeShape(
"VATvalve160",
"VATvalve160b:trv1+VATvalve1600:trv2+VATvalve160b:trv3");
117 TGeoPcon* TVP700 =
new TGeoPcon(
"TVP700",0.,360.,8);
118 TVP700->SetDimensions(psv1);
136 TGeoPcon* TVP1000 =
new TGeoPcon(
"TVP1000",0.,360.,12);
137 TVP1000->SetDimensions(psv2);
150 TGeoPcon* IGP1000 =
new TGeoPcon(
"IGP1000",0.,360.,6);
151 IGP1000->SetDimensions(psv3);
162 TGeoVolume *Vgvhesr =
new TGeoVolume(
"gvhesr",SVATvalve100 ,
gGeoManager->GetMedium(
"steel"));
163 Vgvhesr->SetLineColor(30);
167 fprintf(stderr,
"currentz a: %f\n", currentz);
178 156.0328, 7.50, 7.60,
179 156.0328, 7.50, 10.125,
180 158.2328, 7.50, 10.125
182 TGeoPcon* pipeup =
new TGeoPcon(
"pipeup",0.,360.,8);
183 pipeup->SetDimensions(psb1);
185 TGeoCombiTrans* trb1 =
new TGeoCombiTrans(
"trb1",0.,0.,z0+currentz,r1); trb1->RegisterYourself();
187 TGeoVolume *Vpipeup =
new TGeoVolume(
"pipeup", pipeup,
gGeoManager->GetMedium(
"steel"));
188 Vpipeup->SetLineColor(31);
191 currentz += 158.2328;
192 fprintf(stderr,
"currentz b: %f\n", currentz);
206 TGeoPcon* ktmpump0 =
new TGeoPcon(
"ktmpump0",0.,360.,6);
207 ktmpump0->SetDimensions(psc1);
208 TGeoTube* tc1 =
new TGeoTube(
"tc1",0.,7.7,7.7);
210 TGeoCombiTrans*
trc1 =
new TGeoCombiTrans(
"trc1",0.,0.,0,r2); trc1->RegisterYourself();
211 TGeoCombiTrans*
trc2 =
new TGeoCombiTrans(
"trc2",0.,0.,z0+currentz+16.7,r1); trc2->RegisterYourself();
213 TGeoCompositeShape *csc1 =
new TGeoCompositeShape(
"csc1",
"(ktmpump0-tc1:trc1)");
214 TGeoCompositeShape *Sktmpump =
new TGeoCompositeShape(
"ktmpump",
"csc1+(csc1:trc1)");
216 TGeoVolume *Vktmpump =
new TGeoVolume(
"ktmpump", Sktmpump,
gGeoManager->GetMedium(
"steel"));
217 Vktmpump->SetLineColor(32);
221 fprintf(stderr,
"currentz c1: %f\n", currentz);
226 TGeoCombiTrans*
trc3 =
new TGeoCombiTrans(
"trc3",0., 0., 7.0,r1); trc3->RegisterYourself();
227 TGeoCombiTrans* trc4 =
new TGeoCombiTrans(
"trc4",0.,-16.7,currentz,r2); trc4->RegisterYourself();
228 TGeoCombiTrans* trc5 =
new TGeoCombiTrans(
"trc5",0., 16.7,currentz,r3); trc5->RegisterYourself();
230 TGeoCompositeShape *STVPwValve =
new TGeoCompositeShape(
"TVPwValve",
"(VATvalve160+TVP1000:trc3)");
231 TGeoCompositeShape *STpumps =
new TGeoCompositeShape(
"Tpumps",
"TVPwValve:trc4+TVPwValve:trc5");
233 TGeoVolume *VTpumps =
new TGeoVolume(
"Tpump", STpumps,
gGeoManager->GetMedium(
"steel"));
234 VTpumps->SetLineColor(33);
239 fprintf(stderr,
"currentz c2: %f\n", currentz);
254 TGeoPcon* pipeTSup =
new TGeoPcon(
"pipeTSup",0.,360.,8);
255 pipeTSup->SetDimensions(psd1);
257 TGeoCombiTrans* trd1 =
new TGeoCombiTrans(
"trd1",0.,0.,z0+currentz,r1); trd1->RegisterYourself();
259 TGeoVolume *VpipeTSup =
new TGeoVolume(
"pipeTSup", pipeTSup,
gGeoManager->GetMedium(
"steel"));
260 VpipeTSup->SetLineColor(34);
265 fprintf(stderr,
"currentz d: %f\n", currentz);
272 fprintf(stderr,
"Target position: 0 / 0 / %f\n",z0+currentz+tz);
284 TGeoPcon* Tcross1 =
new TGeoPcon(
"Tcross1",0.,360.,7);
285 Tcross1->SetDimensions(pse1);
287 TGeoTube* Tcross2 =
new TGeoTube(
"Tcross2",1.0,1.02,11.5);
313 TGeoPcon* Tcross3 =
new TGeoPcon(
"Tcross3",0.,360.,20);
314 Tcross3->SetDimensions(pse2);
316 TGeoTube* te1 =
new TGeoTube(
"te1",0.,1.25,0.51+delta);
317 TGeoTube* te2 =
new TGeoTube(
"te2",0.,1.00,0.51+delta);
318 TGeoTube* te3 =
new TGeoTube(
"te3",0.,1.00,1.27+delta);
319 TGeoTube* te4 =
new TGeoTube(
"te4",0.,1.00,1.02+delta);
321 TGeoCombiTrans* tre1 =
new TGeoCombiTrans(
"tre1",0., 0., tz, r2); tre1->RegisterYourself();
322 TGeoCombiTrans* tre2 =
new TGeoCombiTrans(
"tre2",0., 0.,-11.5, r2); tre2->RegisterYourself();
323 TGeoCombiTrans* tre3 =
new TGeoCombiTrans(
"tre3",0., 0., 0., r2); tre3->RegisterYourself();
324 TGeoCombiTrans* tre4 =
new TGeoCombiTrans(
"tre4",0., 0., -0.51, r1); tre4->RegisterYourself();
325 TGeoCombiTrans* tre5 =
new TGeoCombiTrans(
"tre5",0., 0., 0.51, r1); tre5->RegisterYourself();
326 TGeoCombiTrans* tre6 =
new TGeoCombiTrans(
"tre6",0., 0., 41.5, r1); tre6->RegisterYourself();
327 TGeoCombiTrans* tre7 =
new TGeoCombiTrans(
"tre7",0., 0., tz, r1); tre7->RegisterYourself();
328 TGeoCombiTrans* tre8 =
new TGeoCombiTrans(
"tre8",0., -175.0, tz, r3); tre8->RegisterYourself();
330 TGeoCombiTrans* tre9 =
new TGeoCombiTrans(
"tre9",0.,0.,z0+currentz, r1); tre9->RegisterYourself();
332 TGeoCompositeShape *STcross0a =
new TGeoCompositeShape(
"Tcross0a",
"Tcross1-te3:tre1");
333 TGeoCompositeShape *STcross0b =
new TGeoCompositeShape(
"Tcross0b",
"Tcross2-te4:tre2");
334 TGeoCompositeShape *STcross0c =
new TGeoCompositeShape(
"Tcross0c",
"Tcross3:tre3-te1:tre4-te2:tre5");
336 TGeoCompositeShape *STcross =
new TGeoCompositeShape(
"Tcross",
"Tcross0a+Tcross0b:tre6+Tcross0c:tre7+VATvalve160:tre8");
338 TGeoVolume *VTcross =
new TGeoVolume(
"Tcross", STcross,
gGeoManager->GetMedium(
"titanium"));
339 VTcross->SetLineColor(35);
343 fprintf(stderr,
"currentz e: %f\n", currentz);
363 261.0725, 3.2, 5.675,
366 TGeoPcon* pipeTSdown =
new TGeoPcon(
"pipeTSdown",0.,360.,16);
367 pipeTSdown->SetDimensions(psf1);
369 TGeoCombiTrans* trf1 =
new TGeoCombiTrans(
"trf1",0.,0.,z0+currentz,r1); trf1->RegisterYourself();
371 TGeoVolume *VpipeTSdown =
new TGeoVolume(
"pipeTSdown", pipeTSdown,
gGeoManager->GetMedium(
"titanium"));
372 VpipeTSdown->SetLineColor(36);
375 currentz += 262.8225;
376 fprintf(stderr,
"currentz f: %f\n", currentz);
392 TGeoPcon* crossTS1 =
new TGeoPcon(
"crossTS1",0.,360.,8);
393 crossTS1->SetDimensions(psg1);
395 TGeoTube* tg1 =
new TGeoTube(
"tg1",0.,6.07,5.07+delta);
396 TGeoCombiTrans* trg1 =
new TGeoCombiTrans(
"trg1" ,0.,0.,26.0, r2); trg1->RegisterYourself();
397 TGeoCompositeShape *ScrossTSa =
new TGeoCompositeShape(
"crossTSa",
"crossTS1-tg1:trg1");
408 TGeoPcon* crossTS2 =
new TGeoPcon(
"crossTS2",0.,360.,22);
409 crossTS2->SetDimensions(psg2);
411 TGeoTube* tg2 =
new TGeoTube(
"tg2",0.,5.07,6.07+delta);
412 TGeoCombiTrans* trg2 =
new TGeoCombiTrans(
"trg2" ,0.,-55.0, 0., r2); trg2->RegisterYourself();
413 TGeoCombiTrans* trg3 =
new TGeoCombiTrans(
"trg3" ,0., 55.0, 0., r3); trg3->RegisterYourself();
414 TGeoCombiTrans* trg4 =
new TGeoCombiTrans(
"trg4" ,0., 0., 7.0775, r1); trg4->RegisterYourself();
415 TGeoCombiTrans* trg5 =
new TGeoCombiTrans(
"trg5" ,0., 0., 33.0775, r1); trg5->RegisterYourself();
418 TGeoCompositeShape *ScrossTSb =
new TGeoCompositeShape(
"crossTSb",
"crossTS2:r2-tg2+TVP700:trg2+TVP700:trg3");
419 TGeoCompositeShape *ScrossTS =
new TGeoCompositeShape(
"crossTS" ,
"crossTSa:trg4+crossTSb:trg5");
421 TGeoCombiTrans* trg6 =
new TGeoCombiTrans(
"trg6",0.,0.,60.0775, r1); trg6->RegisterYourself();
422 TGeoCombiTrans* trg7 =
new TGeoCombiTrans(
"trg7",0.,0.,z0+currentz, r1); trg7->RegisterYourself();
424 TGeoCompositeShape *ScrossTSTMPs =
new TGeoCompositeShape(
"crossTSTMPs",
"VATvalve63+crossTS+VATvalve100:trg6");
426 TGeoVolume *VcrossTSTMPs =
new TGeoVolume(
"crossTSTMPs", ScrossTSTMPs,
gGeoManager->GetMedium(
"steel"));
427 VcrossTSTMPs->SetLineColor(37);
431 fprintf(stderr,
"currentz g: %f\n", currentz);
441 TGeoRotation *dipolerot =
new TGeoRotation(
"dipolerot",90.,dphi/rad, -90.);
457 TGeoPcon* Dippip1 =
new TGeoPcon(
"Dippip1",0.,360.,4);
458 Dippip1->SetDimensions(psh1);
461 TGeoTorus *Dippip2 =
new TGeoTorus(
"Dippip2", R, 5.0, 5.2, 0., dphi/rad);
468 439.3572, 9.0, 12.65.,
469 441.7572, 9.0, 12.65,
473 TGeoPcon* Dippip3 =
new TGeoPcon(
"Dippip3",0.,360.,7);
474 Dippip3->SetDimensions(psh2);
476 TGeoCombiTrans* trh1 =
new TGeoCombiTrans(
"trh1", R,0.,7.1225,
new TGeoRotation(
"a",0.,-90.,180.)); trh1->RegisterYourself();
477 TGeoCombiTrans* trh2 =
new TGeoCombiTrans(
"trh2",dx0,.0.,7.1225+dz0, dipolerot); trh2->RegisterYourself();
479 TGeoCombiTrans* trh3 =
new TGeoCombiTrans(
"trh3",dx0+s*
sin(dphi),0.,7.1225+dz0+s*
cos(dphi),dipolerot); trh3->RegisterYourself();
481 TGeoCombiTrans* trh4 =
new TGeoCombiTrans(
"trh4",0.,0.,z0+currentz,r1); trh4->RegisterYourself();
484 TGeoCompositeShape *SDippip =
new TGeoCompositeShape(
"Dippip",
"Dippip1+Dippip2:trh1+VATvalve100:trh2+Dippip3:trh3");
486 TGeoVolume *VDipolePip =
new TGeoVolume(
"DipolePip", SDippip,
gGeoManager->GetMedium(
"steel"));
487 VDipolePip->SetLineColor(38);
490 currentz += 7.1225+dz0+s*
cos(dphi);
491 fprintf(stderr,
"currentz/s h: %f %f\n", currentz,s);
509 TGeoPcon* LumMon0 =
new TGeoPcon(
"LumMon0",0.,360.,10);
510 LumMon0->SetDimensions(psi1);
521 TGeoPcon* nozzle0 =
new TGeoPcon(
"nozzle0",0.,360.,6);
522 nozzle0->SetDimensions(psi2);
524 TGeoTube* ti1 =
new TGeoTube(
"ti1",0.,12.7,5.4+delta);
525 TGeoTube* ti2 =
new TGeoTube(
"ti2",0.,5.0,12.7+delta);
527 TGeoCombiTrans* tri1 =
new TGeoCombiTrans(
"tri1",0.,0., 77.8,r2); tri1->RegisterYourself();
528 TGeoCombiTrans* tri2 =
new TGeoCombiTrans(
"tri2",0.,0., 97.8,r2); tri2->RegisterYourself();
529 TGeoCombiTrans* tri3 =
new TGeoCombiTrans(
"tri3",0.,0.,117.8,r2); tri3->RegisterYourself();
530 TGeoCombiTrans* tri4 =
new TGeoCombiTrans(
"tri4",0.,0.,137.8,r2); tri4->RegisterYourself();
531 TGeoCombiTrans* tri5 =
new TGeoCombiTrans(
"tri5",0.,0., 0., r4); tri5->RegisterYourself();
534 TGeoCompositeShape *Snozzle1 =
new TGeoCompositeShape(
"nozzle1",
"(nozzle0-ti1:r2)");
535 TGeoCompositeShape *Snozzles =
new TGeoCompositeShape(
"nozzles",
"nozzle1:tri1+nozzle1:tri2+nozzle1:tri3+nozzle1:tri4");
536 TGeoCompositeShape *Sholes =
new TGeoCompositeShape(
"holes",
"ti1:tri1+ti1:tri2+ti1:tri3+ti1:tri4");
537 TGeoCompositeShape *SLumMon1 =
new TGeoCompositeShape(
"LumMon1",
"LumMon0-holes-(holes:tri5)");
538 TGeoCompositeShape *SLumMon =
new TGeoCompositeShape(
"LumMon",
"LumMon1+nozzles+(nozzles:tri5)");
540 TGeoCombiTrans* tri6 =
new TGeoCombiTrans(
"tri6",dx0+s*
sin(dphi),0.,z0+currentz,dipolerot); tri6->RegisterYourself();
543 TGeoVolume *VLumMon =
new TGeoVolume(
"LumMon", SLumMon,
gGeoManager->GetMedium(
"steel"));
544 VLumMon->SetLineColor(39);
548 currentz += 200.00*
cos(dphi);
549 fprintf(stderr,
"currentz/s i: %f %f\n", currentz,s);
561 TGeoPcon* EndCross0a =
new TGeoPcon(
"EndCross0a",0.,360.,4);
562 EndCross0a->SetDimensions(psj1);
571 TGeoPcon* EndCross0b =
new TGeoPcon(
"EndCross0b",0.,360.,4);
572 EndCross0b->SetDimensions(psj2);
583 TGeoPcon* EndCross1 =
new TGeoPcon(
"EndCross1",0.,360.,6);
584 EndCross1->SetDimensions(psj3);
586 TGeoTube* tj1 =
new TGeoTube(
"tj1",0.,7.7,10.125+delta);
587 TGeoTube* tj2 =
new TGeoTube(
"tj2",0.,7.7,3.85+delta);
588 TGeoTube* tj2 =
new TGeoTube(
"tj3",0.,4.7,3.85+delta);
590 TGeoCombiTrans* trj1 =
new TGeoCombiTrans(
"trj1",0., 0., 16.7, r2); trj1->RegisterYourself();
591 TGeoCombiTrans* trj2 =
new TGeoCombiTrans(
"trj2",0., 0., 12.85-delta, r1); trj2->RegisterYourself();
592 TGeoCombiTrans* trj3 =
new TGeoCombiTrans(
"trj3",0., 0., 20.55+delta, r1); trj3->RegisterYourself();
593 TGeoCombiTrans* trj4 =
new TGeoCombiTrans(
"trj4",0., 0., 36.7, r1); trj4->RegisterYourself();
594 TGeoCombiTrans* trj5 =
new TGeoCombiTrans(
"trj5",0., 16.7, 16.7, r3); trj5->RegisterYourself();
595 TGeoCombiTrans* trj6 =
new TGeoCombiTrans(
"trj6",0., -23.7, 16.7, r3); trj6->RegisterYourself();
596 TGeoCombiTrans* trj6 =
new TGeoCombiTrans(
"trj7",0., -23.7, 16.7, r2); trj6->RegisterYourself();
599 TGeoCompositeShape *EndCross2 =
new TGeoCompositeShape(
"EndCross2",
"EndCross0a+EndCross0b-tj1:trj1");
600 TGeoCompositeShape *EndCross3 =
new TGeoCompositeShape(
"EndCross3",
"EndCross1:trj1-tj2:trj2-tj3:trj3");
601 TGeoCompositeShape *EndCross4 =
new TGeoCompositeShape(
"EndCross4",
"TVPwValve:trj5+VATvalve160:trj6+IGP1000:trj7");
602 TGeoCompositeShape *EndCross =
new TGeoCompositeShape(
"EndCross",
"EndCross2+EndCross3+EndCross4+VATvalve100:trj4");
604 TGeoCombiTrans* trj8 =
new TGeoCombiTrans(
"trj8",dx0+s*
sin(dphi),0.,z0+currentz,dipolerot); trj8->RegisterYourself();
607 TGeoVolume *VEndCross =
new TGeoVolume(
"EndCross", EndCross,
gGeoManager->GetMedium(
"steel"));
608 VEndCross->SetLineColor(40);
611 currentz += 43.7*
cos(dphi);
612 fprintf(stderr,
"currentz/s j: %f %f\n", currentz,s);
616 TGeoVolume *beamPipe =
new TGeoVolumeAssembly(
"BeamPipe");
617 beamPipe->AddNode(Vgvhesr, 0, tr0);
618 beamPipe->AddNode(Vpipeup, 0, trb1);
619 beamPipe->AddNode(Vktmpump, 0, trc2);
620 beamPipe->AddNode(VTpumps, 0, tr0);
621 beamPipe->AddNode(VpipeTSup, 0, trd1);
622 beamPipe->AddNode(VTcross, 0, tre9);
623 beamPipe->AddNode(VpipeTSdown, 0, trf1);
624 beamPipe->AddNode(VcrossTSTMPs, 0, trg7);
625 beamPipe->AddNode(VDipolePip, 0, trh4);
626 beamPipe->AddNode(VLumMon, 0, tri6);
627 beamPipe->AddNode(VEndCross, 0, trj8);
630 cave->AddNode(beamPipe, 1);
646 fprintf(stderr,
"\n");
647 fprintf(stderr,
"<I> Geometry of PANDA beam pipe written to %s\n",(
char*)fGeoFile);
648 fprintf(stderr,
"\n");
friend F32vec4 cos(const F32vec4 &a)
friend F32vec4 sin(const F32vec4 &a)
TGeoManager * gGeoManager
FairGeoMedium * FairMediumAir
FairGeoInterface * geoFace
FairGeoBuilder * geoBuild