ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
na49view.C
Go to the documentation of this file.
1 void na49view() {
2  //
3  // This macro generates
4  // a begin_html <a href="gif/na49canvas.gif">Canvas</a> end_html
5  // with 2 views of the NA49 detector using the old obsolete geometry package.
6  //Author: Rene Brun
7 
8  TCanvas *c1 = new TCanvas("c1","The NA49 canvas",200,10,700,780);
9 
10  gBenchmark->Start("na49view");
11 
12  TPad *all = new TPad("all","A Global view of NA49",0.02,0.02,0.48,0.82,28);
13  TPad *tof = new TPad("tof","One Time Of Flight element",0.52,0.02,0.98,0.82,28);
14  all->Draw();
15  tof->Draw();
16  TPaveLabel *na49title = new TPaveLabel(0.04,0.86,0.96,0.98,"Two views of the NA49 detector");
17  na49title->SetFillColor(32);
18  na49title->Draw();
19  //
20  TFile *nageom = new TFile("na49.root");
21  if (!nageom || nageom->IsZombie()) return;
22  TGeometry *n49 =(TGeometry*)gROOT->FindObject("na49");
23  n49->SetBomb(1.2);
24  n49->cd(); //Set current geometry
25  all->cd(); //Set current pad
26  n49->Draw();
27  c1->Update();
28  tof->cd();
29  TNode *TOFR1 = n49->GetNode("TOFR1");
30  TOFR1->Draw();
31  c1->Update();
32 
33  gBenchmark->Show("na49view");
34 
35  // To have a better and dynamic view of any of these pads,
36  // you can click with the middle button of your mouse to select it.
37  // Then select "View with x3d" in the VIEW menu of the Canvas.
38  // Once in x3d, you are in wireframe mode by default.
39  // You can switch to:
40  // - Hidden Line mode by typing E
41  // - Solid mode by typing R
42  // - Wireframe mode by typing W
43  // - Stereo mode by clicking S (and you need special glasses)
44  // - To leave x3d type Q
45 }
tuple na49title
Definition: na49view.py:17
virtual void Draw(Option_t *option="")
Draw Referenced node with current parameters.
Definition: TNode.cxx:323
void na49view()
Definition: na49view.C:1
TCanvas * c1
Definition: legend1.C:2
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:45
TNode description.
Definition: TNode.h:43
#define gROOT
Definition: TROOT.h:344
virtual void Show(const char *name)
Stops Benchmark name and Prints results.
Definition: TBenchmark.cxx:155
Bool_t IsZombie() const
Definition: TObject.h:141
TNode * GetNode(const char *name) const
Return pointer to node with name in the geometry tree.
Definition: TGeometry.cxx:345
TVirtualPad * cd(Int_t subpadnumber=0)
Set Current pad.
Definition: TPad.cxx:514
virtual void Start(const char *name)
Starts Benchmark with the specified name.
Definition: TBenchmark.cxx:172
virtual void Draw(Option_t *option="")
Draw Pad in Current pad (re-parent pad if necessary).
Definition: TPad.cxx:1192
tuple nageom
Definition: na49view.py:21
TGeometry description.
Definition: TGeometry.h:43
A Pave (see TPave) with a text centered in the Pave.
Definition: TPaveLabel.h:32
virtual void SetFillColor(Color_t fcolor)
Definition: TAttFill.h:50
R__EXTERN TBenchmark * gBenchmark
Definition: TBenchmark.h:63
The most important graphics class in the ROOT system.
Definition: TPad.h:46
tuple tof
Definition: na49view.py:14
virtual void Draw(Option_t *option="")
Draw this Geometry.
Definition: TGeometry.cxx:254
The Canvas class.
Definition: TCanvas.h:48
virtual void Draw(Option_t *option="")
Draw this pavelabel with its current attributes.
Definition: TPaveLabel.cxx:77
virtual void SetBomb(Float_t bomb=1.4)
Definition: TGeometry.h:106
virtual void cd(const char *path=0)
Change Current Geometry to this.
Definition: TGeometry.cxx:246
tuple TOFR1
Definition: na49view.py:29
virtual void Update()
Update canvas pad buffers.
Definition: TCanvas.cxx:2179
tuple all
Definition: na49view.py:13