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