void provaeffplateau() { // // To see the output of this macro, click here. // gROOT->Reset(); c1 = new TCanvas("c1","Efficiency plateau",200,10,700,500); c1->SetFillColor(0); c1->SetGrid(); c1->GetFrame()->SetFillColor(21); c1->GetFrame()->SetBorderSize(12); //string fileName = "../data/thscan.dat"; //char* fileName = "../data/hvscan.dat"; char* fileName = "hvscan.dat"; ifstream inputFile; //inputFile.open("../data/thscan.dat"); inputFile.open(fileName); Int_t nP = 0; Float_t x[100]; Float_t dx[100]; Float_t eff_v[100]; Float_t deff_v[100]; while (1) { Float_t vth = 0; Float_t triple = 0.; Float_t quadruple = 0; Float_t singole = 0.; inputFile >> vth >> triple >> quadruple >> singole; if (!inputFile.good()) break; Float_t eff = quadruple/triple; Float_t deff = sqrt(eff*(1.-eff)/triple); cout<<"reading from file "<SetTitle("scintillatore n. xxx - discrimination thr. 18 mV"); gr->SetMarkerColor(4); gr->SetMarkerStyle(21); gr->GetXaxis()->SetTitle("HV / kV"); gr->GetYaxis()->SetTitle("efficiency"); //gr->Draw("ALP"); gr->Draw("AP"); c1->Update(); }