1 /////////////////////////////////////
\r
2 // Created by: Kevin McDermott //
\r
3 // email: kmcderm3@nd.edu //
\r
4 // CERN Summer Student 2012 //
\r
5 // University of Notre Dame du Lac //
\r
8 // Created on: August 6, 2012 //
\r
9 /////////////////////////////////////
\r
11 #include "AliPSQAVisualization.h"
\r
13 ClassImp(AliPSQAVisualization)
\r
15 AliPSQAVisualization::AliPSQAVisualization(): // Default constructor
\r
23 fFillSeparationLine(0x0)
\r
25 // Initialize some private data members from AliPSQAV
\r
33 fDrawOverPlot = kFALSE;
\r
34 fOverPlotTitle = "";
\r
37 fScaleAuto = kFALSE;
\r
38 fUseColorArray = kFALSE;
\r
41 InitializeColorArray("");
\r
42 InitializeSelectedPlots("");
\r
45 //________________________________________________________________________________________________
\r
46 AliPSQAVisualization::~AliPSQAVisualization(){
\r
49 delete[] fFillSeparationLine;
\r
50 delete[] fSelectedPlots;
\r
55 //________________________________________________________________________________________________
\r
56 void AliPSQAVisualization::InitializeColorArray(const Char_t * listOfColors){ // Function to custom set color array used for plots, not essential
\r
57 Color_t colors; //color enums from list
\r
58 ifstream input_data_col; //text file object
\r
59 input_data_col.open(listOfColors, ios::in ); //open the text file
\r
60 Int_t Ncol = 0; //number of color names to be used
\r
62 while ( input_data_col >> colors ) { // count number of color names
\r
66 fNColors = Ncol; // Set private data member to total color names to be used
\r
67 input_data_col.close(); // reset the file
\r
69 fColors = new Color_t [fNColors]; // initialize private data member with number of trig names
\r
70 input_data_col.open(listOfColors, ios::in );
\r
71 for (Int_t icol = 0; icol < fNColors; icol++){
\r
72 input_data_col >> fColors[icol];
\r
75 input_data_col.close();
\r
78 //________________________________________________________________________________________________
\r
79 void AliPSQAVisualization::InitializeSelectedPlots(const Char_t * listOfPlots){
\r
80 TString plotnames; //plot names from list
\r
81 ifstream input_data_pn; //text file object
\r
82 if(!listOfPlots) cout << "No list of plots" << endl;
\r
83 input_data_pn.open(listOfPlots, ios::in ); //open the text file
\r
84 Int_t Npn = 0; //number of plot names to be used
\r
86 while ( input_data_pn >> plotnames ) { // count number of plot names
\r
90 cout << "Number of initalized plots = " << Npn << endl;
\r
92 fNSelectedPlots = Npn; // Set private data member to total plot names to be used
\r
93 input_data_pn.close(); // reset the file
\r
94 //cout << "Number of selected plots = " << fNSelectedPlots << endl;
\r
95 fSelectedPlots = new TString [fNSelectedPlots]; // initialize private data member with number of trig names
\r
96 input_data_pn.open(listOfPlots, ios::in );
\r
97 for (Int_t iplot = 0; iplot < fNSelectedPlots; iplot++){
\r
98 input_data_pn >> fSelectedPlots[iplot];
\r
99 //cout << "Plots to process :" << fSelectedPlots[iplot] << endl;
\r
102 input_data_pn.close();
\r
105 //________________________________________________________________________________________________
\r
106 void AliPSQAVisualization::PostProcessQA(){
\r
108 if(!fROOTInput) cout << "No .root file found" << endl;
\r
110 //cout << "Sto morendo qua? 1" << endl;
\r
111 gStyle->SetOptStat(0);
\r
112 gStyle->SetPalette(1);
\r
113 gStyle->SetFillColor(10);
\r
114 gStyle->SetOptStat(0);
\r
115 gStyle->SetOptTitle(1);
\r
116 // do not use scientific notation for run number
\r
117 TGaxis::SetMaxDigits(6);
\r
118 //cout << "Sto morendo qua? 2" << endl;
\r
119 ConvertTGraphErrorsToTH1Ds(); // Convert all plots to TH1D's from specified plot list
\r
120 //cout << "Sto morendo qua? 3" << endl;
\r
121 fCanvas = new TCanvas[fNSelectedPlots]; // Allocate memory for the canvases to draw PostProcessing
\r
123 if ((fDrawOverPlot) || (fSaveOverPlotPDF) || (fSaveOverPlotEPS)){
\r
124 fOverLegend = new TLegend(0.55,0.625,.75,.85);
\r
130 if ((fSavePDFs) || (fSaveOverPlotPDF) || (fSaveOverPlotEPS)){
\r
131 FileStat_t dummy_filestat;
\r
132 if (gSystem->GetPathInfo(fOutDirectory.Data(), dummy_filestat) == 1) { // cache directory does not exist
\r
133 MakeDir(fOutDirectory);
\r
137 // *************************************** LOOP ON PLOTS ***************************************
\r
139 for (Int_t iplot = 0; iplot < fNSelectedPlots; iplot++){ // Loop over the number of plots to be made pretty and drawn
\r
140 DrawSelected(iplot); // Draw the Selected plots, decide later whether to have them open/save them
\r
142 DrawSameTriggerOnSameCA(iplot);
\r
143 cout << "Draw selected - OK " << endl;
\r
145 if (fSavePDFs){ // Write the canvas to the PDF file if kTRUE
\r
147 SaveToPDFSeparately(iplot);
\r
150 if (!fDrawSelected){ // Close the canvas if you do not want to see the plot
\r
151 fCanvas[iplot].Close();
\r
154 if ( (fDrawOverPlot) || (fSaveOverPlotPDF) || (fSaveOverPlotEPS) ) { // Set points and draw overplot if any are true
\r
155 if (fUseColorArray){
\r
156 DrawOverPlotCA(iplot);
\r
159 DrawOverPlotNoCA(iplot);
\r
162 else if( (!fDrawOverPlot) && ( (fSaveOverPlotPDF) || (fSaveOverPlotEPS) ) ) { // Set the points to save to and/or pdf/eps but then close it outside the loop
\r
163 if (fUseColorArray){
\r
164 DrawOverPlotCA(iplot);
\r
167 DrawOverPlotNoCA(iplot);
\r
171 } // end loop on plots
\r
173 if (fSaveOverPlotPDF){ // Save the overplot to pdf
\r
176 if (fSaveOverPlotEPS){ // Save the overplot to eps
\r
179 if (!fDrawOverPlot){ // Close if you do not want to see it
\r
180 fOverCanvas.Close();
\r
184 //________________________________________________________________________________________________
\r
185 Int_t AliPSQAVisualization::MatchGoodRunToFillNumber(Int_t runnumber){
\r
189 for(Int_t irun = 0; irun < fNRawRuns; irun++){
\r
190 if(runnumber == fRawRunNumbers[irun]){
\r
191 fill = fRawFillNumbers[irun];
\r
192 // cout << runnumber << " matched to fill " << fill << endl;
\r
195 // cout << "Matching completed" << endl;
\r
199 //________________________________________________________________________________________________
\r
200 Int_t AliPSQAVisualization::MatchGoodRunToStats(Int_t runnumber){
\r
204 for(Int_t irun = 0; irun < fNRawRuns; irun++){
\r
205 if(runnumber == fRawRunNumbers[irun]){
\r
206 Stats = fRawRunStats[irun];
\r
207 // cout << runnumber << " matched to fill " << fill << endl;
\r
211 // cout << "Matching completed" << endl;
\r
215 //________________________________________________________________________________________________
\r
216 void AliPSQAVisualization::ConvertTGraphErrorsToTH1Ds(){
\r
218 cout << "********************** C O N V E R T I N G TGRAPHS T O T H 1 D" << endl;
\r
220 fRootFile = TFile::Open(Form("%s",fROOTInput.Data()));
\r
221 cout << "Opening file " << fROOTInput.Data() << endl;
\r
223 fDrawPlot = new TH1D[fNSelectedPlots]; // Array of TH1D's to be converted
\r
224 fNDiffFills = new Int_t[fNSelectedPlots];
\r
225 fFillSeparationLine = new TLine*[fNSelectedPlots];
\r
227 for (Int_t iplot = 0; iplot < fNSelectedPlots; iplot++){
\r
228 // Variables from the old TGraphErrors needed to draw TH1Fs
\r
229 // Uncomment if seg fault returns TGraph::GetX (this=0x0), as last printout will say which graph is not correct
\r
230 // cout << fInDirectory.Data() << "/" << fROOTInput.Data() << ": " << fSelectedPlots[iplot].Data() << endl;
\r
231 fNDiffFills[iplot] = 0;
\r
233 // cout << "Problem is here? " << fSelectedPlots[iplot].Data() << endl;
\r
234 TGraphErrors * TGEplot = (TGraphErrors*) fRootFile->Get(fSelectedPlots[iplot].Data());
\r
236 // cout << "Missing plot @ step " << iplot << "plot is -> " << fSelectedPlots[iplot].Data() << endl;
\r
240 Double_t * TGEx = TGEplot->GetX(); // needed to properly index the x-axis (run numbers)
\r
241 Double_t * TGEy = TGEplot->GetY(); // array of double_t's, qaval
\r
242 Int_t TGEnpoints = TGEplot->GetN(); // number of points used in the TGE
\r
243 Double_t * TGEey = TGEplot->GetEY(); // array of double_t's corresponding to the errors in the TGE
\r
244 TString TGEname = TGEplot->GetName();
\r
245 TString TGEtitle = TGEplot->GetTitle();
\r
247 // TGEx = new Double_t[TGEnpoints];
\r
249 fNRuns = TGEnpoints;
\r
250 fRunNumbers = new Int_t[fNRuns];
\r
251 fFillNumbers = new Int_t[fNRuns];
\r
252 fBinArray = new Int_t[fNRuns];
\r
254 for (Int_t irun=0; irun<TGEnpoints; irun++){
\r
255 fRunNumbers[irun] = TGEx[irun];
\r
256 fFillNumbers[irun] = MatchGoodRunToFillNumber(fRunNumbers[irun]);
\r
257 cout << "Run number [" << irun << "] - " << fRunNumbers[irun] << " - " << fFillNumbers[irun] << endl;
\r
258 fBinArray[irun] = irun;
\r
261 // make tlines to identify different
\r
263 // Parameters for the to be drawn TH1D
\r
264 TString TH1Dname = TGEname.Data();
\r
265 TH1Dname += "_TH1D";
\r
266 TString TH1Dtitle = TGEtitle.Data();
\r
267 TH1Dtitle += " TH1D";
\r
268 // See Below for the strange numbering of bins
\r
270 Int_t TH1Dxnbin = TGEnpoints;
\r
271 Int_t TH1Dxlow = 1;
\r
272 Int_t TH1Dxhigh = TH1Dxnbin + 1;
\r
273 // Declare the new plot to be drawn as a TH1D
\r
275 fDrawPlot[iplot].SetBins(TH1Dxnbin, TH1Dxlow, TH1Dxhigh); // start with bin label 1, up through bin number +1 (TH1D bin numbering has strange conventions, as zero bin is the underflow bin)
\r
277 fDrawPlot[iplot].SetNameTitle(TH1Dname.Data(),TH1Dtitle.Data());
\r
278 fDrawPlot[iplot].GetXaxis()->SetTitle("Run Number");
\r
279 TString TH1Dytitle = SetDrawSelectedYTitle(TGEtitle);
\r
280 fDrawPlot[iplot].SetYTitle(TH1Dytitle.Data());
\r
282 cout << "==================== TEST ============= " << endl;
\r
283 cout << "-------------------- iplot = " << iplot << endl;
\r
285 for (Int_t ibin = 1; ibin < TH1Dxnbin+1; ibin++){ // everything shifted off by one because tgraph starts at zero, th1f starts bins at 1
\r
286 fDrawPlot[iplot].SetBinContent(fDrawPlot[iplot].FindBin(ibin),TGEy[ibin-1]); // y[i-1] is the bin in plot
\r
287 fDrawPlot[iplot].SetBinError(fDrawPlot[iplot].FindBin(ibin),TGEey[ibin-1]);
\r
289 if(ibin< TH1Dxnbin){
\r
290 if(fFillNumbers[ibin]!=fFillNumbers[ibin-1]){
\r
291 cout << "New fill @ " << ibin << endl;
\r
292 cout << "Run @ "<< ibin-1 << " = " << fRunNumbers[ibin-1] <<" corresponding to fill " << fFillNumbers[ibin-1] << "; Crosscheck on bin array = " << fBinArray[ibin-1] << endl;
\r
293 cout << "Run @ "<< ibin << " = " << fRunNumbers[ibin] <<" corresponding to fill " << fFillNumbers[ibin] << endl;
\r
294 fNDiffFills[iplot]++;
\r
295 cout << "****************************************" << endl;
\r
299 Int_t TH1Dx = Int_t(TGEx[ibin-1]); // x[i-1] = actual bin label in plot
\r
300 TString TH1DxBinLabel = Form("%i",TH1Dx);
\r
302 cout << "TH1DxBinLabel = " << TH1DxBinLabel << endl;
\r
304 fDrawPlot[iplot].GetXaxis()->SetBinLabel(fDrawPlot[iplot].FindBin(ibin), TH1DxBinLabel.Data());
\r
305 fDrawPlot[iplot].GetXaxis()->SetTitleSize(.05); // default = 4%, made it 5%
\r
307 } // end of loop on bins
\r
309 fFillSeparationLine[iplot] = new TLine[fNDiffFills[iplot]];
\r
311 TLine * newline = new TLine[fNDiffFills[iplot]];
\r
313 cout << "Number of different fills = " << fNDiffFills[iplot] << " for iplot index = " << iplot << endl;
\r
314 cout << "==================== END TEST ============= " << endl;
\r
316 //looping again on the bins of the TGE -> filling the TLines
\r
318 Int_t fillindex = 0;
\r
319 for (Int_t ibin = 1; ibin < TH1Dxnbin+1; ibin++){
\r
321 if(ibin<TH1Dxnbin){
\r
322 if(fFillNumbers[ibin]!=fFillNumbers[ibin-1]){
\r
323 //newline[fillindex].SetX1((0.5*(fFillNumbers[ibin-1]+fFillNumbers[ibin])));
\r
324 //newline[fillindex].SetX2((0.5*(fFillNumbers[ibin-1]+fFillNumbers[ibin])));
\r
325 // newline[fillindex].SetX1((0.5*((ibin-1)+ibin)));
\r
326 // newline[fillindex].SetX2((0.5*((ibin-1)+ibin)));
\r
327 newline[fillindex].SetX1(ibin+1);
\r
328 newline[fillindex].SetX2(ibin+1);
\r
329 newline[fillindex].SetY1(0.);
\r
330 newline[fillindex].SetY2(1.);
\r
331 cout << "setting line @ = " << ((0.5*((ibin-1)+ibin))) << endl;
\r
333 fFillSeparationLine[iplot][fillindex] = newline[fillindex];
\r
336 } // end if on checking different run numbers
\r
338 }// endl loop on bins
\r
342 // adding some drawing options
\r
344 fDrawPlot[iplot].SetMarkerStyle(20);
\r
345 fDrawPlot[iplot].SetMarkerSize(1.4);
\r
346 fDrawPlot[iplot].SetMarkerColor(kBlue);
\r
347 fDrawPlot[iplot].SetLineColor(kBlue);
\r
348 fDrawPlot[iplot].GetYaxis()->SetRangeUser(-0.001,1.05);
\r
349 fDrawPlot[iplot].GetXaxis()->LabelsOption("V");
\r
350 } // end loop on plots
\r
352 cout << "********************** E N D C O N V E R T I N G TGRAPHS T O T H 1 D" << endl;
\r
356 //________________________________________________________________________________________________
\r
357 TString AliPSQAVisualization::SetDrawSelectedYTitle(TString TGEtitle){
\r
360 Ssiz_t first_o = TGEtitle.First('o'); // o in over, lowercase o that appears first is the over
\r
361 Ssiz_t first_f = TGEtitle.First('f');
\r
364 label[0] = TString(TGEtitle( start , first_o - start - 1)); // Shift one over from the 'h'
\r
365 label[1] = TString(TGEtitle( first_o + 4, first_f - first_o - 4 )); //Shift five over from the 'O'
\r
367 // Make this substitution to make legend smaller
\r
369 if (label[1].Contains("Trigger class")){
\r
370 label[1].ReplaceAll("Trigger class","All");
\r
373 TString yTH1Dtitle = label[0];
\r
374 yTH1Dtitle += " / ";
\r
375 yTH1Dtitle += label[1];
\r
380 //________________________________________________________________________________________________
\r
381 void AliPSQAVisualization::ScaleMinAndMax(){ // Get maximum and minimum value of traghs to set bounds for overplot
\r
382 Double_t tmp_max; // max values from tgraphs
\r
383 Double_t tmp_min; // min values from tgraphs
\r
385 for (Int_t iplot = 0; iplot < fNSelectedPlots; iplot++){ // Loop over the number of plots to be made
\r
387 tmp_max = fDrawPlot[iplot].GetMaximum();
\r
388 if (tmp_max > fMaximum){
\r
389 fMaximum = tmp_max;
\r
392 tmp_min = fDrawPlot[iplot].GetMinimum();
\r
393 if (tmp_max < fMinimum){
\r
394 fMinimum = tmp_min;
\r
398 // Set the min to be lower and max to be higher so that all points can be seen
\r
399 fMaximum *= fMultMax;
\r
400 fMinimum /= fDivMin;
\r
403 //________________________________________________________________________________________________
\r
404 void AliPSQAVisualization::MakeDir(TString dir){ // have to pass a private data member, kinda ugly, but otherwise use sentinel values or copy this function three times... taken from AliPSQA
\r
405 TString mkDir = "mkdir -p ";
\r
406 mkDir += dir.Data();
\r
407 gSystem->Exec(mkDir); // mkdir for the cache/output
\r
410 //________________________________________________________________________________________________
\r
411 void AliPSQAVisualization::ImportRunAndFillInfo(const Char_t * listOfRunsAndFills){
\r
413 Int_t run_num; //run number from list
\r
414 ifstream input_runsandfill; //text file object
\r
415 input_runsandfill.open(listOfRunsAndFills,ios::in ); //open the text file
\r
417 Int_t NRuns = 0; //number of runs to be processed
\r
418 while(input_runsandfill >> run_num) { // count number of runs
\r
421 input_runsandfill.close();
\r
422 cout << "In total there are " << NRuns << " runs in file " << endl;
\r
424 fNRawRuns = NRuns/3;
\r
425 fRawFillNumbers = new Int_t[fNRawRuns];
\r
426 fRawRunNumbers = new Int_t[fNRawRuns];
\r
427 fRawRunStats = new Int_t[fNRawRuns];
\r
429 input_runsandfill.open(listOfRunsAndFills,ios::in );
\r
431 for(Int_t irun = 0; irun < fNRawRuns; irun++){
\r
432 input_runsandfill >> fRawRunNumbers[irun] >> fRawFillNumbers[irun] >> fRawRunStats[irun];
\r
433 cout << irun << " - " << fRawRunNumbers[irun] << " - " << fRawFillNumbers[irun] << " - stats = " << fRawRunStats[irun] << endl;
\r
435 cout << "DONE " << endl;
\r
436 input_runsandfill.close();
\r
437 cout << "DONE DONE" << endl;
\r
440 //________________________________________________________________________________________________
\r
441 void AliPSQAVisualization::DrawSelected(Int_t iplot){
\r
442 fCanvas[iplot].cd(); // write to this canvas first
\r
443 fCanvas[iplot].SetBottomMargin(0.15); // default 0.15
\r
444 fCanvas[iplot].SetRightMargin(0.02);
\r
446 cout << ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> " << endl;
\r
447 cout << "iplot = " << iplot << endl;
\r
448 cout << "Number of different fills for this plot " << fNDiffFills[iplot] << endl;
\r
449 cout << "Plot name " << fSelectedPlots[iplot] << endl;
\r
450 cout << " " << endl;
\r
453 fDrawPlot[iplot].GetXaxis()->SetTitleOffset(1.6);
\r
455 fDrawPlot[iplot].Draw("E P X0"); // draw the new plot to canvas
\r
457 cout << "Drawing " << fSelectedPlots[iplot] << endl;
\r
459 TLine * line = new TLine[fNDiffFills[iplot]];
\r
460 for (Int_t lineIndex = 0; lineIndex < fNDiffFills[iplot]; lineIndex++){
\r
461 // cout << "Index pf plots that are processed = (" << iplot << "," << lineIndex << ")" << endl;
\r
462 // cout << "Copying line " << lineIndex << endl;
\r
463 line[lineIndex] = fFillSeparationLine[iplot][lineIndex];
\r
464 // cout << "Copied - drawing line " << lineIndex << endl;
\r
465 line[lineIndex].Draw("same");
\r
466 // cout << "Drawn line " << lineIndex << endl;
\r
467 // cout << "*****************" << endl;
\r
468 }// endl loop on bins
\r
469 // cout << "COMPLETED " << endl;
\r
472 //________________________________________________________________________________________________
\r
473 void AliPSQAVisualization::DrawSameTriggerOnSameCA(Int_t iplot){
\r
475 Bool_t containsstring = kFALSE;
\r
477 containsstring = fSelectedPlots[iplot].Contains("kINT7",TString::kExact);
\r
479 if(containsstring) cout << iplot << " - Sting " << fSelectedPlots[iplot] << " - contains string: yes " << endl;
\r
480 else cout << iplot << " - Sting " << fSelectedPlots[iplot] << " - contains string: no " << endl;
\r
484 //________________________________________________________________________________________________
\r
485 void AliPSQAVisualization::DrawOverPlotCA(Int_t iplot){
\r
488 fDrawPlot[iplot].SetMarkerColor(fColors[iplot]); // iplot == 0 for Color_t == white...
\r
489 fDrawPlot[iplot].SetMarkerStyle(Style_t(iplot+20)); // 20 = big circle, afterwards, useful styles, otherwise too small
\r
490 fDrawPlot[iplot].SetLineColor(fColors[iplot]);
\r
491 fDrawPlot[iplot].SetTitle(fOverPlotTitle);
\r
492 fOverLegend->AddEntry(&fDrawPlot[iplot],fDrawPlot[iplot].GetYaxis()->GetTitle(),"lep");
\r
493 fDrawPlot[iplot].GetYaxis()->SetTitle("");
\r
494 fDrawPlot[iplot].GetYaxis()->SetRangeUser(fMinimum, fMaximum);
\r
495 // adding fill lines
\r
497 // end adding fill lines
\r
498 fDrawPlot[iplot].Draw("E P X0");
\r
500 else if (iplot == (fNSelectedPlots - 1) ){
\r
502 fDrawPlot[iplot].SetMarkerColor(fColors[iplot]);
\r
503 fDrawPlot[iplot].SetMarkerStyle(Style_t(iplot+20)); // 20 = big circle, afterwards, useful styles, otherwise too small
\r
504 fDrawPlot[iplot].SetLineColor(fColors[iplot]);
\r
505 fDrawPlot[iplot].SetTitle(fOverPlotTitle);
\r
506 fOverLegend->AddEntry(&fDrawPlot[iplot],fDrawPlot[iplot].GetYaxis()->GetTitle(),"lep");
\r
507 fDrawPlot[iplot].GetYaxis()->SetTitle("");
\r
508 fDrawPlot[iplot].Draw("E P X0 SAME");
\r
509 // fOverLegend->Draw();
\r
513 fDrawPlot[iplot].SetMarkerColor(fColors[iplot]);
\r
514 fDrawPlot[iplot].SetMarkerStyle(Style_t(iplot+20)); // 20 = big circle, afterwards, useful styles, otherwise too small
\r
515 fDrawPlot[iplot].SetLineColor(fColors[iplot]);
\r
516 fDrawPlot[iplot].SetTitle(fOverPlotTitle);
\r
517 fOverLegend->AddEntry(&fDrawPlot[iplot],fDrawPlot[iplot].GetYaxis()->GetTitle(),"lep");
\r
518 fDrawPlot[iplot].GetYaxis()->SetTitle("");
\r
519 fDrawPlot[iplot].Draw("E P X0 SAME");
\r
523 //________________________________________________________________________________________________
\r
524 void AliPSQAVisualization::DrawOverPlotNoCA(Int_t iplot){
\r
527 fDrawPlot[iplot].SetMarkerColor(Color_t(iplot+1)); // iplot == 0 for Color_t == white...
\r
528 fDrawPlot[iplot].SetMarkerStyle(Style_t(iplot+20)); // 20 = big circle, afterwards, useful styles, otherwise too small
\r
529 fDrawPlot[iplot].SetLineColor(Color_t(iplot+1));
\r
530 fDrawPlot[iplot].SetTitle(fOverPlotTitle);
\r
531 fOverLegend->AddEntry(&fDrawPlot[iplot],fDrawPlot[iplot].GetYaxis()->GetTitle(),"lep");
\r
532 fDrawPlot[iplot].GetYaxis()->SetTitle("");
\r
533 fDrawPlot[iplot].GetYaxis()->SetRangeUser(fMinimum, fMaximum);
\r
534 fDrawPlot[iplot].Draw("E P X0");
\r
536 else if (iplot == (fNSelectedPlots - 1) ){
\r
538 fDrawPlot[iplot].SetMarkerColor(Color_t(iplot+1));
\r
539 fDrawPlot[iplot].SetMarkerStyle(Style_t(iplot+20)); // 20 = big circle, afterwards, useful styles, otherwise too small
\r
540 fDrawPlot[iplot].SetLineColor(Color_t(iplot+1));
\r
541 fDrawPlot[iplot].SetTitle(fOverPlotTitle);
\r
542 fOverLegend->AddEntry(&fDrawPlot[iplot],fDrawPlot[iplot].GetYaxis()->GetTitle(),"lep");
\r
543 fDrawPlot[iplot].GetYaxis()->SetTitle("");
\r
544 fDrawPlot[iplot].Draw("E P X0 SAME");
\r
545 fOverLegend->Draw();
\r
549 fDrawPlot[iplot].SetMarkerColor(Color_t(iplot+1));
\r
550 fDrawPlot[iplot].SetMarkerStyle(Style_t(iplot+20)); // 20 = big circle, afterwards, useful styles, otherwise too small
\r
551 fDrawPlot[iplot].SetLineColor(Color_t(iplot+1));
\r
552 fDrawPlot[iplot].SetTitle(fOverPlotTitle);
\r
553 fOverLegend->AddEntry(&fDrawPlot[iplot],fDrawPlot[iplot].GetYaxis()->GetTitle(),"lep");
\r
554 fDrawPlot[iplot].GetYaxis()->SetTitle("");
\r
555 fDrawPlot[iplot].Draw("P SAME");
\r
559 //________________________________________________________________________________________________
\r
560 void AliPSQAVisualization::SaveToPDFSeparately(Int_t iplot){
\r
561 cout << "Saving: " << fOutDirectory << "/" << fSelectedPlots[iplot] <<".pdf"<<endl;
\r
562 fCanvas[iplot].SaveAs(Form("%s/%s.pdf",fOutDirectory.Data(),fSelectedPlots[iplot].Data()));
\r
565 //________________________________________________________________________________________________
\r
566 void AliPSQAVisualization::SavePDFs(Int_t iplot){
\r
567 if ( iplot == 0 ){ // Open the PDF file if to be saved and save the first plot
\r
568 fCanvas[iplot].Print(Form("%s/%s(",fOutDirectory.Data(),fOutPDFName.Data()),"pdf");
\r
570 else if ( (iplot == (fNSelectedPlots - 1)) && (!fSaveOverPlotPDF) ){ // Close the PDF and save the last plot
\r
571 fCanvas[iplot].Print(Form("%s/%s)",fOutDirectory.Data(),fOutPDFName.Data()),"pdf");
\r
572 fCanvas[iplot].SaveAs(Form("%s/%s_%d.pdf",fOutDirectory.Data(),fOutPDFName.Data(),iplot));
\r
574 else{ // Save the PDF with the inbetween plots
\r
575 fCanvas[iplot].Print(Form("%s/%s",fOutDirectory.Data(),fOutPDFName.Data()),"pdf");
\r
579 //________________________________________________________________________________________________
\r
580 void AliPSQAVisualization::SaveOverPlotPDF(){
\r
583 fOverCanvas.Print(Form("%s/%s)",fOutDirectory.Data(),fOutPDFName.Data()),"pdf");
\r
586 fOverCanvas.Print(Form("%s/%s",fOutDirectory.Data(),fOutPDFName.Data()),"pdf");
\r
590 //________________________________________________________________________________________________
\r
591 void AliPSQAVisualization::SaveOverPlotEPS(){
\r
593 fOverCanvas.Print(Form("%s/%s",fOutDirectory.Data(),fOutEPSName.Data()),"eps");
\r
596 //________________________________________________________________________________________________
\r