TENDER becomes Tender
[u/mrichter/AliRoot.git] / PWGPP / analysisQA / processHFEQAtask.C
CommitLineData
948b38b2 1/***************************************************************
2 processHFEQAtask:
3
4 Post Processing of HF QA task in Analysis QA train
5
6 Modification Done // sjena
7 To save file and putting an unique naming convention
8
9***************************************************************/
10
11void processHFEQAtask(const char *fnamedata = "AnalysisResults.root",
12 TString suffix = "eps",
13 const char * outfile = "HFEQAtask_output.root") {
14
15 const char *fnamedir = "t131073f16s0p1TPC110r60p80ITS4Pi2DCAr100z200TOF30TPCe50V0D2er8i0t-20t50";
16 const char *fnamelist = "list_t131073f16s0p1TPC110r60p80ITS4Pi2DCAr100z200TOF30TPCe50V0D2er8i0t-20t50";
17
18
19 gSystem->Load("libANALYSIS.so");
20 gSystem->Load("libANALYSISalice.so");
21 gSystem->Load("libCORRFW.so");
af472fff 22 gSystem->Load("libTender.so");
948b38b2 23 gSystem->Load("libPWGPP.so");
24 gSystem->Load("libPWGflowBase.so");
25 gSystem->Load("libPWGflowTasks.so");
26 gSystem->Load("libPWGHFhfe.so");
27
28
29 gStyle->SetPalette(1);
30 gStyle->SetOptStat(1111);
31 gStyle->SetPadBorderMode(0);
32 gStyle->SetCanvasColor(10);
33 gStyle->SetPadLeftMargin(0.13);
34 gStyle->SetPadRightMargin(0.13);
35 gStyle->SetPadBottomMargin(0.13);
36 gStyle->SetPadTopMargin(0.13);
37
38
39 //////////////////////
40 // Data
41 //////////////////////
42 TFile *indata = TFile::Open(fnamedata);
43 indata->ls();
44 TDirectoryFile *d = (TDirectoryFile *) indata->Get(fnamedir);
45
46 if(!d) {
47 Printf("FATAL: %s : Not found", fnamedir);
48 Printf("Exiting <<<<<<<<<<<<<<<< processHFEQAtask >>>>>>>>>>>>>");
49 return;
50 }
51
52 TList *qadata = (TList *) d->Get(fnamelist);
53
54
55 if(!qadata) {
56 Printf("FATAL: %s : Not found", fnamelist);
57 Printf("Exiting <<<<<<<<<<<<<<<< processHFEQAtask >>>>>>>>>>>>>");
58 return;
59 }
60
61
62
63 TList *qaadata = (TList *)qadata->FindObject("HFEpidQA");
64
65 if(!qaadata) {
66 Printf("FATAL: HFEpidQA Not found");
67 Printf("Exiting <<<<<<<<<<<<<<<< processHFEQAtask >>>>>>>>>>>>>");
68 return;
69 }
70
71
72 // Make Plots for TPC
73 AliHFEtpcPIDqa *tpcqadata = (AliHFEtpcPIDqa *)qaadata->FindObject("TPCQA");
74 AliHFEcollection *collectiontpc = tpcqadata->GetHistograms();
75 THnSparseF *tpcsparseF = (THnSparseF *) collectiontpc->Get("tpcnSigma");
76
77 // Make Plots for TOF
78 AliHFEtofPIDqa *tofqadata = (AliHFEtofPIDqa *)qaadata->FindObject("TOFQA");
79 AliHFEcollection *collectiontof = tofqadata->GetHistoCollection();
80 THnSparseF *tofsparseF = (THnSparseF *) collectiontof->Get("tofnSigma");
81 THnSparseF *toftpcsparseF = (THnSparseF *) collectiontof->Get("tofMonitorTPC");
82
83
84 ////////////////
85 // Projection
86 /////////////////
87
88 TAxis *pidaxistpc = tpcsparseF->GetAxis(0);
89 TAxis *pidaxistof = tofsparseF->GetAxis(0);
90 TAxis *pidaxistoftpc = toftpcsparseF->GetAxis(0);
91
92 TAxis *stepaxistpc = tpcsparseF->GetAxis(3);
93 TAxis *stepaxistof = tofsparseF->GetAxis(3);
94 TAxis *stepaxistoftpc = toftpcsparseF->GetAxis(3);
95
96 TAxis *centralityaxistpc = tpcsparseF->GetAxis(4);
97 TAxis *centralityaxistof = tofsparseF->GetAxis(4);
98 TAxis *centralityaxistoftpc = toftpcsparseF->GetAxis(4);
99
100 stepaxistpc->SetRange(1,1);
101 stepaxistof->SetRange(1,1);
102 stepaxistoftpc->SetRange(2,2);
103
104 Int_t nbinsc = centralityaxistpc->GetNbins();
105 printf("There are %d centrality bins \n",nbinsc);
106
107
108 //
109 centralityaxistpc->SetRange(8,9);
110 centralityaxistof->SetRange(8,9);
111 centralityaxistoftpc->SetRange(8,9);
112 stepaxistoftpc->SetRange(1,1);
113 TH2D *toftpc2Dsumper = toftpcsparseF->Projection(2,1);
114 toftpc2Dsumper->SetName("toftpc2Dsumper_21");
115 TH2D *tof2Dsumper = tofsparseF->Projection(2,1);
116 tof2Dsumper->SetName("tof2Dsumper_21");
117
118 stepaxistof->SetRange(2,2);
119 TH2D *tof2Dsumbper = tofsparseF->Projection(2,1);
120 tof2Dsumbper->SetName("tof2Dsumbper_21");
121
122 TH2D *tpc2Dsumper = tpcsparseF->Projection(2,1);
123 tpc2Dsumper->SetName("toftpc2Dsumper_21");
124
125 stepaxistpc->SetRange(2,2);
126 TH2D *tpc2Dsumbper = tpcsparseF->Projection(2,1);
127 tpc2Dsumbper->SetName("tpc2Dsumbper_21");
128
129 //
130 centralityaxistpc->SetRange(0,1);
131 centralityaxistof->SetRange(0,1);
132 centralityaxistoftpc->SetRange(0,1);
133 stepaxistpc->SetRange(1,1);
134 stepaxistof->SetRange(1,1);
135 stepaxistoftpc->SetRange(1,1);
136 TH2D *toftpc2Dsumc = toftpcsparseF->Projection(2,1);
137 toftpc2Dsumc->SetName("toftpc2Dsumc_21");
138
139 TH2D *tof2Dsumc = tofsparseF->Projection(2,1);
140 tof2Dsumc->SetName("tof2Dsumc_21");
141
142 stepaxistof->SetRange(2,2);
143
144 TH2D *tof2Dsumbc = tofsparseF->Projection(2,1);
145 tof2Dsumbc->SetName("tof2Dsumbc_21");
146
147 TH2D *tpc2Dsumc = tpcsparseF->Projection(2,1);
148 tpc2Dsumc->SetName("tpc2Dsumc_21");
149
150 stepaxistpc->SetRange(2,2);
151 TH2D *tpc2Dsumbc = tpcsparseF->Projection(2,1);
152 tpc2Dsumbc->SetName("tpc2Dsumbc_21");
153
154
155 ///////////////
156 // Plots
157 ///////////////
158
159 //added by sjena
160 TFile *fout = TFile::Open(outfile,"UPDATE");
161 fout->ls();
162
163 TDirectoryFile *cdd = NULL;
164 cdd = (TDirectoryFile*)fout->Get("HF");
165 if(!cdd) {
166 Printf("Warning: HF <dir> doesn't exist, creating a new one");
167 cdd = (TDirectoryFile*)fout->mkdir("HF");
168 }
169 cdd->cd();
170 cdd->ls();
171
172
173
174 // Draw Plots
175 TCanvas *cElectronsTPCper = new TCanvas("ElectronTPCPID_70-90%", "ElectronTPCPID_70-90%");
176 cElectronsTPCper->Divide(3,1);
177 cElectronsTPCper->cd(1);
178 gPad->SetLogz();
179 gPad->SetLogx();
180 gPad->SetTicks();
181 tof2Dsumper->SetStats(0);
182 tof2Dsumper->SetTitle("TOF 70-90% Pb-Pb");
183 tof2Dsumper->GetXaxis()->SetTitle("p_{t} (GeV/c)");
184 tof2Dsumper->GetYaxis()->SetTitle("TOF time_{e} - expected time|_{e} (#sigma)");
185 tof2Dsumper->GetXaxis()->SetRangeUser(0.3,10.0);
186 tof2Dsumper->GetXaxis()->SetTitleSize(0.05);
187 tof2Dsumper->GetYaxis()->SetTitleSize(0.05);
188 tof2Dsumper->Draw("colz");
189
190 //Added By Satya
191 tof2Dsumper->SetName(Form("fig_hf_1_%s", tof2Dsumper->GetName()));
192 tof2Dsumper->Write();
193
194 cElectronsTPCper->cd(2);
195 gPad->SetLogz();
196 gPad->SetLogx();
197 gPad->SetTicks();
198 tof2Dsumbper->SetStats(0);
199 tof2Dsumbper->SetTitle("TOF cut 70-90% Pb-Pb");
200 tof2Dsumbper->GetXaxis()->SetTitle("p_{t} (GeV/c)");
201 tof2Dsumbper->GetYaxis()->SetTitle("TOF time_{e} - expected time|_{e} (#sigma)");
202 tof2Dsumbper->GetXaxis()->SetRangeUser(0.3,10.0);
203 tof2Dsumbper->GetXaxis()->SetTitleSize(0.05);
204 tof2Dsumbper->GetYaxis()->SetTitleSize(0.05);
205 tof2Dsumbper->Draw("colz");
206
207
208 //Added By Satya
209 tof2Dsumbper->SetName(Form("fig_hf_2_%s", tof2Dsumbper->GetName()));
210 tof2Dsumbper->Write();
211
212 cElectronsTPCper->cd(3);
213 gPad->SetLogz();
214 gPad->SetLogx();
215 gPad->SetTicks();
216 tpc2Dsumper->SetStats(0);
217 tpc2Dsumper->SetTitle("TPC 70-90% Pb-Pb");
218 tpc2Dsumper->GetXaxis()->SetTitle("p_{t} (GeV/c)");
219 tpc2Dsumper->GetYaxis()->SetTitle("TPC dE/dx - expected dE/dx|_{e} (#sigma)");
220 tpc2Dsumper->GetXaxis()->SetRangeUser(0.3,10.0);
221 tpc2Dsumper->GetXaxis()->SetTitleSize(0.05);
222 tpc2Dsumper->GetYaxis()->SetTitleSize(0.05);
223 tpc2Dsumper->Draw("colz");
224 //Added by satya
225
226
227 tpc2Dsumper->SetName(Form("fig_hf_3_%s", tpc2Dsumper->GetName()));
228 tpc2Dsumper->Write();
229
230 cElectronsTPCper->SaveAs(Form("fig_hf_ElectronTPCPID_70-90.%s",suffix.Data()));
231
232
233
234 TCanvas *cElectronsTPCc = new TCanvas("ElectronTPCPID_0-10%", "ElectronTPCPID_0-10%");
235 cElectronsTPCc->Divide(3,1);
236 cElectronsTPCc->cd(1);
237 gPad->SetLogz();
238 gPad->SetLogx();
239 gPad->SetTicks();
240 tof2Dsumc->SetStats(0);
241 tof2Dsumc->SetTitle("TOF 0-10% Pb-Pb");
242 tof2Dsumc->GetXaxis()->SetTitle("p_{t} (GeV/c)");
243 tof2Dsumc->GetYaxis()->SetTitle("TOF time_{e} - expected time|_{e} (#sigma)");
244 tof2Dsumc->GetXaxis()->SetRangeUser(0.3,10.0);
245 tof2Dsumc->GetXaxis()->SetTitleSize(0.05);
246 tof2Dsumc->GetYaxis()->SetTitleSize(0.05);
247 tof2Dsumc->Draw("colz");
248
249 tof2Dsumc->SetName(Form("fig_hf_4_%s", tof2Dsumc->GetName()));
250 tof2Dsumc->Write();
251
252 cElectronsTPCc->cd(2);
253 gPad->SetLogz();
254 gPad->SetLogx();
255 gPad->SetTicks();
256 tof2Dsumbc->SetStats(0);
257 tof2Dsumbc->SetTitle("TOF cut 0-10% Pb-Pb");
258 tof2Dsumbc->GetXaxis()->SetTitle("p_{t} (GeV/c)");
259 tof2Dsumbc->GetYaxis()->SetTitle("TOF time_{e} - expected time|_{e} (#sigma)");
260 tof2Dsumbc->GetXaxis()->SetRangeUser(0.3,10.0);
261 tof2Dsumbc->GetXaxis()->SetTitleSize(0.05);
262 tof2Dsumbc->GetYaxis()->SetTitleSize(0.05);
263 tof2Dsumbc->Draw("colz");
264
265 tof2Dsumbc->SetName(Form("fig_hf_5_%s", tof2Dsumbc->GetName()));
266 tof2Dsumbc->Write();
267
268 cElectronsTPCc->cd(3);
269 gPad->SetLogz();
270 gPad->SetLogx();
271 gPad->SetTicks();
272 tpc2Dsumc->SetStats(0);
273 tpc2Dsumc->SetTitle("TPC 0-10% Pb-Pb");
274 tpc2Dsumc->GetXaxis()->SetTitle("p_{t} (GeV/c)");
275 tpc2Dsumc->GetYaxis()->SetTitle("TPC dE/dx - expected dE/dx|_{e} (#sigma)");
276 tpc2Dsumc->GetXaxis()->SetRangeUser(0.3,10.0);
277 tpc2Dsumc->GetXaxis()->SetTitleSize(0.05);
278 tpc2Dsumc->GetYaxis()->SetTitleSize(0.05);
279 tpc2Dsumc->Draw("colz");
280 // Added by satya
281
282 tpc2Dsumc->SetName(Form("fig_hf_6_%s", tpc2Dsumc->GetName()));
283 tpc2Dsumc->Write();
284
285 cElectronsTPCc->SaveAs(Form("fig_hf_ElectronTPCPID_0-10.%s",suffix.Data()));
286
287 fout->Close();
288
289
290}