provide non-void return type for operator=() to make the
[u/mrichter/AliRoot.git] / ITS / Displayv11.C
CommitLineData
541f7ba6 1//----------------------------------------------------------------------
2void Displayv11(const char* filename=""){
3 // Display AliITSv11 Geometry
4 // Inputs:
5 // const char* filename output file with the display in it
6 // Outputs:
7 // none.
8 // Retrurn:
9 // none.
10
11 gSystem->Load("libGeom");
12 //
541f7ba6 13 if(gGeoManager) delete gGeoManager;
d1a22f9a 14 mgr2 = gGeoManager = new TGeoManager("ITSGeometry",
15 " ITS Simulation Geometry Manager");
541f7ba6 16 //
17 TGeoMaterial *vacmat = new TGeoMaterial("Vacume",0,0,0);
18 TGeoMedium *vacmed = new TGeoMedium("Vacume_med",1,vacmat);
19 TGeoVolume *ALIC = mgr2->MakeBox("ALIC",vacmed,100.,100.,200.);
20 mgr2->SetTopVolume(ALIC);
21 //
541f7ba6 22 AliITSv11 *its = new AliITSv11();
d1a22f9a 23 its->SetDebug(ISetits(0,-1));
541f7ba6 24 its->CreateMaterials();
25 its->CreateGeometry();
541f7ba6 26 //
27 mgr2->CloseGeometry();
d1a22f9a 28 //
29 TControlBar *bar=new TControlBar("vertical","ITS Geometry Display",10,10);
30 bar->AddButton("Set ITS Debug level 1","ISetits(0,1)","Debug on");
31 bar->AddButton("Set ITS Debug level 0","ISetits(0,0)","Debug off");
32 bar->AddButton("Set ITS Theta,Phi cut on","ISetits(2,1)","Cut on");
33 bar->AddButton("Set ITS Theta,Phi cut off","ISetits(2,0)","Cut off");
34 bar->AddButton("Set axis on","ISetits(3,1)","Show Axis on");
35 bar->AddButton("Set axis off","ISetits(3,0)","Show Axis off");
36 bar->AddButton("Set perspective on","ISetits(4,1)","Perspective on");
37 bar->AddButton("Set perspective off","ISetits(4,0)","Perspective off");
38 bar->AddButton("Set circle/80","ISetits(1,80)","circles ~ by 80 lines");
39 bar->AddButton("Display Geometry","Displayit()","Run Displayit");
4830bf84 40 bar->AddButton("Display SPD Thermal Sheald","EngineeringSPDThS()",
41 "Run EngineeringSPDThS");
d1a22f9a 42 bar->AddButton("Display SDD Cone","EngineeringSDDCone()",
43 "Run EngineeringSDDCone");
44 bar->AddButton("Display SDD Centeral Cylinder","EngineeringSDDCylinder()",
45 "Run EngineeringSDDCylinder");
46 bar->AddButton("Display SUP RB24 side","EngineeringSupRB24()",
47 "Run EngineeringSDDCylinder");
48 bar->AddButton("Display SUP RB26 side","EngineeringSupRB26()",
49 "Run EngineeringSupRB26");
50 bar->AddButton("Quit/Exit",".q","Exit");
51 bar->Show();
52 gROOT->SaveContext();
53 //Displayit();
54}
55//----------------------------------------------------------------------
56Int_t ISetits(Int_t t,Int_t v){
57 static Int_t itsdebug=0,nsegments=80,cut=0,axis=1,perspective=0;
58
59 switch (t) {
60 case 0:
61 if(v<0) return itsdebug;
62 itsdebug = v;
63 break;
64 case 1:
65 if(v<0) return nsegments;
66 nsegments= v;
67 break;
68 case 2:
69 if(v<0) return cut;
70 cut = v;
71 break;
72 case 3:
73 if(v<0) return axis;
74 axis = v;
75 break;
76 case 4:
77 if(v<0) return perspective;
78 perspective = v;
79 break;
80 }// end switch
81 return 0;
82}
83//----------------------------------------------------------------------
84Double_t DSetits(Int_t t,Double_t v){
85 static Double_t phimincut=0.0,phimaxcut=180.0;
86 static Double_t longitude=90.0,latitude=0.0,psi=0.0;
87
88 switch (t) {
89 case 0:
90 if(v<0.) return phimincut;
91 phimincut = v;
92 break;
93 case 1:
94 if(v<0.) return phimaxcut;
95 phimaxcut = v;
96 break;
97 case 2:
98 if(v<0.) return longitude;
99 longitude = v;
100 break;
101 case 3:
102 if(v<0.) return latitude;
103 latitude = v;
104 break;
105 case 4:
106 if(v<0.) return latitude;
107 latitude = v;
108 break;
109 }// end switch
110 return 0;
111}
112//----------------------------------------------------------------------
113void Displayit(){
114 // Display AliITSv11 Geometry
115 // Inputs:
116 // const char* filename output file with the display in it
117 // Outputs:
118 // none.
119 // Retrurn:
120 // none.
121 Int_t irr;
122 //
123 TGeoManager *mgr2 = gGeoManager;
124 TGeoVolume *ALIC = mgr2->GetTopVolume();
125 TCanvas *c1;
126 if(!(c1 = (TCanvas*)gROOT->FindObject("C1")))
127 c1 = new TCanvas("C1","ITS Simulation Geometry",900,900);
128 c1->Divide(2,2);
129 //
130 mgr2->SetNsegments(ISetits(1,-1));
541f7ba6 131 //
171f3f35 132 mgr2->SetVisLevel(6);
cbd7b929 133 mgr2->SetVisOption(0);
171f3f35 134 //mgr2->CheckOverlaps(0.01);
135 //mgr2->PrintOverlaps();
d1a22f9a 136 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
541f7ba6 137 //
171f3f35 138 c1->cd(1);
139 ALIC->Draw();
140 TPad *p1 = c1->GetPad(1);
141 TView *view1 = p1->GetView();
142 if(view1){
d1a22f9a 143 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
144 if(irr) cout <<"error="<<irr<<endl;
145 if(ISetits(4,-1)==0) view1->SetParralel();
146 else view1->SetPerspective();
171f3f35 147 view1->Front();
d1a22f9a 148 if(ISetits(3,-1)!=0) view1->ShowAxis();
149 } // end if view1
171f3f35 150 c1->cd(2);
151 ALIC->Draw();
152 TPad *p2 = c1->GetPad(2);
153 TView *view2 = p2->GetView();
154 if(view2){
d1a22f9a 155 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
156 if(irr) cout <<"error="<<irr<<endl;
157 if(ISetits(4,-1)==0) view2->SetParralel();
158 else view2->SetPerspective();
171f3f35 159 view2->RotateView(60.,30.);
d1a22f9a 160 if(ISetits(3,-1)!=0) view2->ShowAxis();
171f3f35 161 } // end if view2
162 c1->cd(3);
171f3f35 163 ALIC->Draw();
d1a22f9a 164 c1->SetPhi(90.0); c1->SetTheta(90.0);
171f3f35 165 TPad *p3 = c1->GetPad(3);
166 TView *view3 = p3->GetView();
167 if(view3){
d1a22f9a 168 view3->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
169 if(irr) cout <<"error="<<irr<<endl;
170 if(ISetits(4,-1)==0) view3->SetParralel();
171 else view3->SetPerspective();
171f3f35 172 view3->Top();
d1a22f9a 173 if(ISetits(3,-1)!=0) view3->ShowAxis();
171f3f35 174 } // end if view3
175 c1->cd(4);
541f7ba6 176 ALIC->Draw();
171f3f35 177 TPad *p4 = c1->GetPad(4);
178 TView *view4 = p4->GetView();
179 if(view4){
d1a22f9a 180 view4->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
181 if(irr) cout <<"error="<<irr<<endl;
182 if(ISetits(4,-1)==0) view4->SetParralel();
183 else view4->SetPerspective();
171f3f35 184 view4->Side();
d1a22f9a 185 if(ISetits(3,-1)!=0) view4->ShowAxis();
171f3f35 186 } // end if view4
541f7ba6 187 //
188}
d1a22f9a 189//----------------------------------------------------------------------
4830bf84 190void EngineeringSPDThS(){
191 // Display SPD Thermal Sheald Geometry
192 // Inputs:
193 // none.
194 // Outputs:
195 // none.
196 // Retrurn:
197 // none.
198 Int_t irr;
199 //
200 TGeoManager *mgr2 = gGeoManager;
201 TGeoVolume *ALIC = mgr2->GetTopVolume();
202 TCanvas *c4;
203 if(!(c4 = (TCanvas*)gROOT->FindObject("C4")))
204 c4 = new TCanvas("C4","ITS SDD Cylinder Geometry",900,450);
205 c4->Divide(2,1);
206 TGeoVolume *ITS,*SPDThS=0;
207 TGeoNode *node;
208 TArrow *arrow=new TArrow();
209 //
210 node = ALIC->FindNode("ITSV_1");
211 ITS = node->GetVolume();
212 node = ITS->FindNode("ITSspdThermalSheald_1");
213 SPDThS = node->GetVolume();
214 //
215 mgr2->SetNsegments(ISetits(1,-1));
216 //
217 mgr2->SetVisLevel(6);
218 mgr2->SetVisOption(0);
219 //mgr2->CheckOverlaps(0.01);
220 //mgr2->PrintOverlaps();
221 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
222 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
223 //
224 c4->cd(1);
225 SPDThS->Draw();
226 TPad *p1 = c4->GetPad(1);
227 TView *view1 = p1->GetView();
228 if(view1){
229 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
230 if(irr) cout <<"error="<<irr<<endl;
231 if(ISetits(4,-1)==0) view1->SetParralel();
232 else view1->SetPerspective();
233 view1->Front();
234 if(ISetits(3,-1)!=0) view1->ShowAxis();
235 } // end if view1
236 //
237 c4->cd(2);
238 SPDThS->Draw();
239 TPad *p2 = c4->GetPad(2);
240 TView *view2 = p2->GetView();
241 if(view2){
242 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
243 if(irr) cout <<"error="<<irr<<endl;
244 if(ISetits(4,-1)==0) view2->SetParralel();
245 else view2->SetPerspective();
246 view2->Top();
247 if(ISetits(3,-1)!=0) view2->ShowAxis();
248 } // end if view2
249 //
250}
251//----------------------------------------------------------------------
d1a22f9a 252void EngineeringSDDCone(){
253 // Display SDD Cone Geometry
254 // Inputs:
255 // none.
256 // Outputs:
257 // none.
258 // Retrurn:
259 // none.
260 Int_t irr;
261 //
262 TGeoManager *mgr2 = gGeoManager;
263 TGeoVolume *ALIC = mgr2->GetTopVolume();
264 TCanvas *c2;
265 if(!(c2 = (TCanvas*)gROOT->FindObject("C2")))
266 c2 = new TCanvas("C2","ITS SDD Cone Geometry",900,450);
267 c2->Divide(2,1);
268 TGeoVolume *ITS,*SDD=0;
269 TGeoNode *node;
270 //
271 node = ALIC->FindNode("ITSV_1");
272 ITS = node->GetVolume();
273 node = ITS->FindNode("ITSsddConeL_1");
274 SDD = node->GetVolume();
275 //
276 mgr2->SetNsegments(ISetits(1,-1));
277 //
278 mgr2->SetVisLevel(6);
279 mgr2->SetVisOption(0);
280 //mgr2->CheckOverlaps(0.01);
281 //mgr2->PrintOverlaps();
282 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
283 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
284 //
285 c2->cd(1);
286 SDD->Draw();
287 TPad *p1 = c2->GetPad(1);
288 TView *view1 = p1->GetView();
289 if(view1){
290 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
291 if(irr) cout <<"error="<<irr<<endl;
292 if(ISetits(4,-1)==0) view1->SetParralel();
293 else view1->SetPerspective();
294 view1->Front();
295 if(ISetits(3,-1)!=0) view1->ShowAxis();
296 } // end if view1
297 //
298 c2->cd(2);
299 SDD->Draw();
300 TPad *p2 = c2->GetPad(2);
301 TView *view2 = p2->GetView();
302 if(view2){
303 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
304 if(irr) cout <<"error="<<irr<<endl;
305 if(ISetits(4,-1)==0) view2->SetParralel();
306 else view2->SetPerspective();
307 view2->Top();
308 if(ISetits(3,-1)!=0) view2->ShowAxis();
309 } // end if view1
310 //
311}
312//----------------------------------------------------------------------
313void EngineeringSDDCylinder(){
314 // Display SDD Cylinder Geometry
315 // Inputs:
316 // none.
317 // Outputs:
318 // none.
319 // Retrurn:
320 // none.
321 Int_t irr;
322 //
323 TGeoManager *mgr2 = gGeoManager;
324 TGeoVolume *ALIC = mgr2->GetTopVolume();
325 TCanvas *c3;
326 if(!(c3 = (TCanvas*)gROOT->FindObject("C3")))
327 c3 = new TCanvas("C3","ITS SDD Cylinder Geometry",900,450);
328 c3->Divide(2,1);
329 TGeoVolume *ITS,*SDD=0;
330 TGeoNode *node;
331 TArrow *arrow=new TArrow();
332 //
333 node = ALIC->FindNode("ITSV_1");
334 ITS = node->GetVolume();
335 node = ITS->FindNode("ITSsddCentCylCF_1");
336 SDD = node->GetVolume();
337 Double_t Rmin = ((TGeoTube*)(SDD->GetShape()))->GetRmin();
338 Double_t Rmax = ((TGeoTube*)(SDD->GetShape()))->GetRmax();
339 Double_t Dz = ((TGeoTube*)(SDD->GetShape()))->GetDz();
340 //
341 mgr2->SetNsegments(ISetits(1,-1));
342 //
343 mgr2->SetVisLevel(6);
344 mgr2->SetVisOption(0);
345 //mgr2->CheckOverlaps(0.01);
346 //mgr2->PrintOverlaps();
347 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
348 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
349 //
350 c3->cd(1);
351 SDD->Draw();
352 TPad *p1 = c3->GetPad(1);
353 TView *view1 = p1->GetView();
354 if(view1){
355 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
356 if(irr) cout <<"error="<<irr<<endl;
357 if(ISetits(4,-1)==0) view1->SetParralel();
358 else view1->SetPerspective();
359 view1->Front();
360 if(ISetits(3,-1)!=0) view1->ShowAxis();
361 } // end if view1
362 arrow->DrawArrow(1.01*Rmax,-Dz,1.01*Rmax,+Dz);
363 //
364 c3->cd(2);
365 SDD->Draw();
366 TPad *p2 = c3->GetPad(2);
367 TView *view2 = p2->GetView();
368 if(view2){
369 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
370 if(irr) cout <<"error="<<irr<<endl;
371 if(ISetits(4,-1)==0) view2->SetParralel();
372 else view2->SetPerspective();
373 view2->Top();
374 if(ISetits(3,-1)!=0) view2->ShowAxis();
375 } // end if view2
376 arrow->DrawArrow(Rmax,0.0,Rmax,0.0);
377 Double_t s = TMath::Sin(0.7),c = TMath::Cos(0.7);
378 arrow->DrawArrow(-Rmin*c,-Rmin*s,Rmin*c,Rmin*s);
379 //
380}
381//----------------------------------------------------------------------
382void EngineeringSupRB24(){
383 // Display SDD Cylinder Geometry
384 // Inputs:
385 // none.
386 // Outputs:
387 // none.
388 // Retrurn:
389 // none.
390 Int_t irr;
391 //
392 TGeoManager *mgr2 = gGeoManager;
393 TGeoVolume *ALIC = mgr2->GetTopVolume();
394 TCanvas *c4;
395 if(!(c4 = (TCanvas*)gROOT->FindObject("C4")))
396 c4 = new TCanvas("C4","ITS SDD Cylinder Geometry",900,450);
397 c4->Divide(2,1);
398 TGeoVolume *ITS,*SUPRB24=0;
399 TGeoNode *node;
400 TArrow *arrow=new TArrow();
401 //
402 node = ALIC->FindNode("ITSV_1");
403 ITS = node->GetVolume();
404 node = ITS->FindNode("ITSsupFrameM24_1");
405 SUPRB24 = node->GetVolume();
406 //
407 mgr2->SetNsegments(ISetits(1,-1));
408 //
409 mgr2->SetVisLevel(6);
410 mgr2->SetVisOption(0);
411 //mgr2->CheckOverlaps(0.01);
412 //mgr2->PrintOverlaps();
413 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
414 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
415 //
416 c4->cd(1);
417 SUPRB24->Draw();
418 TPad *p1 = c4->GetPad(1);
419 TView *view1 = p1->GetView();
420 if(view1){
421 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
422 if(irr) cout <<"error="<<irr<<endl;
423 if(ISetits(4,-1)==0) view1->SetParralel();
424 else view1->SetPerspective();
425 view1->Front();
426 if(ISetits(3,-1)!=0) view1->ShowAxis();
427 } // end if view1
428 //
429 c4->cd(2);
430 SUPRB24->Draw();
431 TPad *p2 = c4->GetPad(2);
432 TView *view2 = p2->GetView();
433 if(view2){
434 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
435 if(irr) cout <<"error="<<irr<<endl;
436 if(ISetits(4,-1)==0) view2->SetParralel();
437 else view2->SetPerspective();
438 view2->Top();
439 if(ISetits(3,-1)!=0) view2->ShowAxis();
440 } // end if view2
441 //
442}
443
444//----------------------------------------------------------------------
445void EngineeringSupRB26(){
446 // Display SDD Cylinder Geometry
447 // Inputs:
448 // none.
449 // Outputs:
450 // none.
451 // Retrurn:
452 // none.
453 Int_t irr;
454 //
455 TGeoManager *mgr2 = gGeoManager;
456 TGeoVolume *ALIC = mgr2->GetTopVolume();
457 TCanvas *c5;
458 if(!(c5 = (TCanvas*)gROOT->FindObject("C5")))
459 c5 = new TCanvas("C5","ITS SDD Cylinder Geometry",900,450);
460 c5->Divide(2,1);
461 TGeoVolume *ITS,*SUPRB26=0;
462 TGeoNode *node;
463 TArrow *arrow=new TArrow();
464 //
465 node = ALIC->FindNode("ITSV_1");
466 ITS = node->GetVolume();
467 node = ITS->FindNode("ITSsupFrameM26_1");
468 SUPRB26 = node->GetVolume();
469 //
470 mgr2->SetNsegments(ISetits(1,-1));
471 //
472 mgr2->SetVisLevel(6);
473 mgr2->SetVisOption(0);
474 //mgr2->CheckOverlaps(0.01);
475 //mgr2->PrintOverlaps();
476 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
477 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
478 //
479 c5->cd(1);
480 SUPRB26->Draw();
481 TPad *p1 = c5->GetPad(1);
482 TView *view1 = p1->GetView();
483 if(view1){
484 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
485 if(irr) cout <<"error="<<irr<<endl;
486 if(ISetits(4,-1)==0) view1->SetParralel();
487 else view1->SetPerspective();
488 view1->Front();
489 if(ISetits(3,-1)!=0) view1->ShowAxis();
490 } // end if view1
491 //
492 c5->cd(2);
493 SUPRB26->Draw();
494 TPad *p2 = c5->GetPad(2);
495 TView *view2 = p2->GetView();
496 if(view2){
497 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
498 if(irr) cout <<"error="<<irr<<endl;
499 if(ISetits(4,-1)==0) view2->SetParralel();
500 else view2->SetPerspective();
501 view2->Top();
502 if(ISetits(3,-1)!=0) view2->ShowAxis();
503 } // end if view2
504 //
505}