#include #include #include #include #include #include "TStyle.h" void testShowSmooth() { gSystem->Load("../libData.so"); const Long64_t kFirstEvent = 128; TFile fr("../data/dataDSR4/analysis_07_1.root"); TTree *tr = (TTree*)fr.Get("atree"); AEvent *revent = new AEvent(); tr->SetBranchAddress("Ach0.",&revent); TGraph *grs[12]; //smoothed graphs TGraph *gr[12]; //normal graphs for (Long64_t i = 0; i < 12; i++) { grs[i] = 0; gr[i] = 0; tr->GetEntry(i+kFirstEvent); grs[i] = new TGraph(*revent->GetGraphSmooth()); gr[i] = new TGraph(*revent->GetGraphSignal()); } TCanvas *c1 = new TCanvas("c1","smoothed graphs",10,10,1000,600); c1->Divide(2,2); for (Int_t k = 0; k < 4; k++) { c1->cd(k+1); grs[k]->GetXaxis()->SetTitle("Time [ns]"); grs[k]->GetXaxis()->CenterTitle(); grs[k]->GetYaxis()->SetTitle("Amplitude [V]"); grs[k]->GetYaxis()->CenterTitle(); grs[k]->GetXaxis()->SetRangeUser(120, 160); grs[k]->SetMarkerStyle(7); grs[k]->Draw(""); //gr[k]->SetMarkerColor(2); //gr[k]->Draw(""); } TCanvas *c2 = new TCanvas("c2","non-smoothed graphs",10,10,1000,600); c2->Divide(2,2); for (Int_t k = 0; k < 4; k++) { c2->cd(k+1); gr[k]->GetXaxis()->SetTitle("Time [ns]"); gr[k]->GetXaxis()->CenterTitle(); gr[k]->GetYaxis()->SetTitle("Amplitude [V]"); gr[k]->GetYaxis()->CenterTitle(); gr[k]->GetXaxis()->SetRangeUser(120, 160); gr[k]->SetMarkerStyle(7); gr[k]->Draw(""); //gr[k]->SetMarkerColor(2); //gr[k]->Draw(""); } }