spectrumpainter.C

Go to the documentation of this file.
00001 {
00002    // Examples showing how to use TSpectrum2Painter (the SPEC option)
00003    //Authors: Olivier Couet, Miroslav Morhac
00004    
00005    TH2 *h2 = new TH2F("h2","h2",40,-8,8,40,-9,9);
00006    Float_t px, py;
00007    for (Int_t i = 0; i < 50000; i++) {
00008       gRandom->Rannor(px,py);
00009       Float_t random = gRandom->Rndm(1);
00010       h2->Fill(px,py);
00011       h2->Fill(px+4,py-4,0.5);
00012       h2->Fill(px+4,py+4,0.25);
00013       h2->Fill(px-3,py+4,0.125);
00014    }
00015 
00016    TCanvas *c1 = new TCanvas("c1","Illustration of 2D graphics",10,10,800,700);
00017    c1->Divide(2,2);
00018 
00019    c1->cd(1);
00020    h2->Draw("SPEC dm(2,10) zs(1)");
00021    c1->cd(2);
00022    h2->Draw("SPEC dm(1,10) pa(2,1,1) ci(1,4,8) a(15,45,0)");
00023    c1->cd(3);
00024    h2->Draw("SPEC dm(2,10) pa(1,1,1) ci(1,1,1) a(15,45,0) s(1,1)");
00025    c1->cd(4);
00026    h2->Draw("SPEC dm(1,10) pa(2,1,1) ci(1,4,8) a(15,45,0) cm(1,15,4,4,1) cg(1,2)");
00027 }

Generated on Tue Jul 5 15:45:10 2011 for ROOT_528-00b_version by  doxygen 1.5.1