#if 0 //#include //#include #include #include #include #include #include #include #include #include "RootHeader.h" #include "TTree.h" #include "TProfile.h" #include "TH1F.h" #include "TFile.h" #endif void raw_check() { TFile *f1=new TFile ("tagh_4.root","R"); TTree *t1= (TTree*)f1->Get("tree1"); Int_t nevent = t1->GetEntries(); cout << nevent << endl; TBranch *br_fadc_raw=t1->GetBranch("fadc_raw"); Int_t fadc_raw[2][16][100]; br_fadc_raw->SetAddress(&fadc_raw); gStyle->SetOptStat(1); TCanvas *c1 = new TCanvas("PS event view ","PS event view (run 357) ",1400.,600.); c1->Divide(8,3); TProfile *hfadc_raw[2][16]; for(Int_t bd = 0; bd < 2; bd++){ for(Int_t ch = 0; ch < 16; ch++){ char title[30]; sprintf(title,"fadc_raw%d_ch%d",bd,ch); hfadc_raw[bd][ch] = new TProfile(title,title,100,0.5,100.5,-10.,9000.); } } hfadc_raw[0][0]->SetFillColor(6); Int_t plot = 0; for(Int_t i = 0; i < nevent; i++){ plot = 1; br_fadc_raw->GetEntry(i); for(Int_t bd = 0; bd < 1; bd++){ for(Int_t ch = 0; ch < 16; ch++){ for(Int_t samp = 1; samp < 100; samp++){ hfadc_raw[bd][ch]->Fill(Float_t(samp),Float_t(fadc_raw[bd][ch][samp]),1.); } // Loop over samples } // Loop over channels } // Loop over boards if(plot) { // hfadc_raw[0][0]->SetMinimum(250); c1->cd(1); hfadc_raw[0][0]->Draw("histo"); c1->cd(2); hfadc_raw[0][1]->Draw("histo"); } if(plot) c1->Update(); // cout << i%10 << " " << i << endl; if(i%1000 == 0) cout << " Event number = " << i << endl; // if(i == 10){ // c1->SaveAs("ps_evend_disp.png"); // return(); // } if(plot) getchar(); for(Int_t bd = 0; bd < 1; bd++){ for(Int_t ch = 0; ch < 16; ch++){ hfadc_raw[bd][ch]->Reset(); } } f1->Close(); return; }