]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCCalibViewerGUI.h
- cosmetics
[u/mrichter/AliRoot.git] / TPC / AliTPCCalibViewerGUI.h
1 #ifndef ALITPCCALIBVIEWERGUI_H
2 #define ALITPCCALIBVIEWERGUI_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 /* $Id: AliTPCCalibViewerGUI.h,v */
8
9 ///////////////////////////////////////////////////////////////////////////////
10 //                                                                           //
11 //  GUI for the AliTPCCalibViewer                                            //
12 //  used for the calibration monitor                                         //
13 //                                                                           //
14 ///////////////////////////////////////////////////////////////////////////////
15
16 #ifndef ROOT_TGButton
17 #include "TGWidget.h"
18 #endif
19 #ifndef ROOT_TGFrame
20 #include "TGFrame.h"
21 #endif
22
23 #include <TGButton.h>
24 #include <TGListBox.h>
25 #include <TGComboBox.h>
26 #include <TGNumberEntry.h>
27 #include <TRootEmbeddedCanvas.h>
28 #include <TGSplitter.h>
29 #include <TGButtonGroup.h>
30 #include <TGLabel.h>
31 #include <TGTab.h>
32 #include <TString.h>
33 class TROOTt;
34 class AliTPCCalibViewer;
35 class AliTPCPreprocessorOnline;
36
37
38 // class TGListBox;
39 // class TGNumberEntry;
40 // class TGSplitter;
41 // class TGTab;
42 // class TGWidget; // ???
43 // class TGLabel;
44 // class TGButtonGroup;
45 // class TGComboBox;
46 // class TRootEmbeddedCanvas;
47 // class TGButton;
48 // class TGRadioButton;
49 // class TGCheckButton;
50 // class TGTextEntry;
51        
52        
53 class AliTPCCalibViewerGUI : public TGCompositeFrame {
54    
55 public:
56    AliTPCCalibViewerGUI(const TGWindow *p, UInt_t w, UInt_t h, char* fileName);  // constructor; fileName specifies the ROOT tree used for drawing
57    AliTPCCalibViewerGUI(const AliTPCCalibViewerGUI &c);                          // copy constructor
58    AliTPCCalibViewerGUI &operator = (const AliTPCCalibViewerGUI &param);         // assignment operator
59
60    virtual ~AliTPCCalibViewerGUI();
61    // virtual void CloseWindow();
62    
63    void DrawGUI(const TGWindow *p, UInt_t w, UInt_t h);         // to be called by the costructor, here the windows is drawn
64    void SetInitialValues();                                     // set the initial button states
65    void Initialize(const char* fileName, const char* treeName = "calPads"); // initializes the GUI with default settings and opens tree for drawing
66    void Initialize(AliTPCCalibViewer *viewer);                  // initializes the GUI with default settings and opens tree for drawing
67    void Reload(){Initialize(fViewer);}                          // reload the viewr after it has been changed, e.g. added a new referenceTree, ...
68    void Reset();
69    TString* GetDrawString();                                    // create the draw string out of selection
70    TString* GetCutString();                                     // create the cut string out of selection
71    TString* GetSectorString();                                  // create the sector string out of selection
72    AliTPCCalibViewer* GetViewer() {return fViewer;}             // returns the internal AliTPCCalibViewer object, which does the work
73    static TObjArray* ShowGUI(const char* fileName = 0);             // initialize and show GUI for presentation, standalone
74    
75    void HandleButtonsGeneral(Int_t id = -1); // handles mutual radio button exclusions for general Tab
76    void HandleButtons1D(Int_t id = -1);      // handles mutual radio button exclusions for 1D Tab
77    void HandleButtonsStat(Int_t id = -1);    // handles statistic check boxes 
78    void HandleButtonsCuts(Int_t id = -1);    // handles mutual radio button exclusions for right side
79    void HandleButtonsNoRedraw(Int_t id = -1);// handles label & scaling checkboxes without redrawing
80    void ReplacePlaceHolders(TString &str);   // replace place holders of the draw variable and normalisation variable
81    void DoNewSelection();                    // decides whether to redraw if user makes another selection
82    void DoDraw();                            // main method for drawing according to user selection
83    void DoFit();                             // main method for fitting
84    void DoExport();                          // function to export a CalPad to Cint
85    void DoDumpToFile();                      // function to dump a new calib tree to file
86    void DoLoadTree();                        // function to load a new calib tree
87    void DoExportNorm();                      // function to use a calPad for normalization
88    void SavePicture();                       // method for saving
89    void GetMinMax();                         // Read current Min & Max from the plot and set it to fTxtSetMin & fTxtSetMax
90    void SetMinMaxLabel();                    // Set min, max and label without redrawing
91    void ChangeSector();                      // function that is called, when the number of the sector is changed
92    void AddFitFunction() const;              // adds the last fit function to the normalization list
93    void MouseMove(Int_t event, Int_t x, Int_t y, TObject *selected); 
94    void UnchekAllStat();                     // Disable all statistical legend entries, no statistical legend.
95    
96 protected:   
97    AliTPCCalibViewer   *fViewer;             // CalibViewer object used for drawing
98    AliTPCPreprocessorOnline *fPreprocessor;  // PreprocessorOnline object, used to collect the exported CalPads and to save them into a new calibTree
99
100    TGCompositeFrame    *fContTopBottom;      // container for all GUI elements, vertical divided
101    TGCompositeFrame    *fContLCR;            // container for all GUI elements, horizontal divided
102    TGCompositeFrame    *fContLeft;           // container for GUI elements on left side
103    TGTab               *ftabLeft;            // Tabs on the left side for plot options
104    TGCompositeFrame    *ftabLeft0;           // Tab 0 on the left side for general plot options
105    TGCompositeFrame    *ftabLeft1;           // Tab 1 on the left side for 1D plot options
106    TGTab               *ftabRight;           // Tabs on the right side
107    TGCompositeFrame    *fTabRight0;          // Tab 0 on the right side for basic
108    TGCompositeFrame    *fTabRight1;          // Tab 1 on the right side for advanced
109    TGCompositeFrame    *fContRight;          // container for GUI elements on right side
110    TGCompositeFrame    *fContCenter;         // container for GUI elements at the center
111    TGCompositeFrame    *fContPlotOpt;        // container for plot options GUI elements
112    TGCompositeFrame    *fContDrawOpt;        // container for draw options GUI elements
113    TGCompositeFrame    *fContDrawOptSub1D2D; // container for 1D and 2D radio-button
114    TGCompositeFrame    *fContNormalized;     // container for normalization options GUI elements
115    TGCompositeFrame    *fContCustom;         // container for custom draw command GUI elements
116    TGCompositeFrame    *fContCuts;           // container for cut options GUI elements
117    TGCompositeFrame    *fContSector;         // container for sector GUI elements
118    TGCompositeFrame    *fContAddCuts;        // container for additional cut command GUI elements
119    TGCompositeFrame    *fContFit;            // container for fit GUI elements
120    TGCompositeFrame    *fContAddFit;         // container for additional fit GUI elements
121    TGCompositeFrame    *fContScaling;        // container for scaling GUI elements
122    TGCompositeFrame    *fContSetMax;         // container for SetMaximum elements
123    TGCompositeFrame    *fContSetMin;         // container for SetMinimum elements
124    TGCompositeFrame    *fContAddDrawOpt;     // additional draw options container
125    TGListBox           *fListVariables;      // listbox with possible variables
126    TGTextButton        *fBtnDraw;            // draw button
127    TGTextButton        *fBtnFit;             // fit button
128    TGTextButton        *fBtnAddFitFunction;  // button to add fit function to normalization
129    TGTextButton        *fBtnGetMinMax;       // GetMinMax-button
130    TRootEmbeddedCanvas *fCanvMain;           // main drawing canvas
131    TGRadioButton       *fRadioRaw;           // raw radio button
132    TGRadioButton       *fRadioNormalized;    // normalized radio button
133    TGRadioButton       *fRadioPredefined;    // predefined plot radio button
134    TGRadioButton       *fRadioCustom;        // custom radio button
135    TGRadioButton       *fRadio1D;            // 1D radio button
136    TGRadioButton       *fRadio2D;            // 2D radio button
137    TGRadioButton       *fRadioTPC;           // TPC radio button
138    TGRadioButton       *fRadioSideA;         // side A radio button
139    TGRadioButton       *fRadioSideC;         // side C radio button
140    TGRadioButton       *fRadioROC;           // ROC radio button
141    TGRadioButton       *fRadioSector;        // sector radio button
142    TGComboBox          *fComboAddDrawOpt;    // additional draw options combo box
143    TGCheckButton       *fChkAuto;            // automatic redraw checkbox
144    TGCheckButton       *fChkAutoAppend;      // automatic appendign of "~" checkbox
145    TGComboBox          *fComboMethod;        // normalization methods dropdown box
146    TGListBox           *fListNormalization;  // listbox with possible normalization variables
147    TGComboBox          *fComboCustom;        // combo box for custom draw commands
148    TGLabel             *fLblCustomDraw;      // custom draw labal
149    TGCheckButton       *fChkAddDrawOpt;      // additional draw options check box
150    TGNumberEntry       *fNmbSector;          // number entry box for specifying the sector
151    TGLabel             *fLblSector;          // label that shows the active sector
152    TGCheckButton       *fChkCutZero;         // cut zeros check box
153    TGCheckButton       *fChkAddCuts;         // additional cuts check box
154    TGLabel             *fLblAddCuts;         // additional cuts label
155    TGComboBox          *fComboAddCuts;       // additional cuts combo box
156    TGComboBox          *fComboCustomFit;     // custom fit combo box
157    TGCheckButton       *fChkSetMax;          // Set maximum check box
158    TGCheckButton       *fChkSetMin;          // Set maximum check box
159    TGCheckButton       *fChkGetMinMaxAuto;   // Get Min & Max automatically from plot
160    TGTextEntry         *fTxtSetMax;          // custom maximum text box
161    TGTextEntry         *fTxtSetMin;          // custom minimum text box
162    TGGroupFrame        *fContDrawOpt1D;      // container in tabLeft1 
163    TGCompositeFrame    *fcontDrawOpt1DSubLR; // container in tabLeft1 to divide L/R
164    TGCompositeFrame    *fContDrawOpt1DSubNSC; // container in tabLeft1 for following radio buttons 
165    TGRadioButton       *fRadioNorm;          // radio button for normal 1D drawing
166    TGRadioButton       *fRadioSigma;         // radio button for sigma 1D drawing
167    TGTextEntry         *fTxtSigmas;          // text box to specify sigmas
168    TGCompositeFrame    *fContCumuLR;         // container in tabLeft1 for two colums for cumulative and integrative
169    TGCompositeFrame    *fContCumLeft;        // container in tabLeft1 for cumulative, left
170    TGCompositeFrame    *fContCumRight;       // container in tabLeft1 for cumulative, right
171    TGLabel             *fLblSigmaMax;        // label to indicate sigmaMax
172    TGTextEntry         *fTxtSigmaMax;        // text box to specify sigmaMax
173    TGRadioButton       *fRadioCumulative;    // radio button for cumulative 1D drawing
174    TGCheckButton       *fCheckCumulativePM;  // checkbox for plus/minus cumulative 1D drawing
175    TGRadioButton       *fRadioIntegrate;     // radio button for integral 1D drawing
176    TGCompositeFrame    *fContDrawOpt1DSubMML; // container in tabLeft1 for following check boxes
177    TGCheckButton       *fChkMean;            // checkbox to plot mean
178    TGCheckButton       *fChkMedian;          // checkbox to plot median
179    TGCheckButton       *fChkLTM;             // checkbox to plot LTM
180    TGGroupFrame        *fContStatOpt;        // container for statistic options in tabLeft1 
181    TGCheckButton       *fChkStatName;        // checkbox to display histogram name in statistic legend
182    TGCheckButton       *fChkStatEntries;     // checkbox to display entries in statistic legend
183    TGCompositeFrame    *fContStatMean;       // container for mean and its error in stat opt
184    TGCheckButton       *fChkStatMean;        // checkbox to display mean in statistic legend
185    TGCheckButton       *fChkStatMeanPM;      // checkbox to display mean error in statistic legend
186    TGCompositeFrame    *fContStatRMS;        // container for RMS and its error in stat opt
187    TGCheckButton       *fChkStatRMS;         // checkbox to display RMS in statistic legend
188    TGCheckButton       *fChkStatRMSPM;       // checkbox to display RMS error in statistic legend
189    TGCheckButton       *fChkStatUnderflow;   // checkbox to display underflow error in statistic legend
190    TGCheckButton       *fChkStatOverflow;    // checkbox to display overflow error in statistic legend
191    TGCheckButton       *fChkStatIntegral;    // checkbox to display integral in statistic legend
192    TGCompositeFrame    *fContStatSkew;       // container for skewness and its error in stat opt
193    TGCheckButton       *fChkStatSkewness;    // checkbox to display skewness in statistic legend
194    TGCheckButton       *fChkStatSkewnessPM;  // checkbox to display skewness error in statistic legend
195    TGCompositeFrame    *fContStatKurt;       // container for kurtosis and its error in stat opt
196    TGCheckButton       *fChkStatKurtosis;    // checkbox to display kurtosis in statistic legend
197    TGCheckButton       *fChkStatKurtosisPM;  // checkbox to display kurtosis error in statistic legend
198    TGButton            *fBtnUnchekAll;       // Button to uncheck all statistic entries
199    TGGroupFrame        *fContLabeling;       // groupframe container for labeling
200    TGCheckButton       *fChkLabelTitle;      // checkbox to display specified title
201    TGTextEntry         *fTxtLabelTitle;      // text box to specify title
202    TGCheckButton       *fChkLabelXaxis;      // checkbox to display specified xaxis label
203    TGTextEntry         *fTxtLabelXaxis;      // text box to specify xaxis label
204    TGCheckButton       *fChkLabelYaxis;      // checkbox to display specified yaxis label
205    TGTextEntry         *fTxtLabelYaxis;      // text box to specify yaxis label
206    TGCheckButton       *fChkLabelGetAuto;    // checkbox to get labels atuomatically from plot
207    TGGroupFrame        *fContSave;           // container for save-button
208    TGButton            *fBtnSave;            // Save button
209    TGCompositeFrame    *fContAddSaveOpt;     // container for additional save options
210    TGCheckButton       *fChkAddSaveOpt;      // checkbox for additional save options
211    TGComboBox          *fComboAddSaveOpt;    // combobox for additional save options
212    TGGroupFrame        *fContExport;         // container for cint-export
213    TGCompositeFrame    *fContAddExport;      // container for dropdown list to enter export name
214    TGComboBox          *fComboExportName;    // dropdownbox to enter a name for the exported CalPad
215    TGTextButton        *fBtnExport;          // button to export a CalPad
216    TGTextButton        *fBtnAddNorm;         // button to add a CalPad to the normalization
217    TGCompositeFrame    *fContTree;           // container for tree functions
218    TGTextButton        *fBtnDumpToFile;      // button to dump a new CalibTree to file
219    TGTextButton        *fBtnLoadTree;        // button to load a new tree
220    TGCheckButton       *fChkAddAsReference;  // checkbox to add a new tree as referenceTree
221    TGTextEntry         *fTxtRefName;         // text box to specify the referenceTree's name
222    
223    private:
224    Bool_t fInitialized;                      // has the GUI already been initialized?
225    
226    ClassDef(AliTPCCalibViewerGUI, 0)
227 };
228
229 #endif