]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TOF/DrawROOTTOF.C
Updated comments (Raffaele)
[u/mrichter/AliRoot.git] / TOF / DrawROOTTOF.C
1 #ifndef __CINT__
2   #include "TView.h"
3   #include "TPolyMarker3D.h"
4
5 #endif
6
7 Int_t DrawROOTTOF() {
8   //
9   // author: F. Pierella
10   // report bug to pierella@bo.infn.it
11   //
12   // use case
13   // generate an event with TOF included
14   // start aliroot
15   // .x DrawROOTTOF.C
16   cerr<<"ROOT TOF Geometry...\n";
17   cerr<<"(TRD and TPC are included)\n";
18   TFile *file=TFile::Open("galice.root");
19   if (!file->IsOpen()) {cerr<<"Can't open galice.root !\n"; return 1;}
20   
21   TCanvas *c1=new TCanvas("ddisplay", "TOF display",0,0,700,730);
22   TView *v=new TView(1);
23   v->SetRange(-430,-560,-430,430,560,1710);
24   c1->Clear();
25   c1->SetFillColor(10);
26   c1->SetTheta(90.);
27   c1->SetPhi(0.);
28   
29   
30   //draw TOF with TRD and TPC included
31   TGeometry *geom=(TGeometry*)file->Get("AliceGeom");
32   TList *list = geom->GetListOfNodes();
33   TNode * main = (TNode*)((geom->GetListOfNodes())->First());
34   TIter next(main->GetListOfNodes());
35   TNode  *module=0;
36   while((module = (TNode*)next())) {
37     char ch[100];
38     sprintf(ch,"%s\n",module->GetTitle());
39     //printf("%s\n",module->GetTitle());
40     if ((ch[0]=='F'&&ch[1]=='T' && ch[2]=='O') || (ch[0]=='T'&&ch[1]=='R' && ch[2]=='D') || (ch[0]=='T'&&ch[1]=='P' && ch[2]=='C')){  //if TOF or TPC or TRD draw
41       module->SetVisibility(3);
42     }else{
43       module->SetVisibility(-1);
44     }
45   }
46   
47   c1->cd();
48   geom->Draw("same");
49   //v->Draw();
50   c1->Modified(); c1->Update(); 
51   
52   //
53   //  Draw the geometry using the x3d viewver.
54
55   c1->x3d();
56   //
57   // once in x3d viewer, type m to see the menu.
58   // For example typing r will show a solid model of this geometry.
59   
60   file->Close();
61   return 0;
62 }