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