Avoid extrusion by HALL.
[u/mrichter/AliRoot.git] / ZDC / CheckLaser.C
CommitLineData
ec1b5578 1#if !defined(__CINT__) || defined(__MAKECINT__)
2
3#include <TROOT.h>
4#include <TStyle.h>
5#include <Riostream.h>
6#include "TClassTable.h"
7#include <TStopwatch.h>
8#include <TDatime.h>
9#include <TClassTable.h>
10#include <TH1.h>
11#include <TH2.h>
12#include <TF1.h>
13#include <TProfile.h>
14#include <TFunction.h>
15#include <TCanvas.h>
16#include <TFile.h>
17
18#endif
19
20void CheckLaser(const char * histoFName = "ZDCLaserHisto.root", Int_t optPlot = 1)
21{
22
ec1b5578 23 TFile * file = new TFile(histoFName, "READ");
24 file->cd();
25 TH1F::AddDirectory(0);
26 //
27 // --- Histos for reference PMTs (high gain chains)
28 TH1F *hPMRefChg = new TH1F("hPMRefChg","hPMRefChg", 100,0.,1000.);
29 TH1F *hPMRefAhg = new TH1F("hPMRefAhg","hPMRefAhg", 100,0.,1000.);
30 TH1F *hPMRefClg = new TH1F("hPMRefClg","hPMRefClg", 100,0.,4000.);
31 TH1F *hPMRefAlg = new TH1F("hPMRefAlg","hPMRefAlg", 100,0.,4000.);
32 //
13f5f39d 33 hPMRefChg = (TH1F*) file->Get("hPMRefChg");
34 hPMRefAhg = (TH1F*) file->Get("hPMRefAhg");
35 hPMRefClg = (TH1F*) file->Get("hPMRefClg");
36 hPMRefAlg = (TH1F*) file->Get("hPMRefAlg");
ec1b5578 37 // --- Histos for detector PMTs
38 TH1F *hZNChg[5], *hZPChg[5], *hZNAhg[5], *hZPAhg[5], *hZEMhg[2];
39 TH1F *hZNClg[5], *hZPClg[5], *hZNAlg[5], *hZPAlg[5], *hZEMlg[2];
40 char hnamZNChg[20], hnamZPChg[20], hnamZNAhg[20], hnamZPAhg[20];
41 char hnamZNClg[20], hnamZPClg[20], hnamZNAlg[20], hnamZPAlg[20];
42 char hnamZEMhg[20], hnamZEMlg[20];
43 for(Int_t j=0; j<5; j++){
44 sprintf(hnamZNChg,"ZNChg-tow%d",j);
45 sprintf(hnamZPChg,"ZPChg-tow%d",j);
46 sprintf(hnamZNAhg,"ZNAhg-tow%d",j);
47 sprintf(hnamZPAhg,"ZPAhg-tow%d",j);
48 //
49 hZNChg[j] = new TH1F(hnamZNChg, hnamZNChg, 100, 0., 1000.);
50 hZPChg[j] = new TH1F(hnamZPChg, hnamZPChg, 100, 0., 1000.);
51 hZNAhg[j] = new TH1F(hnamZNAhg, hnamZNAhg, 100, 0., 1000.);
52 hZPAhg[j] = new TH1F(hnamZPAhg, hnamZPAhg, 100, 0., 1000.);
53 //
54 sprintf(hnamZNClg,"ZNClg-tow%d",j);
55 sprintf(hnamZPClg,"ZPClg-tow%d",j);
56 sprintf(hnamZNAlg,"ZNAlg-tow%d",j);
57 sprintf(hnamZPAlg,"ZPAlg-tow%d",j);
58 //
59 hZNClg[j] = new TH1F(hnamZNClg, hnamZNClg, 100, 0., 4000.);
60 hZPClg[j] = new TH1F(hnamZPClg, hnamZPClg, 100, 0., 4000.);
61 hZNAlg[j] = new TH1F(hnamZNAlg, hnamZNAlg, 100, 0., 4000.);
62 hZPAlg[j] = new TH1F(hnamZPAlg, hnamZPAlg, 100, 0., 4000.);
63 //
64 if(j<2){
65 sprintf(hnamZEMhg,"ZEM%dhg",j);
66 sprintf(hnamZEMlg,"ZEM%dlg",j);
67 //
68 hZEMhg[j] = new TH1F(hnamZEMhg, hnamZEMhg, 100, 0., 1000.);
69 hZEMlg[j] = new TH1F(hnamZEMlg, hnamZEMlg, 100, 0., 4000.);
70 }
13f5f39d 71 //
72 hZNChg[j] = (TH1F*) file->Get(hnamZNChg);
73 hZPChg[j] = (TH1F*) file->Get(hnamZPChg);
74 hZNAhg[j] = (TH1F*) file->Get(hnamZNAhg);
75 hZPAhg[j] = (TH1F*) file->Get(hnamZPAhg);
76 //
77 hZNClg[j] = (TH1F*) file->Get(hnamZNClg);
78 hZPClg[j] = (TH1F*) file->Get(hnamZPClg);
79 hZNAlg[j] = (TH1F*) file->Get(hnamZNAlg);
80 hZPAlg[j] = (TH1F*) file->Get(hnamZPAlg);
81
82
ec1b5578 83 }
84
85 if(optPlot==1){
86 // Plot the retrieved histos
87 //***********************************************************
88 // #### ROOT initialization
89 gROOT->Reset();
90 gStyle->SetCanvasColor(10);
91 gStyle->SetFrameFillColor(10);
92 gStyle->SetOptTitle(0);
93 gStyle->SetOptStat(1111);
94 gStyle->SetOptFit(111);
95 gStyle->SetTitleTextColor(9);
96 gStyle->SetStatTextColor(4);
97 gStyle->SetLineColor(1);
98 gStyle->SetPalette(1);
99 //***********************************************************
100 TCanvas *c1 = new TCanvas("c1","ZNC",0,0,1000,400);
101 c1->Divide(5,2);
102 for(Int_t y=0; y<5; y++){
103 c1->cd(y+1);
104 hZNChg[y]->Draw();
105 c1->cd(y+6);
106 hZNClg[y]->Draw();
107 }
108 c1->Print("ZNCLaser.ps");
109 //
110 TCanvas *c2 = new TCanvas("c2","ZPC",300,0,1000,400);
111 c2->Divide(5,2);
112 for(Int_t y=0; y<5; y++){
113 c2->cd(y+1);
114 hZPChg[y]->Draw();
115 c2->cd(y+6);
116 hZPClg[y]->Draw();
117 }
118 c2->Print("ZPCLaser.ps");
119 //
120 TCanvas *c3 = new TCanvas("c3","ZEM",400,0,400,400);
121 c3->Divide(2,2);
122 for(Int_t y=0; y<2; y++){
123 c3->cd(y+1);
124 hZEMhg[y]->Draw();
125 c3->cd(y+3);
126 hZEMlg[y]->Draw();
127 }
128 c3->Print("ZEMLaser.ps");
129 //
130 TCanvas *c4 = new TCanvas("c4","ZNA",0,400,1000,400);
131 c4->Divide(5,2);
132 for(Int_t y=0; y<5; y++){
133 c4->cd(y+1);
134 hZNAhg[y]->Draw();
135 c4->cd(y+6);
136 hZNAlg[y]->Draw();
137 }
138 c4->Print("ZNALaser.ps");
139 //
140 TCanvas *c5 = new TCanvas("c5","ZPA",300,400,1000,400);
141 c5->Divide(5,2);
142 for(Int_t y=0; y<5; y++){
143 c5->cd(y+1);
144 hZPAhg[y]->Draw();
145 c5->cd(y+6);
146 hZPAlg[y]->Draw();
147 }
148 c5->Print("ZPALaser.ps");
13f5f39d 149 //
150 TCanvas *c6 = new TCanvas("c6","Ref",400,0,400,400);
151 c6->Divide(2,2);
152 c6->cd(1);
153 hPMRefChg->Draw();
154 c6->cd(2);
155 hPMRefAhg->Draw();
156 c6->cd(3);
157 hPMRefClg->Draw();
158 c6->cd(4);
159 hPMRefAlg->Draw();
160 //
161 c6->Print("RefLaser.ps");
ec1b5578 162 }
163}