1 #ifndef AliTPCCalibViewerGUItime_H
2 #define AliTPCCalibViewerGUItime_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 /* $Id: AliTPCCalibViewerGUI.h,v */
9 ///////////////////////////////////////////////////////////////////////////////
11 // GUI for displaying calibration entires over time //
12 // Calibration Trees are created using the macro TPC/CalibMacros/CalibEnv.C //
13 // used for the calibration monitor //
15 ///////////////////////////////////////////////////////////////////////////////
25 // #include <TGButton.h>
26 // #include <TGListBox.h>
27 // #include <TGComboBox.h>
28 // #include <TGNumberEntry.h>
29 // #include <TRootEmbeddedCanvas.h>
30 // #include <TGSplitter.h>
31 // #include <TGButtonGroup.h>
32 // #include <TGLabel.h>
37 class TGCompositeFrame;
38 class TRootEmbeddedCanvas;
52 class AliTPCCalibViewerGUI;
53 class AliTPCConfigParser;
57 class AliTPCCalibViewerGUItime : public TGCompositeFrame {
59 AliTPCCalibViewerGUItime(const TGWindow *p, UInt_t w, UInt_t h);
60 virtual ~AliTPCCalibViewerGUItime();
62 static TObjArray* ShowGUI(const char* fileName = 0); // initialize and show GUI standalone
64 void DrawGUI(const TGWindow */*p*/, UInt_t w, UInt_t h);
66 void UseFile(const char* fileName);
67 void Reload(Int_t first=1);
70 void SetCalibViewerGUI(AliTPCCalibViewerGUI *gui) {fCalibViewerGUI=gui;}
71 void SetCalibViewerGUItab(TGTabElement *tab) {fCalibViewerGUItab=tab;}
72 void SetConfigFile(const char* file) {fConfigFile=file;}
73 void SetCacheDir(const char* cachedir) {fOutputCacheDir=cachedir;}
75 const char* GetDrawString();
76 const char* GetCutString();
81 void DoCustomCutsDraw();
82 void DoParLimitChange();
83 void DoNewSelection(); // decides whether to redraw if user makes another selection
84 void DoChangeSelectionList() {Reload(0);}
85 void HandleButtonsDrawSel(Int_t id = -1);
86 void MouseMove(Int_t event, Int_t x, Int_t y, TObject */*selected*/);
89 TFile* fFile; //file that keeps the tree
90 TChain* fTree; //internal tree
91 AliTPCCalibViewerGUI *fCalibViewerGUI; //calib viewer gui used to display verbose information for one run
92 TGTabElement *fCalibViewerGUItab; //tab the calib view gui redies in
93 TH1* fCurrentHist; //histogram currently drawn in main canvas
94 TGraph* fCurrentGraph; //current graph
95 Int_t fCurrentRunDetails; //run number for wich details are currently shown
96 TString fOutputCacheDir; //output cache diretory for AliTPCCalibViewerGUI trees, created on the fly
97 TString fDrawString; //current draw string
98 TString fConfigFile; //configuration file keeping active branches and branch descriptions
99 AliTPCConfigParser *fConfigParser; //configuration parser
100 Bool_t fIsCustomDraw; //if custom draw string is selected
101 TVectorD fRunNumbers; //run numbers of current selection
102 TVectorD fTimeStamps; //timr stamps of current selection
103 TVectorD fValuesX; //values of current selection
104 TVectorD fValuesY; //values of current selection
107 //main canvas Top part, bottom part
108 TGCompositeFrame *fContTopBottom; // container for all GUI elements, vertical divided
109 //top left, centre, right
110 TGCompositeFrame *fContLCR; // container for all GUI elements, horizontal divided
112 TGCompositeFrame *fContLeft; // container for GUI elements on left side
113 TGGroupFrame *fContDrawSel; // Subgroup for draw selection
114 TGCompositeFrame *fContDrawSelSubRunTime; //Radio button subframe
115 TGRadioButton *fRadioXhist; // Radio button x-variable: show only 1D distribution
116 TGRadioButton *fRadioXrun; // Radio button x-variable: run
117 TGRadioButton *fRadioXtime; // Radio button x-variable: time
118 TGListBox *fListVariables; // listbox with possible variables
119 TGComboBox *fComboRunType; // run type selection box
120 TGLabel *fLblRunType; // run type label
121 TGNumberEntry *fNmbPar; // parameter number
122 TGLabel *fLblPar; // parameter name
123 TGListBox *fListCalibType; // calibration type selection box
124 TGGroupFrame *fContCalibType; // calibration type label
126 TGCompositeFrame *fContCenter; // container for GUI elements at the center
127 TRootEmbeddedCanvas *fCanvMain; // main drawing canvas
129 TGCompositeFrame *fContRight; // container for GUI elements on right side
130 TGGroupFrame *fContValues; // container to keep data point information
131 TGLabel *fLblRunNumber; // run number label
132 TGLabel *fLblRunTime; // time stamp label
133 TGLabel *fLblValueX; // value label
134 TGLabel *fLblValueY; // value label
135 TGLabel *fLblRunNumberVal; // run number of the data point hoovered
136 TGLabel *fLblRunTimeVal; // time stamp of the data point hoovered
137 TGLabel *fLblValueXVal; // value of the data point hoovered
138 TGLabel *fLblValueYVal; // value of the data point hoovered
139 TGTextButton *fBtnDumpRuns; // draw button
141 TGCompositeFrame *fContCustom; // container for custom draw command GUI elements
142 TGCompositeFrame *fContCustomCuts; // container for custom cut options GUI elements
143 TGLabel *fLblCustomDraw; // label for custom draw string
144 TGLabel *fLblCustomCuts; // label for custom cuts string
145 TGComboBox *fComboCustomDraw; // combo box custom draw string
146 TGComboBox *fComboCustomCuts; // combo box custom cuts string
148 enum { kRadioXhist=10, kRadioXrun=11, kRadioXtime=12 };
149 enum { kBranchOnOff=0, kBranchTitle=1, kCalibType=2, kParamNames=3 };
151 void UpdateParLimits();
152 void UpdateParName();
153 void SetGuiTree(Int_t run);
155 void FillCalibTypes();
156 void SetInitialValues();
157 const char* SubstituteUnderscores(const char* in);
160 AliTPCCalibViewerGUItime(const AliTPCCalibViewerGUItime &v);
161 AliTPCCalibViewerGUItime &operator = (const AliTPCCalibViewerGUItime &v); // assignment operator
163 ClassDef(AliTPCCalibViewerGUItime, 0)