ROOT
Version v6.34
master
v6.32
Reference Guide
▼
ROOT
ROOT Reference Documentation
Tutorials
▼
Functional Parts
►
Core ROOT classes
►
std Extension classes
►
Parallelized classes
►
The Geometry Package
►
Graphics
►
Event display with ROOT7
►
GUI
►
Web Widgets
►
Web Display
►
Histogram Library
►
Input/Output Library
►
Math
►
N-D parametric functions
►
VecOps
►
Monte Carlo
►
HTTP server
►
PROOF
►
TMVA
►
RooFit
►
Dataframe
►
ROOT7 classes
►
NTuple-related classes
►
Tree Library
►
TreePlayer Library
▼
Tutorials
►
Histograms tutorials
►
Tree tutorials
►
Dataframe tutorials
►
ROOT 7 tutorials
►
FOAM tutorials
►
Containers tutorials
►
Event display tutorials
►
Event display ROOT7 tutorials
►
Geometry tutorials
►
Fast Fourier Transforms tutorials
►
Fit Tutorials
►
RooFit Tutorials
►
Graphs tutorials
▼
Graphics tutorials
accessiblecolorschemes.C
analyze.C
anim.C
archi.C
arrows.C
basic3d.C
canvas.C
canvas2.C
compile.C
crown.C
diamond.C
earth.C
ellipse.C
eval.C
event.C
feynman.C
first.C
formula1.C
framework.C
gaxis.C
gaxis2.C
gaxis3.C
graph_edit_playback.C
gtime.C
inside.C
latex.C
latex2.C
latex3.C
latex4.C
latex5.C
mandelbrot.C
markerwarning.C
mass_spectrum.C
palettes.C
pavetext.C
perceptualcolormap.C
piechart.C
polytest1.C
polytest2.C
pstable.C
psview.C
quarks.C
save_batch.C
saveall.C
schroedinger_hydrogen.C
tmathtext.C
tmathtext2.C
tornado.C
transparency.C
triangles.C
►
OpenGL tutorials
►
Tutorials specific to Mac/Cocoa
►
GUI tutorials
►
HistFactory Tutorials
►
HTTP tutorials
►
Image tutorials
►
IO tutorials
►
Math tutorials
►
Matrix tutorials
►
Monte Carlo tutorials
►
Multicore tutorials
►
Net tutorials
►
Physics tutorials
►
PyRoot tutorials
►
Pythia tutorials
►
Quadratic programming package.
►
R tutorials
►
RooStats Tutorials
►
Spectrum tutorials
►
TSPlot tutorials
►
SQL tutorials
►
TMVA tutorials
►
TUnfold tutorials
►
Unuran tutorials
►
VecOps tutorials
►
FITS files interface tutorials
►
XML tutorials
►
Proof tutorials
►
TWebCanvas tutorials
►
Webgui tutorials
►
Legacy tutorials
demos.C
demoshelp.C
hsimple.C
rootlogoff.C
rootlogon.C
►
R Interface for Statistical Computing
►
Namespaces
►
All Classes
►
Files
Release Notes
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Loading...
Searching...
No Matches
tornado.C File Reference
Tutorials
»
Graphics tutorials
Detailed Description
Show 3-d polymarker.
void
tornado
() {
gBenchmark
->
Start
(
"tornado"
);
double
PI
= 3.141592653;
int
d
= 16;
int
numberOfPoints
=200;
int
numberOfCircles
=40;
// create and open a canvas
TCanvas
*
sky
=
new
TCanvas
(
"sky"
,
"Tornado"
, 300, 10, 700, 500 );
sky
->SetFillColor(14);
// creating view
TView
*view =
TView::CreateView
(1,0,0);
float
range
=
numberOfCircles
*
d
;
view->
SetRange
( 0, 0, 0, 4.0*
range
, 2.0*
range
,
range
);
for
(
int
j
=
d
;
j
<
numberOfCircles
*
d
;
j
+=
d
) {
// create a PolyMarker3D
TPolyMarker3D
*
pm3d
=
new
TPolyMarker3D
(
numberOfPoints
);
float
x
,
y
, z;
// set points
for
(
int
i = 1; i <
numberOfPoints
; i++ ) {
float
csin
= sin(2*
PI
/ (
double
)
numberOfPoints
* (
double
)i) + 1;
float
ccos
= cos(2*
PI
/ (
double
)
numberOfPoints
* (
double
)i) + 1;
float
esin
= sin(2*
PI
/ (
double
)(
numberOfCircles
*
d
) * (
double
)
j
) + 1;
x
=
j
* (
csin
+
esin
);
y
=
j
*
ccos
;
z =
j
;
pm3d
->SetPoint( i,
x
,
y
, z );
}
// set marker size, color & style
pm3d
->SetMarkerSize( 1 );
pm3d
->SetMarkerColor( 2 + (
d
== (
j
&
d
) ) );
pm3d
->SetMarkerStyle( 3 );
//draw
pm3d
->Draw();
}
char
timeStr
[60];
gBenchmark
->
Show
(
"tornado"
);
Float_t
ct
=
gBenchmark
->
GetCpuTime
(
"tornado"
);
sprintf
(
timeStr
,
"Execution time: %g sec."
,
ct
);
TPaveText
*
text
=
new
TPaveText
( 0.1, 0.81, 0.9, 0.97 );
text
->SetFillColor( 42 );
text
->AddText(
"ROOT example: tornado.C"
);
text
->AddText(
timeStr
);
text
->Draw();
sky
->Update();
}
d
#define d(i)
Definition
RSha256.hxx:102
Float_t
float Float_t
Definition
RtypesCore.h:57
PI
#define PI
Definition
SpecFuncMathCore.cxx:23
gBenchmark
R__EXTERN TBenchmark * gBenchmark
Definition
TBenchmark.h:59
TRangeDynCast
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Definition
TCollection.h:358
text
Option_t Option_t TPoint TPoint const char text
Definition
TGWin32VirtualXProxy.cxx:68
ROOT::Detail::TRangeCast
Definition
TCollection.h:311
TBenchmark::Start
virtual void Start(const char *name)
Starts Benchmark with the specified name.
Definition
TBenchmark.cxx:172
TBenchmark::Show
virtual void Show(const char *name)
Stops Benchmark name and Prints results.
Definition
TBenchmark.cxx:155
TBenchmark::GetCpuTime
Float_t GetCpuTime(const char *name)
Returns Cpu time used by Benchmark name.
Definition
TBenchmark.cxx:117
TCanvas
The Canvas class.
Definition
TCanvas.h:23
TPaveText
A Pave (see TPave) with text, lines or/and boxes inside.
Definition
TPaveText.h:21
TPolyMarker3D
A 3D polymarker.
Definition
TPolyMarker3D.h:33
TView
See TView3D.
Definition
TView.h:25
TView::CreateView
static TView * CreateView(Int_t system=1, const Double_t *rmin=nullptr, const Double_t *rmax=nullptr)
Create a concrete default 3-d view via the plug-in manager.
Definition
TView.cxx:27
TView::SetRange
virtual void SetRange(const Double_t *min, const Double_t *max)=0
y
Double_t y[n]
Definition
legend1.C:17
x
Double_t x[n]
Definition
legend1.C:17
tornado
Definition
tornado.py:1
Author
Rene Brun
Definition in file
tornado.C
.
tutorials
graphics
tornado.C
ROOT tags/6-34-04 - Reference Guide Generated on Tue Mar 25 2025 04:21:41 (GVA Time) using Doxygen 1.10.0