1 /***************************************************************
4 Post Processing of HF QA task in Analysis QA train
6 Modification Done // sjena
7 To save file and putting an unique naming convention
9 ***************************************************************/
11 void processHFEQAtask(const char *fnamedata = "AnalysisResults.root",
12 TString suffix = "eps",
13 const char * outfile = "HFEQAtask_output.root") {
15 const char *fnamedir = "t131073f16s0p1TPC110r60p80ITS4Pi2DCAr100z200TOF30TPCe50V0D2er8i0t-20t50";
16 const char *fnamelist = "list_t131073f16s0p1TPC110r60p80ITS4Pi2DCAr100z200TOF30TPCe50V0D2er8i0t-20t50";
19 gSystem->Load("libANALYSIS.so");
20 gSystem->Load("libANALYSISalice.so");
21 gSystem->Load("libCORRFW.so");
22 gSystem->Load("libTENDER.so");
23 gSystem->Load("libPWGPP.so");
24 gSystem->Load("libPWGflowBase.so");
25 gSystem->Load("libPWGflowTasks.so");
26 gSystem->Load("libPWGHFhfe.so");
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);
39 //////////////////////
41 //////////////////////
42 TFile *indata = TFile::Open(fnamedata);
44 TDirectoryFile *d = (TDirectoryFile *) indata->Get(fnamedir);
47 Printf("FATAL: %s : Not found", fnamedir);
48 Printf("Exiting <<<<<<<<<<<<<<<< processHFEQAtask >>>>>>>>>>>>>");
52 TList *qadata = (TList *) d->Get(fnamelist);
56 Printf("FATAL: %s : Not found", fnamelist);
57 Printf("Exiting <<<<<<<<<<<<<<<< processHFEQAtask >>>>>>>>>>>>>");
63 TList *qaadata = (TList *)qadata->FindObject("HFEpidQA");
66 Printf("FATAL: HFEpidQA Not found");
67 Printf("Exiting <<<<<<<<<<<<<<<< processHFEQAtask >>>>>>>>>>>>>");
73 AliHFEtpcPIDqa *tpcqadata = (AliHFEtpcPIDqa *)qaadata->FindObject("TPCQA");
74 AliHFEcollection *collectiontpc = tpcqadata->GetHistograms();
75 THnSparseF *tpcsparseF = (THnSparseF *) collectiontpc->Get("tpcnSigma");
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");
88 TAxis *pidaxistpc = tpcsparseF->GetAxis(0);
89 TAxis *pidaxistof = tofsparseF->GetAxis(0);
90 TAxis *pidaxistoftpc = toftpcsparseF->GetAxis(0);
92 TAxis *stepaxistpc = tpcsparseF->GetAxis(3);
93 TAxis *stepaxistof = tofsparseF->GetAxis(3);
94 TAxis *stepaxistoftpc = toftpcsparseF->GetAxis(3);
96 TAxis *centralityaxistpc = tpcsparseF->GetAxis(4);
97 TAxis *centralityaxistof = tofsparseF->GetAxis(4);
98 TAxis *centralityaxistoftpc = toftpcsparseF->GetAxis(4);
100 stepaxistpc->SetRange(1,1);
101 stepaxistof->SetRange(1,1);
102 stepaxistoftpc->SetRange(2,2);
104 Int_t nbinsc = centralityaxistpc->GetNbins();
105 printf("There are %d centrality bins \n",nbinsc);
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");
118 stepaxistof->SetRange(2,2);
119 TH2D *tof2Dsumbper = tofsparseF->Projection(2,1);
120 tof2Dsumbper->SetName("tof2Dsumbper_21");
122 TH2D *tpc2Dsumper = tpcsparseF->Projection(2,1);
123 tpc2Dsumper->SetName("toftpc2Dsumper_21");
125 stepaxistpc->SetRange(2,2);
126 TH2D *tpc2Dsumbper = tpcsparseF->Projection(2,1);
127 tpc2Dsumbper->SetName("tpc2Dsumbper_21");
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");
139 TH2D *tof2Dsumc = tofsparseF->Projection(2,1);
140 tof2Dsumc->SetName("tof2Dsumc_21");
142 stepaxistof->SetRange(2,2);
144 TH2D *tof2Dsumbc = tofsparseF->Projection(2,1);
145 tof2Dsumbc->SetName("tof2Dsumbc_21");
147 TH2D *tpc2Dsumc = tpcsparseF->Projection(2,1);
148 tpc2Dsumc->SetName("tpc2Dsumc_21");
150 stepaxistpc->SetRange(2,2);
151 TH2D *tpc2Dsumbc = tpcsparseF->Projection(2,1);
152 tpc2Dsumbc->SetName("tpc2Dsumbc_21");
160 TFile *fout = TFile::Open(outfile,"UPDATE");
163 TDirectoryFile *cdd = NULL;
164 cdd = (TDirectoryFile*)fout->Get("HF");
166 Printf("Warning: HF <dir> doesn't exist, creating a new one");
167 cdd = (TDirectoryFile*)fout->mkdir("HF");
175 TCanvas *cElectronsTPCper = new TCanvas("ElectronTPCPID_70-90%", "ElectronTPCPID_70-90%");
176 cElectronsTPCper->Divide(3,1);
177 cElectronsTPCper->cd(1);
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");
191 tof2Dsumper->SetName(Form("fig_hf_1_%s", tof2Dsumper->GetName()));
192 tof2Dsumper->Write();
194 cElectronsTPCper->cd(2);
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");
209 tof2Dsumbper->SetName(Form("fig_hf_2_%s", tof2Dsumbper->GetName()));
210 tof2Dsumbper->Write();
212 cElectronsTPCper->cd(3);
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");
227 tpc2Dsumper->SetName(Form("fig_hf_3_%s", tpc2Dsumper->GetName()));
228 tpc2Dsumper->Write();
230 cElectronsTPCper->SaveAs(Form("fig_hf_ElectronTPCPID_70-90.%s",suffix.Data()));
234 TCanvas *cElectronsTPCc = new TCanvas("ElectronTPCPID_0-10%", "ElectronTPCPID_0-10%");
235 cElectronsTPCc->Divide(3,1);
236 cElectronsTPCc->cd(1);
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");
249 tof2Dsumc->SetName(Form("fig_hf_4_%s", tof2Dsumc->GetName()));
252 cElectronsTPCc->cd(2);
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");
265 tof2Dsumbc->SetName(Form("fig_hf_5_%s", tof2Dsumbc->GetName()));
268 cElectronsTPCc->cd(3);
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");
282 tpc2Dsumc->SetName(Form("fig_hf_6_%s", tpc2Dsumc->GetName()));
285 cElectronsTPCc->SaveAs(Form("fig_hf_ElectronTPCPID_0-10.%s",suffix.Data()));