Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
event.C
Go to the documentation of this file.
1/// \file
2/// \ingroup tutorial_graphics
3/// \notebook -js
4/// Illustrate some basic primitives.
5///
6/// \macro_image
7/// \macro_code
8///
9/// \author Rene Brun
10
11void event()
12{
13 TCanvas *c1 = new TCanvas("c1", "ROOT Event description", 700, 500);
14 c1->Range(0, 0, 14, 15.5);
15 TPaveText *event = new TPaveText(1, 13, 3, 15);
16 event->SetFillColor(11);
17 event->Draw();
18 event->AddText("Event");
19 TLine *line = new TLine(1.1, 13, 1.1, 1.5);
21 line->Draw();
22 line->DrawLine(1.3, 13, 1.3, 3.5);
23 line->DrawLine(1.5, 13, 1.5, 5.5);
24 line->DrawLine(1.7, 13, 1.7, 7.5);
25 line->DrawLine(1.9, 13, 1.9, 9.5);
26 line->DrawLine(2.1, 13, 2.1, 11.5);
27 TArrow *arrow = new TArrow(1.1, 1.5, 3.9, 1.5, 0.02, "|>");
28 arrow->SetFillStyle(1001);
29 arrow->SetFillColor(1);
30 arrow->Draw();
31 arrow->DrawArrow(1.3, 3.5, 3.9, 3.5, 0.02, "|>");
32 arrow->DrawArrow(1.5, 5.5, 3.9, 5.5, 0.02, "|>");
33 arrow->DrawArrow(1.7, 7.5, 3.9, 7.5, 0.02, "|>");
34 arrow->DrawArrow(1.9, 9.5, 3.9, 9.5, 0.02, "|>");
35 arrow->DrawArrow(2.1, 11.5, 3.9, 11.5, 0.02, "|>");
36 TPaveText *p1 = new TPaveText(4, 1, 11, 2);
37 p1->SetTextAlign(12);
38 p1->SetFillColor(42);
39 p1->AddText("1 Mbyte");
40 p1->Draw();
41 TPaveText *p2 = new TPaveText(4, 3, 10, 4);
42 p2->SetTextAlign(12);
43 p2->SetFillColor(42);
44 p2->AddText("100 Kbytes");
45 p2->Draw();
46 TPaveText *p3 = new TPaveText(4, 5, 9, 6);
47 p3->SetTextAlign(12);
48 p3->SetFillColor(42);
49 p3->AddText("10 Kbytes");
50 p3->Draw();
51 TPaveText *p4 = new TPaveText(4, 7, 8, 8);
52 p4->SetTextAlign(12);
53 p4->SetFillColor(42);
54 p4->AddText("1 Kbytes");
55 p4->Draw();
56 TPaveText *p5 = new TPaveText(4, 9, 7, 10);
57 p5->SetTextAlign(12);
58 p5->SetFillColor(42);
59 p5->AddText("100 bytes");
60 p5->Draw();
61 TPaveText *p6 = new TPaveText(4, 11, 6, 12);
62 p6->SetTextAlign(12);
63 p6->SetFillColor(42);
64 p6->AddText("10 bytes");
65 p6->Draw();
66 TText text;
67 text.SetTextAlign(12);
68 text.SetTextSize(0.04);
69 text.SetTextFont(72);
70 text.DrawText(6.2, 11.5, "Header:Event_flag");
71 text.DrawText(7.2, 9.5, "Trigger_Info");
72 text.DrawText(8.2, 7.5, "Muon_Detector: TOF");
73 text.DrawText(9.2, 5.5, "Calorimeters");
74 text.DrawText(10.2, 3.5, "Forward_Detectors");
75 text.DrawText(11.2, 1.5, "TPCs");
76}
Option_t Option_t TPoint TPoint const char text
Draw all kinds of Arrows.
Definition TArrow.h:29
virtual void SetFillColor(Color_t fcolor)
Set the fill area color.
Definition TAttFill.h:37
virtual void SetLineWidth(Width_t lwidth)
Set the line width.
Definition TAttLine.h:43
virtual void SetTextAlign(Short_t align=11)
Set the text alignment.
Definition TAttText.h:42
The Canvas class.
Definition TCanvas.h:23
Use the TLine constructor to create a simple line.
Definition TLine.h:22
virtual TLine * DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
Draw this line with new coordinates.
Definition TLine.cxx:103
virtual void Draw(Option_t *option="")
Default Draw method for all objects.
Definition TObject.cxx:292
A Pave (see TPave) with text, lines or/and boxes inside.
Definition TPaveText.h:21
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
void Draw(Option_t *option="") override
Draw this pavetext with its current attributes.
Base class for several text objects.
Definition TText.h:22
TLine * line
return c1
Definition legend1.C:41