void testShowCFD() { gSystem->Load("../libData.so"); const Long64_t kFirstEvent = 133; const char *foldername = "nustar_present"; const char *ext = ".pdf"; // TFile fr("../data/dataDSR4/analysis_08_2_CFD02_06.root"); // TFile fr("../data/dataDSR4/analysis_08_2.root"); TFile fr("../data/dataDSR4/analysis_08_2_smooth.root"); TTree *tr = (TTree*)fr.Get("atree"); AEvent *revent = new AEvent(); tr->SetBranchAddress("Ach0.",&revent); TGraph *gr[12]; //loop over events for (Int_t i = 0; i < 12; i++) { gr[i] = 0; tr->GetEntry(i+kFirstEvent); gr[i] = new TGraph(*revent->GetGraphCFD()); }//for over events TCanvas *c1 = new TCanvas("c1","CFD implementation",10,10,1000,600); // four event picture /* c1->Divide(2,2); for (Int_t i = 0; i < 4; i++) { c1->cd(i+1); gr[i]->GetXaxis()->SetRangeUser(130, 175); gr[i]->GetXaxis()->SetTitle("Time [ns]"); gr[i]->GetXaxis()->CenterTitle(); gr[i]->GetYaxis()->SetTitle("Signal CFD [V]"); gr[i]->GetYaxis()->CenterTitle(); gr[i]->Draw("AL*"); } c1->Print(Form("../macros/picsDRS4/%s/Signal_shapes_CFD%s", foldername, ext));*/ //one event picture gr[2]->GetXaxis()->SetRangeUser(130, 160); gr[2]->GetXaxis()->SetTitle("Time [ns]"); gr[2]->GetXaxis()->CenterTitle(); gr[2]->GetYaxis()->SetTitle("Signal [V]"); gr[2]->GetYaxis()->CenterTitle(); gr[2]->Draw("AL*"); //f1->SetRange(t10[2], t90[2]); //gr[2]->Fit(f1, "RQ"); c1->Print(Form("../macros/picsDRS4/%s/CFD_one_signal_shape%s", foldername, ext)); // c1->cd(2); // tr->Draw("gAmp.Draw()","","goff",1,124); }