Using the cosmic analysis task from the PWG1 library avoiding the compilation with...
[u/mrichter/AliRoot.git] / prod / acrcaf / qa / qa.C
CommitLineData
c2174181 1void qa(Int_t runNumber) {
2 TStopwatch timer;
3 timer.Start();
4
5 gEnv->SetValue("XSec.GSI.DelegProxy","2");
6 // Select ROOT version
7 TProof::Mgr("aliprod@alicecaf")->SetROOTVersion("v5-24-00b-caf");
8 // Login to CAF
9 TProof::Open("aliprod@alicecaf");
10
11 // Enable AliRoot
12 gProof->UploadPackage("/afs/cern.ch/alice/caf/sw/ALICE/PARs/v4-17-Release.rec/AF-v4-17-rec.par");
13 gProof->EnablePackage("AF-v4-17-rec.par");
14
a7ec3dd4 15 // Enable analysis libs
16 gSystem->Load("libANALYSIS.so");
17 gSystem->Load("libANALYSISalice.so");
13424c7e 18 gSystem->Load("libPWG1.so");
a7ec3dd4 19 gProof->Exec("gSystem->Load(\"libANALYSIS.so\");",kTRUE);
20 gProof->Exec("gSystem->Load(\"libANALYSISalice.so\");",kTRUE);
13424c7e 21 gProof->Exec("gSystem->Load(\"libPWG1.so\");",kTRUE);
c2174181 22
23 //____________________________________________//
24 // Make the analysis manager
25 AliAnalysisManager *mgr = new AliAnalysisManager("AnalysisQAManager");
26 AliESDInputHandler* esdH = new AliESDInputHandler();
27 mgr->SetInputEventHandler(esdH);
28 mgr->SetDebugLevel(10);
29
30 //____________________________________________//
31 // 1st Cosmic task
32 AliAnalysisTaskCosmic *task1 = new AliAnalysisTaskCosmic("TaskCosmic");
33 mgr->AddTask(task1);
34
35 // Create containers for input/output
36 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist1",TList::Class(),AliAnalysisManager::kOutputContainer,
37 Form("run%d.root",runNumber));
38
39 //____________________________________________//
40 mgr->ConnectInput (task1, 0, mgr->GetCommonInputContainer());
41 mgr->ConnectOutput (task1, 1, coutput1);
42
43 if (!mgr->InitAnalysis()) return;
44 mgr->PrintStatus();
45 mgr->StartAnalysis("proof",
a7ec3dd4 46 Form("/ALIREC/aliprod/run%d",runNumber));
c2174181 47
48 timer.Stop();
49 timer.Print();
50
51 plot(runNumber);
52}
53
54void plot(Int_t runNumber)
55{
56 TFile* f = new TFile(Form("run%d.root",runNumber), "read");
57
58 // pt, phi ....
59 TCanvas* c1 = new TCanvas("c1", "pt,eta,phi", 10, 10, 1100, 800);
60 c1->Divide(2,2);
61 c1->cd(1);
62 c1->GetPad(1)->SetLogy();
63
64 fhPtP = (TH1F*) chist1->FindObject("fhPtPC");
65 fhPtP->SetLineColor(2);
66 fhPtP->Draw();
67 fhPtN = (TH1F*) chist1->FindObject("fhPtNC");
68 fhPtN->SetLineColor(4);
69 fhPtN->Draw("same");
70
71 c1->cd(2);
72 fhPhiP = (TH1F*) chist1->FindObject("fhPhiPC");
73 fhPhiP->SetLineColor(2);
74 fhPhiP->Draw();
75 fhPhiN = (TH1F*) chist1->FindObject("fhPhiNC");
76 fhPhiN->SetLineColor(4);
77 fhPhiN->Draw("same");
78
79 c1->cd(3);
80 fhThetaP = (TH1F*) chist1->FindObject("fhThetaPC");
81 fhThetaP->SetLineColor(2);
82 fhThetaP->Draw();
83 fhThetaN = (TH1F*) chist1->FindObject("fhThetaNC");
84 fhThetaN->SetLineColor(4);
85 fhThetaN->Draw("same");
86
87
88 // delta phi
89 TCanvas* c2 = new TCanvas("c2", "#Delta#phi", 10, 10, 1100, 800);
90 c2->Divide(2,2);
91 // pos/neg charge
92 c2->cd(1);
93 c2->GetPad(1)->SetLogy();
94 fhDPhiP = (TH1F*) chist1->FindObject("fhDPhiPC");
95 fhDPhiN = (TH1F*) chist1->FindObject("fhDPhiNC");
96 fhDPhiP->SetLineColor(2);
97 fhDPhiN->SetLineColor(4);
98 fhDPhiP->SetXTitle("#Delta#phi [rad]");
99 fhDPhiP->Draw();
100 fhDPhiN->Draw("same");
101
102 // pos/neg z
103 c2->cd(2);
104 c2->GetPad(2)->SetLogy();
105
106 fhDPhiZP = (TH1F*) chist1->FindObject("fhDPhiPZ");
107 fhDPhiZN = (TH1F*) chist1->FindObject("fhDPhiNZ");
108 fhDPhiBA = (TH1F*) chist1->FindObject("fhDPhi_Bad");
109 fhDPhiZP->SetLineColor(2);
110 fhDPhiZN->SetLineColor(4);
111 fhDPhiBA->SetLineColor(6);
112
113 fhDPhiZP->SetXTitle("#Delta#phi [rad]");
114 fhDPhiZP->Draw();
115 fhDPhiZN->Draw("same");
116 // fhDPhiBA->Draw("same");
117
118
119 // delta theta
120 // pos/neg charge
121 c2->cd(3);
122 c2->GetPad(3)->SetLogy();
123 fhDThetaP = (TH1F*) chist1->FindObject("fhDThetaPC");
124 fhDThetaN = (TH1F*) chist1->FindObject("fhDThetaNC");
125 fhDThetaP->SetLineColor(2);
126 fhDThetaN->SetLineColor(4);
127
128
129 fhDThetaP->SetXTitle("#Delta#theta [rad]");
130 fhDThetaP->Draw();
131 fhDThetaN->Draw("same");
132
133 // pos/neg z
134 c2->cd(4);
135 c2->GetPad(4)->SetLogy();
136
137 fhDThetaZP = (TH1F*) chist1->FindObject("fhDThetaPZ");
138 fhDThetaZN = (TH1F*) chist1->FindObject("fhDThetaNZ");
139 fhDThetaBA = (TH1F*) chist1->FindObject("fhDTheta_Bad");
140 fhDThetaZP->SetLineColor(2);
141 fhDThetaZN->SetLineColor(4);
142 fhDThetaBA->SetLineColor(6);
143 fhDThetaZP->SetXTitle("#Delta#theta [rad]");
144 fhDThetaZP->Draw();
145
146 fhDThetaZN->Draw("same");
147 // fhDThetaBA->Draw("same");
148
149
150 // delta Pt
151 TCanvas* c3 = new TCanvas("c3", "#Delta p_{T}", 10, 10, 1100, 800);
152 c3->Divide(2,2);
153 // pos/neg charge
154 c3->cd(1);
155 c3->GetPad(1)->SetLogy();
156 fhDPtP = (TH1F*) chist1->FindObject("fhDPtPC");
157 fhDPtN = (TH1F*) chist1->FindObject("fhDPtNC");
158 fhDPtP->SetLineColor(2);
159 fhDPtN->SetLineColor(4);
160
161 fhDPtP->Draw();
162 fhDPtN->Draw("same");
163
164 // pos/neg z
165 c3->cd(2);
166 c3->GetPad(2)->SetLogy();
167
168 fhDPtZP = (TH1F*) chist1->FindObject("fhDPtPZ");
169 fhDPtZN = (TH1F*) chist1->FindObject("fhDPtNZ");
170 fhDPtZP->SetLineColor(2);
171 fhDPtZN->SetLineColor(4);
172 fhDPtZP->Draw();
173 fhDPtZN->Draw("same");
174
175 c3->cd(3);
176
177 fpDPtP = (TH1F*) chist1->FindObject("fpDPtPC");
178 fpDPtN = (TH1F*) chist1->FindObject("fpDPtNC");
179 fpDPtP->SetLineColor(2);
180 fpDPtN->SetLineColor(4);
181 fpDPtP->Draw();
182 fpDPtN->Draw("same");
183
184 c3->cd(4);
185
186 fpDPtZP = (TH1F*) chist1->FindObject("fpDPtPZ");
187 fpDPtZN = (TH1F*) chist1->FindObject("fpDPtNZ");
188 fpDPtZP->SetLineColor(2);
189 fpDPtZN->SetLineColor(4);
190 fpDPtZP->Draw();
191 fpDPtZN->Draw("same");
192
193
194 // dZ
195 TCanvas* c4 = new TCanvas("c4", "#Delta Z", 10, 10, 1100, 800);
196 c4->Divide(2,2);
197 // pos/neg charge
198 c4->cd(1);
199 c4->GetPad(1)->SetLogy();
200 fhDZP = (TH1F*) chist1->FindObject("fhDZPC");
201 fhDZN = (TH1F*) chist1->FindObject("fhDZNC");
202 fhDZP->SetLineColor(2);
203 fhDZN->SetLineColor(4);
204
205 fhDZP->Draw();
206 fhDZN->Draw("same");
207
208 // pos/neg z
209 c4->cd(2);
210 c4->GetPad(2)->SetLogy();
211
212 fhDZZP = (TH1F*) chist1->FindObject("fhDZPZ");
213 fhDZZN = (TH1F*) chist1->FindObject("fhDZNZ");
214 fhDZBA = (TH1F*) chist1->FindObject("fhDZ_Bad");
215
216 fhDZZP->SetLineColor(2);
217 fhDZZN->SetLineColor(4);
218 fhDZBA->SetLineColor(6);
219
220 fhDZZP->Draw();
221 fhDZZN->Draw("same");
222 fhDZBA->Draw("same");
223
224 // dX
225 // pos/neg charge
226 c4->cd(3);
227 c4->GetPad(3)->SetLogy();
228 fhDXP = (TH1F*) chist1->FindObject("fhDXPC");
229 fhDXN = (TH1F*) chist1->FindObject("fhDXNC");
230 fhDXP->SetLineColor(2);
231 fhDXN->SetLineColor(4);
232
233 fhDXP->Draw();
234 fhDXN->Draw("same");
235
236 // pos/neg z
237 c4->cd(4);
238 c4->GetPad(4)->SetLogy();
239
240 fhDXZP = (TH1F*) chist1->FindObject("fhDXPZ");
241 fhDXZN = (TH1F*) chist1->FindObject("fhDXNZ");
242 fhDXBA = (TH1F*) chist1->FindObject("fhDX_Bad");
243
244 fhDXZP->SetLineColor(2);
245 fhDXZN->SetLineColor(4);
246 fhDXBA->SetLineColor(6);
247
248 fhDXZP->Draw();
249 fhDXZN->Draw("same");
250 fhDXBA->Draw("same");
251
252 // dY
253 TCanvas* c4a = new TCanvas("c4a", "#Delta Y", 10, 10, 1100, 800);
254 c4a->Divide(2,2);
255 // pos/neg charge
256 c4a->cd(1);
257 c4a->GetPad(1)->SetLogy();
258 fhDYP = (TH1F*) chist1->FindObject("fhDYPC");
259 fhDYN = (TH1F*) chist1->FindObject("fhDYNC");
260 fhDYP->SetLineColor(2);
261 fhDYN->SetLineColor(4);
262
263 fhDYP->Draw();
264 fhDYN->Draw("same");
265
266 // pos/neg z
267 c4a->cd(2);
268 c4a->GetPad(2)->SetLogy();
269
270 fhDYZP = (TH1F*) chist1->FindObject("fhDYPZ");
271 fhDYZN = (TH1F*) chist1->FindObject("fhDYNZ");
272 fhDYBA = (TH1F*) chist1->FindObject("fhDY_Bad");
273
274 fhDYZP->SetLineColor(2);
275 fhDYZN->SetLineColor(4);
276 fhDYBA->SetLineColor(6);
277
278 fhDYZP->Draw();
279 fhDYZN->Draw("same");
280 fhDYBA->Draw("same");
281
282 // delta Pt
283 TCanvas* c5 = new TCanvas("c5", "#Delta p_{T} (n-sigma)", 10, 10, 1100, 800);
284 c5->Divide(2,2);
285 c5->cd(1);
286
287 fpDPtSP = (TH1F*) chist1->FindObject("fpDPtSPC");
288 fpDPtSN = (TH1F*) chist1->FindObject("fpDPtSNC");
289 fpDPtSP->SetLineColor(2);
290 fpDPtSN->SetLineColor(4);
291 fpDPtSP->Draw();
292 fpDPtSN->Draw("same");
293
294
295 c5->cd(2);
296
297 fpDPtSPZ = (TH1F*) chist1->FindObject("fpDPtSPZ");
298 fpDPtSNZ = (TH1F*) chist1->FindObject("fpDPtSNZ");
299 fpDPtSPZ->SetLineColor(2);
300 fpDPtSNZ->SetLineColor(4);
301 fpDPtSPZ->Draw();
302 fpDPtSNZ->Draw("same");
303
304 TCanvas* c6 = new TCanvas("c6", "Dz vs z", 10, 10, 1100, 800);
305 fhDZvsZ = (TH2F*) chist1->FindObject("fhDZvsZ");
306 fhDZvsZ->SetXTitle("z_{in} * sign(z_{in}) * sign(z_{out}) [cm]");
307 fhDZvsZ->SetYTitle("#DeltaZ [cm]");
308
309 gStyle->SetPalette(1);
310
311 fhDZvsZ->Draw("colz");
312}
313