#include <TH2.h> #include <TStyle.h> #include <TCanvas.h> #include <iostream> #include "TCanvas.h" #include "TGraphErrors.h" #include "TF1.h" #include "TMath.h" #include "TChain.h" #include "TH1D.h" #include "string" #include "stdio.h" void plot(int layer, int x) { string num[15] = {"475"," 476" , "477" , " 487" , "488" ,"489" , "491" , "496" , "497", "500", "517", "525", "527", "528"}; string txt = ".txt"; for(int i=0;i<15;++i) { float mean, sigma, dummy; FILE *f; string tmp = num[i]+".txt"; f=fopen(tmp.c_str(), "r"); for(int j=0;j<18;++j) { char str1 [80]; char str2 [80]; char str3 [80]; char str4 [80]; char str5 [80]; char str6 [80]; char str7 [80]; char str8 [80]; fscanf(f,"%s %s %s %s %s %s %f %s %f %s %f", str1,str2,str3,str4,str5,str6, &mean, str7, &dummy, str8, &sigma); cout<<mean<<endl; } } return; }