1 /****************************************************************************************************************************
2 ****** provided by Gamma Conversion Group, PWG4, *****
3 ****** Kathrin Koch, kkoch@physi.uni-heidelberg.de *****
4 ****** Friederike Bock, friederike.bock@cern.ch *****
5 *****************************************************************************************************************************
6 *** This macro can be used to display the Photon Characteristics of the conversion method in ALICE, it can be operated *****
7 *** on the output of the GammaConversionTask. It can take 2 input files, the second one should be MC, if this is not *****
8 *** the case all histograms including MC need to be commented out otherwise the running will crash. *****
9 ****************************************************************************************************************************/
11 #include <Riostream.h>
18 #include <TApplication.h>
19 #include <TPaveLabel.h>
31 #include "TVirtualFitter.h"
34 #include "TMultiGraph.h"
36 #include "TDatabasePDG.h"
40 #include "TPostScript.h"
41 #include "TGraphErrors.h"
44 #include "TGraphAsymmErrors.h"
46 TString textGenerator;
47 TString collisionSystem;
51 void SetStyleTLatex( TLatex* text, Size_t textSize, Width_t lineWidth, Color_t textColor = 1, Bool_t kNDC = kTRUE){
52 if (kNDC) {text->SetNDC();}
53 text->SetTextColor(textColor);
54 text->SetTextSize(textSize);
55 text->SetLineWidth(lineWidth);
59 /* DrawAutoGammaHisto is function used for styling a histograma of the gamma conversion group with standart settings
60 * histo1 - first histogram (Data)
61 * Title - histogram title
62 * XTitle - X-axis title
63 * YTitle - Y-axis title
64 * YRangeMax = kTRUE will scale by Maximum and Minimum Range in Y
65 *YMaxFactor - will MaximumY by this factor if YRangeMay = kTRUE
66 *YMinimum - this will be used if YRangeMax is set
67 *YRange = kTRUE will Cut y-axis by YMin and YMax
68 - will be set to kFAlSE if YRangeMax is set
71 *XRange = kTRUE will Cut x-axis by XMin and XMax
75 void DrawAutoGammaHisto( TH1* histo1,
76 TString Title, TString XTitle, TString YTitle,
77 Bool_t YRangeMax, Float_t YMaxFactor, Float_t YMinimum,
78 Bool_t YRange, Float_t YMin ,Float_t YMax,
79 Bool_t XRange, Float_t XMin, Float_t XMax) {
80 if (YRangeMax && !XRange){
82 Double_t maxRangeR = histo1->GetMaximum();
83 Double_t minRangeR = histo1->GetMinimum();
84 if(YMinimum > minRangeR){minRangeR = YMinimum;}
85 histo1->GetYaxis()->SetRangeUser(minRangeR, maxRangeR*YMaxFactor);
87 if (YRangeMax && XRange){
89 Double_t maxRangeR = histo1->GetMaximum();
90 Double_t minRangeR = histo1->GetMinimum();
91 if(YMinimum > minRangeR){minRangeR = YMinimum;}
92 histo1->GetYaxis()->SetRangeUser(minRangeR, maxRangeR*YMaxFactor);
93 histo1->GetXaxis()->SetRangeUser(XMin, XMax);
95 if (YRange && XRange){
96 histo1->GetYaxis()->SetRangeUser(YMin, YMax);
97 histo1->GetXaxis()->SetRangeUser(XMin, XMax);
99 if (!YRangeMax && !YRange && XRange){
100 histo1->GetXaxis()->SetRangeUser(XMin, XMax);
103 if (YRange && !XRange){
104 histo1->GetYaxis()->SetRangeUser(YMin, YMax);
107 histo1->SetTitle(Title.Data());
109 if(XTitle.CompareTo("") != 0){
110 histo1->SetXTitle(XTitle.Data());
112 if(YTitle.CompareTo("") != 0){
113 histo1->SetYTitle(YTitle.Data());
115 histo1->GetYaxis()->SetLabelSize(0.03);
116 histo1->GetYaxis()->SetTitleSize(0.035);
117 histo1->GetYaxis()->SetDecimals();
118 histo1->GetYaxis()->SetTitleOffset(1.8);
119 histo1->GetXaxis()->SetTitleSize(0.035);
120 histo1->GetXaxis()->SetLabelSize(0.03);
121 histo1->SetLineColor(kBlue+2);
122 histo1->SetMarkerColor(kBlue+2);
123 histo1->SetMarkerStyle(kFullCircle);
124 histo1->SetMarkerSize(1.5);
125 histo1->DrawCopy("e,p");
129 void DrawLabelsEvents(Float_t startX, Float_t startY, Float_t textHeight, Float_t decrease, TString collisionSystemDummy, TString textGeneratorDummy, TString textPeriodDummy){
131 Float_t aliceStartY = startY - textHeight * 1.15;
133 if( collisionSystemDummy.CompareTo("PbPb @ #sqrt{s_{NN}} = 2.76 TeV") == 0){
134 pp7 = new TLatex((startX-2*decrease),(aliceStartY),collisionSystemDummy.Data()); // Bo: this was modified
136 pp7 = new TLatex((startX+2*decrease),(aliceStartY),collisionSystemDummy.Data()); // Bo: this was modified
139 pp7->SetTextColor(1);
140 pp7->SetTextFont(62);
141 pp7->SetTextSize(textHeight);
142 pp7->SetLineWidth(2);
144 if (textGeneratorDummy.CompareTo("")!=0 && textPeriodDummy.CompareTo("")!=0){
145 TLatex *generator = new TLatex((startX+decrease),(aliceStartY-1*textHeight*1.15),Form("%s %s",textGeneratorDummy.Data(),textPeriodDummy.Data())); // Bo: this was modified
147 generator->SetTextColor(1);
148 generator->SetTextFont(62);
149 generator->SetTextSize(textHeight);
150 generator->SetLineWidth(2);
151 generator->Draw("same");
152 } else if (textGeneratorDummy.CompareTo("")!=0) {
153 TLatex *generator = new TLatex((startX+decrease),(aliceStartY-1*textHeight*1.15),Form("%s",textGeneratorDummy.Data())); // Bo: this was modified
155 generator->SetTextColor(1);
156 generator->SetTextFont(62);
157 generator->SetTextSize(textHeight);
158 generator->SetLineWidth(2);
159 generator->Draw("same");
163 /*DrawAutoGammaHisto2D is a function for drawing a 2D-histogram of the gamma conversion group
164 * histo - histogramm which need to be drawn
165 * Title - histogram title
166 * XTitle - X- axis-title
167 * YTitle - Y-axis-title
169 * YRange - if kTRUE will scale by YMin and YMay
172 * XRange - if kTRUE will scale by XMin and XMax
176 void DrawAutoGammaHisto2D( TH2 *histo,
177 TString Title, TString XTitle, TString YTitle, TString Input,
178 Bool_t YRange, Float_t YMin ,Float_t YMax,
179 Bool_t XRange, Float_t XMin, Float_t XMax,Float_t titleOffsetX=1.4, Float_t titleOffsetY=1.2) {
182 if (YRange && XRange){
183 histo->GetYaxis()->SetRangeUser(YMin, YMax);
184 histo->GetXaxis()->SetRangeUser(XMin, XMax);
186 if ( !YRange && XRange){
187 histo->GetXaxis()->SetRangeUser(XMin, XMax);
190 if (YRange && !XRange){
191 histo->GetYaxis()->SetRangeUser(YMin, YMax);
194 // if(Title.CompareTo("") != 0){
195 histo->SetTitle(Title.Data());
197 if(XTitle.CompareTo("") != 0){
198 histo->SetXTitle(XTitle.Data());
200 if(YTitle.CompareTo("") != 0){
201 histo->SetYTitle(YTitle.Data());
203 histo->GetYaxis()->SetTitleSize(0.043);
204 histo->GetYaxis()->SetLabelSize(0.035);
205 histo->GetXaxis()->SetLabelSize(0.035);
206 histo->GetYaxis()->SetDecimals();
207 histo->GetYaxis()->SetTitleOffset(titleOffsetY);
208 histo->GetXaxis()->SetTitleOffset(titleOffsetX);
209 histo->GetXaxis()->SetTitleSize(0.043);
210 histo->DrawCopy("colz");
211 if(Input.CompareTo("") != 0){
212 TLegend* leg2 = new TLegend(0.6,0.82,0.83,0.9);
213 leg2->SetTextSize(0.04);
214 leg2->SetFillColor(0);
215 leg2->AddEntry(histo,(Input.Data()));
220 void PlotStandard2D( TH2* histo2D, TString nameOutput, TString title, TString xTitle, TString yTitle, Bool_t kRangeY, Double_t startY, Double_t endY, Bool_t kRangeX, Double_t startX, Double_t endX, Int_t logX, Int_t logY, Int_t logZ, Float_t* floatLogo, Int_t canvasSizeX = 500, Int_t canvasSizeY = 500, TString generator ="" , TString period =""){
221 TCanvas * canvasStandard = new TCanvas("canvasStandard","",10,10,canvasSizeX,canvasSizeY); // gives the page size
222 canvasStandard->SetLogx(logX);
223 canvasStandard->SetLogy(logY);
224 canvasStandard->SetLogz(logZ);
225 canvasStandard->SetRightMargin(0.12);
226 canvasStandard->SetLeftMargin(0.12);
227 canvasStandard->SetBottomMargin(0.1);
228 canvasStandard->SetTopMargin(0.04);
229 canvasStandard->cd();
230 histo2D->SetTitle("");
231 DrawAutoGammaHisto2D( histo2D,
232 title.Data(), xTitle.Data(), yTitle.Data(),"",kRangeY, startY, endY, kRangeX, startX, endX);
233 histo2D->GetXaxis()->SetTitleOffset(1.05);
234 // cout << histo2D->GetYaxis()->GetTitleOffset() << endl;
235 histo2D->GetYaxis()->SetTitleOffset(1.35);
237 // cout << histo2D->GetXaxis()->GetLabelOffset() << endl;
238 histo2D->GetXaxis()->SetLabelOffset(0.);
241 histo2D->Draw("colz");
242 DrawLabelsEvents(floatLogo[0],floatLogo[1],floatLogo[2], 0.00, collisionSystem, generator, period);
244 canvasStandard->Update();
245 canvasStandard->SaveAs(nameOutput.Data());
246 delete canvasStandard;
249 TString GetCentralityString(TString cutNumber){
250 TString centralityCutNumberStart = cutNumber(1,1);
251 TString centralityCutNumberEnd = cutNumber(2,1);
252 TString ppCutNumber = cutNumber(0,1);
253 if (ppCutNumber.CompareTo("0") ==0){
255 } else if ( ppCutNumber.CompareTo("1") ==0 || ppCutNumber.CompareTo("2") ==0 || ppCutNumber.CompareTo("5") ==0 || ppCutNumber.CompareTo("8") ==0 || ppCutNumber.CompareTo("9") ==0){
256 if (centralityCutNumberStart.CompareTo("0") == 0 && centralityCutNumberEnd.CompareTo("0") == 0 ){
259 return Form("%i-%i%s", centralityCutNumberStart.Atoi()*10,centralityCutNumberEnd.Atoi()*10,"%");
261 } else if (ppCutNumber.CompareTo("3") ==0 || ppCutNumber.CompareTo("6") ==0){
262 if (centralityCutNumberStart.CompareTo("0") == 0 && centralityCutNumberEnd.CompareTo("0") == 0 ){
265 return Form("%i-%i%s", centralityCutNumberStart.Atoi()*5,centralityCutNumberEnd.Atoi()*5,"%");
267 } else if (ppCutNumber.CompareTo("4") ==0 || ppCutNumber.CompareTo("7") ==0){
268 if (centralityCutNumberStart.CompareTo("0") == 0 && centralityCutNumberEnd.CompareTo("0") == 0 ){
271 return Form("%i-%i%s",45+centralityCutNumberStart.Atoi()*5,45+centralityCutNumberEnd.Atoi()*5,"%");
276 TString ReturnFullCollisionsSystem(TString fEnergyFlagOpt){
277 if(fEnergyFlagOpt.CompareTo("7TeV") == 0){
278 return "pp, #sqrt{s} = 7 TeV";
279 } else if( fEnergyFlagOpt.CompareTo("900GeV") == 0) {
280 return "pp, #sqrt{s} = 900 GeV";
281 } else if( fEnergyFlagOpt.CompareTo("2.76TeV") == 0) {
282 return "pp, #sqrt{s} = 2.76 TeV";
283 } else if( (fEnergyFlagOpt.CompareTo("PbPb_2.76TeV") == 0) || (fEnergyFlagOpt.CompareTo("HI") == 0) ) {
284 return "Pb-Pb, #sqrt{s_{NN}} = 2.76 TeV";
285 } else if( fEnergyFlagOpt.CompareTo("pPb_5.023TeV") == 0) {
286 return "p-Pb, #sqrt{s_{NN}} = 5.023 TeV";
288 cout << "No correct collision system specification, has been given" << endl;
293 /* StyleSettingsThesis will make some standard settings for gStyle
295 void StyleSettingsThesis(){
296 gStyle->SetOptDate(0); //show day and time
297 gStyle->SetOptStat(0); //show statistic
298 gStyle->SetPalette(1,0);
299 gStyle->SetFrameBorderMode(0);
300 gStyle->SetFrameFillColor(0);
301 gStyle->SetTitleFillColor(0);
302 gStyle->SetTextSize(0.5);
303 gStyle->SetLabelSize(0.03,"xyz");
304 gStyle->SetLabelOffset(0.002,"xyz");
305 gStyle->SetTitleFontSize(0.04);
306 gStyle->SetTitleOffset(1,"y");
307 gStyle->SetTitleOffset(0.7,"x");
308 gStyle->SetCanvasColor(0);
309 gStyle->SetPadTickX(1);
310 gStyle->SetPadTickY(1);
311 gStyle->SetLineWidth(0.01);
313 gStyle->SetPadTopMargin(0.03);
314 gStyle->SetPadBottomMargin(0.09);
315 gStyle->SetPadRightMargin(0.03);
316 gStyle->SetPadLeftMargin(0.13);
319 TGaxis::SetMaxDigits(5);
320 gErrorIgnoreLevel=kError;
324 void SetPlotStyle() {
325 const Int_t nRGBs = 5;
326 const Int_t nCont = 255;
328 Double_t stops[nRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
329 Double_t red[nRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
330 Double_t green[nRGBs] = { 0.31, 0.81, 1.00, 0.20, 0.00 };
331 Double_t blue[nRGBs] = { 0.51, 1., 0.12, 0.00, 0.00};
333 TColor::CreateGradientColorTable(nRGBs, stops, red, green, blue, nCont);
334 gStyle->SetNumberContours(nCont);
338 void ProduceFastQA(TString fileNameInput = "myOutput", TString cutSelection = "5080001022092970023220000000", TString suffix = "eps", TString optEnergy="", TString optMCGenerator="", TString optPeriod=""){
341 gSystem->Load("libCore.so");
342 gSystem->Load("libTree.so");
343 gSystem->Load("libGeom.so");
344 gSystem->Load("libVMC.so");
345 gSystem->Load("libPhysics.so");
346 gSystem->Load("libSTEERBase");
347 gSystem->Load("libESD");
348 gSystem->Load("libAOD");
349 gSystem->Load("libANALYSIS");
350 gSystem->Load("libANALYSISalice");
351 gSystem->Load("libCORRFW.so");
352 gROOT->SetStyle("Plain");
354 StyleSettingsThesis();
357 collisionSystem = ReturnFullCollisionsSystem(optEnergy);
358 if (collisionSystem.CompareTo("") == 0){
359 cout << "No correct collision system specification, has been given" << endl;
362 TString centralityCutNumber = cutSelection(0,3);
363 TString centralityString = GetCentralityString(centralityCutNumber);
364 cout<< centralityCutNumber.Data() << "\t" << centralityString.Data() << endl;
365 if (centralityString.CompareTo("pp") !=0){
366 collisionSystem = Form("%s %s", centralityString.Data(), collisionSystem.Data());
369 if(optMCGenerator.CompareTo("") ==0){
372 textGenerator = optMCGenerator;
375 TFile* fileInput = new TFile(fileNameInput.Data());
376 TDirectory* directoryQA = (TDirectory*)fileInput->Get(Form("GammaConvV1_QA_%s",cutSelection.Data()));
377 TList* listQA = (TList*)directoryQA->Get(Form("GammaConv_V1QA_%s",cutSelection.Data()));
378 TList* listQAESD = (TList*)listQA->FindObject("ESD QA");
379 TH1F* histoVertexZ = (TH1F*)listQAESD->FindObject("Vertex_Z");
380 histoVertexZ->Sumw2();
381 Double_t nEvt = histoVertexZ->GetEntries();
382 histoVertexZ->Scale(1./nEvt);
384 TH1I* histoContrVertexZ = (TH1I*)listQAESD->FindObject("ContrVertex_Z");
385 TH1D* histoDContrVertexZ = new TH1D("ContrVertex_Z","ContrVertex_Z",3000,0,3000);
386 histoDContrVertexZ->Sumw2();
387 for (Int_t i = 1; i < histoContrVertexZ->GetNbinsX(); i++){
388 histoDContrVertexZ->SetBinContent(i, histoContrVertexZ->GetBinContent(i)/nEvt);
389 histoDContrVertexZ->SetBinError(i, histoContrVertexZ->GetBinError(i)/nEvt);
391 histoDContrVertexZ->Rebin(8);
393 TH1I* histoGoodESDTracks = (TH1I*)listQAESD->FindObject("GoodESDTracks");
394 TH1D* histoDGoodESDTracks = new TH1D("GoodESDTracks","GoodESDTracks",3000,0,3000);
395 histoDGoodESDTracks->Sumw2();
396 for (Int_t i = 1; i < histoGoodESDTracks->GetNbinsX(); i++){
397 histoDGoodESDTracks->SetBinContent(i, histoGoodESDTracks->GetBinContent(i)/nEvt);
398 histoDGoodESDTracks->SetBinError(i, histoGoodESDTracks->GetBinError(i)/nEvt);
400 histoDGoodESDTracks->Rebin(8);
402 TH1I* histoV0Mult = (TH1I*)listQAESD->FindObject("V0 Multiplicity");
403 TH1D* histoDV0Mult = new TH1D("V0 Multiplicity","V0 Multiplicity",30000,0,30000);
404 histoDV0Mult->Sumw2();
405 for (Int_t i = 1; i < histoV0Mult->GetNbinsX(); i++){
406 histoDV0Mult->SetBinContent(i, histoV0Mult->GetBinContent(i)/nEvt);
407 histoDV0Mult->SetBinError(i, histoV0Mult->GetBinError(i)/nEvt);
409 histoDV0Mult->Rebin(10);
412 TH2F* histoITSClusterPhi = (TH2F*)listQAESD->FindObject("ITSClusterPhi");
413 histoITSClusterPhi->Sumw2();
414 histoITSClusterPhi->Scale(1./nEvt);
416 TH1F* histoGammaPt = (TH1F*)listQAESD->FindObject("Gamma_Pt");
417 histoGammaPt->Sumw2();
418 histoGammaPt->Scale(1./nEvt);
421 TH1F* histoGammaPhi = (TH1F*)listQAESD->FindObject("Gamma_Phi");
422 histoGammaPhi->Sumw2();
423 histoGammaPhi->Scale(1./nEvt);
424 histoGammaPhi->Rebin(2);
426 TH1F* histoGammaEta = (TH1F*)listQAESD->FindObject("Gamma_Eta");
427 histoGammaEta->Sumw2();
428 histoGammaEta->Scale(1./nEvt);
429 histoGammaEta->Rebin(2);
431 TH1F* histoGammaChi2 = (TH1F*)listQAESD->FindObject("Gamma_Chi2perNDF");
432 histoGammaChi2->Sumw2();
433 histoGammaChi2->Scale(1./nEvt);
435 TH1F* histoGammaPsiPair = (TH1F*)listQAESD->FindObject("Gamma_PsiPair");
436 histoGammaPsiPair->Sumw2();
437 histoGammaPsiPair->Scale(1./nEvt);
439 TH1F* histoGammaCosPoint = (TH1F*)listQAESD->FindObject("Gamma_CosinePointingAngle");
440 histoGammaCosPoint->Sumw2();
441 histoGammaCosPoint->Scale(1./nEvt);
443 TH1F* histoGammaInvMass = (TH1F*)listQAESD->FindObject("Gamma_InvMass");
444 histoGammaInvMass->Sumw2();
445 histoGammaInvMass->Scale(1./nEvt);
447 TH2F* histoGammaArmenteros = (TH2F*)listQAESD->FindObject("Gamma_Armenteros");
448 histoGammaArmenteros->Sumw2();
449 histoGammaArmenteros->Scale(1./nEvt);
451 TH2F* histoEPPt = (TH2F*)listQAESD->FindObject("Electron_Positron_Pt");
453 histoEPPt->Scale(1./nEvt);
455 TH2F* histoEPEta = (TH2F*)listQAESD->FindObject("Electron_Positron_Eta");
457 histoEPEta->Scale(1./nEvt);
459 TH2F* histoEPPhi = (TH2F*)listQAESD->FindObject("Electron_Positron_Phi");
461 histoEPPhi->Scale(1./nEvt);
463 TH1F* histoEFindableClusterTPC = (TH1F*)listQAESD->FindObject("Electron_findableClusterTPC");
464 histoEFindableClusterTPC->Sumw2();
465 histoEFindableClusterTPC->Scale(1./nEvt);
467 TH1F* histoPFindableClusterTPC = (TH1F*)listQAESD->FindObject("Positron_findableClusterTPC");
468 histoPFindableClusterTPC->Sumw2();
469 histoPFindableClusterTPC->Scale(1./nEvt);
471 TH2F* histoEdEdxPTPC = (TH2F*)listQAESD->FindObject("Electron_dEdx_P");
472 Double_t nElectronTPC = histoEdEdxPTPC->GetEntries();
473 histoEdEdxPTPC->Sumw2();
474 histoEdEdxPTPC->Scale(1./nEvt);
475 TH2F* histoPdEdxPTPC = (TH2F*)listQAESD->FindObject("Positron_dEdx_P");
476 Double_t nPositronTPC = histoPdEdxPTPC->GetEntries();
477 histoPdEdxPTPC->Sumw2();
478 histoPdEdxPTPC->Scale(1./nEvt);
479 TH2F* histoENSigmadEdxPTPC = (TH2F*)listQAESD->FindObject("Electron_NSigmadEdx_P");
480 histoENSigmadEdxPTPC->Sumw2();
481 histoENSigmadEdxPTPC->Scale(1./nEvt);
482 TH2F* histoPNSigmadEdxPTPC = (TH2F*)listQAESD->FindObject("Positron_NSigmadEdx_P");
483 histoPNSigmadEdxPTPC->Sumw2();
484 histoPNSigmadEdxPTPC->Scale(1./nEvt);
485 TH2F* histoENSigmaPiondEdxPTPC = (TH2F*)listQAESD->FindObject("Electron_NSigmaPiondEdx_P");
486 histoENSigmaPiondEdxPTPC->Sumw2();
487 histoENSigmaPiondEdxPTPC->Scale(1./nEvt);
488 TH2F* histoPNSigmaPiondEdxPTPC = (TH2F*)listQAESD->FindObject("Positron_NSigmaPiondEdx_P");
489 histoPNSigmaPiondEdxPTPC->Sumw2();
490 histoPNSigmaPiondEdxPTPC->Scale(1./nEvt);
492 TH2F* histoETOFP = (TH2F*)listQAESD->FindObject("Electron_TOF_P");
493 Double_t nElectronTOF = histoETOFP->GetEntries();
495 histoETOFP->Scale(1./nEvt);
496 TH2F* histoPTOFP = (TH2F*)listQAESD->FindObject("Positron_TOF_P");
497 Double_t nPositronTOF = histoPTOFP->GetEntries();
499 histoPTOFP->Scale(1./nEvt);
500 TH2F* histoENSigmaTOFP = (TH2F*)listQAESD->FindObject("Electron_NSigmaTOF_P");
501 histoENSigmaTOFP->Sumw2();
502 histoENSigmaTOFP->Scale(1./nEvt);
503 TH2F* histoPNSigmaTOFP = (TH2F*)listQAESD->FindObject("Positron_NSigmaTOF_P");
504 histoPNSigmaTOFP->Sumw2();
505 histoPNSigmaTOFP->Scale(1./nEvt);
507 TH2F* histoEdEdxPITS = (TH2F*)listQAESD->FindObject("Electron_ITSdEdx_P");
508 Double_t nElectronITS = histoEdEdxPITS->GetEntries();
509 histoEdEdxPITS->Sumw2();
510 histoEdEdxPITS->Scale(1./nEvt);
511 TH2F* histoPdEdxPITS = (TH2F*)listQAESD->FindObject("Positron_ITSdEdx_P");
512 Double_t nPositronITS = histoPdEdxPITS->GetEntries();
513 histoPdEdxPITS->Sumw2();
514 histoPdEdxPITS->Scale(1./nEvt);
515 TH2F* histoENSigmadEdxPITS = (TH2F*)listQAESD->FindObject("Electron_NSigmaITS_P");
516 histoENSigmadEdxPITS->Sumw2();
517 histoENSigmadEdxPITS->Scale(1./nEvt);
518 TH2F* histoPNSigmadEdxPITS = (TH2F*)listQAESD->FindObject("Positron_NSigmaITS_P");
519 histoPNSigmadEdxPITS->Sumw2();
520 histoPNSigmadEdxPITS->Scale(1./nEvt);
523 TCanvas * canvasEventProp = new TCanvas("canvasEventProp","",0,0,1000,1000); // gives the page size
524 TPad* padEventProp = new TPad("padEventProp","",0.0,0.0,1,1,0); // gives the size of the histo areas
525 padEventProp->SetFillColor(0);
526 padEventProp->GetFrame()->SetFillColor(0);
527 padEventProp->SetBorderMode(0);
529 padEventProp->Divide(2,2);
530 padEventProp->Draw();
533 DrawAutoGammaHisto( histoVertexZ,
534 "", "Z_{vtx} (cm)","dZ/dN_{evt}",
540 TLatex *labelDataSet = NULL;
541 if (optPeriod.CompareTo("") ){
542 labelDataSet = new TLatex(0.18,0.9,Form("%s",optPeriod.Data()));
543 SetStyleTLatex( labelDataSet, 0.05,4);
544 labelDataSet->Draw();
547 padEventProp->cd(2)->SetLogy(1);
549 DrawAutoGammaHisto( histoDContrVertexZ,
550 "", "# Contr to prim Vtx","norm counts",
556 padEventProp->cd(3)->SetLogy(1);
558 DrawAutoGammaHisto( histoDGoodESDTracks,
559 "", "# Good ESD tracks","norm counts",
565 padEventProp->cd(4)->SetLogy(1);
567 DrawAutoGammaHisto( histoDV0Mult,
568 "", "V0 signal","norm counts",
573 canvasEventProp->Update();
574 canvasEventProp->SaveAs(Form("EventCharacteristics.%s",suffix.Data()));
576 TCanvas * canvasdEdxTPC = new TCanvas("canvasdEdxTPC","",0,0,1000,1500); // gives the page size
577 TPad* paddEdxTPC = new TPad("paddEdxTPC","",0.0,0.0,1,1,0); // gives the size of the histo areas
578 paddEdxTPC->SetFillColor(0);
579 paddEdxTPC->GetFrame()->SetFillColor(0);
580 paddEdxTPC->SetBorderMode(0);
582 paddEdxTPC->Divide(2,3);
585 paddEdxTPC->cd(1)->SetLogx(1);
586 paddEdxTPC->cd(1)->SetLogz(1);
587 paddEdxTPC->cd(1)->SetTopMargin(0.01);
588 paddEdxTPC->cd(1)->SetRightMargin(0.12);
589 Double_t maximumEPTPC = 1.2*histoEdEdxPTPC->GetMaximum();
590 histoEdEdxPTPC->GetZaxis()->SetRangeUser(1/nEvt,maximumEPTPC);
591 histoEdEdxPTPC->GetXaxis()->SetLabelOffset(-0.009);
592 DrawAutoGammaHisto2D( histoEdEdxPTPC,
593 "", "#it{p}_{e^{-}} (GeV/c)", "dE_{e^{-}-cand} /dx", "",
595 kTRUE, 0.01, 20.,0.95);
597 TLatex *labelElectronTPC = new TLatex(0.5,0.9,"Electrons TPC");
598 SetStyleTLatex( labelElectronTPC, 0.05,4);
599 labelElectronTPC->Draw();
601 if (labelDataSet) labelDataSet->Draw();
605 paddEdxTPC->cd(2)->SetLogx(1);
606 paddEdxTPC->cd(2)->SetLogz(1);
607 paddEdxTPC->cd(2)->SetTopMargin(0.01);
608 paddEdxTPC->cd(2)->SetRightMargin(0.12);
609 histoPdEdxPTPC->GetZaxis()->SetRangeUser(1/nEvt,maximumEPTPC);
610 histoPdEdxPTPC->GetXaxis()->SetLabelOffset(-0.009);
611 DrawAutoGammaHisto2D( histoPdEdxPTPC,
612 "", "#it{p}_{e^{+}} (GeV/c)", "dE_{e^{+}-cand} /dx", "",
614 kTRUE, 0.01, 20.,0.95);
616 TLatex *labelPositronTPC = new TLatex(0.5,0.9,"Positrons TPC");
617 SetStyleTLatex( labelPositronTPC, 0.05,4);
618 labelPositronTPC->Draw();
621 paddEdxTPC->cd(3)->SetLogx(1);
622 paddEdxTPC->cd(3)->SetLogz(1);
623 paddEdxTPC->cd(3)->SetTopMargin(0.01);
624 paddEdxTPC->cd(3)->SetRightMargin(0.12);
625 histoENSigmadEdxPTPC->GetZaxis()->SetRangeUser(1/nEvt,maximumEPTPC);
626 histoENSigmadEdxPTPC->GetXaxis()->SetLabelOffset(-0.009);
627 DrawAutoGammaHisto2D( histoENSigmadEdxPTPC,
628 "", "#it{p}_{e^{-}} (GeV/c)", "n #sigma_{e^{-}} dE/dx", "",
630 kTRUE, 0.01, 20.,0.95);
633 paddEdxTPC->cd(4)->SetLogx(1);
634 paddEdxTPC->cd(4)->SetLogz(1);
635 paddEdxTPC->cd(4)->SetTopMargin(0.01);
636 paddEdxTPC->cd(4)->SetRightMargin(0.12);
637 histoPNSigmadEdxPTPC->GetZaxis()->SetRangeUser(1/nEvt,maximumEPTPC);
638 histoPNSigmadEdxPTPC->GetXaxis()->SetLabelOffset(-0.009);
639 DrawAutoGammaHisto2D( histoPNSigmadEdxPTPC,
640 "", "#it{p}_{e^{+}} (GeV/c)", "n #sigma_{e^{+}} dE/dx", "",
642 kTRUE, 0.01, 20.,0.95);
645 paddEdxTPC->cd(5)->SetLogx(1);
646 paddEdxTPC->cd(5)->SetLogz(1);
647 paddEdxTPC->cd(5)->SetTopMargin(0.01);
648 paddEdxTPC->cd(5)->SetRightMargin(0.12);
649 histoENSigmaPiondEdxPTPC->GetZaxis()->SetRangeUser(1/nEvt,maximumEPTPC);
650 histoENSigmaPiondEdxPTPC->GetXaxis()->SetLabelOffset(-0.009);
651 DrawAutoGammaHisto2D( histoENSigmaPiondEdxPTPC,
652 "", "#it{p}_{e^{-}} (GeV/c)", "n #sigma_{#pi^{-}} dE/dx", "",
654 kTRUE, 0.01, 20.,0.95);
657 paddEdxTPC->cd(6)->SetLogx(1);
658 paddEdxTPC->cd(6)->SetLogz(1);
659 paddEdxTPC->cd(6)->SetTopMargin(0.01);
660 paddEdxTPC->cd(6)->SetRightMargin(0.12);
661 histoPNSigmaPiondEdxPTPC->GetZaxis()->SetRangeUser(1/nEvt,maximumEPTPC);
662 histoPNSigmaPiondEdxPTPC->GetXaxis()->SetLabelOffset(-0.009);
663 DrawAutoGammaHisto2D( histoPNSigmaPiondEdxPTPC,
664 "", "#it{p}_{e^{+}} (GeV/c)", "n #sigma_{#pi^{+}} dE/dx", "",
666 kTRUE, 0.01, 20.,0.95);
668 canvasdEdxTPC->Update();
669 canvasdEdxTPC->SaveAs(Form("Electrons_dEdx_TPC.%s",suffix.Data()));
671 TCanvas * canvasTOF = new TCanvas("canvasTOF","",0,0,1000,1000); // gives the page size
672 TPad* padTOF = new TPad("padTOF","",0.0,0.0,1,1,0); // gives the size of the histo areas
673 padTOF->SetFillColor(0);
674 padTOF->GetFrame()->SetFillColor(0);
675 padTOF->SetBorderMode(0);
680 padTOF->cd(1)->SetLogx(1);
681 padTOF->cd(1)->SetLogz(1);
682 padTOF->cd(1)->SetTopMargin(0.01);
683 padTOF->cd(1)->SetRightMargin(0.12);
684 Double_t maximumEPTOF = 1.2*histoETOFP->GetMaximum();
685 histoETOFP->GetZaxis()->SetRangeUser(1/nEvt,maximumEPTOF);
686 histoETOFP->GetXaxis()->SetLabelOffset(-0.009);
687 DrawAutoGammaHisto2D( histoETOFP,
688 "", "#it{p}_{e^{-}} (GeV/c)", "t_{measured}-t_{expected} e^{-}", "",
690 kTRUE, 0.01, 20.,0.95);
692 TLatex *labelElectronTOF = new TLatex(0.5,0.9,"Electrons TOF");
693 SetStyleTLatex( labelElectronTOF, 0.05,4);
694 labelElectronTOF->Draw();
695 Double_t fracElecTOF = nElectronTOF/nElectronTPC*100;
696 TLatex *labelFracElectronTOF = new TLatex(0.5,0.845,Form("%4.2f %",fracElecTOF ));
697 SetStyleTLatex( labelFracElectronTOF, 0.05,4);
698 labelFracElectronTOF->Draw();
701 if (labelDataSet) labelDataSet->Draw();
705 padTOF->cd(2)->SetLogx(1);
706 padTOF->cd(2)->SetLogz(1);
707 padTOF->cd(2)->SetTopMargin(0.01);
708 padTOF->cd(2)->SetRightMargin(0.12);
709 histoPTOFP->GetZaxis()->SetRangeUser(1/nEvt,maximumEPTOF);
710 histoPTOFP->GetXaxis()->SetLabelOffset(-0.009);
711 DrawAutoGammaHisto2D( histoPTOFP,
712 "", "#it{p}_{e^{+}} (GeV/c)", "t_{measured}-t_{expected} e^{+}", "",
714 kTRUE, 0.01, 20.,0.95);
716 TLatex *labelPositronTOF = new TLatex(0.5,0.9,"Positrons TOF");
717 SetStyleTLatex( labelPositronTOF, 0.05,4);
718 labelPositronTOF->Draw();
719 Double_t fracPosiTOF = nPositronTOF/nPositronTPC*100;
720 TLatex *labelFracPositronTOF = new TLatex(0.5,0.845,Form("%4.2f %",fracPosiTOF ));
721 SetStyleTLatex( labelFracPositronTOF, 0.05,4);
722 labelFracPositronTOF->Draw();
725 padTOF->cd(3)->SetLogx(1);
726 padTOF->cd(3)->SetLogz(1);
727 padTOF->cd(3)->SetTopMargin(0.01);
728 padTOF->cd(3)->SetRightMargin(0.12);
729 histoENSigmaTOFP->GetZaxis()->SetRangeUser(1/nEvt,maximumEPTOF);
730 histoENSigmaTOFP->GetXaxis()->SetLabelOffset(-0.009);
731 DrawAutoGammaHisto2D( histoENSigmaTOFP,
732 "", "#it{p}_{e^{-}} (GeV/c)", "n #sigma_{e^{-}} TOF", "",
734 kTRUE, 0.01, 20.,0.95);
737 padTOF->cd(4)->SetLogx(1);
738 padTOF->cd(4)->SetLogz(1);
739 padTOF->cd(4)->SetTopMargin(0.01);
740 padTOF->cd(4)->SetRightMargin(0.12);
741 histoPNSigmaTOFP->GetZaxis()->SetRangeUser(1/nEvt,maximumEPTOF);
742 histoPNSigmaTOFP->GetXaxis()->SetLabelOffset(-0.009);
743 DrawAutoGammaHisto2D( histoPNSigmaTOFP,
744 "", "#it{p}_{e^{+}} (GeV/c)", "n #sigma_{e^{+}} TOF", "",
746 kTRUE, 0.01, 20.,0.95);
749 canvasTOF->SaveAs(Form("Electrons_TOF.%s",suffix.Data()));
752 TCanvas * canvasITS = new TCanvas("canvasITS","",0,0,1000,1000); // gives the page size
753 TPad* padITS = new TPad("padITS","",0.0,0.0,1,1,0); // gives the size of the histo areas
754 padITS->SetFillColor(0);
755 padITS->GetFrame()->SetFillColor(0);
756 padITS->SetBorderMode(0);
761 padITS->cd(1)->SetLogx(1);
762 padITS->cd(1)->SetLogz(1);
763 padITS->cd(1)->SetTopMargin(0.01);
764 padITS->cd(1)->SetRightMargin(0.12);
765 Double_t maximumEPITS = 1.2*histoEdEdxPITS->GetMaximum();
766 histoEdEdxPITS->GetZaxis()->SetRangeUser(1/nEvt,maximumEPITS);
767 histoEdEdxPITS->GetXaxis()->SetLabelOffset(-0.009);
768 DrawAutoGammaHisto2D( histoEdEdxPITS,
769 "", "#it{p}_{e^{-}} (GeV/c)", "dE_{e^{-}-cand} /dx ITS", "",
771 kTRUE, 0.01, 20.,0.95);
773 TLatex *labelElectronITS = new TLatex(0.5,0.9,"Electrons ITS");
774 SetStyleTLatex( labelElectronITS, 0.05,4);
775 labelElectronITS->Draw();
776 Double_t fracElecITS = nElectronITS/nElectronTPC*100;
777 TLatex *labelFracElectronITS = new TLatex(0.5,0.845,Form("%4.2f %",fracElecITS ));
778 SetStyleTLatex( labelFracElectronITS, 0.05,4);
779 labelFracElectronITS->Draw();
782 if (labelDataSet) labelDataSet->Draw();
786 padITS->cd(2)->SetLogx(1);
787 padITS->cd(2)->SetLogz(1);
788 padITS->cd(2)->SetTopMargin(0.01);
789 padITS->cd(2)->SetRightMargin(0.12);
791 histoPdEdxPITS->GetZaxis()->SetRangeUser(1/nEvt,maximumEPITS);
792 histoPdEdxPITS->GetXaxis()->SetLabelOffset(-0.009);
793 DrawAutoGammaHisto2D( histoPdEdxPITS,
794 "", "#it{p}_{e^{+}} (GeV/c)","dE_{e^{+}-cand} /dx ITS", "",
796 kTRUE, 0.01, 20.,0.95);
798 TLatex *labelPositronITS = new TLatex(0.5,0.9,"Positrons ITS");
799 SetStyleTLatex( labelPositronITS, 0.05,4);
800 labelPositronITS->Draw();
801 Double_t fracPosiITS = nPositronITS/nPositronTPC*100;
802 TLatex *labelFracPositronITS = new TLatex(0.5,0.845,Form("%4.2f %",fracPosiITS ));
803 SetStyleTLatex( labelFracPositronITS, 0.05,4);
804 labelFracPositronITS->Draw();
807 padITS->cd(3)->SetLogx(1);
808 padITS->cd(3)->SetLogz(1);
809 padITS->cd(3)->SetTopMargin(0.01);
810 padITS->cd(3)->SetRightMargin(0.12);
811 histoENSigmadEdxPITS->GetZaxis()->SetRangeUser(1/nEvt,maximumEPITS);
812 histoENSigmadEdxPITS->GetXaxis()->SetLabelOffset(-0.009);
813 DrawAutoGammaHisto2D( histoENSigmadEdxPITS,
814 "", "#it{p}_{e^{-}} (GeV/c)", "n #sigma_{e^{-}} ITS", "",
816 kTRUE, 0.01, 20.,0.95);
819 padITS->cd(4)->SetLogx(1);
820 padITS->cd(4)->SetLogz(1);
821 padITS->cd(4)->SetTopMargin(0.01);
822 padITS->cd(4)->SetRightMargin(0.12);
823 histoPNSigmadEdxPITS->GetZaxis()->SetRangeUser(1/nEvt,maximumEPITS);
824 histoPNSigmadEdxPITS->GetXaxis()->SetLabelOffset(-0.009);
825 DrawAutoGammaHisto2D( histoPNSigmadEdxPITS,
826 "", "#it{p}_{e^{+}} (GeV/c)", "n #sigma_{e^{+}} ITS", "",
828 kTRUE, 0.01, 20.,0.95);
831 canvasITS->SaveAs(Form("Electrons_ITS.%s",suffix.Data()));
835 TCanvas * canvasPhoton = new TCanvas("canvasPhoton","",0,0,1000,1000); // gives the page size
836 TPad* padPhoton = new TPad("padPhoton","",0.0,0.0,1,1,0); // gives the size of the histo areas
837 padPhoton->SetFillColor(0);
838 padPhoton->GetFrame()->SetFillColor(0);
839 padPhoton->SetBorderMode(0);
841 padPhoton->Divide(3,3);
844 padPhoton->cd(1)->SetLogy(1);
845 padPhoton->cd(1)->SetLogx(1);
846 padPhoton->cd(1)->SetTopMargin(0.01);
847 DrawAutoGammaHisto( histoGammaPt,
848 "", "#it{p}_{#gamma,T} (GeV/c)","d#it{N}_{#gamma}/d#it{N}_{evt}",
852 histoGammaPt->SetMarkerSize(0.5);
853 histoGammaPt->Draw("ep1");
855 TLatex *labelPhotons = new TLatex(0.75,0.9,"Photon");
856 SetStyleTLatex( labelPhotons, 0.05,4);
857 labelPhotons->Draw();
859 if (labelDataSet) labelDataSet->Draw();
862 padPhoton->cd(2)->SetLogy(1);
863 padPhoton->cd(2)->SetTopMargin(0.01);
865 DrawAutoGammaHisto( histoGammaEta,
866 "", "#eta_{#gamma}","d#it{N}_{#gamma}/d#it{N}_{evt}",
870 histoGammaEta->SetMarkerSize(0.5);
871 histoGammaEta->Draw("ep1");
874 padPhoton->cd(3)->SetLogy(1);
875 padPhoton->cd(3)->SetTopMargin(0.01);
877 DrawAutoGammaHisto( histoGammaPhi,
878 "", "#phi_{#gamma}","d#it{N}_{#gamma}/d#it{N}_{evt}",
882 histoGammaPhi->SetMarkerSize(0.5);
883 histoGammaPhi->Draw("ep1");
886 padPhoton->cd(4)->SetLogy(1);
887 padPhoton->cd(4)->SetTopMargin(0.01);
889 DrawAutoGammaHisto( histoGammaInvMass,
890 "", "M_{#gamma#gamma} (GeV/c^{2})","d#it{N}_{#gamma}/d#it{N}_{evt}",
894 histoGammaInvMass->SetMarkerSize(0.5);
895 histoGammaInvMass->Draw("ep1");
898 padPhoton->cd(5)->SetLogy(1);
899 padPhoton->cd(5)->SetTopMargin(0.01);
901 DrawAutoGammaHisto( histoGammaChi2,
902 "", "#chi^{2}/NDF","d#it{N}_{#gamma}/d#it{N}_{evt}",
903 kTRUE, 2., 0.5/nEvt*1e1,
906 histoGammaChi2->SetMarkerSize(0.5);
907 histoGammaChi2->Draw("ep1");
910 padPhoton->cd(6)->SetLogy(1);
911 padPhoton->cd(6)->SetTopMargin(0.01);
913 DrawAutoGammaHisto( histoGammaPsiPair,
914 "", "#psi_{Pair}","d#it{N}_{#gamma}/d#it{N}_{evt}",
915 kTRUE, 2., 0.5/nEvt*1e2,
918 histoGammaPsiPair->SetMarkerSize(0.5);
919 histoGammaPsiPair->Draw("ep1");
922 padPhoton->cd(7)->SetLogy(1);
923 padPhoton->cd(7)->SetTopMargin(0.01);
925 DrawAutoGammaHisto( histoGammaCosPoint,
926 "", "cos(#theta_{Point})","d#it{N}_{#gamma}/d#it{N}_{evt}",
930 histoGammaCosPoint->SetMarkerSize(0.5);
931 histoGammaCosPoint->Draw("ep1");
934 padPhoton->cd(8)->SetLogz(1);
935 padPhoton->cd(8)->SetTopMargin(0.01);
936 padPhoton->cd(8)->SetRightMargin(0.12);
937 Double_t maximumPhotons = 1.2*histoGammaArmenteros->GetMaximum();
938 histoGammaArmenteros->GetZaxis()->SetRangeUser(1/nEvt,maximumPhotons);
939 DrawAutoGammaHisto2D( histoGammaArmenteros,
940 "", "#alpha = (p^{+}_{L}-p^{-}_{L})/(p^{+}_{L}+p^{-}_{L})", "q_{T} (GeV/c)", "",
942 kTRUE, -1., 1.,0.95);
944 canvasPhoton->Update();
945 canvasPhoton->SaveAs(Form("Photons.%s",suffix.Data()));