AliRoot Core  ee782a0 (ee782a0)
AliTPCCalibViewerGUI.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 
27 
28 #include "AliTPCCalibViewerGUI.h"
29 #include "AliTPCCalPad.h"
30 #include <iostream>
31 
32 #include <TCanvas.h>
33 #include <TPad.h>
34 #include <TVirtualPad.h>
35 
36 #include <TROOT.h>
37 #include <TMath.h>
38 #include <TObjArray.h>
39 #include <TObjString.h>
40 #include <TVector.h>
41 #include <string.h>
42 #include <TH1.h>
43 #include "TStyle.h"
44 #include "TGFileDialog.h"
45 #include "TGInputDialog.h"
46 #include "AliTPCCalibViewer.h"
48 
49 // #include "TGListBox.h"
50 // #include "TGNumberEntry"
51 // #include "TGSplitter"
52 // #include "TGTab"
53 // #include "TGLabel"
54 // #include "TGButtonGroup"
55 // #include "TGComboBox"
56 // #include "TRootEmbeddedCanvas"
57 // #include "TGButton"
58 // #include "TGRadioButton"
59 // #include "GTCheckButton"
60 // #include "TGTextEntry"
61 
62 
63 
64 
66 ClassImp(AliTPCCalibViewerGUI)
68 
69 AliTPCCalibViewerGUI::AliTPCCalibViewerGUI(const TGWindow *p, UInt_t w, UInt_t h, char* fileName)
70  : TGCompositeFrame(p, w, h),
71  fViewer(0),
72  fPreprocessor(0),
73  fContTopBottom(0),
74  fContLCR(0),
75  fContLeft(0),
76  ftabLeft(0),
77  ftabLeft0(0),
78  ftabLeft1(0),
79  ftabRight(0),
80  fTabRight0(0),
81  fTabRight1(0),
82  fContRight(0),
83  fContCenter(0),
84  fContPlotOpt(0),
85  fContDrawOpt(0),
86  fContDrawOptSub1D2D(0),
87  fContNormalized(0),
88  fContCustom(0),
89  fContCuts(0),
90  fContSector(0),
91  fContAddCuts(0),
92  fContFit(0),
93  fContAddFit(0),
94  fContScaling(0),
95  fContSetMax(0),
96  fContSetMin(0),
97  fContAddDrawOpt(0),
98  fListVariables(0),
99  fBtnDraw(0),
100  fBtnFit(0),
101  fBtnAddFitFunction(0),
102  fBtnGetMinMax(0),
103  fCanvMain(0),
104  fRadioRaw(0),
105  fRadioNormalized(0),
106  fRadioPredefined(0),
107  fRadioCustom(0),
108  fRadio1D(0),
109  fRadio2D(0),
110  fRadioTPC(0),
111  fRadioSideA(0),
112  fRadioSideC(0),
113  fRadioROC(0),
114  fRadioSector(0),
115  fComboAddDrawOpt(0),
116  fChkAuto(0),
117  fChkAutoAppend(0),
118  fComboMethod(0),
119  fListNormalization(0),
120  fComboCustom(0),
121  fLblCustomDraw(0),
122  fChkAddDrawOpt(0),
123  fNmbSector(0),
124  fLblSector(0),
125  fChkCutZero(0),
126  fChkAddCuts(0),
127  fLblAddCuts(0),
128  fComboAddCuts(0),
129  fComboCustomFit(0),
130  fChkSetMax(0),
131  fChkSetMin(0),
132  fChkGetMinMaxAuto(0),
133  fTxtSetMax(0),
134  fTxtSetMin(0) ,
135  fContDrawOpt1D(0),
136  fcontDrawOpt1DSubLR(0),
137  fContDrawOpt1DSubNSC(0),
138  fRadioNorm(0),
139  fRadioSigma(0),
140  fTxtSigmas(0),
141  fContCumuLR(0),
142  fContCumLeft(0),
143  fContCumRight(0),
144  fLblSigmaMax(0),
145  fTxtSigmaMax(0),
146  fRadioCumulative(0),
147  fCheckCumulativePM(0),
148  fRadioIntegrate(0),
149  fContDrawOpt1DSubMML(0),
150  fChkMean(0),
151  fChkMedian(0),
152  fChkLTM(0),
153  fContStatOpt(0),
154  fChkStatName(0),
155  fChkStatEntries(0),
156  fContStatMean(0),
157  fChkStatMean(0),
158  fChkStatMeanPM(0),
159  fContStatRMS(0),
160  fChkStatRMS(0),
161  fChkStatRMSPM(0),
162  fChkStatUnderflow(0),
163  fChkStatOverflow(0),
164  fChkStatIntegral(0),
165  fContStatSkew(0),
166  fChkStatSkewness(0),
167  fChkStatSkewnessPM(0),
168  fContStatKurt(0),
169  fChkStatKurtosis(0),
170  fChkStatKurtosisPM(0),
171  fBtnUnchekAll(0),
172  fContLabeling(0),
173  fChkLabelTitle(0),
174  fTxtLabelTitle(0),
175  fChkLabelXaxis(0),
176  fTxtLabelXaxis(0),
177  fChkLabelYaxis(0),
178  fTxtLabelYaxis(0),
179  fChkLabelGetAuto(0),
180  fContSave(0),
181  fBtnSave(0),
182  fContAddSaveOpt(0),
183  fChkAddSaveOpt(0),
184  fComboAddSaveOpt(0),
185  fContExport(0),
186  fContAddExport(0),
187  fComboExportName(0),
188  fBtnExport(0),
189  fBtnAddNorm(0),
190  fContTree(0),
191  fBtnDumpToFile(0),
192  fBtnLoadTree(0),
193  fChkAddAsReference(0),
194  fTxtRefName(0),
195  fInitialized(0)
196 {
197  //
198  // AliTPCCalibViewerGUI constructor; fileName specifies the ROOT tree used for drawing
199  //
200 
201  // draw the GUI:
202  fPreprocessor = new AliTPCPreprocessorOnline();
203  DrawGUI(p, w, h);
204  // initialize the AliTPCCalibViewer:
205  if (fileName) Initialize(fileName);
206  // set default button states:
207  SetInitialValues();
208  // do first drawing:
209  if (fileName) DoDraw();
210 }
211 
212 
213 void AliTPCCalibViewerGUI::DrawGUI(const TGWindow */*p*/, UInt_t w, UInt_t h) {
215 
216  // ************************* Display everything *************************
217 
218  SetCleanup(kDeepCleanup);
219 
220  // *****************************************************************************
221  // ************************* content of this MainFrame *************************
222  // *****************************************************************************
223  // top level container with horizontal layout
224  fContTopBottom = new TGCompositeFrame(this, w, h, kVerticalFrame | kFixedWidth | kFixedHeight);
225  AddFrame(fContTopBottom, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
226 
227  fContLCR = new TGCompositeFrame(fContTopBottom, w, h, kHorizontalFrame | kFixedWidth | kFixedHeight);
228  fContTopBottom->AddFrame(fContLCR, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
229 
230  // ***********************************************************************
231  // ************************* content of fContLCR *************************
232  // ***********************************************************************
233  // left container
234  fContLeft = new TGCompositeFrame(fContLCR, 200, 200, kVerticalFrame | kFixedWidth | kFitHeight);
235  fContLCR->AddFrame(fContLeft, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandY, 5, 3, 3, 3));
236 
237  // left vertical splitter
238  TGVSplitter *splitLeft = new TGVSplitter(fContLCR);
239  splitLeft->SetFrame(fContLeft, kTRUE);
240  fContLCR->AddFrame(splitLeft, new TGLayoutHints(kLHintsLeft | kLHintsExpandY, 0, 0, 0, 0));
241 
242  // right container
243  fContRight = new TGCompositeFrame(fContLCR, 150, 200, kVerticalFrame | kFixedWidth | kFitHeight);
244  fContLCR->AddFrame(fContRight, new TGLayoutHints(kLHintsTop | kLHintsRight | kLHintsExpandY, 3, 5, 3, 3));
245 
246  // center container
247  fContCenter = new TGCompositeFrame(fContLCR, 200, 200, kVerticalFrame | kFixedWidth | kFitHeight);
248  fContLCR->AddFrame(fContCenter, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
249 
250  // right vertical splitter
251  TGVSplitter *splitRight = new TGVSplitter(fContLCR);
252  splitRight->SetFrame(fContRight, kFALSE);
253  fContLCR->AddFrame(splitRight, new TGLayoutHints(kLHintsLeft | kLHintsExpandY, 0, 0, 0, 0));
254 
255 
256  // ========================================================================
257  // ************************* content of fContLeft *************************
258  // ========================================================================
259  // --- draw button and tabLeft ---
260  // draw button
261  fBtnDraw = new TGTextButton(fContLeft, "&Draw");
262  fContLeft->AddFrame(fBtnDraw, new TGLayoutHints(kLHintsExpandX, 10, 10, 0, 0));
263  //fBtnDraw->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "DoTest(=\"fBtnDraw clicked\")");
264  fBtnDraw->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "DoDraw()");
265  fBtnDraw->SetToolTipText("Press here to draw according to selections.");
266 
267  // tabs on the left side:
268  ftabLeft = new TGTab(fContLeft);
269  fContLeft->AddFrame(ftabLeft, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 8, 0));
270  ftabLeft0 = ftabLeft->AddTab("General");
271  ftabLeft1 = ftabLeft->AddTab("More plot options");
272 
273 
274  // **************************** content of tabLeft0 *******************************
275 
276  // draw options container *** fcontDrawOpt *** " Plot options "
277  fContDrawOpt = new TGGroupFrame(ftabLeft0, "Plot options", kVerticalFrame | kFitWidth | kFitHeight);
278  ftabLeft0->AddFrame(fContDrawOpt, new TGLayoutHints(kLHintsExpandX, 0, 0, 10, 0));
279  fContDrawOptSub1D2D = new TGCompositeFrame(fContDrawOpt, 200, 23, kHorizontalFrame | kFitWidth | kFixedHeight);
280  fContDrawOpt->AddFrame(fContDrawOptSub1D2D, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
281 
282  // ------------------------- content of fContDrawOpt -------------------------
283  // -- radio1D, radio2D, chkAuto
284  // 1D radio button
285  fRadio1D = new TGRadioButton(fContDrawOptSub1D2D, "1D", 30);
286  fContDrawOptSub1D2D->AddFrame(fRadio1D, new TGLayoutHints(kLHintsNormal, 0, 2, 0, 0));
287  fRadio1D->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsGeneral()");
288  fRadio1D->SetToolTipText("1D drawing \nSelect this if you want to have the full control for the custom draw.");
289 
290  // 2D radio button
291  fRadio2D = new TGRadioButton(fContDrawOptSub1D2D, "2D", 31);
292  fContDrawOptSub1D2D->AddFrame(fRadio2D, new TGLayoutHints(kLHintsNormal, 2, 2, 0, 0));
293  fRadio2D->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsGeneral()");
294  fRadio2D->SetToolTipText("2D drawing");
295 
296  // additional draw options container
297  fContAddDrawOpt = new TGCompositeFrame(fContDrawOpt, 200, 200, kVerticalFrame | kFitWidth | kFitHeight);
298  fContDrawOpt->AddFrame(fContAddDrawOpt, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
299 
300  // content of --- fContAddDrawOpt ---
301  // addition draw options label
302  fChkAddDrawOpt = new TGCheckButton(fContAddDrawOpt, "Draw options:");
303  //fChkAddDrawOpt->SetTextJustify(kTextLeft);
304  fContAddDrawOpt->AddFrame(fChkAddDrawOpt, new TGLayoutHints(kLHintsNormal | kLHintsExpandX));
305  fChkAddDrawOpt->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "DoNewSelection()");
306  fChkAddDrawOpt->SetToolTipText("Enter additional draw options like 'prof' or 'colz' here.\nBe careful with the option 'same' for 2D drawings as it will crash (ROOT feature).");
307 
308  // additional draw options combo box
309  fComboAddDrawOpt = new TGComboBox(fContAddDrawOpt);
310  fComboAddDrawOpt->Resize(0, fBtnDraw->GetDefaultHeight());
311  fComboAddDrawOpt->EnableTextInput(kTRUE);
312  fContAddDrawOpt->AddFrame(fComboAddDrawOpt, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
313  fComboAddDrawOpt->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "HandleButtonsGeneral(=14)");
314  fComboAddDrawOpt->Connect("Selected(Int_t)", "AliTPCCalibViewerGUI", this, "DoNewSelection()");
315  fComboAddDrawOpt->GetTextEntry()->SetText("",kFALSE);
316 
317  // automatic redraw check button
318  fChkAuto = new TGCheckButton(fContDrawOpt, "Auto redraw");
319  fContDrawOpt->AddFrame(fChkAuto, new TGLayoutHints(kLHintsNormal, 0, 2, 0, 0));
320  fChkAuto->SetToolTipText("Decide if you want an automatic redraw on each new selection.\nNot recommended on a slow machine, during remote connection or if your draw option is 'same'.");
321 
322  // automatic append ending check button
323  fChkAutoAppend = new TGCheckButton(fContDrawOpt, "Auto add appending");
324  fContDrawOpt->AddFrame(fChkAutoAppend, new TGLayoutHints(kLHintsNormal, 0, 2, 0, 0));
325  fChkAutoAppend->SetToolTipText("Tries to repair your custom draw string or custom cut string, if you forgot '~' or '.fElements' \nThis function may be buggy!");
326 
327 
328  // *** predefined radio button *** " Predefined "
329  fRadioPredefined = new TGRadioButton(ftabLeft0, "Predefined: ", 13);
330  ftabLeft0->AddFrame(fRadioPredefined, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
331  fRadioPredefined->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsGeneral()");
332  fRadioPredefined->SetToolTipText("Draw predefined variables according to selection.");
333 
334  // list of variables
335  fListVariables = new TGListBox(ftabLeft0);
336  ftabLeft0->AddFrame(fListVariables, new TGLayoutHints(kLHintsNormal | kLHintsExpandX | kLHintsExpandY, 10, 0, 0, 0));
337  fListVariables->Connect("Selected(Int_t)", "AliTPCCalibViewerGUI", this, "DoNewSelection()");
338 
339 
340  // normalization options container *** fContPlotOpt ***
341  //fContPlotOpt = new TGCompositeFrame(fContLeft, 200, 200, kVerticalFrame | kFitWidth | kFitHeight);
342  fContPlotOpt = new TGGroupFrame(ftabLeft0, "Normalization options", kVerticalFrame | kFitWidth | kFitHeight);
343  ftabLeft0->AddFrame(fContPlotOpt, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 10, 0, 0, 0));
344 
345  // ------------------------- content of fContPlotOpt -------------------------
346  // raw radio button
347  fRadioRaw = new TGRadioButton(fContPlotOpt, "Raw", 10);
348  fContPlotOpt->AddFrame(fRadioRaw, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
349  fRadioRaw->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsGeneral()");
350  fRadioRaw->SetToolTipText("Plot without normalization");
351 
352  // normalized radio button
353  fRadioNormalized = new TGRadioButton(fContPlotOpt, "Normalized", 11);
354  fContPlotOpt->AddFrame(fRadioNormalized, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
355  fRadioNormalized->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsGeneral()");
356  fRadioNormalized->SetToolTipText("Normalize data");
357 
358  // normalized options container *** fContNormalized ***
359  fContNormalized = new TGCompositeFrame(fContPlotOpt, 200, 200, kVerticalFrame | kFitWidth | kFitHeight);
360  fContPlotOpt->AddFrame(fContNormalized, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 15, 0, 0, 0));
361 
362  // --- content of fContNormalized ---
363  // --- combo box to select 'subtract' or 'divide', list of normalization variables
364  // method drop down combo box
365  fComboMethod = new TGComboBox(fContNormalized);
366  fComboMethod->Resize(0, fBtnDraw->GetDefaultHeight());
367  fContNormalized->AddFrame(fComboMethod, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
368  fComboMethod->Connect("Selected(Int_t)", "AliTPCCalibViewerGUI", this, "DoNewSelection()");
369 
370  // list of normalization variables
371  fListNormalization = new TGListBox(fContNormalized);
372  fContNormalized->AddFrame(fListNormalization, new TGLayoutHints(kLHintsNormal | kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
373  fListNormalization->Connect("Selected(Int_t)", "AliTPCCalibViewerGUI", this, "DoNewSelection()");
374 
375  // custom radio button
376  fRadioCustom = new TGRadioButton(ftabLeft0, "Custom: ", 12);
377  ftabLeft0->AddFrame(fRadioCustom, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
378  fRadioCustom->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsGeneral()");
379  fRadioCustom->SetToolTipText("Draw data according to user specific text entry in the 'Custom Draw' line. Remember '~' (= '.fElements')!");
380  // custom options container is located further down
381 
382  // **************************** content of tabLeft1 *******************************
383 
384  // draw options container *** fcontDrawOpt1D *** " Plot options "
385  fContDrawOpt1D = new TGGroupFrame(ftabLeft1, "1D Plot options", kVerticalFrame | kFitWidth | kFitHeight);
386  ftabLeft1->AddFrame(fContDrawOpt1D, new TGLayoutHints(kLHintsExpandX, 0, 0, 10, 0));
387 
388  fcontDrawOpt1DSubLR = new TGCompositeFrame(fContDrawOpt1D, 1, 1, kVerticalFrame | kFitWidth | kFitHeight);
389  fContDrawOpt1D->AddFrame(fcontDrawOpt1DSubLR, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
390 
391  // ***** content of fContDrawOpt1DSubLR *****
392  fContDrawOpt1DSubNSC = new TGCompositeFrame(fcontDrawOpt1DSubLR, 200, 23, kVerticalFrame | kFitWidth | kFitHeight);
393  fcontDrawOpt1DSubLR->AddFrame(fContDrawOpt1DSubNSC, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
394 
395  // --------------------------- content of fContDrawOpt1DSubNSC -----------------
396  fRadioNorm = new TGRadioButton(fContDrawOpt1DSubNSC, "Normal", 110);
397  fContDrawOpt1DSubNSC->AddFrame(fRadioNorm, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
398  fRadioNorm->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtons1D()");
399  fRadioNorm->SetToolTipText("Produce a normal 1D plot, a histogram of the selected data.");
400 
401  fRadioSigma = new TGRadioButton(fContDrawOpt1DSubNSC, "Sigma", 111);
402  fContDrawOpt1DSubNSC->AddFrame(fRadioSigma, new TGLayoutHints(kLHintsNormal, 0, 0, 5, 0));
403  fRadioSigma->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtons1D()");
404  fRadioSigma->SetToolTipText("Draw a normal histogram, but also lines that indicate the mean/median/LTM \nand sigmas of the selected data.");
405 
406  fTxtSigmas = new TGTextEntry(fContDrawOpt1DSubNSC, "2; 4; 6", 111);
407  fContDrawOpt1DSubNSC->AddFrame(fTxtSigmas, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 10, 15, 0, 0));
408  fTxtSigmas->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "HandleButtons1D(=111)");
409  fTxtSigmas->SetToolTipText("Enter sigma intervals you would like to be indicated by lines. \nExample: '2; 4; 6'");
410 
411  fContCumuLR = new TGCompositeFrame(fContDrawOpt1DSubNSC, 200, 23, kHorizontalFrame | kFitWidth | kFitHeight);
412  fContDrawOpt1DSubNSC->AddFrame(fContCumuLR, new TGLayoutHints(kLHintsExpandX, 0, 0, 5, 0));
413 
414  fContCumLeft = new TGCompositeFrame(fContCumuLR, 200, 23, kVerticalFrame | kFitWidth | kFitHeight);
415  fContCumuLR->AddFrame(fContCumLeft, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
416 
417  fRadioCumulative = new TGRadioButton(fContCumLeft, "Cumulative", 112);
418  fContCumLeft->AddFrame(fRadioCumulative, new TGLayoutHints(kLHintsNormal, 0, 10, 0, 0));
419  fRadioCumulative->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtons1D()");
420  fRadioCumulative->SetToolTipText("Draw the cumulative (SigmaCut) of the given selection. \nThe data distribution is integrated, starting from the mean/median/LTM.");
421 
422  fCheckCumulativePM = new TGCheckButton(fContCumLeft, "Plus/Minus");
423  fContCumLeft->AddFrame(fCheckCumulativePM, new TGLayoutHints(kLHintsNormal, 10, 15, 0, 0));
424  fCheckCumulativePM->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtons1D()");
425  fCheckCumulativePM->SetToolTipText("Decide whether you want the cumulative integration for each direction (+/-) \nor only for the absolute distance to the mean/median/LTM value.");
426 
427  fRadioIntegrate = new TGRadioButton(fContCumLeft, "Integrate", 113);
428  fContCumLeft->AddFrame(fRadioIntegrate, new TGLayoutHints(kLHintsNormal, 0, 0, 5, 0));
429  fRadioIntegrate->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtons1D()");
430  fRadioIntegrate->SetToolTipText("Draw the integral of the given selection.");
431 
432  fContCumRight = new TGCompositeFrame(fContCumuLR, 200, 23, kVerticalFrame | kFitWidth | kFitHeight);
433  fContCumuLR->AddFrame(fContCumRight, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
434 
435  fLblSigmaMax = new TGLabel(fContCumRight, "SigmaMax:");
436  fLblSigmaMax->SetTextJustify(kTextLeft);
437  fContCumRight->AddFrame(fLblSigmaMax, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 5, 0, 0, 0));
438 
439  fTxtSigmaMax = new TGTextEntry(fContCumRight, "5", 112);
440  fContCumRight->AddFrame(fTxtSigmaMax, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 10, 15, 0, 0));
441  fTxtSigmaMax->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "HandleButtons1D(=112)");
442  fTxtSigmaMax->SetToolTipText("Enter up to which multiple of sigma you want to integrate.");
443 
444 
445  fContDrawOpt1DSubMML = new TGCompositeFrame(fcontDrawOpt1DSubLR, 200, 23, kHorizontalFrame | kFitWidth | kFitHeight);
446  fcontDrawOpt1DSubLR->AddFrame(fContDrawOpt1DSubMML, new TGLayoutHints(kLHintsExpandX, 0, 0, 5, 0));
447 
448  // -------------- content of fcontDrawOpt1DSubLR
449  fChkMean = new TGCheckButton(fContDrawOpt1DSubMML, "Mean");
450  fContDrawOpt1DSubMML->AddFrame(fChkMean, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
451  fChkMean->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtons1D()");
452  fChkMean->SetToolTipText("Activate Mean for Sigma/Cumulative/Integrate");
453 
454  fChkMedian = new TGCheckButton(fContDrawOpt1DSubMML, "Median");
455  fContDrawOpt1DSubMML->AddFrame(fChkMedian, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
456  fChkMedian->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtons1D()");
457  fChkMedian->SetToolTipText("Activate Median for Sigma/Cumulative/Integrate");
458 
459  fChkLTM = new TGCheckButton(fContDrawOpt1DSubMML, "LTM");
460  fContDrawOpt1DSubMML->AddFrame(fChkLTM, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
461  fChkLTM->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtons1D()");
462  fChkLTM->SetToolTipText("Activate LTM for Sigma/Cumulative/Integrate");
463 
464 
465  // statistic options container *** fcontStatOpt1D *** " Statistic options "
466  fContStatOpt = new TGGroupFrame(ftabLeft1, "Statistic options", kVerticalFrame | kFitWidth | kFitHeight);
467  ftabLeft1->AddFrame(fContStatOpt, new TGLayoutHints(kLHintsExpandX, 0, 0, 10, 0));
468 
469  fChkStatName = new TGCheckButton(fContStatOpt, "Name");
470  fContStatOpt->AddFrame(fChkStatName, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
471  fChkStatName->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsStat()");
472  fChkStatName->SetToolTipText("Display the name in the statistics legend.");
473 
474  fChkStatEntries = new TGCheckButton(fContStatOpt, "Entries");
475  fContStatOpt->AddFrame(fChkStatEntries, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
476  fChkStatEntries->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsStat()");
477  fChkStatEntries->SetToolTipText("Display the number of entries in the statistics legend.");
478 
479  fContStatMean = new TGCompositeFrame(fContStatOpt, 1, 1, kHorizontalFrame | kFitWidth | kFitHeight);
480  fContStatOpt->AddFrame(fContStatMean, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
481 
482  fChkStatMean = new TGCheckButton(fContStatMean, "Mean");
483  fContStatMean->AddFrame(fChkStatMean, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
484  fChkStatMean->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsStat()");
485  fChkStatMean->SetToolTipText("Display the mean value of the data in the statistics legend.");
486 
487  fChkStatMeanPM = new TGCheckButton(fContStatMean, "+- Error");
488  fContStatMean->AddFrame(fChkStatMeanPM, new TGLayoutHints(kLHintsNormal, 10, 0, 0, 0));
489  fChkStatMeanPM->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsStat()");
490  fChkStatMeanPM->SetToolTipText("Display the mean value's error in the statistics legend.");
491 
492  fContStatRMS = new TGCompositeFrame(fContStatOpt, 1, 1, kHorizontalFrame | kFitWidth | kFitHeight);
493  fContStatOpt->AddFrame(fContStatRMS, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
494 
495  fChkStatRMS = new TGCheckButton(fContStatRMS, "RMS");
496  fContStatRMS->AddFrame(fChkStatRMS, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
497  fChkStatRMS->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsStat()");
498  fChkStatRMS->SetToolTipText("Display the RMS value of the data in the statistics legend.");
499 
500  fChkStatRMSPM = new TGCheckButton(fContStatRMS, "+- Error");
501  fContStatRMS->AddFrame(fChkStatRMSPM, new TGLayoutHints(kLHintsNormal, 10, 0, 0, 0));
502  fChkStatRMSPM->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsStat()");
503  fChkStatRMSPM->SetToolTipText("Display the RMS value's error in the statistics legend.");
504 
505  fChkStatUnderflow = new TGCheckButton(fContStatOpt, "Underflow");
506  fContStatOpt->AddFrame(fChkStatUnderflow, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
507  fChkStatUnderflow->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsStat()");
508  fChkStatUnderflow->SetToolTipText("Display the number of entries in the underflow bin.");
509 
510  fChkStatOverflow = new TGCheckButton(fContStatOpt, "Overflow");
511  fContStatOpt->AddFrame(fChkStatOverflow, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
512  fChkStatOverflow->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsStat()");
513  fChkStatOverflow->SetToolTipText("Display the number of entries in the overflow bin.");
514 
515  fChkStatIntegral = new TGCheckButton(fContStatOpt, "Integral");
516  fContStatOpt->AddFrame(fChkStatIntegral, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
517  fChkStatIntegral->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsStat()");
518  fChkStatIntegral->SetToolTipText("Display the integral of the data in the statistics legend.");
519 
520  fContStatSkew = new TGCompositeFrame(fContStatOpt, 1, 1, kHorizontalFrame | kFitWidth | kFitHeight);
521  fContStatOpt->AddFrame(fContStatSkew, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
522 
523  fChkStatSkewness = new TGCheckButton(fContStatSkew, "Skewness");
524  fContStatSkew->AddFrame(fChkStatSkewness, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
525  fChkStatSkewness->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsStat()");
526  fChkStatSkewness->SetToolTipText("Display the skewness of the data in the statistics legend. \nBe careful! Sometimes the skewness causes a floating point exception that hangs the GUI!");
527 
528  fChkStatSkewnessPM = new TGCheckButton(fContStatSkew, "+- Error");
529  fContStatSkew->AddFrame(fChkStatSkewnessPM, new TGLayoutHints(kLHintsNormal, 10, 0, 0, 0));
530  fChkStatSkewnessPM->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsStat()");
531  fChkStatSkewnessPM->SetToolTipText("Display the skewness' error in the statistics legend.");
532 
533  fContStatKurt = new TGCompositeFrame(fContStatOpt, 1, 1, kHorizontalFrame | kFitWidth | kFitHeight);
534  fContStatOpt->AddFrame(fContStatKurt, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
535 
536  fChkStatKurtosis = new TGCheckButton(fContStatKurt, "Kurtosis");
537  fContStatKurt->AddFrame(fChkStatKurtosis, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
538  fChkStatKurtosis->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsStat()");
539  fChkStatKurtosis->SetToolTipText("Display the kurtosis of the data in the statistics legend.");
540 
541  fChkStatKurtosisPM = new TGCheckButton(fContStatKurt, "+- Error");
542  fContStatKurt->AddFrame(fChkStatKurtosisPM, new TGLayoutHints(kLHintsNormal, 10, 0, 0, 0));
543  fChkStatKurtosisPM->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsStat()");
544  fChkStatKurtosisPM->SetToolTipText("Display the kurtosis' error in the statistics legend.");
545 
546  fBtnUnchekAll = new TGTextButton(fContStatOpt, "&Uncheck all");
547  fContStatOpt->AddFrame(fBtnUnchekAll, new TGLayoutHints(kLHintsExpandX, 10, 10, 0, 0));
548  //fBtnDraw->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "DoTest(=\"fBtnDraw clicked\")");
549  fBtnUnchekAll->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "UnchekAllStat()");
550  fBtnUnchekAll->SetToolTipText("Disable all statistics legend entries, \nno statistics legend.");
551 
552 
553  // custom options container
554  // --- fComboCustom --- the custom draw line on the very low
555  fContCustom = new TGCompositeFrame(fContTopBottom, 200, 200, kHorizontalFrame | kFitWidth | kFitHeight);
556  fContTopBottom->AddFrame(fContCustom, new TGLayoutHints(kLHintsExpandX, 10, 0, 0, 0));
557 
558  // ------------------------- content of fContCustom -------------------------
559  fLblCustomDraw = new TGLabel(fContCustom, "Custom draw: ");
560  fLblCustomDraw->SetTextJustify(kTextLeft);
561  fContCustom->AddFrame(fLblCustomDraw, new TGLayoutHints(kLHintsNormal, 5, 0, 0, 0));
562  // text field for custom draw command
563  fComboCustom = new TGComboBox(fContCustom);
564  fComboCustom->Resize(0, fBtnDraw->GetDefaultHeight());
565  fComboCustom->EnableTextInput(kTRUE);
566  fContCustom->AddFrame(fComboCustom, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
567  fComboCustom->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "HandleButtonsGeneral(=42)");
568  fComboCustom->Connect("Selected(Int_t)", "AliTPCCalibViewerGUI", this, "DoNewSelection()");
569  fComboCustom->GetTextEntry()->SetText("",kFALSE);
570 
571  // additional cuts container
572  fContAddCuts = new TGCompositeFrame(fContTopBottom, 200, 200, kHorizontalFrame | kFitWidth | kFitHeight);
573  fContTopBottom->AddFrame(fContAddCuts, new TGLayoutHints(kLHintsExpandX, 10, 0, 0, 0));
574 
575  // ------------------------- content of fContAddCuts -------------------------
576  fLblAddCuts = new TGLabel(fContAddCuts, "Custom cuts: ");
577  fLblAddCuts->SetTextJustify(kTextLeft);
578  fContAddCuts->AddFrame(fLblAddCuts, new TGLayoutHints(kLHintsNormal, 5, 0, 0, 0));
579  // combo text field for additional cuts
580  fComboAddCuts = new TGComboBox(fContAddCuts);
581  fComboAddCuts->Resize(0, fBtnDraw->GetDefaultHeight());
582  fComboAddCuts->EnableTextInput(kTRUE);
583  fContAddCuts->AddFrame(fComboAddCuts, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
584  fComboAddCuts->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "HandleButtonsCuts(=31)");
585  fComboAddCuts->Connect("Selected(Int_t)", "AliTPCCalibViewerGUI", this, "DoNewSelection()");
586  fComboAddCuts->GetTextEntry()->SetText("",kFALSE);
587 
588  // ==========================================================================
589  // ************************* content of fContCenter *************************
590  // ========================================================================
591  // main drawing canvas
592  fCanvMain = new TRootEmbeddedCanvas("Main_Canvas", fContCenter, 200, 200, kFitWidth | kFitHeight);
593  fContCenter->AddFrame(fCanvMain, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
594  fCanvMain->GetCanvas()->Connect("ProcessedEvent(Int_t, Int_t, Int_t, TObject*)", "AliTPCCalibViewerGUI", this, "MouseMove(Int_t, Int_t, Int_t, TObject*)");
595  fCanvMain->GetCanvas()->Connect("RangeAxisChanged()", "AliTPCCalibViewerGUI", this, "GetMinMax()");
596  fCanvMain->GetCanvas()->SetToolTipText("The Main_Canvas, here your plots are displayed.");
597 
598 
599  // =========================================================================
600  // ************************* content of fContRight *************************
601  // ========================================================================
602 
603  // tabs on the right side:
604  ftabRight = new TGTab(fContRight);
605  fContRight->AddFrame(ftabRight, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 8, 0));
606  fTabRight0 = ftabRight->AddTab("Basic");
607  fTabRight1 = ftabRight->AddTab("Advanced");
608 
609 
610  // **************************** content of tabLeft0 *******************************
611  // cut options container
612  fContCuts = new TGGroupFrame(fTabRight0, "Cuts", kVerticalFrame | kFitWidth | kFitHeight);
613  fTabRight0->AddFrame(fContCuts, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
614 
615 
616  // ************************* content of fContCuts *************************
617  // TPC radio button
618  fRadioTPC = new TGRadioButton(fContCuts, "Whole TPC", 20);
619  fContCuts->AddFrame(fRadioTPC, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
620  fRadioTPC->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsCuts()");
621  fRadioTPC->SetToolTipText("No cuts, use the whole TPC. \nIn 2D mode, A side and C side are superimposed!");
622 
623  // side A radio button
624  fRadioSideA = new TGRadioButton(fContCuts, "Side A", 21);
625  fContCuts->AddFrame(fRadioSideA, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
626  fRadioSideA->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsCuts()");
627  fRadioSideA->SetToolTipText("Use only side A.");
628 
629  // side C radio button
630  fRadioSideC = new TGRadioButton(fContCuts, "Side C", 22);
631  fContCuts->AddFrame(fRadioSideC, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
632  fRadioSideC->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsCuts()");
633  fRadioSideC->SetToolTipText("Use only side C.");
634 
635  // roc radio button
636  fRadioROC = new TGRadioButton(fContCuts, "ROC", 23);
637  fContCuts->AddFrame(fRadioROC, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
638  fRadioROC->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsCuts()");
639  fRadioROC->SetToolTipText("Use only one ROC (readout chamber).");
640 
641  // sector radio button
642  fRadioSector = new TGRadioButton(fContCuts, "Sector", 24);
643  fContCuts->AddFrame(fRadioSector, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
644  fRadioSector->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsCuts()");
645  fRadioSector->SetToolTipText("Use only one Sector (0-17 A-Side, 18-35 C-Side).");
646 
647  // sector options container
648  fContSector = new TGCompositeFrame(fContCuts, 200, 200, kHorizontalFrame | kFitWidth | kFitHeight);
649  fContCuts->AddFrame(fContSector, new TGLayoutHints(kLHintsExpandX, 5, 0, 0, 0));
650 
651  // ------------------------- content of fContSector -------------------------
652  // sector number entry
653  fNmbSector = new TGNumberEntry(fContSector, 0, 1, -1, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative, TGNumberFormat::kNELLimitMinMax, 0, 71);
654  fContSector->AddFrame(fNmbSector, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
655  fNmbSector->Connect("ValueSet(Long_t)", "AliTPCCalibViewerGUI", this, "ChangeSector()");
656 
657  // sector number label
658  fLblSector = new TGLabel(fContSector, "IROC, A");
659  fLblSector->SetTextJustify(kTextLeft);
660  fContSector->AddFrame(fLblSector, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 5, 0, 0, 0));
661 
662  // cut zeros check button
663  fChkCutZero = new TGCheckButton(fContCuts, "Cut zeros");
664  fContCuts->AddFrame(fChkCutZero, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
665  fChkCutZero->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "DoNewSelection()");
666  fChkCutZero->SetToolTipText("Use only values that are not zero. \nWhen doing a custom draw this cut is composed of the draw string\nup to the first ':' or '>>' and the condition that this should not be zero.");
667 
668  // additional cuts check button
669  fChkAddCuts = new TGCheckButton(fContCuts, "Custom cuts");
670  fContCuts->AddFrame(fChkAddCuts, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
671  fChkAddCuts->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "DoNewSelection()");
672  fChkAddCuts->SetToolTipText("Activate the custom cuts on the bottom. Remember '~' (= '.fElements')!");
673  // fContAddCuts' content is locaed further op
674 
675 
676  // Scaling options container
677  fContScaling = new TGGroupFrame(fTabRight0, "Scaling", kVerticalFrame | kFitWidth | kFitHeight);
678  fTabRight0->AddFrame(fContScaling, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
679 
680  // ************************* content of fContScaling *************************
681  // SetMaximum container
682  fContSetMax = new TGCompositeFrame(fContScaling, 200, 200, kVerticalFrame | kFitWidth | kFitHeight);
683  fContScaling->AddFrame(fContSetMax, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
684 
685  // ------------------------- content of fContSetMax -------------------------
686  // SetMaximum - checkbox
687  fChkSetMax = new TGCheckButton(fContSetMax, "Set fixed max.");
688  fContSetMax->AddFrame(fChkSetMax, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
689  fChkSetMax->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsNoRedraw()");
690  fChkSetMax->SetToolTipText("Set the maximum fixed to the value specified here.");
691 
692  // text field for maximum value
693  fTxtSetMax = new TGTextEntry(fContSetMax, "", 41);
694  fContSetMax->AddFrame(fTxtSetMax, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
695  fTxtSetMax->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "HandleButtonsNoRedraw()");
696  fTxtSetMax->SetToolTipText("maximum value for the drawing");
697 
698  // SetMinimum container
699  fContSetMin = new TGCompositeFrame(fContScaling, 200, 200, kVerticalFrame | kFitWidth | kFitHeight);
700  fContScaling->AddFrame(fContSetMin, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
701 
702  // ------------------------- content of fContSetMin -------------------------
703  // SetMinimum - checkbox
704  fChkSetMin = new TGCheckButton(fContSetMin, "Set fixed min.");
705  fContSetMin->AddFrame(fChkSetMin, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
706  fChkSetMin->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsNoRedraw()");
707  fChkSetMin->SetToolTipText("Set the minimum fixed to the value specified here.");
708 
709  // text field for minimum value
710  fTxtSetMin = new TGTextEntry(fContSetMin, "", 40);
711  fContSetMin->AddFrame(fTxtSetMin, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
712  fTxtSetMin->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "HandleButtonsNoRedraw()");
713  fTxtSetMin->SetToolTipText("minimum value for the drawing");
714 
715  // get Min & Max from Plot - button
716  fBtnGetMinMax = new TGTextButton(fContScaling, "&Get scale from plot");
717  fContScaling->AddFrame(fBtnGetMinMax, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
718  fBtnGetMinMax->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "GetMinMax()");
719  fBtnGetMinMax->SetToolTipText("Get min and max from plot, e.g. after rescaling by dragging the palette. \nObsolete! The button's function will change to 'Unzoom all'.");
720 
721  // GetMinMaxAuto - checkbox
722  fChkGetMinMaxAuto = new TGCheckButton(fContScaling, "Get Min + Max auto.");
723  fContScaling->AddFrame(fChkGetMinMaxAuto, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
724  fChkGetMinMaxAuto->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsNoRedraw()");
725  fChkGetMinMaxAuto->SetToolTipText("Get minimum and maximum automatically from each new plot. \nDeactivate this, if you want to 'save' your specified minimum and maximum.");
726 
727  // labeling container *** fContLabeling *** " Labeling "
728  fContLabeling = new TGGroupFrame(fTabRight0, "Labeling", kVerticalFrame | kFitWidth | kFitHeight);
729  fTabRight0->AddFrame(fContLabeling, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
730 
731  fChkLabelTitle = new TGCheckButton(fContLabeling, "Set title:");
732  fContLabeling->AddFrame(fChkLabelTitle, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
733  fChkLabelTitle->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsNoRedraw()");
734  fChkLabelTitle->SetToolTipText("Set the plot title.");
735 
736  fTxtLabelTitle = new TGTextEntry(fContLabeling, "Title", 500);
737  fContLabeling->AddFrame(fTxtLabelTitle, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
738  fTxtLabelTitle->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "HandleButtonsNoRedraw(=50)");
739  fTxtLabelTitle->SetToolTipText("plot title");
740 
741  fChkLabelXaxis = new TGCheckButton(fContLabeling, "Set X-axis label:");
742  fContLabeling->AddFrame(fChkLabelXaxis, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
743  fChkLabelXaxis->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsNoRedraw()");
744  fChkLabelXaxis->SetToolTipText("Set the X-axis label.");
745 
746  fTxtLabelXaxis = new TGTextEntry(fContLabeling, "XaxisLabel", 500);
747  fContLabeling->AddFrame(fTxtLabelXaxis, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
748  fTxtLabelXaxis->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "HandleButtonsNoRedraw(=51)");
749  fTxtLabelXaxis->SetToolTipText("X-axis label");
750 
751  fChkLabelYaxis = new TGCheckButton(fContLabeling, "Set Y-axis label:");
752  fContLabeling->AddFrame(fChkLabelYaxis, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
753  fChkLabelYaxis->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsNoRedraw()");
754  fChkLabelYaxis->SetToolTipText("Set the Y-axis label.");
755 
756  fTxtLabelYaxis = new TGTextEntry(fContLabeling, "YaxisLabel", 500);
757  fContLabeling->AddFrame(fTxtLabelYaxis, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
758  fTxtLabelYaxis->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "HandleButtonsNoRedraw(=52)");
759  fTxtLabelYaxis->SetToolTipText("Y-axis label");
760 
761  fChkLabelGetAuto = new TGCheckButton(fContLabeling, "Get labels auto.");
762  fContLabeling->AddFrame(fChkLabelGetAuto, new TGLayoutHints(kLHintsNormal, 0, 0, 0, 0));
763  fChkLabelGetAuto->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "HandleButtonsNoRedraw()");
764  fChkLabelGetAuto->SetToolTipText("Get labels automatically from each new plot \nDeactivate this, if you want to 'save' your specified labels.");
765 
766 
767  // **************************** content of ftabRight1 *******************************
768  // Save container
769  fContSave = new TGGroupFrame(fTabRight1, "Save", kVerticalFrame | kFitWidth | kFitHeight);
770  fTabRight1->AddFrame(fContSave, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
771  // save button
772  fBtnSave = new TGTextButton(fContSave, "&Save picture");
773  fContSave->AddFrame(fBtnSave, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
774  fBtnSave->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "SavePicture()");
775  fBtnSave->SetToolTipText("Open a 'Save as...' dialog to save the current plot as picture or macro.");
776 
777  // additional save options container
778  fContAddSaveOpt = new TGCompositeFrame(fContSave, 200, 200, kVerticalFrame | kFitWidth | kFitHeight);
779  fContSave->AddFrame(fContAddSaveOpt, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
780 
781  // content of --- fContAddSaveOpt ---
782  // addition save options label
783  fChkAddSaveOpt = new TGCheckButton(fContAddSaveOpt, "Save options:");
784  fContAddSaveOpt->AddFrame(fChkAddSaveOpt, new TGLayoutHints(kLHintsNormal | kLHintsExpandX));
785  fChkAddSaveOpt->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "DoNewSelection()");
786  fChkAddSaveOpt->SetToolTipText("Additional save options (see documentation for TPad::Print()).");
787 
788  // additional save options combo box
789  fComboAddSaveOpt = new TGComboBox(fContAddSaveOpt);
790  fContAddSaveOpt->AddFrame(fComboAddSaveOpt, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
791  fComboAddSaveOpt->Resize(0, fBtnDraw->GetDefaultHeight());
792  fComboAddSaveOpt->EnableTextInput(kTRUE);
793  fComboAddSaveOpt->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "SavePicture()");
794  // fComboAddSaveOpt->Connect("Selected(Int_t)", "AliTPCCalibViewerGUI", this, "SavePicture()");
795  fComboAddSaveOpt->GetTextEntry()->SetText("",kFALSE);
796 
797  // calPad export container
798  fContExport = new TGGroupFrame(fTabRight1, "Export AliTPCCalPad", kVerticalFrame | kFitWidth | kFitHeight);
799  fTabRight1->AddFrame(fContExport, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
800 
801  // ------------------------- content of fContExport -------------------------
802  // container for export name
803  fContAddExport = new TGCompositeFrame(fContExport, 200, 200, kVerticalFrame | kFitWidth | kFitHeight);
804  fContExport->AddFrame(fContAddExport, new TGLayoutHints(kLHintsExpandX, -5, -5, 0, 0));
805 
806  fComboExportName = new TGComboBox(fContAddExport);
807  fComboExportName->Resize(0, fBtnDraw->GetDefaultHeight());
808  fContAddExport->AddFrame(fComboExportName, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
809  fComboExportName->AddEntry("calPad", 0); // first default value
810  fComboExportName->Select(0); // select default value before connecting
811  fComboExportName->EnableTextInput(kTRUE);
812  fComboExportName->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "DoExport()");
813  fComboExportName->Connect("Selected(Int_t)", "AliTPCCalibViewerGUI", this, "DoExport()");
814  fComboExportName->GetTextEntry()->SetText("",kFALSE);
815 
816  // export button
817  fBtnExport = new TGTextButton(fContExport, "&Export to CINT");
818  fContExport->AddFrame(fBtnExport, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
819  fBtnExport->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "DoExport()");
820  fBtnExport->SetToolTipText("Export the current 2D view as AliTPCCalPad to the CINT command line interpreter, use the specified name. \nThis works only in 2D mode.");
821 
822  // add to normalisation button
823  fBtnAddNorm = new TGTextButton(fContExport, "&Add to normalization");
824  fContExport->AddFrame(fBtnAddNorm, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
825  fBtnAddNorm->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "DoExportNorm()");
826  fBtnAddNorm->SetToolTipText("Use the current 2D view as normalization variable, use the specified name. \nNot yet working!");
827 
828  // Tree container
829  fContTree = new TGGroupFrame(fTabRight1, "Tree", kVerticalFrame | kFitWidth | kFitHeight);
830  fTabRight1->AddFrame(fContTree, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
831 
832  // dump tree to file button
833  fBtnDumpToFile = new TGTextButton(fContTree, "&Dump to File");
834  fContTree->AddFrame(fBtnDumpToFile, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
835  fBtnDumpToFile->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "DoDumpToFile()");
836  fBtnDumpToFile->SetToolTipText("Write the exported CalPads to a new CalibTree");
837 
838  // dump tree to file button
839  fBtnLoadTree = new TGTextButton(fContTree, "&Load Tree");
840  fContTree->AddFrame(fBtnLoadTree, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
841  fBtnLoadTree->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "DoLoadTree()");
842  fBtnLoadTree->SetToolTipText("Load and initialize a new calibration tree. ");
843 
844  fChkAddAsReference = new TGCheckButton(fContTree, "as reference:");
845  fContTree->AddFrame(fChkAddAsReference, new TGLayoutHints(kLHintsNormal | kLHintsExpandX));
846  fChkAddAsReference->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "DoLoadTree()");
847  fChkAddAsReference->SetToolTipText("To add a new tree as reference tree.");
848 
849  fTxtRefName = new TGTextEntry(fContTree, "R", 500);
850  fContTree->AddFrame(fTxtRefName, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 15, 0, 0, 0));
851  // fTxtRefName->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "HandleButtonsNoRedraw(=50)");
852  fTxtRefName->SetToolTipText("Reference Name");
853 
854 
855  // Fit options container
856  fContFit = new TGGroupFrame(fTabRight1, "Custom fit", kVerticalFrame | kFitWidth | kFitHeight);
857  fTabRight1->AddFrame(fContFit, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
858 
859  // ------------------------- content of fContFit -------------------------
860  // container for additional fits
861  fContAddFit = new TGCompositeFrame(fContFit, 200, 200, kVerticalFrame | kFitWidth | kFitHeight);
862  fContFit->AddFrame(fContAddFit, new TGLayoutHints(kLHintsExpandX, -5, -5, 0, 0));
863 
864  // --- content of fContAddFit ---
865  // text field for custom fit
866  fComboCustomFit = new TGComboBox(fContAddFit);
867  fComboCustomFit->Resize(0, fBtnDraw->GetDefaultHeight());
868  fComboCustomFit->EnableTextInput(kTRUE);
869  fContAddFit->AddFrame(fComboCustomFit, new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
870  fComboCustomFit->Connect("ReturnPressed()", "AliTPCCalibViewerGUI", this, "DoFit()");
871  fComboCustomFit->Connect("Selected(Int_t)", "AliTPCCalibViewerGUI", this, "DoFit()");
872  fComboCustomFit->GetTextEntry()->SetText("",kFALSE);
873 
874  // fit button
875  fBtnFit = new TGTextButton(fContAddFit, "&Fit");
876  fContAddFit->AddFrame(fBtnFit, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
877  fBtnFit->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "DoFit()");
878  fBtnFit->SetToolTipText("Fit a whole TPC side, e.g. with gx~ ++ gy~, the result is printed to the console \nNot yet final status.");
879 
880  // add fit function button
881  //fBtnAddFitFunction = new TGTextButton(fContAddFit, "&Add fit function to normalization");
882  //fContAddFit->AddFrame(fBtnAddFitFunction, new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0));
883  //fBtnAddFitFunction->Connect("Clicked()", "AliTPCCalibViewerGUI", this, "AddFitFunction()");
884 
885  SetWindowName("AliTPCCalibViewer GUI");
886  MapSubwindows();
887  Resize(GetDefaultSize());
888  MapWindow();
889 }
890 
891 
894 
895  fChkAuto->SetState(kButtonUp);
896  fRadioPredefined->SetState(kButtonDown);
897  fRadioRaw->SetState(kButtonDown);
898  fRadioTPC->SetState(kButtonDown);
899  fRadio1D->SetState(kButtonDown);
900  fChkAddCuts->SetState(kButtonUp);
901  fChkGetMinMaxAuto->SetState(kButtonDown);
902  fChkSetMin->SetState(kButtonUp);
903  fChkSetMax->SetState(kButtonUp);
904  fRadioNorm->SetState(kButtonDown);
905  fRadioSigma->SetState(kButtonUp);
906  fRadioCumulative->SetState(kButtonUp);
907  fChkMean->SetState(kButtonDown);
908  fCheckCumulativePM->SetState(kButtonUp);
909 
910  fChkLabelGetAuto->SetState(kButtonDown);
911 
912  // TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
913  // TODO Set the checkboxes state as it is really TODO
914  // TODO in gStyle TODO
915  // TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
916 // k = 1; kurtosis printed
917 // k = 2; kurtosis and kurtosis error printed
918 // s = 1; skewness printed
919 // s = 2; skewness and skewness error printed
920 // i = 1; integral of bins printed
921 // o = 1; number of overflows printed
922 // u = 1; number of underflows printed
923 // r = 1; rms printed
924 // r = 2; rms and rms error printed
925 // m = 1; mean value printed
926 // m = 2; mean and mean error values printed
927 // e = 1; number of entries printed
928 // n = 1; name of histogram is printed
929 // (default = 000001111)
930 
931  Int_t statOpt = gStyle->GetOptStat();
932  if (statOpt == 1) statOpt = 1111;
933  if (statOpt / 200000000 >= 1) {
934  fChkStatKurtosis->SetState(kButtonDown);
935  fChkStatKurtosisPM->SetState(kButtonDown);
936  statOpt -= 200000000;
937  }
938  if (statOpt / 100000000 >= 1) {
939  fChkStatKurtosis->SetState(kButtonDown);
940  statOpt -= 100000000;
941  }
942  if (statOpt / 20000000 >= 1) {
943  fChkStatSkewness->SetState(kButtonDown);
944  fChkStatSkewnessPM->SetState(kButtonDown);
945  statOpt -= 20000000;
946  }
947  if (statOpt / 10000000 >= 1) {
948  fChkStatSkewness->SetState(kButtonDown);
949  statOpt -= 10000000;
950  }
951  if (statOpt / 1000000 >= 1) {
952  fChkStatIntegral->SetState(kButtonDown);
953  statOpt -= 1000000;
954  }
955  if (statOpt / 100000 >= 1) {
956  fChkStatOverflow->SetState(kButtonDown);
957  statOpt -= 100000;
958  }
959  if (statOpt / 10000 >= 1) {
960  fChkStatUnderflow->SetState(kButtonDown);
961  statOpt -= 10000;
962  }
963  if (statOpt / 2000 >= 1) {
964  fChkStatRMS->SetState(kButtonDown);
965  fChkStatRMSPM->SetState(kButtonDown);
966  statOpt -= 2000;
967  }
968  if (statOpt / 1000 >= 1) {
969  fChkStatRMS->SetState(kButtonDown);
970  statOpt -= 1000;
971  }
972  if (statOpt / 200 >= 1) {
973  fChkStatMean->SetState(kButtonDown);
974  fChkStatMeanPM->SetState(kButtonDown);
975  statOpt -= 200;
976  }
977  if (statOpt / 100 >= 1) {
978  fChkStatMean->SetState(kButtonDown);
979  statOpt -= 100;
980  }
981  if (statOpt / 10 >= 1) {
982  fChkStatEntries->SetState(kButtonDown);
983  statOpt -= 10;
984  }
985  if (statOpt / 1 >= 1) {
986  fChkStatName->SetState(kButtonDown);
987  statOpt -= 1;
988  }
989 
990  /*
991  fChkStatName->SetState(kButtonDown);
992  fChkStatEntries->SetState(kButtonDown);
993  fChkStatMean->SetState(kButtonDown);
994  fChkStatRMS->SetState(kButtonDown);
995  */
996 // fChkStatMeanPM->SetState(kButtonUp);
997 // fChkStatRMSPM->SetState(kButtonUp);
998 // fChkStatUnderflow->SetState(kButtonUp);
999 // fChkStatOverflow->SetState(kButtonUp);
1000 // fChkStatIntegral->SetState(kButtonUp);
1001 // fChkStatSkewness->SetState(kButtonUp);
1002 // fChkStatSkewnessPM->SetState(kButtonUp);
1003 // fChkStatKurtosis->SetState(kButtonDown);
1004 // fChkStatKurtosisPM->SetState(kButtonDown);
1005 
1006  // fill fComboAddDrawOpt with some additional drawing options
1007  fComboAddDrawOpt->AddEntry("same", 0);
1008  fComboAddDrawOpt->AddEntry("profbox", 1);
1009  fComboAddDrawOpt->AddEntry("profcolz", 2);
1010  fComboAddDrawOpt->AddEntry("profcont0", 3);
1011  fComboAddDrawOpt->AddEntry("proflego", 4);
1012  fComboAddDrawOpt->AddEntry("proflego2", 5);
1013  fComboAddDrawOpt->AddEntry("profsurf", 6);
1014  fComboAddDrawOpt->AddEntry("profsurf1", 7);
1015  fComboAddDrawOpt->AddEntry("profsurf2", 8);
1016  fComboAddDrawOpt->AddEntry("box", 9);
1017  fComboAddDrawOpt->AddEntry("colz", 10);
1018  fComboAddDrawOpt->AddEntry("cont0", 11);
1019  fComboAddDrawOpt->AddEntry("lego", 12);
1020  fComboAddDrawOpt->AddEntry("lego2", 13);
1021  fComboAddDrawOpt->AddEntry("surf", 14);
1022  fComboAddDrawOpt->AddEntry("surf1", 15);
1023  fComboAddDrawOpt->AddEntry("surf2", 16);
1024 
1025  // fill fComboAddSaveOpt with some additional drawing options
1026  fComboAddSaveOpt->AddEntry("Portrait", 0);
1027  fComboAddSaveOpt->AddEntry("Landscape", 1);
1028  fComboAddSaveOpt->AddEntry("Preview", 2);
1029  fComboAddSaveOpt->AddEntry("+50", 3);
1030 
1031  // fill fComboMethod
1032  fComboMethod->AddEntry("subtract", 0);
1033  fComboMethod->AddEntry("divide by", 1);
1034 
1035  // fill fComboExportName
1036 // fComboExportName->AddEntry("calPad", 0);
1037  // fComboExportName->AddEntry("calPad2", 1);
1038  fBtnExport->SetEnabled(kFALSE);
1039  fBtnAddNorm->SetEnabled(kFALSE);
1040 
1041  // select initial variables
1042  fListVariables->Select(0);
1043  fListNormalization->Select(0);
1044  fComboMethod->Select(0);
1045 // fComboExportName->Select(0);
1046 // fComboExportName->EnableTextInput(kTRUE);
1047 
1048  //fCanvMain->GetCanvas()->ToggleEventStatus(); // klappt nicht
1049  //fCanvMain->GetCanvas()->GetCanvasImp()->ShowStatusBar(kTRUE); // klappt auch nicht
1050  fListVariables->IntegralHeight(kFALSE); // naja
1051  fListNormalization->IntegralHeight(kFALSE); // naja
1052  fChkAuto->SetState(kButtonDown);
1053 
1054  // Make first drawing:
1055  // DoDraw();
1056 }
1057 
1058 
1060  : TGCompositeFrame(c.fParent, c.fWidth, c.fHeight),
1061  fViewer(0),
1062  fPreprocessor(0),
1063  fContTopBottom(0),
1064  fContLCR(0),
1065  fContLeft(0),
1066  ftabLeft(0),
1067  ftabLeft0(0),
1068  ftabLeft1(0),
1069  ftabRight(0),
1070  fTabRight0(0),
1071  fTabRight1(0),
1072  fContRight(0),
1073  fContCenter(0),
1074  fContPlotOpt(0),
1075  fContDrawOpt(0),
1077  fContNormalized(0),
1078  fContCustom(0),
1079  fContCuts(0),
1080  fContSector(0),
1081  fContAddCuts(0),
1082  fContFit(0),
1083  fContAddFit(0),
1084  fContScaling(0),
1085  fContSetMax(0),
1086  fContSetMin(0),
1087  fContAddDrawOpt(0),
1088  fListVariables(0),
1089  fBtnDraw(0),
1090  fBtnFit(0),
1091  fBtnAddFitFunction(0),
1092  fBtnGetMinMax(0),
1093  fCanvMain(0),
1094  fRadioRaw(0),
1095  fRadioNormalized(0),
1096  fRadioPredefined(0),
1097  fRadioCustom(0),
1098  fRadio1D(0),
1099  fRadio2D(0),
1100  fRadioTPC(0),
1101  fRadioSideA(0),
1102  fRadioSideC(0),
1103  fRadioROC(0),
1104  fRadioSector(0),
1105  fComboAddDrawOpt(0),
1106  fChkAuto(0),
1107  fChkAutoAppend(0),
1108  fComboMethod(0),
1109  fListNormalization(0),
1110  fComboCustom(0),
1111  fLblCustomDraw(0),
1112  fChkAddDrawOpt(0),
1113  fNmbSector(0),
1114  fLblSector(0),
1115  fChkCutZero(0),
1116  fChkAddCuts(0),
1117  fLblAddCuts(0),
1118  fComboAddCuts(0),
1119  fComboCustomFit(0),
1120  fChkSetMax(0),
1121  fChkSetMin(0),
1122  fChkGetMinMaxAuto(0),
1123  fTxtSetMax(0),
1124  fTxtSetMin(0),
1125  fContDrawOpt1D(0),
1128  fRadioNorm(0),
1129  fRadioSigma(0),
1130  fTxtSigmas(0),
1131  fContCumuLR(0),
1132  fContCumLeft(0),
1133  fContCumRight(0),
1134  fLblSigmaMax(0),
1135  fTxtSigmaMax(0),
1136  fRadioCumulative(0),
1137  fCheckCumulativePM(0),
1138  fRadioIntegrate(0),
1140  fChkMean(0),
1141  fChkMedian(0),
1142  fChkLTM(0),
1143  fContStatOpt(0),
1144  fChkStatName(0),
1145  fChkStatEntries(0),
1146  fContStatMean(0),
1147  fChkStatMean(0),
1148  fChkStatMeanPM(0),
1149  fContStatRMS(0),
1150  fChkStatRMS(0),
1151  fChkStatRMSPM(0),
1152  fChkStatUnderflow(0),
1153  fChkStatOverflow(0),
1154  fChkStatIntegral(0),
1155  fContStatSkew(0),
1156  fChkStatSkewness(0),
1157  fChkStatSkewnessPM(0),
1158  fContStatKurt(0),
1159  fChkStatKurtosis(0),
1160  fChkStatKurtosisPM(0),
1161  fBtnUnchekAll(0),
1162  fContLabeling(0),
1163  fChkLabelTitle(0),
1164  fTxtLabelTitle(0),
1165  fChkLabelXaxis(0),
1166  fTxtLabelXaxis(0),
1167  fChkLabelYaxis(0),
1168  fTxtLabelYaxis(0),
1169  fChkLabelGetAuto(0),
1170  fContSave(0),
1171  fBtnSave(0),
1172  fContAddSaveOpt(0),
1173  fChkAddSaveOpt(0),
1174  fComboAddSaveOpt(0),
1175  fContExport(0),
1176  fContAddExport(0),
1177  fComboExportName(0),
1178  fBtnExport(0),
1179  fBtnAddNorm(0),
1180  fContTree(0),
1181  fBtnDumpToFile(0),
1182  fBtnLoadTree(0),
1183  fChkAddAsReference(0),
1184  fTxtRefName(0),
1185  fInitialized(0)
1186 {
1188 
1189 }
1190 
1191 
1194 
1195  return (*this);
1196 }
1197 
1198 
1201 
1202  if (fCanvMain && fCanvMain->GetCanvas()) {
1203  for (Int_t i = 0; i < fCanvMain->GetCanvas()->GetListOfPrimitives()->GetEntries(); i++) {
1204  if (strcmp(fCanvMain->GetCanvas()->GetListOfPrimitives()->At(i)->ClassName(), "TFrame") != 0)
1205  fCanvMain->GetCanvas()->GetListOfPrimitives()->At(i)->Delete();
1206  }
1207  }
1208  Cleanup();
1209  if (fViewer) fViewer->Delete();
1210  delete fPreprocessor;
1211 }
1212 
1213 
1214 /*
1215 void AliTPCCalibViewerGUI::CloseWindow() {
1216  DeleteWindow();
1217 }
1218 */
1219 
1220 
1221 void AliTPCCalibViewerGUI::Initialize(const char* fileName, const char* treeName) {
1223 
1224  // create AliTPCCalibViewer object, which will be used for generating all drawings
1225  if (fViewer) delete fViewer;
1226  fViewer = new AliTPCCalibViewer(fileName, treeName);
1227  Initialize(fViewer);
1228 }
1229 
1230 
1233 
1234  fViewer = viewer;
1235  TString selectedVariable("");
1236  TString selectedNormalization("");
1237  Int_t variableId = -1;
1238  Int_t normalizationId = -1;
1239  if (fInitialized) {
1240  // remember the selected entry
1241  if (fListVariables->GetSelectedEntry()) selectedVariable = fListVariables->GetSelectedEntry()->GetTitle();
1242  if (fListNormalization->GetSelectedEntry()) selectedNormalization = fListNormalization->GetSelectedEntry()->GetTitle();
1243  }
1244 
1245  // fill fListVariables, list of drawable variables:
1247  if (!arr) return;
1248  TIterator* iter = arr->MakeIterator();
1249  iter->Reset();
1250  TObjString* currentStr = 0;
1251  Int_t id = 0;
1252  fListVariables->RemoveAll();
1253  while ((currentStr = (TObjString*)(iter->Next()))) {
1254  fListVariables->AddEntry(currentStr->GetString().Data(), id);
1255  if (fInitialized && currentStr->GetString() == selectedVariable) variableId = id;
1256  id++;
1257  }
1258 
1259  // fill fListNorm, list of normalization variables:
1261  TIterator *iterNorm = arrNorm->MakeIterator();
1262  iterNorm->Reset();
1263  currentStr = 0;
1264  id = 0;
1265  fListNormalization->RemoveAll();
1266  while ((currentStr = (TObjString*)(iterNorm->Next()))) {
1267  fListNormalization->AddEntry(currentStr->GetString().Data(), id);
1268  if (fInitialized && currentStr->GetString() == selectedNormalization) normalizationId = id;
1269  id++;
1270  }
1271  currentStr = 0;
1272  iter->Reset();
1273  //Add draw variables to the list of normalisation
1274  while ((currentStr = (TObjString*)(iter->Next()))) {
1275  if (currentStr->GetString().BeginsWith("Map")) continue; //don't add mapping information
1276  fListNormalization->AddEntry(currentStr->GetString().Data(), id);
1277  if (fInitialized && currentStr->GetString() == selectedNormalization) normalizationId = id;
1278  id++;
1279  }
1280 
1281  delete iterNorm;
1282  arrNorm->Delete();
1283  delete arrNorm;
1284 
1285  delete iter;
1286  arr->Delete();
1287  delete arr;
1288 
1289  // trick do display the entries corectly after reinitialization
1290  // otherwise all the entries would appear as one kryptic entry
1291  // resizing the listbox somehow fixes the problem...
1292  if (fInitialized) fListVariables->Resize(fListVariables->GetWidth()-1, fListVariables->GetHeight());
1293  if (fInitialized) fListVariables->Resize(fListVariables->GetWidth()+1, fListVariables->GetHeight());
1294  if (fInitialized) fListNormalization->Resize(fListNormalization->GetWidth()-1, fListNormalization->GetHeight());
1295  if (fInitialized) fListNormalization->Resize(fListNormalization->GetWidth()+1, fListNormalization->GetHeight());
1296 
1297  // select the last selected variable and normalization
1298  if (fInitialized && variableId != -1) fListVariables->Select(variableId);
1299  if (fInitialized && normalizationId != -1)fListVariables->Select(normalizationId);
1300 
1301  if (fInitialized) Info("Initialize", "AliTPCCalibViewerGUI new initialized.");
1302  fInitialized = kTRUE;
1303 
1304 }
1305 
1308 
1309  if (fViewer) delete fViewer;
1310  fListVariables->RemoveAll();
1311  fListNormalization->RemoveAll();
1312  fInitialized = kFALSE;
1313 }
1314 
1318 
1319  if (id == -1) {
1320  TGButton *btn = (TGButton *) gTQSender;
1321  id = btn->WidgetId();
1322  }
1323 
1324  switch (id) {
1325  case 10: // fRadioRaw
1326  fRadioNormalized->SetState(kButtonUp);
1327  fRadioPredefined->SetState(kButtonDown);
1328  fRadioCustom->SetState(kButtonUp);
1329  // fComboMethod->UnmapWindow();
1330  // fListNormalization->UnmapWindow();
1331  break;
1332  case 11: // fRadioNormalized
1333  fRadioRaw->SetState(kButtonUp);
1334  fRadioPredefined->SetState(kButtonDown);
1335  fRadioCustom->SetState(kButtonUp);
1336  break;
1337  case 12: // fRadioCustom
1338  fRadioPredefined->SetState(kButtonUp);
1339  // fComboCustom->SetEnabled(kFALSE);
1340  // fRadioNormalized->SetState(kButtonUp);
1341  break;
1342  case 14: // select Draw options fComboAddDrawOpt
1343  fChkAddDrawOpt->SetState(kButtonDown);
1344  break;
1345  case 13: // fRadioPredefined
1346  fRadioCustom->SetState(kButtonUp);
1347  // fComboCustom->SetEnabled(kTRUE);
1348  //f RadioNormalized->SetState(kButtonUp);
1349  break;
1350  //--------
1351  case 30: // fRadio1D
1352  fRadio2D->SetState(kButtonUp);
1353  fBtnExport->SetEnabled(kFALSE);
1354  fBtnAddNorm->SetEnabled(kFALSE);
1355  break;
1356  case 31: // fRadio2D
1357  fRadio1D->SetState(kButtonUp);
1358  fBtnExport->SetEnabled(kTRUE);
1359  fBtnAddNorm->SetEnabled(kTRUE);
1360  break;
1361  case 42: // fComboCustom
1362  fRadioCustom->SetState(kButtonDown);
1363  fRadioPredefined->SetState(kButtonUp);
1364  break;
1365  }
1366  DoNewSelection();
1367 }
1368 
1369 
1373 
1374  if (id == -1) {
1375  TGButton *btn = (TGButton *) gTQSender;
1376  id = btn->WidgetId();
1377  }
1378  switch (id) {
1379  case 110: // 1D draw normal
1380  fRadioNorm->SetState(kButtonDown);
1381  fRadioSigma->SetState(kButtonUp);
1382  fRadioCumulative->SetState(kButtonUp);
1383  fRadioIntegrate->SetState(kButtonUp);
1384  break;
1385  case 111: // 1D draw sigma
1386  fRadioNorm->SetState(kButtonUp);
1387  fRadioSigma->SetState(kButtonDown);
1388  fRadioCumulative->SetState(kButtonUp);
1389  fRadioIntegrate->SetState(kButtonUp);
1390  break;
1391  case 112: // 1D draw cumulative
1392  fRadioNorm->SetState(kButtonUp);
1393  fRadioSigma->SetState(kButtonUp);
1394  fRadioCumulative->SetState(kButtonDown);
1395  fRadioIntegrate->SetState(kButtonUp);
1396  break;
1397  case 113: // 1D draw integral
1398  fRadioNorm->SetState(kButtonUp);
1399  fRadioSigma->SetState(kButtonUp);
1400  fRadioCumulative->SetState(kButtonUp);
1401  fRadioIntegrate->SetState(kButtonDown);
1402  break;
1403  }
1404  DoNewSelection();
1405 }
1406 
1407 
1413 
1414  if (id == -1) {
1415  TGButton *btn = (TGButton *) gTQSender;
1416  id = btn->WidgetId();
1417  }
1418  TString statOpt("");
1419  if (fChkStatName->GetState() == kButtonDown) statOpt.Append("n");
1420  if (fChkStatEntries->GetState() == kButtonDown) statOpt.Append("e");
1421  if (fChkStatMean->GetState() == kButtonDown && fChkStatMeanPM->GetState() == kButtonUp) statOpt.Append("m");
1422  if (fChkStatMeanPM->GetState() == kButtonDown) statOpt.Append("M");
1423  if (fChkStatRMS->GetState() == kButtonDown && fChkStatRMSPM->GetState() == kButtonUp) statOpt.Append("r");
1424  if (fChkStatRMSPM->GetState() == kButtonDown) statOpt.Append("R");
1425  if (fChkStatUnderflow->GetState() == kButtonDown) statOpt.Append("u");
1426  if (fChkStatOverflow->GetState() == kButtonDown) statOpt.Append("o");
1427  if (fChkStatIntegral->GetState() == kButtonDown) statOpt.Append("i");
1428  if (fChkStatSkewness->GetState() == kButtonDown && fChkStatSkewnessPM->GetState() == kButtonUp) statOpt.Append("s");
1429  if (fChkStatSkewnessPM->GetState() == kButtonDown) statOpt.Append("S");
1430  if (fChkStatKurtosis->GetState() == kButtonDown && fChkStatKurtosisPM->GetState() == kButtonUp) statOpt.Append("k");
1431  if (fChkStatKurtosisPM->GetState() == kButtonDown) statOpt.Append("K");
1432 
1433  gStyle->SetOptStat(statOpt);
1434  DoNewSelection();
1435 }
1436 
1437 
1441 
1442  if (id == -1) {
1443  TGButton *btn = (TGButton *) gTQSender;
1444  id = btn->WidgetId();
1445  }
1446 
1447  switch (id) {
1448  case 20: // fRadioTPC
1449  fRadioSideA->SetState(kButtonUp);
1450  fRadioSideC->SetState(kButtonUp);
1451  fRadioROC->SetState(kButtonUp);
1452  fRadioSector->SetState(kButtonUp);
1453  break;
1454  case 21: // fRadioSideA
1455  fRadioTPC->SetState(kButtonUp);
1456  fRadioSideC->SetState(kButtonUp);
1457  fRadioROC->SetState(kButtonUp);
1458  fRadioSector->SetState(kButtonUp);
1459  break;
1460  case 22: // fRadioSideC
1461  fRadioTPC->SetState(kButtonUp);
1462  fRadioSideA->SetState(kButtonUp);
1463  fRadioROC->SetState(kButtonUp);
1464  fRadioSector->SetState(kButtonUp);
1465  break;
1466  case 23: // fRadioROC
1467  fRadioTPC->SetState(kButtonUp);
1468  fRadioSideA->SetState(kButtonUp);
1469  fRadioSideC->SetState(kButtonUp);
1470  fRadioSector->SetState(kButtonUp);
1471  break;
1472  case 24: // fRadioSector
1473  fRadioTPC->SetState(kButtonUp);
1474  fRadioSideA->SetState(kButtonUp);
1475  fRadioSideC->SetState(kButtonUp);
1476  fRadioROC->SetState(kButtonUp);
1477  break;
1478  case 31: // fComboAddCuts
1479  fChkAddCuts->SetState(kButtonDown);
1480  break;
1481  }
1482  DoNewSelection();
1483 }
1484 
1485 
1489 
1490  if (id == -1) {
1491  TGButton *btn = (TGButton *) gTQSender;
1492  id = btn->WidgetId();
1493  }
1494 
1495  switch (id) {
1496  case 40: // fTxtSetMin
1497  fChkSetMin->SetState(kButtonDown);
1498  break;
1499  case 41: // fTxtSetMax
1500  fChkSetMax->SetState(kButtonDown);
1501  break;
1502  case 50: // fTxtLabelTitle
1503  fChkLabelTitle->SetState(kButtonDown);
1504  break;
1505  case 51: // fTxtLabelXaxis
1506  fChkLabelXaxis->SetState(kButtonDown);
1507  break;
1508  case 52: // fTxtLabelXaxis
1509  fChkLabelYaxis->SetState(kButtonDown);
1510  break;
1511  }
1512  SetMinMaxLabel();
1513 }
1514 
1516 {
1518 
1519  TString drawPlaceHolder("#draw#");
1520  TString normPlaceHolder("#norm#");
1521 
1522  //current draw variable
1523  TString desiredData("");
1524  if (fListVariables->GetSelectedEntry()){
1525  desiredData += ((TGTextLBEntry*)(fListVariables->GetSelectedEntry()))->GetTitle();
1526  str.ReplaceAll(drawPlaceHolder,desiredData);
1527  }
1528 // desiredData += fViewer->GetAbbreviation();
1529 
1530  //current normalisation
1531  TString normalizationData("");
1532  if (fListNormalization->GetSelectedEntry()){
1533  normalizationData += ((TGTextLBEntry*)(fListNormalization->GetSelectedEntry()))->GetTitle();
1534  if (! (TString(((TGTextLBEntry*)(fListNormalization->GetSelectedEntry()))->GetTitle())).BeginsWith("Fit"))
1535  if ( normalizationData.BeginsWith("_") ) normalizationData = desiredData+normalizationData;
1536  if ( fListVariables->FindEntry(normalizationData.Data()) )
1537  normalizationData+="~";
1538  str.ReplaceAll(normPlaceHolder,normalizationData);
1539  }
1540 }
1541 
1544 
1545  if (fChkAuto->GetState() == kButtonDown) DoDraw();
1546 }
1547 
1548 
1551 
1552  // specify data to plot
1553  TString desiredData("");
1554  if (!fListVariables->GetSelectedEntry()) return 0;
1555  desiredData += ((TGTextLBEntry*)(fListVariables->GetSelectedEntry()))->GetTitle();
1556  desiredData += fViewer->GetAbbreviation();
1557 
1558  // specify normalization
1559  if (fRadioPredefined->GetState() == kButtonDown && fRadioNormalized->GetState() == kButtonDown) {
1560  TString op("");
1561  switch (fComboMethod->GetSelected()) {
1562  case 0: // subtraction
1563  op += "-";
1564  break;
1565  case 1: // division
1566  op += "/";
1567  break;
1568  }
1569  TString normalizationData("");
1570  if (!fListNormalization->GetSelectedEntry()) return 0;
1571  normalizationData += ((TGTextLBEntry*)(fListNormalization->GetSelectedEntry()))->GetTitle();
1572 
1573  if ( normalizationData.BeginsWith("Fit")) {
1574  // create fit formula, evaluate it an replace normalizationData-String
1575  // ********** create cut string **********
1576  TString cutStr("");
1577  if (fRadioTPC->GetState() == kButtonDown)
1578  cutStr += ""; // whole TPC is used for fitting
1579  if (fRadioSideA->GetState() == kButtonDown)
1580  cutStr += "(sector/18)%2==0"; // side A
1581  if (fRadioSideC->GetState() == kButtonDown)
1582  cutStr+= "(sector/18)%2==1"; // side C
1583  if (fRadioROC->GetState() == kButtonDown) {
1584  Int_t sector = (Int_t)(fNmbSector->GetNumber());
1585  cutStr += "sector==";
1586  cutStr += sector;
1587  }
1588  if (fRadioSector->GetState() == kButtonDown) {
1589  Int_t sector = ((Int_t)(fNmbSector->GetNumber()))%36;
1590  cutStr += "sector%36==";
1591  cutStr += sector;
1592  }
1593  if (fChkAddCuts->GetState() == kButtonDown && strcmp(fComboAddCuts->GetTextEntry()->GetText(), "") != 0){
1594  if (fRadioTPC->GetState() != kButtonDown) cutStr += " && ";
1595  cutStr += fComboAddCuts->GetTextEntry()->GetText();
1596  }
1597  Double_t chi2 = 0;
1598  TVectorD fitParam(0);
1599  TMatrixD covMatrix(0,0);
1600  TString formulaStr("");
1601  if (normalizationData.CompareTo("FitLinLocal") == 0)
1602  formulaStr = "lx~ ++ ly~";
1603  if (normalizationData.CompareTo("FitLinGlobal") == 0)
1604  formulaStr = "gx~ ++ gy~";
1605  if (normalizationData.CompareTo("FitParLocal") == 0)
1606  formulaStr = "lx~ ++ ly~ ++ lx~^2 ++ ly~^2 ++ lx~*ly~";
1607  if (normalizationData.CompareTo("FitParGlobal") == 0)
1608  formulaStr = "gx~ ++ gy~ ++ gx~^2 ++ gy~^2 ++ gx~*gy~";
1609  formulaStr.ReplaceAll("~", fViewer->GetAbbreviation());
1610  normalizationData = *fViewer->Fit(desiredData.Data(), formulaStr.Data(), cutStr.Data(), chi2, fitParam, covMatrix);
1611  } // if ( normalizationData.BeginsWith("Fit")
1612 
1613  desiredData += op;
1614  if (! (TString(((TGTextLBEntry*)(fListNormalization->GetSelectedEntry()))->GetTitle())).BeginsWith("Fit"))
1615  if ( normalizationData.BeginsWith("_") ) desiredData += ((TGTextLBEntry*)(fListVariables->GetSelectedEntry()))->GetTitle();
1616  if ( fListVariables->FindEntry(normalizationData.Data()) )
1617  normalizationData+="~";
1618  desiredData += normalizationData;
1619  }
1620  else if (fRadioCustom->GetState() == kButtonDown) {
1621  desiredData = fComboCustom->GetTextEntry()->GetText();
1622  if (desiredData == "") return 0;
1623  ReplacePlaceHolders(desiredData);
1624  }
1625 
1626  // try to add forgotten '~'
1627  if (fChkAutoAppend->GetState() == kButtonDown)
1628  desiredData = TString(fViewer->AddAbbreviations((char*)desiredData.Data()));
1629  return new TString(desiredData.Data());
1630 }
1631 
1632 
1635 
1636  TString sectorStr("");
1637  if (fRadioTPC->GetState() == kButtonDown)
1638  sectorStr += "ALL";
1639  if (fRadioSideA->GetState() == kButtonDown)
1640  sectorStr += "A"; //cuts += "(sector/18)%2==0";
1641  if (fRadioSideC->GetState() == kButtonDown)
1642  sectorStr+= "C"; //cuts += "(sector/18)%2==1";
1643  if (fRadioROC->GetState() == kButtonDown) {
1644  Int_t sector = (Int_t)(fNmbSector->GetNumber());
1645  sectorStr += sector; //cuts += "sector==";
1646  }
1647  if (fRadioSector->GetState() == kButtonDown) {
1648  Int_t sector = ((Int_t)(fNmbSector->GetNumber()))%36;
1649  sectorStr += "S";
1650  sectorStr += sector; //cuts += "sector%36==";
1651  }
1652  return new TString(sectorStr.Data());
1653 }
1654 
1655 
1658 
1659  TString cutsStr("");
1660  if (fChkCutZero->GetState() == kButtonDown) {
1661  TString cutZerosStr(GetDrawString()->Data());
1662  if (cutZerosStr.Contains(">>")) {
1663  cutZerosStr.Remove(cutZerosStr.First(">>"));
1664  }
1665  if (cutZerosStr.Contains(":")) {
1666  cutZerosStr.Remove(cutZerosStr.First(":"));
1667  }
1668  cutsStr += cutZerosStr.Data();
1669  cutsStr += "!=0";
1670  if (fChkAddCuts->GetState() == kButtonDown) cutsStr += " && ";
1671  }
1672  if (fChkAddCuts->GetState() == kButtonDown){
1673  cutsStr += fComboAddCuts->GetTextEntry()->GetText();
1674  ReplacePlaceHolders(cutsStr);
1675  }
1676 
1677 
1678  // try to add forgotten '~'
1679  if (fChkAutoAppend->GetState() == kButtonDown)
1680  cutsStr = TString(fViewer->AddAbbreviations((char*)cutsStr.Data()));
1681  return new TString(cutsStr.Data());
1682 }
1683 
1684 
1687 
1688  // specify data to plot:
1689  if (!GetDrawString()) return;
1690  TString desiredData(GetDrawString()->Data());
1691  // specify sector:
1692  TString sectorStr(GetSectorString()->Data());
1693  // specify cuts:
1694  TString cutsStr(GetCutString()->Data());
1695 
1696  TString addDrawOpt("");
1697  if (fChkAddDrawOpt->GetState() == kButtonDown)
1698  addDrawOpt += fComboAddDrawOpt->GetTextEntry()->GetText();
1699 
1700  // remove last picture
1701  if (!addDrawOpt.Contains("same"))
1702  for (Int_t i = 0; i < fCanvMain->GetCanvas()->GetListOfPrimitives()->GetEntries(); i++) {
1703  if (strcmp(fCanvMain->GetCanvas()->GetListOfPrimitives()->At(i)->ClassName(), "TFrame") != 0)
1704  fCanvMain->GetCanvas()->GetListOfPrimitives()->At(i)->Delete();
1705  }
1706  //fCanvMain->GetCanvas()->Clear();
1707  fCanvMain->GetCanvas()->cd();
1708  Int_t entries = -1;
1709  // draw finally
1710  if (fRadio1D->GetState() == kButtonDown){
1711  // 1D-Drawing
1712  TString strSigmaMax(fTxtSigmaMax->GetText()); // get sigmaMax from text enty
1713  Double_t sigmaMax = (strSigmaMax.IsFloat()) ? strSigmaMax.Atof() : 5; // convert to double, if not convertable, set to 5
1714  Bool_t plotMean = fChkMean->GetState() == kButtonDown;
1715  Bool_t plotMedian = fChkMedian->GetState() == kButtonDown;
1716  Bool_t plotLTM = fChkLTM->GetState() == kButtonDown;
1717  if (fRadioNorm->GetState() == kButtonDown) // normal 1D drawing
1718  entries = fViewer->EasyDraw1D(desiredData.Data(), sectorStr.Data(), cutsStr.Data(), addDrawOpt.Data());
1719  if (fRadioSigma->GetState() == kButtonDown) // sigma 1D drawing
1720  entries = fViewer->DrawHisto1D(desiredData.Data(), sectorStr.Data(), cutsStr.Data(), //
1721  fTxtSigmas->GetText(), plotMean, plotMedian, plotLTM);
1722  if (fRadioCumulative->GetState() == kButtonDown) // cumulative 1D drawing
1723  entries = fViewer->SigmaCut(desiredData.Data(), sectorStr.Data(), cutsStr.Data(), //
1724  sigmaMax, plotMean, plotMedian, plotLTM, //
1725  fCheckCumulativePM->GetState() == kButtonDown, fTxtSigmas->GetText(), /* Float_t sigmaStep =*/ -1);
1726  if (fRadioIntegrate->GetState() == kButtonDown) // integral 1D drawing
1727  entries = fViewer->Integrate(desiredData.Data(), sectorStr.Data(), cutsStr.Data(), //
1728  sigmaMax, plotMean, plotMedian, plotLTM, //
1729  fTxtSigmas->GetText(), /* Float_t sigmaStep =*/ -1);
1730  }
1731  else if (fRadio2D->GetState() == kButtonDown) {
1732  // 2D-Drawing
1733  entries = fViewer->EasyDraw(desiredData.Data(), sectorStr.Data(), cutsStr.Data(), addDrawOpt.Data());
1734  }
1735  if (entries == -1) return; // nothing was drawn, there is no histogram to get min and max
1736 
1737  SetMinMaxLabel();
1738  fCanvMain->GetCanvas()->Update();
1739 }
1740 
1741 
1744 
1745  Double_t chi2 = 0;
1746  TVectorD fitParam(0);
1747  TMatrixD covMatrix(0,0);
1748  TString cutStr("");
1749  TString formulaStr("");
1750 
1751  // specify data to plot:
1752  TString drawStr(GetDrawString()->Data());
1753 
1754  // ********** create cut string **********
1755  if (fRadioTPC->GetState() == kButtonDown)
1756  cutStr += ""; // whole TPC is used for fitting
1757  if (fRadioSideA->GetState() == kButtonDown)
1758  cutStr += "(sector/18)%2==0"; // side A
1759  if (fRadioSideC->GetState() == kButtonDown)
1760  cutStr+= "(sector/18)%2==1"; // side C
1761  if (fRadioROC->GetState() == kButtonDown) {
1762  Int_t sector = (Int_t)(fNmbSector->GetNumber());
1763  cutStr += "sector==";
1764  cutStr += sector;
1765  }
1766  if (fRadioSector->GetState() == kButtonDown) {
1767  Int_t sector = (Int_t)(fNmbSector->GetNumber())%36;
1768  cutStr += "sector%36==";
1769  cutStr += sector;
1770  }
1771  if (fChkAddCuts->GetState() == kButtonDown && strcmp(fComboAddCuts->GetTextEntry()->GetText(), "") != 0){
1772  if (fRadioTPC->GetState() != kButtonDown) cutStr += " && ";
1773  cutStr += fComboAddCuts->GetTextEntry()->GetText();
1774  }
1775  // try to add forgotten '~'
1776  if (fChkAutoAppend->GetState() == kButtonDown)
1777  cutStr = TString(fViewer->AddAbbreviations((char*)cutStr.Data()));
1778 
1779  // ********** get formula string **********
1780  formulaStr += fComboCustomFit->GetTextEntry()->GetText();
1781  if (fChkAutoAppend->GetState() == kButtonDown)
1782  formulaStr = TString(fViewer->AddAbbreviations((char*)formulaStr.Data()));
1783 
1784  // ********** call AliTPCCalibViewer's fit-function
1785  ReplacePlaceHolders(drawStr);
1786  ReplacePlaceHolders(cutStr);
1787  TString *returnStr = fViewer->Fit(drawStr.Data(), formulaStr.Data(), cutStr.Data(), chi2, fitParam, covMatrix);
1788 
1789  std::cout << std::endl;
1790  std::cout << "Your fit formula reads as follows:" << std::endl;
1791  std::cout << returnStr->Data() << std::endl;
1792  std::cout << "chi2 = " << chi2 << std::endl;
1793 
1794  delete returnStr;
1795 }
1796 
1797 
1800 
1801  if ( fRadio2D->GetState() != kButtonDown){
1802  Error("ExportCalPad", "Export of AliTPCCalPad to CINT works only in 2D mode.");
1803  return;
1804  }
1805  // specify data to plot:
1806  TString desiredData(GetDrawString()->Data());
1807  // specify cuts:
1808  TString cutsStr(GetCutString()->Data());
1809  // get name for the calPad
1810  const char* calPadName = fComboExportName->GetTextEntry()->GetText();
1811  // create calPad according to drawCommand and cuts
1812  AliTPCCalPad *calPad = fViewer->GetCalPad(desiredData.Data(), (char*)cutsStr.Data(), (char*)calPadName);
1813  // finally export calPad to Cint:
1814  gROOT->ProcessLine(Form("AliTPCCalPad* %s = (AliTPCCalPad*)0x%lx;", calPadName, (ULong_t)calPad));
1815  fPreprocessor->AddComponent(calPad);
1816  Info("ExportCalPad", "Current 2D view has been exported to an AliTPCCalPad* with name '%s'", calPadName);
1817 }
1818 
1819 
1822 
1823  if ( fRadio2D->GetState() != kButtonDown){
1824  Error("ExportCalPad", "Adding an AliTPCCalPad to the normalization works only in 2D mode.");
1825  return;
1826  }
1827 
1828  Error("DoExportNorm", "Not yet implemented.");
1829 /*
1830  return;
1831 
1832  // specify data to plot:
1833  TString desiredData(GetDrawString()->Data());
1834  // specify sector:
1835  TString sectorStr(GetSectorString()->Data());
1836  // specify cuts:
1837  TString cutsStr(GetCutString()->Data());
1838 
1839  // get name for the calPad
1840  const char* calPadName = fComboExportName->GetTextEntry()->GetText();
1841  // create calPad according to drawCommand and cuts
1842  AliTPCCalPad *calPad = fViewer->GetCalPad(desiredData.Data(), (char*)cutsStr.Data(), (char*)fComboExportName->GetTextEntry()->GetText());
1843  // finally export calPad to Cint:
1844  gROOT->ProcessLine(Form("AliTPCCalPad* %s = (AliTPCCalPad*)0x%lx;", calPadName, (ULong_t) calPad));
1845  Info("ExportCalPad", "Current 2D view has been exported to an AliTPCCalPad* with name '%s'", calPadName);
1846  */
1847 }
1848 
1849 
1852 
1853  if (fChkGetMinMaxAuto->GetState() == kButtonUp) return;
1854  TList* listOfPrimitives = fCanvMain->GetCanvas()->GetListOfPrimitives();
1855  TObject* ptr = 0;
1856  for (Int_t i = 0; i < listOfPrimitives->GetEntries(); i++) {
1857  ptr = listOfPrimitives->At(i);
1858  if ( ptr->InheritsFrom("TH1") ) break;
1859  }
1860  if ( !ptr || !ptr->InheritsFrom("TH1") ) return; // if the loop did not find a TH1
1861  TH1 *hist = (TH1*)ptr;
1862 
1863 // Double_t histMax = hist->GetMaximum();
1864 // Double_t histMin = hist->GetMinimum();
1865 // fTxtSetMax->SetText(Form("%f",histMax));
1866 // fTxtSetMin->SetText(Form("%f",histMin));
1867 
1868  if (fRadio2D->GetState() == kButtonDown) {
1869  if (fChkSetMax->GetState() == kButtonUp)
1870  fTxtSetMax->SetText(Form("%f", hist->GetMaximum()));
1871  if (fChkSetMin->GetState() == kButtonUp)
1872  fTxtSetMin->SetText(Form("%f", hist->GetMinimum()));
1873  }
1874  else if (fRadio1D->GetState() == kButtonDown) {
1875  if (fChkSetMax->GetState() == kButtonUp)
1876  fTxtSetMax->SetText( Form("%f", hist->GetXaxis()->GetXmax()) );
1877  if (fChkSetMin->GetState() == kButtonUp)
1878  fTxtSetMin->SetText( Form("%f", hist->GetXaxis()->GetXmin()) );
1879  }
1880 }
1881 
1882 
1886 
1887  // search for histogram
1888  TList* listOfPrimitives = fCanvMain->GetCanvas()->GetListOfPrimitives();
1889  TObject* ptr = 0;
1890  for (Int_t i = 0; i < listOfPrimitives->GetEntries(); i++) {
1891  ptr = listOfPrimitives->At(i);
1892  if ( ptr->InheritsFrom("TH1") ) break;
1893  }
1894  if ( ptr == 0 || !ptr->InheritsFrom("TH1") ) { // if the loop did not find a TH1
1895  fCanvMain->GetCanvas()->Update();
1896  Warning("SetMinMaxLabel","No Histogram found!");
1897  return;
1898  // unable to find histogram, no min and max wil be read out
1899  }
1900 
1901  TH1 *hist = (TH1*)ptr;
1902  TString minTxt(fTxtSetMin->GetText());
1903  TString maxTxt(fTxtSetMax->GetText());
1904 
1905  // set min and max according to specified values, if checkbox is checked
1906  if (fRadio2D->GetState() == kButtonDown) {
1907  if (fChkSetMax->GetState() == kButtonDown && fChkSetMax->GetState() == kButtonDown &&(maxTxt.IsDigit() || maxTxt.IsFloat()) )
1908  hist->SetMaximum(maxTxt.Atof());
1909  if (fChkSetMax->GetState() == kButtonUp)
1910  hist->SetMaximum(-1111); // default value, to unzoom
1911  if (fChkSetMin->GetState() == kButtonDown && (minTxt.IsDigit() || minTxt.IsFloat()) )
1912  hist->SetMinimum(minTxt.Atof());
1913  if (fChkSetMin->GetState() == kButtonUp)
1914  hist->SetMinimum(-1111); // default value, to unzoom
1915  }
1916  else if (fRadio2D->GetState() == kButtonDown) {
1917  if (fChkSetMin->GetState() == kButtonDown &&
1918  fChkSetMax->GetState() == kButtonDown && hist->GetXaxis())
1919  hist->GetXaxis()->SetRangeUser(hist->GetXaxis()->GetXmin(), hist->GetXaxis()->GetXmax());
1920  else if (fChkSetMax->GetState() == kButtonDown && hist->GetXaxis())
1921  hist->GetXaxis()->SetRangeUser(hist->GetXaxis()->GetXmin(), maxTxt.Atof());
1922  else if (fChkSetMin->GetState() == kButtonDown && hist->GetXaxis())
1923  hist->GetXaxis()->SetRangeUser(minTxt.Atof(), hist->GetXaxis()->GetXmax());
1924  hist->SetTitle(hist->GetTitle()); // trick to update the histogram
1925  }
1926 
1927  // get min and max from plot
1928  GetMinMax();
1929 
1930  // set labels according to specification, if cehckboxes are checked
1931  if (fChkLabelTitle->GetState() == kButtonDown)
1932  hist->SetTitle(fTxtLabelTitle->GetText());
1933  if (fChkLabelXaxis->GetState() == kButtonDown)
1934  hist->GetXaxis()->SetTitle(fTxtLabelXaxis->GetText());
1935  if (fChkLabelYaxis->GetState() == kButtonDown)
1936  hist->GetYaxis()->SetTitle(fTxtLabelYaxis->GetText());
1937  // get and/or set labels and title
1938  if (fChkLabelGetAuto->GetState() == kButtonDown) {
1939  fTxtLabelTitle->SetText(hist->GetTitle());
1940  fTxtLabelXaxis->SetTitle(hist->GetXaxis()->GetTitle());
1941  fTxtLabelYaxis->SetTitle(hist->GetYaxis()->GetTitle());
1942  }
1943  hist->SetTitle(hist->GetTitle()); // trick to update the histogram
1944  fCanvMain->GetCanvas()->Update();
1945 }
1946 
1947 
1951 
1952  if ( fRadioROC->GetState()!=kButtonDown && fRadioSector->GetState()!=kButtonDown ){
1953  fLblSector->SetText("not used");
1954  return;
1955  }
1956 
1957  Int_t sector = (Int_t)(fNmbSector->GetNumber());
1958  TString secLabel = "";
1959  if ( sector < 36 )
1960  secLabel = "IROC";
1961  else
1962  secLabel = "OROC";
1963 
1964  if (fRadioSector->GetState()==kButtonDown)
1965  secLabel="Sector";
1966 
1967  if ( sector%36<18 ) //A-Side
1968  secLabel += ", A";
1969  else
1970  secLabel += ", C";
1971 
1972  secLabel += Form("%02d",sector%18);
1973 
1974  fLblSector->SetText(secLabel);
1975  DoNewSelection();
1976 }
1977 
1978 
1981 
1982  std::cout << "Not yet implemented." << std::endl;
1983 }
1984 
1985 
1988 
1989  fChkStatName->SetState(kButtonUp);
1990  fChkStatEntries->SetState(kButtonUp);
1991  fChkStatMean->SetState(kButtonUp);
1992  fChkStatMeanPM->SetState(kButtonUp);
1993  fChkStatRMS->SetState(kButtonUp);
1994  fChkStatRMSPM->SetState(kButtonUp);
1995  fChkStatUnderflow->SetState(kButtonUp);
1996  fChkStatOverflow->SetState(kButtonUp);
1997  fChkStatIntegral->SetState(kButtonUp);
1998  fChkStatSkewness->SetState(kButtonUp);
1999  fChkStatSkewnessPM->SetState(kButtonUp);
2000  fChkStatKurtosis->SetState(kButtonUp);
2001  fChkStatKurtosisPM->SetState(kButtonUp);
2002 
2003  HandleButtonsStat(0);
2004 }
2005 
2006 
2007 void AliTPCCalibViewerGUI::MouseMove(Int_t event, Int_t x, Int_t y, TObject *selectedObject) {
2010 
2011  Double_t pi = TMath::Pi();
2012  if (event != kButton1Double )
2013  return;
2014  if (!selectedObject->InheritsFrom("TH2")) return;
2015  // zoom to sector works ONLY in 2D mode, if one side is specified
2016  if (fRadio2D->GetState() == kButtonUp) return;
2017  if (fRadioROC->GetState() == kButtonDown) { // return to full side view
2018  // return to full side view
2019  Int_t sector = (Int_t)(fNmbSector->GetNumber());
2020  if ( (sector >= 0 && sector <= 17) || (sector >= 36 && sector <= 53) ) {
2021  // A-Side
2022  fRadioSideA->Clicked();
2023  fRadioSideA->SetState(kButtonDown);
2024  DoNewSelection();
2025  }
2026  if ( (sector >= 18 && sector <= 35) || (sector >= 54 && sector <= 71) ) {
2027  // C-Side
2028  fRadioSideC->Clicked();
2029  fRadioSideC->SetState(kButtonDown);
2030  DoNewSelection();
2031  }
2032  return;
2033  }
2034  if (!(fRadioSideA->GetState() == kButtonDown || fRadioSideC->GetState() == kButtonDown)) return;
2035 
2036  // Int_t px = gPad->GetEventX();
2037  // Int_t py = gPad->GetEventY();
2038  Float_t upy = gPad->AbsPixeltoY(y);
2039  Float_t upx = gPad->AbsPixeltoX(x);
2040  Float_t gy = gPad->PadtoY(upy);
2041  Float_t gx = gPad->PadtoX(upx);
2042  Int_t quadrant = -1;
2043  if (gx >= 0 && gy >= 0) quadrant = 1;
2044  if (gx < 0 && gy >= 0) quadrant = 2;
2045  if (gx < 0 && gy < 0) quadrant = 3;
2046  if (gx >= 0 && gy < 0) quadrant = 4;
2047  gx = TMath::Abs(gx);
2048  gy = TMath::Abs(gy);
2049  Double_t phi = TMath::ATan(gy/gx); // angle phi is in Pi- units
2050  Double_t r = TMath::Sqrt(gx*gx + gy*gy);
2051  if (quadrant == 2) phi = pi - phi;
2052  if (quadrant == 3) phi = pi + phi;
2053  if (quadrant == 4) phi = 2 * pi - phi;
2054  Double_t phiGrad = phi / pi * 180;
2055  Int_t sector = (Int_t) phiGrad / 20; // one sector coresponds to 20�
2056  // IROC starts at 84.5 cm
2057  // IROC ends at 135.5 cm, OROC begins
2058  // OROC ends at 250 cm
2059  if (r < 84.5 || r > 250) return; // outside TPC
2060  if (r < 135.5) { // IROC
2061  if (fRadioSideC->GetState() == kButtonDown) sector += 18;
2062  }
2063  else {// OROC
2064  sector += 36;
2065  if (fRadioSideC->GetState() == kButtonDown) sector += 18;
2066  }
2067  // printf("r: %f, phi: %f, phiGrad: %f, gy/gx: %f, quadrant: %i, sector: %i \n", r, phi, phiGrad, gy/gx, quadrant, sector);
2068  fNmbSector->SetNumber(sector);
2069  fRadioROC->Clicked();
2070  fRadioROC->SetState(kButtonDown);
2071  ChangeSector();
2072 }
2073 
2074 
2097 
2098  const char *kSaveAsTypes[] = {
2099  "Postscript", "*.ps",
2100  "Encapsulated Postscript", "*.eps",
2101  "PDF", "*.pdf",
2102  "JPEG", "*.jpg",
2103  "PNG", "*.png",
2104  "TIFF", "*.tiff",
2105  "GIF", "*.gif",
2106  "XPM", "*.xpm",
2107  "SVG", "*.svg",
2108  "XML", "*.xml",
2109  "C++ macro", "*.cxx",
2110  "Macro file", "*.C",
2111  "ROOT file", "*.root",
2112  "All file", "*",
2113  0, 0
2114  };
2115  TString addSaveOpt("");
2116  if (fChkAddSaveOpt->GetState() == kButtonDown)
2117  addSaveOpt += fComboAddSaveOpt->GetTextEntry()->GetText();
2118  TString dir(".");
2119  TGFileInfo fi;
2120  fi.fFileTypes = kSaveAsTypes;
2121  // fi.fIniDir = StrDup(dir);
2122  fi.fOverwrite = kFALSE;
2123  new TGFileDialog(gClient->GetRoot(), gClient->GetRoot(), kFDSave, &fi);
2124  if (fi.fFilename && strlen(fi.fFilename)) {
2125  if (addSaveOpt != "")
2126  fCanvMain->GetCanvas()->Print(fi.fFilename, addSaveOpt.Data());
2127  else
2128  fCanvMain->GetCanvas()->Print(fi.fFilename);
2129  }
2130 
2131 // TList* fFileNamesList list of selected file names
2132 // Int_t fFileTypeIdx selected file type, index in fFileTypes
2133 // const char** fFileTypes file types used to filter selectable files
2134 // char* fFilename selected file name
2135 // char* fIniDir on input: initial directory, on output: new directory
2136 // Bool_t fMultipleSelection if true, allow multiple file selection
2137 // Bool_t fOverwrite if true overwrite the file with existing name on save
2138 
2139 }
2140 
2141 
2146 
2147  const char *kSaveAsTypes[] = {
2148  "ROOT file", "*.root",
2149  0, 0
2150  };
2151  TString dir(".");
2152  TGFileInfo fi;
2153  fi.fFileTypes = kSaveAsTypes;
2154  // fi.fIniDir = StrDup(dir);
2155  fi.fOverwrite = kFALSE;
2156  new TGFileDialog(gClient->GetRoot(), gClient->GetRoot(), kFDSave, &fi);
2157  if (fi.fFilename && strlen(fi.fFilename)) {
2158  fPreprocessor->DumpToFile(fi.fFilename);
2159  Info("DumpToFile","New CalibTree has been writen to file '%s'", fi.fFilename);
2160  }
2161 }
2162 
2163 
2166 
2167  const char *kFileTypes[] = {
2168  "ROOT file", "*.root",
2169  0, 0
2170  };
2171  TString dir(".");
2172  TGFileInfo fi;
2173  fi.fFileTypes = kFileTypes;
2174  // fi.fIniDir = StrDup(dir);
2175  fi.fOverwrite = kFALSE;
2176  new TGFileDialog(gClient->GetRoot(), gClient->GetRoot(), kFDOpen, &fi);
2177  if (fi.fFilename && strlen(fi.fFilename) && fChkAddAsReference->GetState() == kButtonUp) {
2178  Initialize(fi.fFilename);
2179  Reload();
2180  }
2181  else if (fi.fFilename && strlen(fi.fFilename) && fChkAddAsReference->GetState() == kButtonDown) {
2182  fViewer->AddReferenceTree(fi.fFilename, "calPads", fTxtRefName->GetText());
2183  Reload();
2184  }
2185 }
2186 
2187 
2189  //
2190  // Initialize and show GUI for presentation for demonstration purposes
2191  // or for fast standalone use
2192  //
2193  TGMainFrame* frmMain = new TGMainFrame(gClient->GetRoot(), 1000, 600);
2194  frmMain->SetWindowName("AliTPCCalibViewer GUI");
2195  frmMain->SetCleanup(kDeepCleanup);
2196 
2197  TGTab* tabMain = new TGTab(frmMain, 1000, 600);
2198  frmMain->AddFrame(tabMain, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
2199 
2200  TGCompositeFrame* tabCont1 = tabMain->AddTab("Viewer 1");
2201  TGCompositeFrame* tabCont2 = tabMain->AddTab("Viewer 2");
2202 
2203  AliTPCCalibViewerGUI* calibViewer1 = new AliTPCCalibViewerGUI(tabCont1, 1000, 600, (char*)fileName);
2204  tabCont1->AddFrame(calibViewer1, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
2205 
2206  AliTPCCalibViewerGUI* calibViewer2 = new AliTPCCalibViewerGUI(tabCont2, 1000, 600, (char*)fileName);
2207  tabCont2->AddFrame(calibViewer2, new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
2208 
2209  TObjArray *guiArray = new TObjArray();
2210  guiArray->Add(calibViewer1);
2211  guiArray->Add(calibViewer2);
2212 
2213  frmMain->MapSubwindows();
2214  frmMain->Resize();
2215  frmMain->MapWindow();
2216 
2217  return guiArray;
2218 }
2219 
TGCheckButton * fChkStatRMSPM
checkbox to display RMS error in statistic legend
TGCheckButton * fChkLabelXaxis
checkbox to display specified xaxis label
TGRadioButton * fRadioRaw
raw radio button
TGCompositeFrame * fContStatSkew
container for skewness and its error in stat opt
TGCompositeFrame * fContAddCuts
container for additional cut command GUI elements
TGCheckButton * fChkStatSkewness
checkbox to display skewness in statistic legend
TGLabel * fLblCustomDraw
custom draw labal
TGCompositeFrame * fContStatRMS
container for RMS and its error in stat opt
void HandleButtonsNoRedraw(Int_t id=-1)
TGCompositeFrame * fContCuts
container for cut options GUI elements
TGCompositeFrame * fTabRight0
Tab 0 on the right side for basic.
TGCompositeFrame * fContScaling
container for scaling GUI elements
TStyle * gStyle
TGTextEntry * fTxtLabelTitle
text box to specify title
TGTextButton * fBtnFit
fit button
TGCompositeFrame * fTabRight1
Tab 1 on the right side for advanced.
TGCheckButton * fChkStatUnderflow
checkbox to display underflow error in statistic legend
TGComboBox * fComboAddDrawOpt
additional draw options combo box
TGTextEntry * fTxtSetMin
custom minimum text box
TGCheckButton * fChkStatKurtosis
checkbox to display kurtosis in statistic legend
#define TObjArray
TGRadioButton * fRadioNormalized
normalized radio button
TGTextEntry * fTxtLabelYaxis
text box to specify yaxis label
GUI for the AliTPCCalibViewer used for the calibration monitor All functionalities of the AliTPCCalib...
TGListBox * fListVariables
listbox with possible variables
TRootEmbeddedCanvas * fCanvMain
main drawing canvas
TGRadioButton * fRadioSideC
side C radio button
TGTextEntry * fTxtSetMax
custom maximum text box
TGCheckButton * fChkStatSkewnessPM
checkbox to display skewness error in statistic legend
AliTPCCalibViewerGUI & operator=(const AliTPCCalibViewerGUI &param)
AliTPCCalibViewerGUI * viewer
TGCheckButton * fChkSetMin
Set maximum check box.
TGCheckButton * fChkMedian
checkbox to plot median
TGCheckButton * fChkAddAsReference
checkbox to add a new tree as referenceTree
TGRadioButton * fRadio1D
1D radio button
TROOT * gROOT
void HandleButtonsGeneral(Int_t id=-1)
Float_t p[]
Definition: kNNTest.C:133
TGNumberEntry * fNmbSector
number entry box for specifying the sector
AliTPCCalibViewerGUI(const TGWindow *p, UInt_t w, UInt_t h, char *fileName)
TGCompositeFrame * fContSetMin
container for SetMinimum elements
TGComboBox * fComboExportName
dropdownbox to enter a name for the exported CalPad
Class for viewing/visualizing TPC calibration data.
void Initialize(const char *fileName, const char *treeName="calPads")
void HandleButtonsStat(Int_t id=-1)
TGGroupFrame * fContExport
container for cint-export
Int_t Integrate(const char *drawCommand, const char *sector, const char *cuts=0, Float_t sigmaMax=5, Bool_t plotMean=kTRUE, Bool_t plotMedian=kTRUE, Bool_t plotLTM=kTRUE, const char *sigmas="", Float_t sigmaStep=-1) const
TGTextButton * fBtnGetMinMax
GetMinMax-button.
TGGroupFrame * fContLabeling
groupframe container for labeling
TGRadioButton * fRadioROC
ROC radio button.
TGCompositeFrame * fContDrawOpt1DSubMML
container in tabLeft1 for following check boxes
TObjArray * GetListOfNormalizationVariables(Bool_t printList=kFALSE) const
TGCompositeFrame * fContAddExport
container for dropdown list to enter export name
TGRadioButton * fRadioSector
sector radio button
void MouseMove(Int_t event, Int_t x, Int_t y, TObject *selected)
void HandleButtons1D(Int_t id=-1)
const char * AddAbbreviations(const Char_t *c, Bool_t printDrawCommand=kFALSE)
TGCompositeFrame * fContAddSaveOpt
container for additional save options
TGCheckButton * fChkStatMean
checkbox to display mean in statistic legend
TString fileName(const char *dir, int runNumber, const char *da, int i, const char *type)
Int_t SigmaCut(const char *drawCommand, Int_t sector, const char *cuts=0, Float_t sigmaMax=5, Bool_t plotMean=kTRUE, Bool_t plotMedian=kTRUE, Bool_t plotLTM=kTRUE, Bool_t pm=kFALSE, const char *sigmas="", Float_t sigmaStep=-1) const
TObjArray * GetListOfVariables(Bool_t printList=kFALSE)
TGRadioButton * fRadioCumulative
radio button for cumulative 1D drawing
TGCompositeFrame * fContFit
container for fit GUI elements
Int_t EasyDraw(const char *drawCommand, const char *sector, const char *cuts=0, const char *drawOptions=0, Bool_t writeDrawCommand=kFALSE) const
TGComboBox * fComboAddCuts
additional cuts combo box
TGCheckButton * fChkSetMax
Set maximum check box.
TGCheckButton * fCheckCumulativePM
checkbox for plus/minus cumulative 1D drawing
AliTPCCalibViewer * fViewer
CalibViewer object used for drawing.
TGComboBox * fComboCustomFit
custom fit combo box
TGTextEntry * fTxtLabelXaxis
text box to specify xaxis label
TString * Fit(const char *drawCommand, const char *formula, const char *cuts, Double_t &chi2, TVectorD &fitParam, TMatrixD &covMatrix)
Double_t chi2
Definition: AnalyzeLaser.C:7
TGButton * fBtnUnchekAll
Button to uncheck all statistic entries.
AliTPCPreprocessorOnline * fPreprocessor
PreprocessorOnline object, used to collect the exported CalPads and to save them into a new calibTree...
TGCompositeFrame * fContDrawOpt1DSubNSC
container in tabLeft1 for following radio buttons
void ReplacePlaceHolders(TString &str)
TGCompositeFrame * fContCumuLR
container in tabLeft1 for two colums for cumulative and integrative
TGRadioButton * fRadioPredefined
predefined plot radio button
TGCompositeFrame * fContCenter
container for GUI elements at the center
TGCheckButton * fChkStatIntegral
checkbox to display integral in statistic legend
TGLabel * fLblSigmaMax
label to indicate sigmaMax
TGTab * ftabRight
Tabs on the right side.
TGTextButton * fBtnAddFitFunction
button to add fit function to normalization
TGCheckButton * fChkStatEntries
checkbox to display entries in statistic legend
TGRadioButton * fRadioNorm
radio button for normal 1D drawing
TGCheckButton * fChkCutZero
cut zeros check box
TGCompositeFrame * fContDrawOptSub1D2D
container for 1D and 2D radio-button
TGCheckButton * fChkLabelYaxis
checkbox to display specified yaxis label
TFriendElement * AddReferenceTree(const char *filename, const char *treename="calPads", const char *refname="R")
TGListBox * fListNormalization
listbox with possible normalization variables
TGCompositeFrame * ftabLeft1
Tab 1 on the left side for 1D plot options.
TGRadioButton * fRadio2D
2D radio button
TGCheckButton * fChkAuto
automatic redraw checkbox
TGTextEntry * fTxtRefName
text box to specify the referenceTree&#39;s name
TGCheckButton * fChkLabelGetAuto
checkbox to get labels atuomatically from plot
TGRadioButton * fRadioIntegrate
radio button for integral 1D drawing
TGTab * ftabLeft
Tabs on the left side for plot options.
TGCompositeFrame * fContSector
container for sector GUI elements
TGTextButton * fBtnLoadTree
button to load a new tree
TGCompositeFrame * fContPlotOpt
container for plot options GUI elements
TGGroupFrame * fContSave
container for save-button
TGTextButton * fBtnAddNorm
button to add a CalPad to the normalization
static TObjArray * ShowGUI(const char *fileName=0)
TGCheckButton * fChkLTM
checkbox to plot LTM
TGCheckButton * fChkAutoAppend
automatic appendign of "~" checkbox
virtual void Delete(Option_t *option="")
TGCheckButton * fChkMean
checkbox to plot mean
TGCheckButton * fChkAddCuts
additional cuts check box
TGButton * fBtnSave
Save button.
TGCompositeFrame * ftabLeft0
Tab 0 on the left side for general plot options.
Bool_t fInitialized
has the GUI already been initialized?
TGTextButton * fBtnDraw
draw button
TGTextButton * fBtnDumpToFile
button to dump a new CalibTree to file
TGComboBox * fComboMethod
normalization methods dropdown box
AliTPCCalPad * GetCalPad(const char *desiredData, const char *cuts="", const char *calPadName="NoName") const
void DumpToFile(const char *fileName)
TGCheckButton * fChkLabelTitle
checkbox to display specified title
TGRadioButton * fRadioSideA
side A radio button
void HandleButtonsCuts(Int_t id=-1)
Preprocessor class for HLT and DAQ.
TGCheckButton * fChkStatName
checkbox to display histogram name in statistic legend
TGTextEntry * fTxtSigmaMax
text box to specify sigmaMax
TGCompositeFrame * fContCumLeft
container in tabLeft1 for cumulative, left
TGCheckButton * fChkAddSaveOpt
checkbox for additional save options
TGCompositeFrame * fContAddFit
container for additional fit GUI elements
Int_t EasyDraw1D(const char *drawCommand, const char *sector, const char *cuts=0, const char *drawOptions=0, Bool_t writeDrawCommand=kFALSE) const
TGCompositeFrame * fContNormalized
container for normalization options GUI elements
TGCheckButton * fChkStatRMS
checkbox to display RMS in statistic legend
TGCompositeFrame * fContLeft
container for GUI elements on left side
TGComboBox * fComboCustom
combo box for custom draw commands
TGCompositeFrame * fcontDrawOpt1DSubLR
container in tabLeft1 to divide L/R
TGCompositeFrame * fContStatKurt
container for kurtosis and its error in stat opt
void DrawGUI(const TGWindow *p, UInt_t w, UInt_t h)
TGCompositeFrame * fContSetMax
container for SetMaximum elements
TGCompositeFrame * fContTopBottom
container for all GUI elements, vertical divided
class TVectorT< Double_t > TVectorD
TGLabel * fLblAddCuts
additional cuts label
TGCompositeFrame * fContCustom
container for custom draw command GUI elements
TGCompositeFrame * fContTree
container for tree functions
TGCheckButton * fChkStatKurtosisPM
checkbox to display kurtosis error in statistic legend
TGCompositeFrame * fContDrawOpt
container for draw options GUI elements
TGCheckButton * fChkGetMinMaxAuto
Get Min & Max automatically from plot.
TGLabel * fLblSector
label that shows the active sector
TGTextButton * fBtnExport
button to export a CalPad
TGCompositeFrame * fContRight
container for GUI elements on right side
TGCompositeFrame * fContCumRight
container in tabLeft1 for cumulative, right
TGCheckButton * fChkStatOverflow
checkbox to display overflow error in statistic legend
TGCompositeFrame * fContAddDrawOpt
additional draw options container
TGCheckButton * fChkAddDrawOpt
additional draw options check box
TGRadioButton * fRadioCustom
custom radio button
TGCompositeFrame * fContLCR
container for all GUI elements, horizontal divided
TGTextEntry * fTxtSigmas
text box to specify sigmas
TGGroupFrame * fContStatOpt
container for statistic options in tabLeft1
TGGroupFrame * fContDrawOpt1D
container in tabLeft1
TGRadioButton * fRadioTPC
TPC radio button.
TGRadioButton * fRadioSigma
radio button for sigma 1D drawing
class TMatrixT< Double_t > TMatrixD
Int_t DrawHisto1D(const char *drawCommand, Int_t sector, const char *cuts=0, const char *sigmas="2;4;6", Bool_t plotMean=kTRUE, Bool_t plotMedian=kTRUE, Bool_t plotLTM=kTRUE) const
TGCheckButton * fChkStatMeanPM
checkbox to display mean error in statistic legend
TString & GetAbbreviation()
TGComboBox * fComboAddSaveOpt
combobox for additional save options
TGCompositeFrame * fContStatMean
container for mean and its error in stat opt