1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
17 // Class for the display of ITS
19 // with the new geometry
20 // A proper description of this class
21 // will be written shortly
29 #include <Riostream.h>
32 #include <TControlBar.h>
33 #include <TGeoManager.h>
34 #include <TGeoMaterial.h>
35 #include <TGeoMedium.h>
37 #include <TGeoVolume.h>
45 #include "AliITSv11.h"
46 #include "DisplayITSv11.h"
48 ClassImp(DisplayITSv11)
49 //______________________________________________________________________
50 DisplayITSv11::DisplayITSv11()
52 // Default Constructor.
58 // A Default constructed DispalyITSv11 class/task.
73 fRmin[0] = fRmin[1] = fRmin[2] = fRmax[0] = fRmax[1] = fRmax[2] = 0.0;
79 //______________________________________________________________________
80 DisplayITSv11::~DisplayITSv11()
91 if(fClip) delete fClip;
97 //______________________________________________________________________
98 void DisplayITSv11::Exec(Option_t* opt)
100 // Main display routine
102 // Option_t * opt Not presently used.
109 if(strstr(opt,"debug")) fits->SetDebug();
110 gSystem->Load("libGeom");
112 if(gGeoManager) delete gGeoManager;
113 fmgr = gGeoManager = new TGeoManager("ITSGeometry",
114 " ITS Simulation Geometry Manager");
116 TGeoMaterial *vacmat = new TGeoMaterial("Vacume",0,0,0);
117 TGeoMedium *vacmed = new TGeoMedium("Vacume_med",1,vacmat);
121 for(i=0;i<3;i++) fRmin[i] = -fRmax[i];
122 fALICE = fmgr->MakeBox("ALIC",vacmed,fRmax[0],fRmax[1],fRmax[2]);
123 fmgr->SetTopVolume(fALICE);
125 AliITSv11 *fits = new AliITSv11();
126 fits->SetDebug(GetDebugITS());
127 fits->CreateMaterials();
128 fits->CreateGeometry();
130 fmgr->CloseGeometry();
131 fITS = fALICE->FindNode("ITSV_1")->GetVolume();
133 TControlBar *bar=new TControlBar("vertical","ITS Geometry Display",10,10);
134 bar->AddButton("Set ITS Debug level 1","SetITSdebugOn()","Debug on");
135 bar->AddButton("Set ITS Debug level 0","SetITSdebugOff()","Debug off");
136 bar->AddButton("Set ITS Theta,Phi cut on","SetCylindericalClipVolume()",
138 bar->AddButton("Set ITS Theta,Phi cut off","SetCylindericalCutOff()",
140 bar->AddButton("Set axis on","SetAxisOn()","Show Axis on");
141 bar->AddButton("Set axis off","SetAxisOff()","Show Axis off");
142 bar->AddButton("Set perspective on","SetPerspectiveOn()",
144 bar->AddButton("Set perspective off","SetPerspectiveOff()",
146 bar->AddButton("Draw volumes as Solid","SetSolid()","Solid Volumes");
147 bar->AddButton("Draw volumes as wire","SetWire()","Wire Volumes");
148 bar->AddButton("Set circle/80","SetCircleSegments(80)",
149 "circles ~ by 80 lines");
150 bar->AddButton("Check Overlaps","fmgr->CheckOverlaps()",
151 "Check for overlaps");
152 bar->AddButton("Display Geometry","Displayit()","Run Displayit");
153 bar->AddButton("Display SPD Thermal Sheald","EngineeringSPDThS()",
154 "Run EngineeringSPDThS");
155 bar->AddButton("Display SDD Cone","EngineeringSDDCone()",
156 "Run EngineeringSDDCone");
157 bar->AddButton("Display SDD Centeral Cylinder","EngineeringSDDCylinder()",
158 "Run EngineeringSDDCylinder");
159 bar->AddButton("Display SUP RB24 side","EngineeringSupRB24()",
160 "Run EngineeringSDDCylinder");
161 bar->AddButton("Display SUP RB26 side","EngineeringSupRB26()",
162 "Run EngineeringSupRB26");
163 bar->AddButton("Quit/Exit",".q","Exit");
165 gROOT->SaveContext();
169 //______________________________________________________________________
170 void DisplayITSv11::Displaying(TGeoVolume *v,TCanvas *c,Int_t ipad)
172 // Display Volume according to existing values
174 // TGeoVolume *v volume to be drawn.
175 // TCanvas *p Pad where drawing is to be done
176 // Int_t ipad subpad to draw on
189 if(!view){view = new TView(fRmin,fRmax,1);p->SetView(view);}
190 view->SetRange(fRmin,fRmax);
191 view->SetView(fLongitude,fLatitude,fPsi,irr);
192 if(fPerspective) view->SetPerspective();
193 else view->SetParralel();
194 if(fAxis) view->ShowAxis();
196 if(fClip) fmgr->SetClippingShape(fClip);
198 if(fSolid) v->Raytrace();
202 //----------------------------------------------------------------------
203 void DisplayITSv11::DisplayITS(){
204 // Display AliITSv11 Geometry
206 // const char* filename output file with the display in it
211 Double_t lon,lat,psi;
214 if(!(c1 = (TCanvas*)gROOT->FindObject("C1")))
215 c1 = new TCanvas("C1","ITS Simulation Geometry",900,900);
218 fmgr->SetNsegments(fNsegments);
220 fmgr->SetVisLevel(6);
221 fmgr->SetVisOption(0);
223 Displaying(fALICE,c1,2);
227 fLongitude = 270.0; // Front
230 Displaying(fALICE,c1,1);
231 fLongitude = 270.0; // Top
234 Displaying(fALICE,c1,3);
235 fLongitude = 0.0; // Side
238 Displaying(fALICE,c1,4);
244 //----------------------------------------------------------------------
245 void DisplayITSv11::EngineeringSPDThS()
247 // Display SPD Thermal Sheald Geometry
254 Double_t lon,lat,psi;
258 if(!(c4 = (TCanvas*)gROOT->FindObject("C4")))
259 c4 = new TCanvas("C4","ITS SDD Cylinder Geometry",900,450);
261 TGeoVolume *sPDThS=0;
262 //TArrow *arrow=new TArrow();
264 node = fITS->FindNode("ITSspdThermalSheald_1");
265 sPDThS = node->GetVolume();
267 fmgr->SetNsegments(fNsegments);
269 fmgr->SetVisLevel(6);
270 fmgr->SetVisOption(0);
275 fLongitude = 270.0; // Front
278 Displaying(sPDThS,c4,1);
280 fLongitude = 270.0; // Top
283 Displaying(sPDThS,c4,2);
290 //----------------------------------------------------------------------
291 void DisplayITSv11::EngineeringSDDCone()
293 // Display SDD Cone Geometry
300 Double_t lon,lat,psi;
303 if(!(c2 = (TCanvas*)gROOT->FindObject("C2")))
304 c2 = new TCanvas("C2","ITS SDD Cone Geometry",900,450);
309 node = fITS->FindNode("ITSsddConeL_1");
310 sDD = node->GetVolume();
312 fmgr->SetNsegments(fNsegments);
314 fmgr->SetVisLevel(6);
315 fmgr->SetVisOption(0);
320 fLongitude = 270.0; // Front
323 Displaying(sDD,c2,1);
325 fLongitude = 270.0; // Top
328 Displaying(sDD,c2,2);
335 //----------------------------------------------------------------------
336 void DisplayITSv11::EngineeringSDDCylinder()
338 // Display SDD Cylinder Geometry
345 Double_t lon,lat,psi;
348 if(!(c3 = (TCanvas*)gROOT->FindObject("C3")))
349 c3 = new TCanvas("C3","ITS SDD Cylinder Geometry",900,450);
353 TArrow *arrow=new TArrow();
355 node = fITS->FindNode("ITSsddCentCylCF_1");
356 sDD = node->GetVolume();
357 Double_t rmin = ((TGeoTube*)(sDD->GetShape()))->GetRmin();
358 Double_t rmax = ((TGeoTube*)(sDD->GetShape()))->GetRmax();
359 Double_t dz = ((TGeoTube*)(sDD->GetShape()))->GetDz();
361 fmgr->SetNsegments(fNsegments);
363 fmgr->SetVisLevel(6);
364 fmgr->SetVisOption(0);
369 fLongitude = 270.0; // Front
372 Displaying(sDD,c3,1);
373 arrow->DrawArrow(1.01*rmax,-dz,1.01*rmax,+dz);
375 fLongitude = 270.0; // Top
378 Displaying(sDD,c3,2);
379 arrow->DrawArrow(rmax,0.0,rmax,0.0);
380 Double_t s = TMath::Sin(0.7),c = TMath::Cos(0.7);
381 arrow->DrawArrow(-rmin*c,-rmin*s,rmin*c,rmin*s);
388 //----------------------------------------------------------------------
389 void DisplayITSv11::EngineeringSupRB24()
391 // Display SDD Cylinder Geometry
398 Double_t lon,lat,psi;
401 if(!(c4 = (TCanvas*)gROOT->FindObject("C4")))
402 c4 = new TCanvas("C4","ITS SDD Cylinder Geometry",900,450);
404 TGeoVolume *sUPRB24=0;
406 //TArrow *arrow=new TArrow();
408 node = fITS->FindNode("ITSsupFrameM24_1");
409 sUPRB24 = node->GetVolume();
411 fmgr->SetNsegments(fNsegments);
413 fmgr->SetVisLevel(6);
414 fmgr->SetVisOption(0);
419 fLongitude = 270.0; // Front
422 Displaying(sUPRB24,c4,1);
424 fLongitude = 270.0; // Top
427 Displaying(sUPRB24,c4,2);
434 //----------------------------------------------------------------------
435 void DisplayITSv11::EngineeringSupRB26()
437 // Display SDD Cylinder Geometry
444 Double_t lon,lat,psi;
447 if(!(c5 = (TCanvas*)gROOT->FindObject("C5")))
448 c5 = new TCanvas("C5","ITS SDD Cylinder Geometry",900,450);
450 TGeoVolume *sUPRB26=0;
452 //TArrow *arrow=new TArrow();
454 node = fITS->FindNode("ITSsupFrameM26_1");
455 sUPRB26 = node->GetVolume();
457 fmgr->SetNsegments(fNsegments);
459 fmgr->SetVisLevel(6);
460 fmgr->SetVisOption(0);
465 fLongitude = 270.0; // Front
468 Displaying(sUPRB26,c5,1);
470 fLongitude = 270.0; // Top
473 Displaying(sUPRB26,c5,2);