1 //----------------------------------------------------------------------
3 static AliITSv11GeometrySPD *gspd;
4 static AliITSv11GeometrySDD *gsdd;
5 static AliITSv11GeometrySSD *gssd;
6 static AliITSv11GeometrySupport *gsupp;
7 static AliITSgeom *geom;
9 //----------------------------------------------------------------------
10 void Displayv11(const char* filename=""){
11 // Display AliITSv11 Geometry
13 // const char* filename output file with the display in it
19 gSystem->Load("libGeom");
21 if(gGeoManager) delete gGeoManager;
22 mgr2 = gGeoManager = new TGeoManager("ITSGeometry",
23 " ITS Simulation Geometry Manager");
25 const AliITSVersion_t kv11=110;
26 const Char_t *cvsDate="$Date$";
27 const Char_t *cvsRevision="$Revision$";
28 const Int_t kLength=100;
29 Char_t vstrng[kLength];
30 AliITSInitGeometry initgeom(kv11,1);
32 TGeoMaterial *vacmat = new TGeoMaterial("Vacume",0,0,0);
33 TGeoMedium *vacmed = new TGeoMedium("Vacume_med",1,vacmat);
34 TGeoVolume *ALIC = mgr2->MakeBox("ALIC",vacmed,1000.,1000.,2000.);
35 mgr2->SetTopVolume(ALIC);
36 TGeoVolume *ITS = mgr2->MakeBox("ITSV",vacmed,990.,990.,1990.);
37 if(initgeom.WriteVersionString(vstrng,kLength,kv11,1,cvsDate,cvsRevision))
38 ITS->SetTitle(vstrng);
39 //TGeoVolumeAssembly *ITSSPD = new TGeoVolumeAssembly("ITSSPD");
40 //ITS->AddNode(ITSSPD,1);
44 AliITSv11 *its = new AliITSv11(0,3);
45 its->SetDebug(ISetits(0,-1));
46 its->GetSPDGeometry()->SetDebug(ISetits(0,-1));
47 its->GetSupGeometry()->SetDebug(ISetits(0,-1));
48 its->CreateMaterials();
49 its->CreateGeometry();
51 gspd = new AliITSv11GeometrySPD(0);
52 gsdd = new AliITSv11GeometrySDD();
53 gsupp = new AliITSv11GeometrySupport(0);
54 gssd = new AliITSv11GeometrySSD();
56 Int_t imat=1,imed=1,ireturn=0;
57 ireturn = gspd->CreateSPDCentralMaterials(imed,imat);
58 gspd->SPDSector(ITS,mgr2);
59 gsupp->SPDCone(ITS,mgr2);
61 gsupp->SDDCone(ITS,mgr2);
64 gsdd->ForwardLayer3(ITS);// in Hybrid its in IS02
65 gsdd->ForwardLayer4(ITS);// in Hybrid its in IS02
68 gssd->LadderSupportLayer5(ITS);
69 gssd->LadderSupportLayer6(ITS);
70 gssd->EndCapSupportSystemLayer6(ITS);
71 gssd->EndCapSupportSystemLayer5(ITS);
72 gsupp->SSDCone(ITS,mgr2);
73 gsupp->ServicesCableSupport(ITS);
75 mgr2->CloseGeometry();
77 geom = new AliITSgeom();
78 initgeom.InitAliITSgeom(geom);
79 geom->WriteNewFile("ITSgeomV11.det");
81 TControlBar *bar=new TControlBar("vertical","ITS Geometry Display",10,10);
82 bar->AddButton("Set Clipping on","ISetits(2,1)","Clipping on");
83 bar->AddButton("Set Cllipping off","ISetits(2,0)","Clipping off");
84 bar->AddButton("Set axis on","ISetits(3,1)","Show Axis on");
85 bar->AddButton("Set axis off","ISetits(3,0)","Show Axis off");
86 bar->AddButton("Set perspective on","ISetits(4,1)","Perspective on");
87 bar->AddButton("Set perspective off","ISetits(4,0)","Perspective off");
88 bar->AddButton("Set RayTrace on","ISetits(5,1)","Perspective on");
89 bar->AddButton("Set RayTrace off","ISetits(5,0)","Perspective off");
90 bar->AddButton("Set circle/80","ISetits(1,80)","circles ~ by 80 lines");
91 bar->AddButton("Display Geometry","Displayit()","Run Displayit");
92 bar->AddButton("Display SPD Sector Volume","EngineeringSPDSector()",
93 "Run EngineeringSPDSector");
94 bar->AddButton("Print SPD Sector Volume data xfig","PrintSPDSectorData()",
95 "Run PrintSPDSectorData");
96 bar->AddButton("Display SPD Ceneral Volume","EngineeringSPDCenter()",
97 "Run EngineeringSPDCenter");
98 bar->AddButton("Display SPD Thermal Sheald","EngineeringSPDThS()",
99 "Run EngineeringSPDThS");
100 bar->AddButton("Display SPD Sector Cross Sections","EngineeringSPDSCS()",
101 "Run EngineeringSPDSCS");
102 bar->AddButton("Display SDD Layer 3","EngineeringSDDLayer3()",
103 "Run EngineeringSDDLayer3");
104 bar->AddButton("Display SDD Layer 4","EngineeringSDDLayer4()",
105 "Run EngineeringSDDLayer4");
106 bar->AddButton("Display SDD Cone","EngineeringSDDCone()",
107 "Run EngineeringSDDCone");
108 bar->AddButton("Display SDD Centeral Cylinder","EngineeringSDDCylinder()",
109 "Run EngineeringSDDCylinder");
110 bar->AddButton("Display SSD Cone","EngineeringSSDCone()",
111 "Run EngineeringSSDCone");
112 bar->AddButton("Display SSD Centeral Cylinder","EngineeringSSDCylinder()",
113 "Run EngineeringSSDCylinder");
114 bar->AddButton("Display SUP RB24 side","EngineeringSupRB24()",
115 "Run EngineeringSupRB24");
116 bar->AddButton("Display Cable Trays RB24 side","EngineeringSupTrayRB24()",
117 "Run EngineeringSupTrayRB24");
118 bar->AddButton("Display SUP RB26 side","EngineeringSupRB26()",
119 "Run EngineeringSupRB26");
120 bar->AddButton("Save Geometry to File","ExportToFile()",
122 bar->AddButton("Quit/Exit",".q","Exit");
124 gROOT->SaveContext();
127 //----------------------------------------------------------------------
129 // Quirry file name and write geometry to a root file.
131 // const char* filename output file with the display in it
136 Char_t filename[100];
138 printf("Eneter File name:");
139 scanf("%s",filename);
141 gGeoManager->Export(filename);
143 //----------------------------------------------------------------------
144 Int_t ISetits(Int_t t,Int_t v){
145 static Int_t itsdebug=1,nsegments=80,cut=0,axis=1,perspective=0,ray=0;
149 if(v<0) return itsdebug;
153 if(v<0) return nsegments;
165 if(v<0) return perspective;
175 //----------------------------------------------------------------------
176 Double_t DSetits(Int_t t,Double_t v){
177 static Double_t phimincut=0.0,phimaxcut=180.0;
178 static Double_t longitude=90.0,latitude=0.0,psi=0.0;
182 if(v<0.) return phimincut;
186 if(v<0.) return phimaxcut;
190 if(v<0.) return longitude;
194 if(v<0.) return latitude;
198 if(v<0.) return latitude;
204 //----------------------------------------------------------------------
206 // Display AliITSv11 Geometry
208 // const char* filename output file with the display in it
215 TGeoManager *mgr2 = gGeoManager;
216 TGeoVolume *ALIC = mgr2->GetTopVolume();
218 if(!(c1 = (TCanvas*)gROOT->FindObject("C1")))
219 c1 = new TCanvas("C1","ITS Simulation Geometry",900,900);
222 mgr2->SetNsegments(ISetits(1,-1));
224 mgr2->SetVisLevel(6);
225 mgr2->SetVisOption(0);
226 //mgr2->CheckOverlaps(0.01);
227 //mgr2->PrintOverlaps();
228 if(ISetits(2,-1)==1){
229 TGeoShape *clip = new TGeoTubeSeg(0, 1000, 2000, 45, 90);
230 mgr2->SetClippingShape(clip);
232 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
236 TPad *p1 = c1->GetPad(1);
237 TView *view1 = p1->GetView();
239 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
240 if(irr) cout <<"error="<<irr<<endl;
241 if(ISetits(4,-1)==0) view1->SetParallel();
242 else view1->SetPerspective();
244 if(ISetits(3,-1)!=0) view1->ShowAxis();
246 if(ISetits(5,-1)==1) ALIC->Raytrace();
249 TPad *p2 = c1->GetPad(2);
250 TView *view2 = p2->GetView();
252 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
253 if(irr) cout <<"error="<<irr<<endl;
254 if(ISetits(4,-1)==0) view2->SetParallel();
255 else view2->SetPerspective();
256 view2->RotateView(60.,30.);
257 if(ISetits(3,-1)!=0) view2->ShowAxis();
259 if(ISetits(5,-1)==1) ALIC->Raytrace();
262 c1->SetPhi(90.0); c1->SetTheta(90.0);
263 TPad *p3 = c1->GetPad(3);
264 TView *view3 = p3->GetView();
266 view3->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
267 if(irr) cout <<"error="<<irr<<endl;
268 if(ISetits(4,-1)==0) view3->SetParallel();
269 else view3->SetPerspective();
271 if(ISetits(3,-1)!=0) view3->ShowAxis();
273 if(ISetits(5,-1)==1) ALIC->Raytrace();
276 TPad *p4 = c1->GetPad(4);
277 TView *view4 = p4->GetView();
279 view4->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
280 if(irr) cout <<"error="<<irr<<endl;
281 if(ISetits(4,-1)==0) view4->SetParallel();
282 else view4->SetPerspective();
284 if(ISetits(3,-1)!=0) view4->ShowAxis();
286 if(ISetits(5,-1)==1) ALIC->Raytrace();
289 //----------------------------------------------------------------------
290 void EngineeringSPDSCS(){
291 // Display SPD Carbon Fiber Sector Cross sections A and B
298 TPolyLine *a0,*a1,*b0,*b1;
304 a0 = new TPolyLine();
305 a1 = new TPolyLine();
306 b0 = new TPolyLine();
307 b1 = new TPolyLine();
308 p = new TPolyMarker();
312 b0->SetLineStyle(2); // dashed
314 b1->SetLineStyle(2); // dashed
315 p->SetMarkerColor(2);
316 p->SetMarkerStyle(5);
317 if(gspd==0||gspd->Make2DcrossSections(*a0,*a1,*b0,*b1,*p)==kFALSE)return;
318 for(i=0;i<a0->GetN();i++) {
319 if(TMath::Abs(a0->GetX()[i])>max) max = TMath::Abs(a0->GetX()[i]);
320 if(TMath::Abs(a0->GetY()[i])>max) max = TMath::Abs(a0->GetY()[i]);
322 for(i=0;i<a1->GetN();i++) {
323 if(TMath::Abs(a1->GetX()[i])>max) max = TMath::Abs(a0->GetX()[i]);
324 if(TMath::Abs(a1->GetY()[i])>max) max = TMath::Abs(a1->GetY()[i]);
326 for(i=0;i<b0->GetN();i++) {
327 if(TMath::Abs(b0->GetX()[i])>max) max = TMath::Abs(b0->GetX()[i]);
328 if(TMath::Abs(b0->GetY()[i])>max) max = TMath::Abs(b0->GetY()[i]);
330 for(i=0;i<b1->GetN();i++) {
331 if(TMath::Abs(b1->GetX()[i])>max) max = TMath::Abs(b1->GetX()[i]);
332 if(TMath::Abs(b1->GetY()[i])>max) max = TMath::Abs(b1->GetY()[i]);
335 cSPDSCS = gROOT->FindObject("cSPDSCS");
336 if(cSPDSCS==0) delete cSPDSCS;
337 cSPDSCS = new TCanvas("cSPDSCS","SPD Carbon Fiber Sector Cross sections",2);
338 cSPDSCS->Range(-max,-max,max,max);
339 //cSPDSCS->RangeAxis();
340 cSPDSCS->SetFixedAspectRatio(kTRUE);
350 //----------------------------------------------------------------------
351 void EngineeringSPDSector(){
352 // Display SPD Sector Geometry
361 TGeoManager *mgr2 = gGeoManager;
362 TGeoVolume *ALIC = mgr2->GetTopVolume();
364 if(!(c4 = (TCanvas*)gROOT->FindObject("C4")))
365 c4 = new TCanvas("C4","ITS SPD Layer Geometry Side View",500,500);
366 TGeoVolume *ITS=0,*ITSSPD=0,*SPDLay=0;
368 TArrow *arrow=new TArrow();
370 node = ALIC->FindNode("ITSV_1");
371 ITS = node->GetVolume();
372 node = ITS->FindNode("ITSSPD_1");
373 ITSSPD = node->GetVolume();
374 node = ITSSPD->FindNode("ITSSPDCarbonFiberSectorV_1");
375 if(node==0)Error("EngineeringSPDSector","could not find node %s",
376 "ITSSPDCarbonFiberSectorV_1");
377 SPDLay = node->GetVolume();
378 if(SPDLay==0)Error("EngineeringSPDSector","could not find volume SPDLay");
380 mgr2->SetNsegments(ISetits(1,-1));
382 mgr2->SetVisLevel(6);
383 mgr2->SetVisOption(0);
384 //mgr2->CheckOverlaps(0.01);
385 //mgr2->PrintOverlaps();
386 if(ISetits(2,-1)==1){
387 TGeoShape *clip = new TGeoTubeSeg(0, 1000, 2000, 45, 90);
388 mgr2->SetClippingShape(clip);
390 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
391 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
394 TView *view1 = c4->GetView();
396 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
397 if(irr) cout <<"error="<<irr<<endl;
398 if(ISetits(4,-1)==0) view1->SetParallel();
399 else view1->SetPerspective();
401 if(ISetits(3,-1)!=0) view1->ShowAxis();
403 if(ISetits(5,-1)==1) SPDLay->Raytrace();
405 if(!(c5 = (TCanvas*)gROOT->FindObject("C5")))
406 c5 = new TCanvas("C5","ITS SPD Sector Geometry End View",500,500);
408 TView *view2 = c5->GetView();
410 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
411 if(irr) cout <<"error="<<irr<<endl;
412 if(ISetits(4,-1)==0) view2->SetParallel();
413 else view2->SetPerspective();
415 if(ISetits(3,-1)!=0) view2->ShowAxis();
417 if(ISetits(5,-1)==1) SPDLay->Raytrace();
420 //----------------------------------------------------------------------
421 void PrintSPDSectorData(){
422 // Print SPD Sector Data
431 TGeoManager *mgr2 = gGeoManager;
433 TGeoVolume *ITS,*ITSSPD,*vA0=0;
437 //mgr2->cd("ITSSPDCarbonFiberSupportSectorA0_1");
438 vA0 = mgr2->FindVolumeFast("ITSSPDCarbonFiberSupportSectorA0");
439 sA0 = (TGeoXtru*) vA0->GetShape();
440 irr = sA0->GetNvert();
443 cout <<"2 3 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 "<<irr;
445 x = sA0->GetX(i)+2.5;
446 y = sA0->GetY(i)+2.5;
447 if(!(i%6)) { cout << endl; cout <<" ";}
448 cout<<" "<<TMath::Nint(x*450.)<<" "<<TMath::Nint(y*450);
449 //cout<<" "<<x<<" "<<y;
451 x = sA0->GetX(0)+2.5;
452 y = sA0->GetY(0)+2.5;
453 if(!(i%6)) { cout << endl; cout <<" ";}
454 cout<<" "<<TMath::Nint(x*450.)<<" "<<TMath::Nint(y*450);
455 //cout<<" "<<x<<" "<<y;
459 //----------------------------------------------------------------------
460 void EngineeringSPDCenter(){
461 // Display SPD Centeral Geometry
470 TGeoManager *mgr2 = gGeoManager;
471 TGeoVolume *ALIC = mgr2->GetTopVolume();
473 if(!(c4 = (TCanvas*)gROOT->FindObject("C4")))
474 c4 = new TCanvas("C4","ITS SPD Layer Geometry Side View",500,500);
475 TGeoVolume *ITS,*ITSSPD,*SPDLay=0;
477 TArrow *arrow=new TArrow();
479 node = ALIC->FindNode("ITSV_1");
480 ITS = node->GetVolume();
481 node = ITS->FindNode("ITSSPD_1");
482 ITSSPD = node->GetVolume();
484 mgr2->SetNsegments(ISetits(1,-1));
486 mgr2->SetVisLevel(6);
487 mgr2->SetVisOption(0);
488 //mgr2->CheckOverlaps(0.01);
489 //mgr2->PrintOverlaps();
490 if(ISetits(2,-1)==1){
491 TGeoShape *clip = new TGeoTubeSeg(0, 1000, 2000, 45, 90);
492 mgr2->SetClippingShape(clip);
494 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
495 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
498 TView *view1 = c4->GetView();
500 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
501 if(irr) cout <<"error="<<irr<<endl;
502 if(ISetits(4,-1)==0) view1->SetParallel();
503 else view1->SetPerspective();
505 if(ISetits(3,-1)!=0) view1->ShowAxis();
507 if(ISetits(5,-1)==1) SPDLay->Raytrace();
509 if(!(c5 = (TCanvas*)gROOT->FindObject("C5")))
510 c5 = new TCanvas("C5","ITS SPD Centeral Geometry End View",500,500);
512 TView *view2 = c5->GetView();
514 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
515 if(irr) cout <<"error="<<irr<<endl;
516 if(ISetits(4,-1)==0) view2->SetParallel();
517 else view2->SetPerspective();
519 if(ISetits(3,-1)!=0) view2->ShowAxis();
521 if(ISetits(5,-1)==1) ITSSPD->Raytrace();
524 //----------------------------------------------------------------------
525 void EngineeringSPDThS(){
526 // Display SPD Thermal Sheald Geometry
535 TGeoManager *mgr2 = gGeoManager;
536 TGeoVolume *ALIC = mgr2->GetTopVolume();
538 if(!(c4 = (TCanvas*)gROOT->FindObject("C4")))
539 c4 = new TCanvas("C4","ITS SDD Cylinder Geometry",900,450);
541 TGeoVolume *ITS,*SPDThS=0;
543 TArrow *arrow=new TArrow();
545 node = ALIC->FindNode("ITSV_1");
546 ITS = node->GetVolume();
547 node = ITS->FindNode("ITSspdThermalShealdMother_1");
548 SPDThS = node->GetVolume();
550 mgr2->SetNsegments(ISetits(1,-1));
552 mgr2->SetVisLevel(6);
553 mgr2->SetVisOption(0);
554 //mgr2->CheckOverlaps(0.01);
555 //mgr2->PrintOverlaps();
556 if(ISetits(2,-1)==1){
557 TGeoShape *clip = new TGeoTubeSeg(0, 1000, 2000, 45, 90);
558 mgr2->SetClippingShape(clip);
560 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
561 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
565 TPad *p1 = c4->GetPad(1);
566 TView *view1 = p1->GetView();
568 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
569 if(irr) cout <<"error="<<irr<<endl;
570 if(ISetits(4,-1)==0) view1->SetParallel();
571 else view1->SetPerspective();
573 if(ISetits(3,-1)!=0) view1->ShowAxis();
575 if(ISetits(5,-1)==1) SPDThS->Raytrace();
579 TPad *p2 = c4->GetPad(2);
580 TView *view2 = p2->GetView();
582 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
583 if(irr) cout <<"error="<<irr<<endl;
584 if(ISetits(4,-1)==0) view2->SetParallel();
585 else view2->SetPerspective();
587 if(ISetits(3,-1)!=0) view2->ShowAxis();
589 if(ISetits(5,-1)==1) SPDThS->Raytrace();
592 //----------------------------------------------------------------------
593 void EngineeringSDDLayer3(){
594 // Display SDD Layer 3 Geometry
603 TGeoManager *mgr2 = gGeoManager;
604 TGeoVolume *ALIC = mgr2->GetTopVolume();
606 if(!(c4 = (TCanvas*)gROOT->FindObject("C4")))
607 c4 = new TCanvas("C4","ITS SDD Layer 3 Geometry Side View",500,500);
608 TGeoVolume *ITS,*SDDLay3=0;
610 TArrow *arrow=new TArrow();
612 node = ALIC->FindNode("ITSV_1");
613 ITS = node->GetVolume();
614 node = ITS->FindNode("ITSsddLayer3_1");
615 SDDLay3 = node->GetVolume();
617 mgr2->SetNsegments(ISetits(1,-1));
619 mgr2->SetVisLevel(6);
620 mgr2->SetVisOption(0);
621 //mgr2->CheckOverlaps(0.01);
622 //mgr2->PrintOverlaps();
623 if(ISetits(2,-1)==1){
624 TGeoShape *clip = new TGeoTubeSeg(0, 1000, 2000, 45, 90);
625 mgr2->SetClippingShape(clip);
627 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
628 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
631 TView *view1 = c4->GetView();
633 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
634 if(irr) cout <<"error="<<irr<<endl;
635 if(ISetits(4,-1)==0) view1->SetParallel();
636 else view1->SetPerspective();
638 if(ISetits(3,-1)!=0) view1->ShowAxis();
640 if(ISetits(5,-1)==1) SDDLay3->Raytrace();
642 if(!(c5 = (TCanvas*)gROOT->FindObject("C5")))
643 c5 = new TCanvas("C5","ITS SDD Layer 3 Geometry End View",500,500);
645 TView *view2 = c5->GetView();
647 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
648 if(irr) cout <<"error="<<irr<<endl;
649 if(ISetits(4,-1)==0) view2->SetParallel();
650 else view2->SetPerspective();
652 if(ISetits(3,-1)!=0) view2->ShowAxis();
654 if(ISetits(5,-1)==1) SDDLay3->Raytrace();
657 //----------------------------------------------------------------------
658 void EngineeringSDDLayer4(){
659 // Display SDD Layer 4 Geometry
668 TGeoManager *mgr2 = gGeoManager;
669 TGeoVolume *ALIC = mgr2->GetTopVolume();
671 if(!(c4 = (TCanvas*)gROOT->FindObject("C4")))
672 c4 = new TCanvas("C4","ITS SDD Layer 4 Geometry Side View",500,500);
673 TGeoVolume *ITS,*SDDLay4=0;
675 TArrow *arrow=new TArrow();
677 node = ALIC->FindNode("ITSV_1");
678 ITS = node->GetVolume();
679 node = ITS->FindNode("ITSsddLayer4_1");
680 SDDLay4 = node->GetVolume();
682 mgr2->SetNsegments(ISetits(1,-1));
684 mgr2->SetVisLevel(6);
685 mgr2->SetVisOption(0);
686 //mgr2->CheckOverlaps(0.01);
687 //mgr2->PrintOverlaps();
688 if(ISetits(2,-1)==1){
689 TGeoShape *clip = new TGeoTubeSeg(0, 1000, 2000, 45, 90);
690 mgr2->SetClippingShape(clip);
692 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
693 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
696 TView *view1 = c4->GetView();
698 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
699 if(irr) cout <<"error="<<irr<<endl;
700 if(ISetits(4,-1)==0) view1->SetParallel();
701 else view1->SetPerspective();
703 if(ISetits(3,-1)!=0) view1->ShowAxis();
705 if(ISetits(5,-1)==1) SDDLay4->Raytrace();
707 if(!(c5 = (TCanvas*)gROOT->FindObject("C5")))
708 c5 = new TCanvas("C5","ITS SDD Layer 4 Geometry End View",500,500);
710 TView *view2 = c5->GetView();
712 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
713 if(irr) cout <<"error="<<irr<<endl;
714 if(ISetits(4,-1)==0) view2->SetParallel();
715 else view2->SetPerspective();
717 if(ISetits(3,-1)!=0) view2->ShowAxis();
719 if(ISetits(5,-1)==1) SDDLay4->Raytrace();
722 //----------------------------------------------------------------------
723 void EngineeringSDDCone(){
724 // Display SDD Cone Geometry
733 TGeoManager *mgr2 = gGeoManager;
734 TGeoVolume *ALIC = mgr2->GetTopVolume();
736 if(!(c2 = (TCanvas*)gROOT->FindObject("C2")))
737 c2 = new TCanvas("C2","ITS SDD Cone Geometry",900,450);
739 TGeoVolume *ITS,*SDD=0;
742 node = ALIC->FindNode("ITSV_1");
743 ITS = node->GetVolume();
744 node = ITS->FindNode("ITSsddConeL_1");
745 SDD = node->GetVolume();
747 mgr2->SetNsegments(ISetits(1,-1));
749 mgr2->SetVisLevel(6);
750 mgr2->SetVisOption(0);
751 //mgr2->CheckOverlaps(0.01);
752 //mgr2->PrintOverlaps();
753 if(ISetits(2,-1)==1){
754 TGeoShape *clip = new TGeoTubeSeg(0, 1000, 2000, 45, 90);
755 mgr2->SetClippingShape(clip);
757 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
758 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
762 TPad *p1 = c2->GetPad(1);
763 TView *view1 = p1->GetView();
765 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
766 if(irr) cout <<"error="<<irr<<endl;
767 if(ISetits(4,-1)==0) view1->SetParallel();
768 else view1->SetPerspective();
770 if(ISetits(3,-1)!=0) view1->ShowAxis();
772 if(ISetits(5,-1)==1) SDD->Raytrace();
776 TPad *p2 = c2->GetPad(2);
777 TView *view2 = p2->GetView();
779 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
780 if(irr) cout <<"error="<<irr<<endl;
781 if(ISetits(4,-1)==0) view2->SetParallel();
782 else view2->SetPerspective();
784 if(ISetits(3,-1)!=0) view2->ShowAxis();
786 if(ISetits(5,-1)==1) SDD->Raytrace();
789 //----------------------------------------------------------------------
790 void EngineeringSDDCylinder(){
791 // Display SDD Cylinder Geometry
800 TGeoManager *mgr2 = gGeoManager;
801 TGeoVolume *ALIC = mgr2->GetTopVolume();
803 if(!(c3 = (TCanvas*)gROOT->FindObject("C3")))
804 c3 = new TCanvas("C3","ITS SDD Cylinder Geometry",900,450);
806 TGeoVolume *ITS,*SDD=0;
808 TArrow *arrow=new TArrow();
810 node = ALIC->FindNode("ITSV_1");
811 ITS = node->GetVolume();
812 node = ITS->FindNode("ITSsddCentCylCF_1");
813 SDD = node->GetVolume();
814 Double_t Rmin = ((TGeoTube*)(SDD->GetShape()))->GetRmin();
815 Double_t Rmax = ((TGeoTube*)(SDD->GetShape()))->GetRmax();
816 Double_t Dz = ((TGeoTube*)(SDD->GetShape()))->GetDz();
818 mgr2->SetNsegments(ISetits(1,-1));
820 mgr2->SetVisLevel(6);
821 mgr2->SetVisOption(0);
822 //mgr2->CheckOverlaps(0.01);
823 //mgr2->PrintOverlaps();
824 if(ISetits(2,-1)==1){
825 TGeoShape *clip = new TGeoTubeSeg(0, 1000, 2000, 45, 90);
826 mgr2->SetClippingShape(clip);
828 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
829 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
833 TPad *p1 = c3->GetPad(1);
834 TView *view1 = p1->GetView();
836 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
837 if(irr) cout <<"error="<<irr<<endl;
838 if(ISetits(4,-1)==0) view1->SetParallel();
839 else view1->SetPerspective();
841 if(ISetits(3,-1)!=0) view1->ShowAxis();
843 if(ISetits(5,-1)==1) SDD->Raytrace();
844 //arrow->DrawArrow(1.01*Rmax,-Dz,1.01*Rmax,+Dz);
848 TPad *p2 = c3->GetPad(2);
849 TView *view2 = p2->GetView();
851 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
852 if(irr) cout <<"error="<<irr<<endl;
853 if(ISetits(4,-1)==0) view2->SetParallel();
854 else view2->SetPerspective();
856 if(ISetits(3,-1)!=0) view2->ShowAxis();
858 if(ISetits(5,-1)==1) SDD->Raytrace();
859 //arrow->DrawArrow(Rmax,0.0,Rmax,0.0);
860 //Double_t s = TMath::Sin(0.7),c = TMath::Cos(0.7);
861 //arrow->DrawArrow(-Rmin*c,-Rmin*s,Rmin*c,Rmin*s);
864 //----------------------------------------------------------------------
865 void EngineeringSSDCone(){
866 // Display SSD Cone Geometry
875 TGeoManager *mgr2 = gGeoManager;
876 TGeoVolume *ALIC = mgr2->GetTopVolume();
878 if(!(c2 = (TCanvas*)gROOT->FindObject("C2")))
879 c2 = new TCanvas("C2","ITS SSD Cone Geometry",900,450);
881 TGeoVolume *ITS,*SSD=0;
884 node = ALIC->FindNode("ITSV_1");
885 ITS = node->GetVolume();
886 node = ITS->FindNode("ITSssdConeA_1");
887 SSD = node->GetVolume();
889 mgr2->SetNsegments(ISetits(1,-1));
891 mgr2->SetVisLevel(6);
892 mgr2->SetVisOption(0);
893 //mgr2->CheckOverlaps(0.01);
894 //mgr2->PrintOverlaps();
895 if(ISetits(2,-1)==1){
896 TGeoShape *clip = new TGeoTubeSeg(0, 1000, 2000, 45, 90);
897 mgr2->SetClippingShape(clip);
899 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
900 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
904 TPad *p1 = c2->GetPad(1);
905 TView *view1 = p1->GetView();
907 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
908 if(irr) cout <<"error="<<irr<<endl;
909 if(ISetits(4,-1)==0) view1->SetParallel();
910 else view1->SetPerspective();
912 if(ISetits(3,-1)!=0) view1->ShowAxis();
914 if(ISetits(5,-1)==1) SSD->Raytrace();
918 TPad *p2 = c2->GetPad(2);
919 TView *view2 = p2->GetView();
921 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
922 if(irr) cout <<"error="<<irr<<endl;
923 if(ISetits(4,-1)==0) view2->SetParallel();
924 else view2->SetPerspective();
926 if(ISetits(3,-1)!=0) view2->ShowAxis();
928 if(ISetits(5,-1)==1) SSD->Raytrace();
931 //----------------------------------------------------------------------
932 void EngineeringSSDCylinder(){
933 // Display SSD Cylinder Geometry
942 TGeoManager *mgr2 = gGeoManager;
943 TGeoVolume *ALIC = mgr2->GetTopVolume();
945 if(!(c3 = (TCanvas*)gROOT->FindObject("C3")))
946 c3 = new TCanvas("C3","ITS SSD Cylinder Geometry",900,450);
948 TGeoVolume *ITS,*SSD=0;
950 TArrow *arrow=new TArrow();
952 node = ALIC->FindNode("ITSV_1");
953 ITS = node->GetVolume();
954 node = ITS->FindNode("ITSssdCentCylCA_1");
955 SSD = node->GetVolume();
956 //Double_t Rmin = ((TGeoPcon*)(SSD->GetShape()))->GetRmin();
957 //Double_t Rmax = ((TGeoPcon*)(SSD->GetShape()))->GetRmax();
958 //Double_t Dz = ((TGeoPcon*)(SSD->GetShape()))->GetDz();
960 mgr2->SetNsegments(ISetits(1,-1));
962 mgr2->SetVisLevel(6);
963 mgr2->SetVisOption(0);
964 //mgr2->CheckOverlaps(0.01);
965 //mgr2->PrintOverlaps();
966 if(ISetits(2,-1)==1){
967 TGeoShape *clip = new TGeoTubeSeg(0, 1000, 2000, 45, 90);
968 mgr2->SetClippingShape(clip);
970 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
971 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
975 TPad *p1 = c3->GetPad(1);
976 TView *view1 = p1->GetView();
978 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
979 if(irr) cout <<"error="<<irr<<endl;
980 if(ISetits(4,-1)==0) view1->SetParallel();
981 else view1->SetPerspective();
983 if(ISetits(3,-1)!=0) view1->ShowAxis();
985 if(ISetits(5,-1)==1) SSD->Raytrace();
986 //arrow->DrawArrow(1.01*Rmax,-Dz,1.01*Rmax,+Dz);
990 TPad *p2 = c3->GetPad(2);
991 TView *view2 = p2->GetView();
993 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
994 if(irr) cout <<"error="<<irr<<endl;
995 if(ISetits(4,-1)==0) view2->SetParallel();
996 else view2->SetPerspective();
998 if(ISetits(3,-1)!=0) view2->ShowAxis();
1000 if(ISetits(5,-1)==1) SSD->Raytrace();
1001 //arrow->DrawArrow(Rmax,0.0,Rmax,0.0);
1002 //Double_t s = TMath::Sin(0.7),c = TMath::Cos(0.7);
1003 //arrow->DrawArrow(-Rmin*c,-Rmin*s,Rmin*c,Rmin*s);
1006 //----------------------------------------------------------------------
1007 void EngineeringSupRB24(){
1008 // Display RB 24 side cable tray support structure Geometry
1017 TGeoManager *mgr2 = gGeoManager;
1018 TGeoVolume *ALIC = mgr2->GetTopVolume();
1020 if(!(c4 = (TCanvas*)gROOT->FindObject("C4")))
1021 c4 = new TCanvas("C4","ITS SDD Cylinder Geometry",900,450);
1023 TGeoVolume *ITS,*SUPRB24=0;
1025 TArrow *arrow=new TArrow();
1027 node = ALIC->FindNode("ITSV_1");
1028 ITS = node->GetVolume();
1029 node = ITS->FindNode("ITSsupFrameM24_1");
1030 SUPRB24 = node->GetVolume();
1032 mgr2->SetNsegments(ISetits(1,-1));
1034 mgr2->SetVisLevel(6);
1035 mgr2->SetVisOption(0);
1036 //mgr2->CheckOverlaps(0.01);
1037 //mgr2->PrintOverlaps();
1038 if(ISetits(2,-1)==1){
1039 TGeoShape *clip = new TGeoTubeSeg(0, 1000, 2000, 45, 90);
1040 mgr2->SetClippingShape(clip);
1042 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
1043 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
1047 TPad *p1 = c4->GetPad(1);
1048 TView *view1 = p1->GetView();
1050 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
1051 if(irr) cout <<"error="<<irr<<endl;
1052 if(ISetits(4,-1)==0) view1->SetParallel();
1053 else view1->SetPerspective();
1055 if(ISetits(3,-1)!=0) view1->ShowAxis();
1057 if(ISetits(5,-1)==1) SUPRB24->Raytrace();
1061 TPad *p2 = c4->GetPad(2);
1062 TView *view2 = p2->GetView();
1064 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
1065 if(irr) cout <<"error="<<irr<<endl;
1066 if(ISetits(4,-1)==0) view2->SetParallel();
1067 else view2->SetPerspective();
1069 if(ISetits(3,-1)!=0) view2->ShowAxis();
1071 if(ISetits(5,-1)==1) SUPRB24->Raytrace();
1074 //----------------------------------------------------------------------
1075 void EngineeringSupTrayRB24(){
1076 // Display RB 24 side cable tray support structure Geometry
1085 TGeoManager *mgr2 = gGeoManager;
1086 TGeoVolume *ALIC = mgr2->GetTopVolume();
1088 //if(!(c4 = (TCanvas*)gROOT->FindObject("C4")))
1089 c4 = new TCanvas("C4","ITS RB24 Cable Trays and Patch Pannels",500,500);
1091 TGeoVolume *ITS,*SUPRB24=0;
1093 TArrow *arrow=new TArrow();
1095 node = ALIC->FindNode("ITSV_1");
1096 ITS = node->GetVolume();
1097 node = ITS->FindNode("ITSsupCableTrayMotherMT24_1");
1098 SUPRB24 = node->GetVolume();
1100 mgr2->SetNsegments(ISetits(1,-1));
1102 mgr2->SetVisLevel(6);
1103 mgr2->SetVisOption(0);
1104 //mgr2->CheckOverlaps(0.01);
1105 //mgr2->PrintOverlaps();
1106 if(ISetits(2,-1)==1){
1107 TGeoShape *clip = new TGeoTubeSeg(0, 1000, 2000, 45, 90);
1108 mgr2->SetClippingShape(clip);
1110 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
1111 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
1115 //TPad *p1 = c4->GetPad(1);
1116 //TView *view1 = p1->GetView();
1117 TView *view1 = c4->GetView();
1119 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
1120 if(irr) cout <<"error="<<irr<<endl;
1121 if(ISetits(4,-1)==0) view1->SetParallel();
1122 else view1->SetPerspective();
1124 if(ISetits(3,-1)!=0) view1->ShowAxis();
1126 if(ISetits(5,-1)==1) SUPRB24->Raytrace();
1129 c5 = new TCanvas("C5","ITS RB24 Cable Trays and Patch Pannels",500,500);
1132 //TPad *p2 = c5->GetPad(1);
1133 //TView *view2 = p2->GetView();
1134 TView *view2 = c5->GetView();
1136 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
1137 if(irr) cout <<"error="<<irr<<endl;
1138 if(ISetits(4,-1)==0) view2->SetParallel();
1139 else view2->SetPerspective();
1141 if(ISetits(3,-1)!=0) view2->ShowAxis();
1143 if(ISetits(5,-1)==1) SUPRB24->Raytrace();
1146 //----------------------------------------------------------------------
1147 void EngineeringSupRB26(){
1148 // Display RB 26 side cable tray support structure
1157 TGeoManager *mgr2 = gGeoManager;
1158 TGeoVolume *ALIC = mgr2->GetTopVolume();
1160 if(!(c5 = (TCanvas*)gROOT->FindObject("C5")))
1161 c5 = new TCanvas("C5","ITS SDD Cylinder Geometry",900,450);
1163 TGeoVolume *ITS,*SUPRB26=0;
1165 TArrow *arrow=new TArrow();
1167 node = ALIC->FindNode("ITSV_1");
1168 ITS = node->GetVolume();
1169 node = ITS->FindNode("ITSsupFrameM26_1");
1170 SUPRB26 = node->GetVolume();
1172 mgr2->SetNsegments(ISetits(1,-1));
1174 mgr2->SetVisLevel(6);
1175 mgr2->SetVisOption(0);
1176 //mgr2->CheckOverlaps(0.01);
1177 //mgr2->PrintOverlaps();
1178 if(ISetits(2,-1)==1){
1179 TGeoShape *clip = new TGeoTubeSeg(0, 1000, 2000, 45, 90);
1180 mgr2->SetClippingShape(clip);
1182 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
1183 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
1187 TPad *p1 = c5->GetPad(1);
1188 TView *view1 = p1->GetView();
1190 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
1191 if(irr) cout <<"error="<<irr<<endl;
1192 if(ISetits(4,-1)==0) view1->SetParallel();
1193 else view1->SetPerspective();
1195 if(ISetits(3,-1)!=0) view1->ShowAxis();
1197 if(ISetits(5,-1)==1) SUPRB26->Raytrace();
1201 TPad *p2 = c5->GetPad(2);
1202 TView *view2 = p2->GetView();
1204 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
1205 if(irr) cout <<"error="<<irr<<endl;
1206 if(ISetits(4,-1)==0) view2->SetParallel();
1207 else view2->SetPerspective();
1209 if(ISetits(3,-1)!=0) view2->ShowAxis();
1211 if(ISetits(5,-1)==1) SUPRB26->Raytrace();