AlcapDAQ  1
plot_ped.c
Go to the documentation of this file.
1 {
2 char title[80];
3 gROOT->SetStyle("Plain");
4 gStyle->SetOptStat(0);
5 gStyle->SetOptFit(1111);
6 TCanvas *c1 = new TCanvas();
7 c1->Divide(4,2);
8 for(int i = 1; i <= 8; i++) {
9  c1->cd(i);
10  TF1 *gaus = (TF1*)gROOT->GetFunction("gaus");
11  gaus->SetLineColor(kRed);
12  gaus->SetLineWidth(1);
13  sprintf(title, "py%d", i);
14  TH1 *py = samples->ProjectionY(title,i,i);
15  sprintf(title, "Channel %d", i-1);
16  py->SetTitle(title);
17  py->GetXaxis()->SetRange(py->GetMean()-9*py->GetRMS(), py->GetMean()+9*py->GetRMS());
18  py->Draw("E1");
19  py->Fit("gaus","LR","SAME",py->GetMean()-9*py->GetRMS(), py->GetMean()+9*py->GetRMS());
20 }
21 
22 }