1 /////////////////////////////////////
2 // Created by: Kevin McDermott //
3 // email: kmcderm3@nd.edu //
4 // CERN Summer Student 2012 //
5 // University of Notre Dame du Lac //
8 // Created on: August 6, 2012 //
9 /////////////////////////////////////
11 #ifndef ALIPSQAVISUALIZATION_H
12 #define ALIPSQAVISUALIZATION_H
14 #if !defined(__CINT__) || defined(__MAKECINT__)
17 #include "TGraphErrors.h"
19 #include <Riostream.h>
26 class AliPSQAVisualization : public TObject
29 AliPSQAVisualization();
30 virtual ~AliPSQAVisualization();
32 void InitializeSelectedPlots(const Char_t * listOfPlots);
33 void InitializeColorArray(const Char_t * listOfColors); // called only if fUseColorArray == kTRUE
35 void PostProcessQA(); // First call of macro
36 void ScaleMinAndMax(); // called only if fScaleAuto == kTRUE
37 void MakeDir(TString dir); // called if anything is to be saved, first check to make sure directory exists.
38 void ImportRunAndFillInfo(const Char_t * listOfRunsAndFills); // import info on run and fill number
39 void DrawSelected(Int_t iplot);
40 Int_t MatchGoodRunToFillNumber(Int_t runnumber); // match run number to fill number
41 Int_t MatchGoodRunToStats(Int_t runnumber); // match run number to it's stats
42 void ConvertTGraphErrorsToTH1Ds();
43 TString SetDrawSelectedYTitle(TString TGEtitle);
44 void SavePDFs(Int_t iplot);
45 void DrawSameTriggerOnSameCA(Int_t iplot);
46 void DrawOverPlotCA(Int_t iplot);
47 void DrawOverPlotNoCA(Int_t iplot);
48 void SaveToPDFSeparately(Int_t iplot);
49 void SaveOverPlotPDF();
50 void SaveOverPlotEPS();
52 // Getters and setters from the macro
54 void SetInDirectory(TString indir){fInDirectory = indir;};
55 TString GetInDirectory(){return fInDirectory;};
57 void SetROOTInput(TString RI){fROOTInput = RI;};
58 TString GetROOTInput(){return fROOTInput;};
60 void SetSavePDFs(Bool_t pdf){fSavePDFs = pdf;};
61 Bool_t GetSavePDFs(){return fSavePDFs;};
63 void SetSaveOverPlotPDF(Bool_t pdf){fSaveOverPlotPDF = pdf;};
64 Bool_t GetSaveOverPlotPDF(){return fSaveOverPlotPDF;};
66 void SetOutPDFName(TString name){fOutPDFName = name;};
67 TString GetOutPDFName(){return fOutPDFName;};
69 void SetSaveOverPlotEPS(Bool_t eps){fSaveOverPlotEPS = eps;};
70 Bool_t GetSaveOverPlotEPS(){return fSaveOverPlotEPS;};
72 void SetOutEPSName(TString name){fOutEPSName = name;};
73 TString GetOutEPSName(){return fOutEPSName;};
75 void SetOutDirectory(TString out){fOutDirectory = out;};
76 TString GetOutDirectory(){return fOutDirectory;};
78 void SetDrawSelected(Bool_t select){fDrawSelected = select;};
79 Bool_t GetDrawSelected(){return fDrawSelected;};
81 void SetUseColorArray(Bool_t ca){fUseColorArray = ca;};
82 Bool_t GetUseColorArray(){return fUseColorArray;};
84 void SetDrawOverPlot(Bool_t op){fDrawOverPlot = op;};
85 Bool_t GetDrawOverPlot(){return fDrawOverPlot;};
87 void SetOverPlotTitle(TString opt){fOverPlotTitle = opt;};
88 TString GetOverPlotTitle(){return fOverPlotTitle;};
90 void SetPlotOnSameCanvas(Bool_t plot){fSetPlotOnSameCanvas=plot;}
94 void SetScaleAuto(Bool_t sa){fScaleAuto = sa;};
95 Bool_t GetScaleAuto(){return fScaleAuto;};
97 void SetScaleAutoDivMin(Double_t div_min){fDivMin = div_min;};
98 Double_t GetScaleAutoDivMin(){return fDivMin;};
100 void SetScaleAutoMultMax(Double_t mult_max){fMultMax = mult_max;};
101 Double_t GetScaleAutoMultMax(){return fMultMax;};
103 void SetScaleManMin(Double_t min){fMinimum = min;};
104 Double_t GetScaleManMin(){return fMinimum;};
106 void SetScaleManMax(Double_t max){fMaximum = max;};
107 Double_t GetScaleManMax(){return fMaximum;};
112 TString * fSelectedPlots; // List of plots to be turned from tragphs to th1ds
113 Int_t fNSelectedPlots; // number of plots to be turned from tgraphs to th1ds
114 TString fInDirectory; // input directory of root file, most likely the one just analyzed from AliPSQA
115 TString fROOTInput; // name of root file specified by user
116 TString fRunFillFile;// name of file containing info on various fills
117 TFile * fRootFile; // Root file to be used to produce plots
120 Bool_t fDrawSelected;
121 Bool_t fSetPlotOnSameCanvas; // plot histos on same canvas
123 // Save PDF variables
125 Bool_t fSavePDFs; // if kTRUE, save pdfs of th1ds
126 TString fOutDirectory; // save pdfs to this directory
127 TString fOutPDFName; // common pdf name, group pdf files together
129 // Overplot variables
131 Bool_t fDrawOverPlot; // if kTrue, save overplot of all the th1ds
132 TString fOverPlotTitle; // title specified by user for overplot, most likely the name of the trigger mask, channel, and logic
133 Bool_t fSaveOverPlotPDF; //if ktrue, save overplot to pdf file
134 TCanvas fOverCanvas; // Overplot canvas
135 TLegend * fOverLegend; // Overplot legend
136 Bool_t fSaveOverPlotEPS; // if ktrue, save overplot eps file
137 TString fOutEPSName; // eps file name for overplot together
139 // Overplot color array variables
141 Bool_t fUseColorArray; // if ktrue, use colorarray specified in a list file
142 Color_t * fColors; // set in a list file, using enums of colors (just use AliRoot and type in the color, e.g. root [0] kBlue returns (const enum EColor)600)
143 Int_t fNColors; // number of colors used
145 // Overplot Scaling Variables
147 Bool_t fScaleAuto; // If kTRUE, set scaling automatically with GetMinAndMax()
148 Double_t fMultMax; // Auto scaling factor, multiply the max
149 Double_t fDivMin; // Auto scaling factor, divide the min
151 Double_t fMinimum; // Maximum val in selected tgraphs, used for setting range for overplot
152 Double_t fMaximum; // Minimum val in selected tgraphs, used for setting range for overplot
154 // Plotting variables needed
156 TCanvas * fCanvas; // new array in InitializeDrawSelected with the amount of fNDrawSelected
157 TH1D * fDrawPlot; // new array in InitializeDrawSelected with the amount of fNDrawSelected
158 TLine ** fFillSeparationLine; // double array of Tlines - for each plot and for each change of fill number
160 Int_t *fRunNumbers; // Runs to be used in macro
161 Int_t *fFillNumbers; // Fill numbers to be associated to macro
162 Int_t *fRawRunNumbers; // raw run numbers - taken from logbook
163 Int_t *fRawFillNumbers;// raw fill numbers corresponding to runs - taken from logbook
164 Int_t *fRawRunStats; // raw stats for each run number - taken from logbook
166 Int_t *fNDiffFills; // array of integers containing info
167 Int_t *fBinArray; // array of histo bins corresponding to different RUNS
169 Int_t fNRuns; // Number of Runs used in macro
170 Int_t fNRawRuns; // Number of raw Runs in macro
172 ClassDef(AliPSQAVisualization, 2)