1 //----------------------------------------------------------------------
2 void Displayv11(const char* filename=""){
3 // Display AliITSv11 Geometry
5 // const char* filename output file with the display in it
11 gSystem->Load("libGeom");
13 if(gGeoManager) delete gGeoManager;
14 mgr2 = gGeoManager = new TGeoManager("ITSGeometry",
15 " ITS Simulation Geometry Manager");
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);
22 AliITSv11 *its = new AliITSv11();
23 its->SetDebug(ISetits(0,-1));
24 its->CreateMaterials();
25 its->CreateGeometry();
27 mgr2->CloseGeometry();
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");
40 bar->AddButton("Display SDD Cone","EngineeringSDDCone()",
41 "Run EngineeringSDDCone");
42 bar->AddButton("Display SDD Centeral Cylinder","EngineeringSDDCylinder()",
43 "Run EngineeringSDDCylinder");
44 bar->AddButton("Display SUP RB24 side","EngineeringSupRB24()",
45 "Run EngineeringSDDCylinder");
46 bar->AddButton("Display SUP RB26 side","EngineeringSupRB26()",
47 "Run EngineeringSupRB26");
48 bar->AddButton("Quit/Exit",".q","Exit");
53 //----------------------------------------------------------------------
54 Int_t ISetits(Int_t t,Int_t v){
55 static Int_t itsdebug=0,nsegments=80,cut=0,axis=1,perspective=0;
59 if(v<0) return itsdebug;
63 if(v<0) return nsegments;
75 if(v<0) return perspective;
81 //----------------------------------------------------------------------
82 Double_t DSetits(Int_t t,Double_t v){
83 static Double_t phimincut=0.0,phimaxcut=180.0;
84 static Double_t longitude=90.0,latitude=0.0,psi=0.0;
88 if(v<0.) return phimincut;
92 if(v<0.) return phimaxcut;
96 if(v<0.) return longitude;
100 if(v<0.) return latitude;
104 if(v<0.) return latitude;
110 //----------------------------------------------------------------------
112 // Display AliITSv11 Geometry
114 // const char* filename output file with the display in it
121 TGeoManager *mgr2 = gGeoManager;
122 TGeoVolume *ALIC = mgr2->GetTopVolume();
124 if(!(c1 = (TCanvas*)gROOT->FindObject("C1")))
125 c1 = new TCanvas("C1","ITS Simulation Geometry",900,900);
128 mgr2->SetNsegments(ISetits(1,-1));
130 mgr2->SetVisLevel(6);
131 mgr2->SetVisOption(0);
132 //mgr2->CheckOverlaps(0.01);
133 //mgr2->PrintOverlaps();
134 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
138 TPad *p1 = c1->GetPad(1);
139 TView *view1 = p1->GetView();
141 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
142 if(irr) cout <<"error="<<irr<<endl;
143 if(ISetits(4,-1)==0) view1->SetParralel();
144 else view1->SetPerspective();
146 if(ISetits(3,-1)!=0) view1->ShowAxis();
150 TPad *p2 = c1->GetPad(2);
151 TView *view2 = p2->GetView();
153 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
154 if(irr) cout <<"error="<<irr<<endl;
155 if(ISetits(4,-1)==0) view2->SetParralel();
156 else view2->SetPerspective();
157 view2->RotateView(60.,30.);
158 if(ISetits(3,-1)!=0) view2->ShowAxis();
162 c1->SetPhi(90.0); c1->SetTheta(90.0);
163 TPad *p3 = c1->GetPad(3);
164 TView *view3 = p3->GetView();
166 view3->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
167 if(irr) cout <<"error="<<irr<<endl;
168 if(ISetits(4,-1)==0) view3->SetParralel();
169 else view3->SetPerspective();
171 if(ISetits(3,-1)!=0) view3->ShowAxis();
175 TPad *p4 = c1->GetPad(4);
176 TView *view4 = p4->GetView();
178 view4->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
179 if(irr) cout <<"error="<<irr<<endl;
180 if(ISetits(4,-1)==0) view4->SetParralel();
181 else view4->SetPerspective();
183 if(ISetits(3,-1)!=0) view4->ShowAxis();
187 //----------------------------------------------------------------------
188 void EngineeringSDDCone(){
189 // Display SDD Cone Geometry
198 TGeoManager *mgr2 = gGeoManager;
199 TGeoVolume *ALIC = mgr2->GetTopVolume();
201 if(!(c2 = (TCanvas*)gROOT->FindObject("C2")))
202 c2 = new TCanvas("C2","ITS SDD Cone Geometry",900,450);
204 TGeoVolume *ITS,*SDD=0;
207 node = ALIC->FindNode("ITSV_1");
208 ITS = node->GetVolume();
209 node = ITS->FindNode("ITSsddConeL_1");
210 SDD = node->GetVolume();
212 mgr2->SetNsegments(ISetits(1,-1));
214 mgr2->SetVisLevel(6);
215 mgr2->SetVisOption(0);
216 //mgr2->CheckOverlaps(0.01);
217 //mgr2->PrintOverlaps();
218 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
219 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
223 TPad *p1 = c2->GetPad(1);
224 TView *view1 = p1->GetView();
226 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
227 if(irr) cout <<"error="<<irr<<endl;
228 if(ISetits(4,-1)==0) view1->SetParralel();
229 else view1->SetPerspective();
231 if(ISetits(3,-1)!=0) view1->ShowAxis();
236 TPad *p2 = c2->GetPad(2);
237 TView *view2 = p2->GetView();
239 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
240 if(irr) cout <<"error="<<irr<<endl;
241 if(ISetits(4,-1)==0) view2->SetParralel();
242 else view2->SetPerspective();
244 if(ISetits(3,-1)!=0) view2->ShowAxis();
248 //----------------------------------------------------------------------
249 void EngineeringSDDCylinder(){
250 // Display SDD Cylinder Geometry
259 TGeoManager *mgr2 = gGeoManager;
260 TGeoVolume *ALIC = mgr2->GetTopVolume();
262 if(!(c3 = (TCanvas*)gROOT->FindObject("C3")))
263 c3 = new TCanvas("C3","ITS SDD Cylinder Geometry",900,450);
265 TGeoVolume *ITS,*SDD=0;
267 TArrow *arrow=new TArrow();
269 node = ALIC->FindNode("ITSV_1");
270 ITS = node->GetVolume();
271 node = ITS->FindNode("ITSsddCentCylCF_1");
272 SDD = node->GetVolume();
273 Double_t Rmin = ((TGeoTube*)(SDD->GetShape()))->GetRmin();
274 Double_t Rmax = ((TGeoTube*)(SDD->GetShape()))->GetRmax();
275 Double_t Dz = ((TGeoTube*)(SDD->GetShape()))->GetDz();
277 mgr2->SetNsegments(ISetits(1,-1));
279 mgr2->SetVisLevel(6);
280 mgr2->SetVisOption(0);
281 //mgr2->CheckOverlaps(0.01);
282 //mgr2->PrintOverlaps();
283 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
284 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
288 TPad *p1 = c3->GetPad(1);
289 TView *view1 = p1->GetView();
291 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
292 if(irr) cout <<"error="<<irr<<endl;
293 if(ISetits(4,-1)==0) view1->SetParralel();
294 else view1->SetPerspective();
296 if(ISetits(3,-1)!=0) view1->ShowAxis();
298 arrow->DrawArrow(1.01*Rmax,-Dz,1.01*Rmax,+Dz);
302 TPad *p2 = c3->GetPad(2);
303 TView *view2 = p2->GetView();
305 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
306 if(irr) cout <<"error="<<irr<<endl;
307 if(ISetits(4,-1)==0) view2->SetParralel();
308 else view2->SetPerspective();
310 if(ISetits(3,-1)!=0) view2->ShowAxis();
312 arrow->DrawArrow(Rmax,0.0,Rmax,0.0);
313 Double_t s = TMath::Sin(0.7),c = TMath::Cos(0.7);
314 arrow->DrawArrow(-Rmin*c,-Rmin*s,Rmin*c,Rmin*s);
317 //----------------------------------------------------------------------
318 void EngineeringSupRB24(){
319 // Display SDD Cylinder Geometry
328 TGeoManager *mgr2 = gGeoManager;
329 TGeoVolume *ALIC = mgr2->GetTopVolume();
331 if(!(c4 = (TCanvas*)gROOT->FindObject("C4")))
332 c4 = new TCanvas("C4","ITS SDD Cylinder Geometry",900,450);
334 TGeoVolume *ITS,*SUPRB24=0;
336 TArrow *arrow=new TArrow();
338 node = ALIC->FindNode("ITSV_1");
339 ITS = node->GetVolume();
340 node = ITS->FindNode("ITSsupFrameM24_1");
341 SUPRB24 = node->GetVolume();
343 mgr2->SetNsegments(ISetits(1,-1));
345 mgr2->SetVisLevel(6);
346 mgr2->SetVisOption(0);
347 //mgr2->CheckOverlaps(0.01);
348 //mgr2->PrintOverlaps();
349 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
350 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
354 TPad *p1 = c4->GetPad(1);
355 TView *view1 = p1->GetView();
357 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
358 if(irr) cout <<"error="<<irr<<endl;
359 if(ISetits(4,-1)==0) view1->SetParralel();
360 else view1->SetPerspective();
362 if(ISetits(3,-1)!=0) view1->ShowAxis();
367 TPad *p2 = c4->GetPad(2);
368 TView *view2 = p2->GetView();
370 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
371 if(irr) cout <<"error="<<irr<<endl;
372 if(ISetits(4,-1)==0) view2->SetParralel();
373 else view2->SetPerspective();
375 if(ISetits(3,-1)!=0) view2->ShowAxis();
380 //----------------------------------------------------------------------
381 void EngineeringSupRB26(){
382 // Display SDD Cylinder Geometry
391 TGeoManager *mgr2 = gGeoManager;
392 TGeoVolume *ALIC = mgr2->GetTopVolume();
394 if(!(c5 = (TCanvas*)gROOT->FindObject("C5")))
395 c5 = new TCanvas("C5","ITS SDD Cylinder Geometry",900,450);
397 TGeoVolume *ITS,*SUPRB26=0;
399 TArrow *arrow=new TArrow();
401 node = ALIC->FindNode("ITSV_1");
402 ITS = node->GetVolume();
403 node = ITS->FindNode("ITSsupFrameM26_1");
404 SUPRB26 = node->GetVolume();
406 mgr2->SetNsegments(ISetits(1,-1));
408 mgr2->SetVisLevel(6);
409 mgr2->SetVisOption(0);
410 //mgr2->CheckOverlaps(0.01);
411 //mgr2->PrintOverlaps();
412 mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
413 if(ISetits(2,-1)!=0) mgr2->SetPhiRange(DSetits(1,-1.),DSetits(0,-1.));
417 TPad *p1 = c5->GetPad(1);
418 TView *view1 = p1->GetView();
420 view1->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
421 if(irr) cout <<"error="<<irr<<endl;
422 if(ISetits(4,-1)==0) view1->SetParralel();
423 else view1->SetPerspective();
425 if(ISetits(3,-1)!=0) view1->ShowAxis();
430 TPad *p2 = c5->GetPad(2);
431 TView *view2 = p2->GetView();
433 view2->SetView(DSetits(2,-1.),DSetits(3,-1.),DSetits(4,-1.),irr);
434 if(irr) cout <<"error="<<irr<<endl;
435 if(ISetits(4,-1)==0) view2->SetParralel();
436 else view2->SetPerspective();
438 if(ISetits(3,-1)!=0) view2->ShowAxis();