AlcapDAQ  1
plot_peds.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 
15  TH1 *py = samples->ProjectionY(title,i,i);
16  sprintf(title, "Channel %d", i-1);
17  py->SetTitle(title);
18  py->GetXaxis()->SetRange(py->GetMean()-9*py->GetRMS(), py->GetMean()+9*py->GetRMS());
19  py->Draw("E1");
20  py->Fit("gaus","LR","SAME",py->GetMean()-9*py->GetRMS(), py->GetMean()+9*py->GetRMS());
21  Int_t x_min = 2800 ;
22  Int_t x_max = 2814 ;
23  py->Fit("gaus","","",x_min, x_max);
24  }
25 
26 }