]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/macros/PhysSelQA/AliPSQAVisualization.h
end-of-line normalization
[u/mrichter/AliRoot.git] / ANALYSIS / macros / PhysSelQA / AliPSQAVisualization.h
1 /////////////////////////////////////
2 // Created by: Kevin McDermott     //
3 // email: kmcderm3@nd.edu          //
4 // CERN Summer Student 2012        //
5 // University of Notre Dame du Lac //
6 //                                 // 
7 // Revision: 1.0                   //
8 // Created on: August 6, 2012      //
9 /////////////////////////////////////
10
11 #ifndef ALIPSQAVISUALIZATION_H
12 #define ALIPSQAVISUALIZATION_H
13
14 #if !defined(__CINT__) || defined(__MAKECINT__)
15 #include "TCanvas.h"
16 #include "TH1D.h"
17 #include "TGraphErrors.h"
18 #include "TFile.h"
19 #include <Riostream.h>
20 #include "TGaxis.h"
21 #include "TStyle.h"
22 #include "TLegend.h"
23 #include "TSystem.h"
24 #endif
25
26 class AliPSQAVisualization : public TObject
27 {
28  public:
29   AliPSQAVisualization();
30   virtual ~AliPSQAVisualization();
31
32   void InitializeSelectedPlots(const Char_t * listOfPlots);
33   void InitializeColorArray(const Char_t * listOfColors); // called only if fUseColorArray == kTRUE
34   
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();
51
52   // Getters and setters from the macro
53
54   void     SetInDirectory(TString indir){fInDirectory = indir;};
55   TString  GetInDirectory(){return fInDirectory;};
56
57   void     SetROOTInput(TString RI){fROOTInput = RI;};
58   TString  GetROOTInput(){return fROOTInput;};
59     
60   void     SetSavePDFs(Bool_t pdf){fSavePDFs = pdf;};
61   Bool_t   GetSavePDFs(){return fSavePDFs;};
62   
63   void     SetSaveOverPlotPDF(Bool_t pdf){fSaveOverPlotPDF = pdf;};
64   Bool_t   GetSaveOverPlotPDF(){return fSaveOverPlotPDF;};
65
66   void     SetOutPDFName(TString name){fOutPDFName = name;};
67   TString  GetOutPDFName(){return fOutPDFName;};
68
69   void     SetSaveOverPlotEPS(Bool_t eps){fSaveOverPlotEPS = eps;};
70   Bool_t   GetSaveOverPlotEPS(){return fSaveOverPlotEPS;};
71   
72   void     SetOutEPSName(TString name){fOutEPSName = name;};
73   TString  GetOutEPSName(){return fOutEPSName;};
74
75   void     SetOutDirectory(TString out){fOutDirectory = out;};
76   TString  GetOutDirectory(){return fOutDirectory;};  
77
78   void     SetDrawSelected(Bool_t select){fDrawSelected = select;};
79   Bool_t   GetDrawSelected(){return fDrawSelected;};
80
81   void     SetUseColorArray(Bool_t ca){fUseColorArray = ca;};
82   Bool_t   GetUseColorArray(){return fUseColorArray;};
83
84   void     SetDrawOverPlot(Bool_t op){fDrawOverPlot = op;};
85   Bool_t   GetDrawOverPlot(){return fDrawOverPlot;};
86
87   void     SetOverPlotTitle(TString opt){fOverPlotTitle = opt;};
88   TString  GetOverPlotTitle(){return fOverPlotTitle;};
89
90   void SetPlotOnSameCanvas(Bool_t plot){fSetPlotOnSameCanvas=plot;}
91
92   // Scaling Options
93
94   void     SetScaleAuto(Bool_t sa){fScaleAuto = sa;};
95   Bool_t   GetScaleAuto(){return fScaleAuto;};
96
97   void     SetScaleAutoDivMin(Double_t div_min){fDivMin = div_min;};
98   Double_t GetScaleAutoDivMin(){return fDivMin;};
99
100   void     SetScaleAutoMultMax(Double_t mult_max){fMultMax = mult_max;};
101   Double_t GetScaleAutoMultMax(){return fMultMax;};
102
103   void     SetScaleManMin(Double_t min){fMinimum = min;};
104   Double_t GetScaleManMin(){return fMinimum;};
105
106   void     SetScaleManMax(Double_t max){fMaximum = max;};
107   Double_t GetScaleManMax(){return fMaximum;};
108
109  private:
110
111   // Input variables
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
118
119   // Save DrawSelected
120   Bool_t  fDrawSelected;
121   Bool_t fSetPlotOnSameCanvas; // plot histos on same canvas
122
123   // Save PDF variables
124
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
128
129   // Overplot variables
130
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
138
139   // Overplot color array variables
140
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
144
145   // Overplot Scaling Variables
146
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
150
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
153
154   // Plotting variables needed
155
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
159     
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
165
166   Int_t *fNDiffFills; // array of integers containing info
167   Int_t *fBinArray; // array of histo bins corresponding to different RUNS
168
169   Int_t fNRuns; // Number of Runs used in macro
170   Int_t fNRawRuns; // Number of raw Runs in macro
171
172   ClassDef(AliPSQAVisualization, 2)
173 };
174
175 #endif