1 #if !defined(__CINT__) || defined(__MAKECINT__)
6 #include "TClassTable.h"
7 #include <TStopwatch.h>
9 #include <TClassTable.h>
14 #include <TFunction.h>
20 void CheckPedestal(const char * histoFName = "ZDCPedHisto.root", Int_t optPlot = 1)
23 int const kNChannels = 24;
25 TFile * file = new TFile(histoFName, "READ");
27 TH1F::AddDirectory(0);
29 TH1F *hPedhg[kNChannels], *hPedOutOfTimehg[kNChannels];
30 TH2F *hPedCorrhg[kNChannels];
31 TH1F *hPedlg[kNChannels], *hPedOutOfTimelg[kNChannels];
32 TH2F *hPedCorrlg[kNChannels];
34 char namhist1hg[50], namhist2hg[50], namhist3hg[50];
35 char namhist1lg[50], namhist2lg[50], namhist3lg[50];
36 for(Int_t j=0; j<kNChannels; j++){
38 sprintf(namhist1hg,"PedZNChg_%d",j);
39 sprintf(namhist2hg,"PedZNChgOutOfTime_%d",j);
40 sprintf(namhist3hg,"PedCorrZNChg_%d",j);
42 sprintf(namhist1lg,"PedZNClg_%d",j);
43 sprintf(namhist2lg,"PedZNClgOutOfTime_%d",j);
44 sprintf(namhist3lg,"PedCorrZNClg_%d",j);
46 else if(j>=5 && j<=9){ // ZPC
47 sprintf(namhist1hg,"PedZPChg_%d",j-5);
48 sprintf(namhist2hg,"PedZPChgOutOfTime_%d",j-5);
49 sprintf(namhist3hg,"PedCorrZPChg_%d",j-5);
51 sprintf(namhist1lg,"PedZPClg_%d",j-5);
52 sprintf(namhist2lg,"PedZPClgOutOfTime_%d",j-5);
53 sprintf(namhist3lg,"PedCorrZPClg_%d",j-5);
55 else if(j==10 || j==11){ // ZEM
56 sprintf(namhist1hg,"PedZEMhg_%d",j-9);
57 sprintf(namhist2hg,"PedZEMhgOutOfTime_%d",j-9);
58 sprintf(namhist3hg,"PedCorrZEMhg_%d",j-9);
60 sprintf(namhist1lg,"PedZEMlg_%d",j-9);
61 sprintf(namhist2lg,"PedZEMlgOutOfTime_%d",j-9);
62 sprintf(namhist3lg,"PedCorrZEMlg_%d",j-9);
64 else if(j>=12 && j<=16){ // ZNA
65 sprintf(namhist1hg,"PedZNAhg_%d",j-12);
66 sprintf(namhist2hg,"PedZNAhgOutOfTime_%d",j-12);
67 sprintf(namhist3hg,"PedCorrZNAhg_%d",j-12);
69 sprintf(namhist1lg,"PedZNAlg_%d",j-12);
70 sprintf(namhist2lg,"PedZNAlgOutOfTime_%d",j-12);
71 sprintf(namhist3lg,"PedCorrZNAlg_%d",j-12);
73 else if(j>=17 && j<=21){ // ZPA
74 sprintf(namhist1hg,"PedZPAhg_%d",j-17);
75 sprintf(namhist2hg,"PedZPAhgOutOfTime_%d",j-17);
76 sprintf(namhist3hg,"PedCorrZPAhg_%d",j-17);
78 sprintf(namhist1lg,"PedZPAlg_%d",j-17);
79 sprintf(namhist2lg,"PedZPAlgOutOfTime_%d",j-17);
80 sprintf(namhist3lg,"PedCorrZPAlg_%d",j-17);
82 else if(j==22 || j==23){ //Reference PMs
83 sprintf(namhist1hg,"PedRefhg_%d",j-22);
84 sprintf(namhist2hg,"PedRefhgOutOfTime_%d",j-22);
85 sprintf(namhist3hg,"PedCorrRefhg_%d",j-22);
87 sprintf(namhist1lg,"PedReflg_%d",j-22);
88 sprintf(namhist2lg,"PedReflgOutOfTime_%d",j-22);
89 sprintf(namhist3lg,"PedCorrReflg_%d",j-22);
91 // --- High gain chain histos
92 hPedhg[j] = (TH1F*) file->Get(namhist1hg);
93 hPedOutOfTimehg[j] = (TH1F*) file->Get(namhist2hg);
94 hPedCorrhg[j] = (TH2F*) file->Get(namhist3hg);
95 // --- Low gain chain histos
96 hPedlg[j] = (TH1F*) file->Get(namhist1lg);
97 hPedOutOfTimelg[j] =(TH1F*) file->Get(namhist2lg);
98 hPedCorrlg[j] = (TH2F*) file->Get(namhist3lg);
102 // Plot the retrieved histos
103 //***********************************************************
104 // #### ROOT initialization
106 gStyle->SetCanvasColor(10);
107 gStyle->SetFrameFillColor(10);
108 gStyle->SetOptTitle(0);
109 gStyle->SetOptStat(1111);
110 gStyle->SetOptFit(111);
111 gStyle->SetTitleTextColor(9);
112 gStyle->SetStatTextColor(4);
113 gStyle->SetLineColor(1);
114 gStyle->SetPalette(1);
115 //***********************************************************
116 TCanvas *c6 = new TCanvas("c6","Side C correlations",0,200,1000,800);
118 for(Int_t t=0; t<10; t++){
120 hPedCorrhg[t]->Draw();
122 hPedCorrlg[t]->Draw();
124 c6->Print("CorrSideC.ps");
126 TCanvas *c7 = new TCanvas("c7","Side A correlations",300,200,1000,800);
128 for(Int_t t=0; t<10; t++){
130 hPedCorrhg[t+12]->Draw();
132 hPedCorrlg[t+12]->Draw();
134 c7->Print("CorrSideA.ps");
136 TCanvas *c8 = new TCanvas("c8","ZEM correlations",400,200,400,400);
138 for(Int_t t=0; t<2; t++){
140 hPedCorrhg[t+10]->Draw();
142 hPedCorrlg[t+10]->Draw();
144 c8->Print("CorrZEM.ps");
145 //***********************************************************
146 TCanvas *c1 = new TCanvas("c1","ZNC pedestals",0,0,1000,400);
148 for(Int_t y=0; y<5; y++){
154 c1->Print("ZNCPed.ps");
156 TCanvas *c2 = new TCanvas("c2","ZPC pedestals",300,0,1000,400);
158 for(Int_t y=0; y<5; y++){
164 c2->Print("ZPCPed.ps");
166 TCanvas *c3 = new TCanvas("c3","ZEM pedestals",400,0,400,400);
168 for(Int_t y=0; y<2; y++){
170 hPedhg[y+10]->Draw();
172 hPedlg[y+10]->Draw();
174 c3->Print("ZEMPed.ps");
176 TCanvas *c4 = new TCanvas("c4","ZNA pedestals",0,400,1000,400);
178 for(Int_t y=0; y<5; y++){
180 hPedhg[y+12]->Draw();
182 hPedlg[y+12]->Draw();
184 c4->Print("ZNAPed.ps");
186 TCanvas *c5 = new TCanvas("c5","ZPA pedestals",300,400,1000,400);
188 for(Int_t y=0; y<5; y++){
190 hPedhg[y+17]->Draw();
192 hPedlg[y+17]->Draw();
194 c5->Print("ZPAPed.ps");