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