16 TString dir = gROOT->GetTutorialDir();
17 dir.Append(
"/hsimple.C");
18 dir.ReplaceAll(
"/./",
"/");
19 if (!gInterpreter->IsLoaded(dir.Data())) gInterpreter->LoadMacro(dir.Data());
20 TFile *file = (TFile*)gROOT->ProcessLineFast(
"hsimple(1)");
22 TTree *ntuple = (TTree*)file->Get(
"ntuple");
24 TCanvas *c1 =
new TCanvas(
"c1",
"Contours",10,10,800,600);
25 ntuple->Draw(
"py:px",
"px*px+py*py < 20",
"contz,list");
32 TCanvas *c2 =
new TCanvas(
"c2",
"First contour",100,100,800,600);
36 (TObjArray*)gROOT->GetListOfSpecials()->FindObject(
"contours");
37 if (!contours)
return;
38 TList *lcontour1 = (TList*)contours->At(0);
39 if (!lcontour1)
return;
40 TGraph *gc1 = (TGraph*)lcontour1->First();
42 if (gc1->GetN() < 10)
return;
43 gc1->SetMarkerStyle(21);
47 TCutG *cutg =
new TCutG(
"cutg",gc1->GetN(),gc1->GetX(),gc1->GetY());
50 const Int_t npmax = 50000;
51 TPolyMarker *pm =
new TPolyMarker(npmax);
54 Double_t x = -4 +8*gRandom->Rndm();
55 Double_t y = -4 +8*gRandom->Rndm();
56 if (cutg->IsInside(x,y)) {
59 if (np == npmax)
break;