{ #include #include #include "TNtuple.h" #include "TCanvas.h" #include "TH1F.h" //Var double HV,c,limiar; //Open data ifstream ler; ler.open("dados06.txt"); //Verifica se Abriu if(!ler.is_open()){ cout<<"Not Open"<> HV >> limiar >> c; ntuple->Fill(HV,limiar,c); } gStyle->SetOptStat(0); TCanvas *canvas = new TCanvas("Canvas","",900,600); canvas->SetLogy(); canvas->SetGridx(); canvas->SetGridy(); ntuple->Draw("c:HV>>h1","limiar==10","prof"); h1->SetMarkerStyle(20); h1->SetMarkerColor(2); h1->SetXTitle("HV (V)"); h1->SetYTitle("contagem/10s"); h1->SetTitle("Platonagem Cintilador 06"); ntuple->Draw("c:HV>>h2","limiar==20","prof"); h2->SetMarkerStyle(21); h2->SetMarkerColor(3); ntuple->Draw("c:HV>>h3","limiar==30","prof"); h3->SetMarkerStyle(22); h3->SetMarkerColor(4); h1->Draw(); h2->Draw("same"); h3->Draw("same"); leg = new TLegend(0.8,0.5,0.9,0.4); leg->SetHeader("Limiar"); leg->AddEntry("h1","10mV 1550HV","p"); leg->AddEntry("h2","20mV 1640HV","p"); leg->AddEntry("h3","30mV 1680HV","p"); leg->SetFillColor(0); leg->Draw(); }