1 #ifndef ALITPCCALIBVIEWERGUI_H
2 #define ALITPCCALIBVIEWERGUI_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 /* $Id: AliTPCCalibViewerGUI.h,v */
9 ///////////////////////////////////////////////////////////////////////////////
11 // GUI for the AliTPCCalibViewer //
12 // used for the calibration monitor //
14 ///////////////////////////////////////////////////////////////////////////////
24 #include <TGListBox.h>
25 #include <TGComboBox.h>
26 #include <TGNumberEntry.h>
27 #include <TRootEmbeddedCanvas.h>
28 #include <TGSplitter.h>
29 #include <TGButtonGroup.h>
33 class AliTPCCalibViewer;
34 class AliTPCPreprocessorOnline;
38 // class TGNumberEntry;
41 // class TGWidget; // ???
43 // class TGButtonGroup;
45 // class TRootEmbeddedCanvas;
47 // class TGRadioButton;
48 // class TGCheckButton;
52 class AliTPCCalibViewerGUI : public TGCompositeFrame {
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 ¶m); // assignment operator
59 virtual ~AliTPCCalibViewerGUI();
60 // virtual void CloseWindow();
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(const char* fileName, const 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
71 static TObjArray* ShowGUI(const char* fileName = 0); // initialize and show GUI for presentation, standalone
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
75 void HandleButtonsStat(Int_t id = -1); // handles statistic check boxes
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
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
81 void DoExport(); // function to export a CalPad to Cint
82 void DoDumpToFile(); // function to dump a new calib tree to file
83 void DoLoadTree(); // function to load a new calib tree
84 void DoExportNorm(); // function to use a calPad for normalization
85 void SavePicture(); // method for saving
86 void GetMinMax(); // Read current Min & Max from the plot and set it to fTxtSetMin & fTxtSetMax
87 void SetMinMaxLabel(); // Set min, max and label without redrawing
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
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.
94 AliTPCCalibViewer *fViewer; // CalibViewer object used for drawing
95 AliTPCPreprocessorOnline *fPreprocessor; // PreprocessorOnline object, used to collect the exported CalPads and to save them into a new calibTree
97 TGCompositeFrame *fContTopBottom; // container for all GUI elements, vertical divided
98 TGCompositeFrame *fContLCR; // container for all GUI elements, horizontal divided
99 TGCompositeFrame *fContLeft; // container for GUI elements on left side
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
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
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
110 TGCompositeFrame *fContDrawOptSub1D2D; // container for 1D and 2D radio-button
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
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
121 TGCompositeFrame *fContAddDrawOpt; // additional draw options container
122 TGListBox *fListVariables; // listbox with possible variables
123 TGTextButton *fBtnDraw; // draw button
124 TGTextButton *fBtnFit; // fit button
125 TGTextButton *fBtnAddFitFunction; // button to add fit function to normalization
126 TGTextButton *fBtnGetMinMax; // GetMinMax-button
127 TRootEmbeddedCanvas *fCanvMain; // main drawing canvas
128 TGRadioButton *fRadioRaw; // raw radio button
129 TGRadioButton *fRadioNormalized; // normalized radio button
130 TGRadioButton *fRadioPredefined; // predefined plot radio button
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
137 TGRadioButton *fRadioROC; // ROC radio button
138 TGRadioButton *fRadioSector; // sector radio button
139 TGComboBox *fComboAddDrawOpt; // additional draw options combo box
140 TGCheckButton *fChkAuto; // automatic redraw checkbox
141 TGCheckButton *fChkAutoAppend; // automatic appendign of "~" checkbox
142 TGComboBox *fComboMethod; // normalization methods dropdown box
143 TGListBox *fListNormalization; // listbox with possible normalization variables
144 TGComboBox *fComboCustom; // combo box for custom draw commands
145 TGLabel *fLblCustomDraw; // custom draw labal
146 TGCheckButton *fChkAddDrawOpt; // additional draw options check box
147 TGNumberEntry *fNmbSector; // number entry box for specifying the sector
148 TGLabel *fLblSector; // label that shows the active sector
149 TGCheckButton *fChkCutZero; // cut zeros check box
150 TGCheckButton *fChkAddCuts; // additional cuts check box
151 TGLabel *fLblAddCuts; // additional cuts label
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
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
195 TGButton *fBtnUnchekAll; // Button to uncheck all statistic entries
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
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
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
221 Bool_t fInitialized; // has the GUI already been initialized?
223 ClassDef(AliTPCCalibViewerGUI, 0)