Logo ROOT  
Reference Guide
na49view.C File Reference

Detailed Description

This macro generates with 2 views of the NA49 detector using the old obsolete geometry package.

void na49view() {
TCanvas *c1 = new TCanvas("c1","The NA49 canvas",200,10,700,780);
TPad *all = new TPad("all","A Global view of NA49",0.02,0.02,0.48,0.82,28);
TPad *tof = new TPad("tof","One Time Of Flight element",0.52,0.02,0.98,0.82,28);
TPaveLabel *na49title = new TPaveLabel(0.04,0.86,0.96,0.98,"Two views of the NA49 detector");
TFile *nageom = new TFile("na49.root");
if (!nageom || nageom->IsZombie()) return;
TGeometry *n49 =(TGeometry*)gROOT->FindObject("na49");
n49->cd(); //Set current geometry
all->cd(); //Set current pad
TNode *TOFR1 = n49->GetNode("TOFR1");
// To have a better and dynamic view of any of these pads,
// you can click with the middle button of your mouse to select it.
// Then select "View with x3d" in the VIEW menu of the Canvas.
// Once in x3d, you are in wireframe mode by default.
// You can switch to:
// - Hidden Line mode by typing E
// - Solid mode by typing R
// - Wireframe mode by typing W
// - Stereo mode by clicking S (and you need special glasses)
// - To leave x3d type Q
R__EXTERN TBenchmark * gBenchmark
Definition: TBenchmark.h:59
#define gROOT
Definition: TROOT.h:406
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition: TAttFill.h:37
virtual void Start(const char *name)
Starts Benchmark with the specified name.
Definition: TBenchmark.cxx:172
virtual void Show(const char *name)
Stops Benchmark name and Prints results.
Definition: TBenchmark.cxx:155
The Canvas class.
Definition: TCanvas.h:23
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
Definition: TFile.h:54
TGeometry description.
Definition: TGeometry.h:39
virtual void SetBomb(Float_t bomb=1.4)
Definition: TGeometry.h:102
virtual void Draw(Option_t *option="")
Draw this Geometry.
Definition: TGeometry.cxx:254
virtual void cd(const char *path=0)
Change Current Geometry to this.
Definition: TGeometry.cxx:246
TNode * GetNode(const char *name) const
Return pointer to node with name in the geometry tree.
Definition: TGeometry.cxx:345
TNode description.
Definition: TNode.h:33
virtual void Draw(Option_t *option="")
Draw Referenced node with current parameters.
Definition: TNode.cxx:324
R__ALWAYS_INLINE Bool_t IsZombie() const
Definition: TObject.h:149
The most important graphics class in the ROOT system.
Definition: TPad.h:26
TVirtualPad * cd(Int_t subpadnumber=0) override
Set Current pad.
Definition: TPad.cxx:603
void Draw(Option_t *option="") override
Draw Pad in Current pad (re-parent pad if necessary).
Definition: TPad.cxx:1299
A Pave (see TPave) with a text centered in the Pave.
Definition: TPaveLabel.h:20
virtual void Draw(Option_t *option="")
Draw this pavelabel with its current attributes.
Definition: TPaveLabel.cxx:77
return c1
Definition: legend1.C:41
Rene Brun

Definition in file na49view.C.