29 namespace CocoaTutorials {
31 Double_t r1, r2, r3, r4, r5, r6, r7, r8, r9;
35 void generate_random(
Int_t i)
42 r2 = (2 * dr *
r.Rndm(i)) - dr;
43 r3 = (2 * dr *
r.Rndm(i)) - dr;
44 r5 = (2 * dr *
r.Rndm(i)) - dr;
45 r6 = (2 * dr *
r.Rndm(i)) - dr;
46 r8 = (2 * dr *
r.Rndm(i)) - dr;
52 void parallelcoordtrans()
59 using namespace ROOT::CocoaTutorials;
61 Double_t s1x = 0., s1y = 0., s1z = 0.;
62 Double_t s2x = 0., s2y = 0., s2z = 0.;
63 Double_t s3x = 0., s3y = 0., s3z = 0.;
65 TCanvas *
c1 =
new TCanvas(
"parallel coords",
"parallel coords", 0, 0, 900, 1000);
68 ::Error(
"generate_random",
"This macro works only on OS X with --enable-cocoa");
73 TNtuple *
const nt =
new TNtuple(
"nt",
"Demo ntuple",
"x:y:z:u:v:w:a:b:c");
75 for (
Int_t i = 0; i < 1500; ++i) {
76 r.Sphere(s1x, s1y, s1z, 0.1);
77 r.Sphere(s2x, s2y, s2z, 0.2);
78 r.Sphere(s3x, s3y, s3z, 0.05);
81 nt->Fill(r1, r2, r3, r4, r5, r6, r7, r8, r9);
84 nt->Fill(s1x, s1y, s1z, s2x, s2y, s2z, r7, r8, r9);
87 nt->Fill(r1, r2, r3, r4, r5, r6, r7, s3y, r9);
90 nt->Fill(s2x - 1, s2y - 1, s2z, s1x + .5, s1y + .5, s1z + .5, r7, r8, r9);
93 nt->Fill(r1, r2, r3, r4, r5, r6, r7, r8, r9);
96 nt->Fill(s1x + 1, s1y + 1, s1z + 1, s3x - 2, s3y - 2, s3z - 2, r7, r8, r9);
99 nt->Fill(r1, r2, r3, r4, r5, r6, s3x, r8, s3z);
106 nt->Draw(
"x:y:z:u:v:w:a:b:c",
"",
"para");
108 assert(para1 != 0 &&
"parallelcoordtrans, 'ParaCoord' is null");
110 para1->SetLineColor(25);
112 pcv->SetHistogramHeight(0.);
115 pcv->SetHistogramHeight(0.);
118 pcv->SetHistogramHeight(0.);
121 pcv->SetHistogramHeight(0.);
124 pcv->SetHistogramHeight(0.);
127 pcv->SetHistogramHeight(0.);
130 pcv->SetHistogramHeight(0.);
133 pcv->SetHistogramHeight(0.);
136 pcv->SetHistogramHeight(0.);
142 assert(col26 != 0 &&
"parallelcoordtrans, color with index 26 not found");
144 col26->SetAlpha(0.01);
147 nt->Draw(
"x:y:z:u:v:w:a:b:c",
"",
"para");
149 assert(para2 != 0 &&
"parallelcoordtrans, 'ParaCoord' is null");
151 para2->SetLineColor(26);
154 pcv->SetHistogramHeight(0.);
157 pcv->SetHistogramHeight(0.);
160 pcv->SetHistogramHeight(0.);
163 pcv->SetHistogramHeight(0.);
166 pcv->SetHistogramHeight(0.);
169 pcv->SetHistogramHeight(0.);
172 pcv->SetHistogramHeight(0.);
175 pcv->SetHistogramHeight(0.);
178 pcv->SetHistogramHeight(0.);
This is the base class for the ROOT Random number generators.
A simple TTree restricted to a list of float variables only.
The color creation and management class.
Parallel Coordinates class.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
void Error(ErrorHandler_t func, int code, const char *va_(fmt),...)
Write error message and call a handler, if required.