#include #include #include #include #include #include void ReadValues(){ ifstream in("outCombFinal.txt"); char buff[100]; double time, timeOld; double charge; double Pmean,Pin,Pout; int j = 0; TCanvas *can = new TCanvas(); can->Divide(2,2); TCanvas *can2 = new TCanvas(); can2->Divide(2,2); TH1F *ch = new TH1F("charge","charge",1000,0,100000); TH1F *dt = new TH1F("#Delta T events","#Delta T events",6000,-0.5,59999.5); TH1F *chan = new TH1F("channel","channel",128,-0.5,127.5); TH1F *avRate = new TH1F("AvRate","Average Rate",128,-0.5,127.5); TH2F *test = new TH2F("test","test",6000,0.,60000.,1000,0,500000); TH1F *mean = new TH1F("MeanPoint","MeanPoint",1280,-0.5,127.5); TH1F *distInOut = new TH1F("distInOut","distInOut",1280,0.,128.); TH1F *disp = new TH1F("disp","disp",1280,-64.,64.); Int_t check, channel; //11399.28547 91 11757 93.166316 94.78044646 91.55218553 //while (in.getline(buff,100)) //for (Int_t kk = 0 ; kk < 50000 ; kk++) while (in.getline(buff,100)) { // in.getline(buff,100); check = sscanf(buff,"%lf %d %le %lf %lf %lf",&time, &channel, &charge,&Pmean,&Pin,&Pout); //cout << buff << endl; // cout << "charge: " << charge << ", time: " << time << ",Pmean: " << Pmean << ", Pin: " << Pin << endl; if (j!=0) { ch->Fill(charge); if (time-timeOld!=0)dt->Fill(time-timeOld); if (time-timeOld!=0 && channel==7)test->Fill(time-timeOld,charge); chan->Fill(channel); mean->Fill(Pmean); distInOut->Fill(TMath::Abs(Pin-Pout)); disp->Fill(Pout-Pmean); } j++; timeOld=time; } can->cd(1); ch->Draw(); can->cd(2); dt->Draw(); can->cd(3); chan->Draw(); can->cd(4); chan->Copy(*avRate); avRate->Scale(1.e+9/(timeOld)); avRate->Draw(); can2->cd(); test->Draw("COLZ"); std::cout.precision(10); cout << "Last event time: " << timeOld <