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 <TGComboBox.h>
29 class TGCompositeFrame;
30 class TRootEmbeddedCanvas;
47 class AliTPCCalibViewerGUI;
48 class AliTPCConfigParser;
52 class AliTPCCalibViewerGUItime : public TGCompositeFrame {
54 AliTPCCalibViewerGUItime(const TGWindow *p, UInt_t w, UInt_t h);
55 virtual ~AliTPCCalibViewerGUItime();
57 static TObjArray* ShowGUI(const char* fileName = 0, const char* treeName="dcs"); // initialize and show GUI standalone
58 static TObjArray* ShowGUI(TChain* chain); // initialize and show GUI standalone
60 void DrawGUI(const TGWindow */*p*/, UInt_t w, UInt_t h);
62 void UseFile(const char* fileName, const char* treeName);
63 void UseChain(TChain *const chain);
64 void UseConfigFile(const char* file="");
65 void Reload(Int_t first=1);
66 void AddReferenceTree(const char* treeFileName, const char* refName="R");
69 void SetCalibViewerGUI(AliTPCCalibViewerGUI *const gui) {fCalibViewerGUI=gui;}
70 void SetCalibViewerGUItab(TGTabElement *const tab) {fCalibViewerGUItab=tab;}
71 void SetCacheDir(const char* cachedir) {fOutputCacheDir=cachedir;}
72 void SetConfigFileName(const char* file) {fConfigFile=file;}
74 const TString GetDrawString();
75 const TString GetDrawOptionString();
76 const char* GetCustomDrawString() const {return fComboCustomDraw->GetTextEntry()?fComboCustomDraw->GetTextEntry()->GetText():"";}
77 void GetCutString(TString &cutStr);
78 TChain* GetChain() const {return fTree;}
80 TGTextEntry* GetDrawEntry() {return fComboCustomDraw->GetTextEntry();}
81 TGTextEntry* GetCutsEntry() {return fComboCustomCuts->GetTextEntry();}
82 TGTextEntry* GetDrawOptEntry() {return fComboAddDrawOpt->GetTextEntry();}
87 void DoCustomCutsDraw();
88 void DoParLimitChange();
89 void DoNewSelection(); // decides whether to redraw if user makes another selection
90 void DoChangeSelectionList() {Reload(0);}
91 void HandleButtonsDrawSel(Int_t id = -1);
92 void MouseMove(Int_t event, Int_t x, Int_t y, TObject */*selected*/);
93 void DoNewSelectionAliases();
96 void UpdateAliasList();
97 TCanvas * GetCanvas(){ return fCanvMain->GetCanvas();}
99 TFile* fFile; //file that keeps the tree
100 TChain* fTree; //internal tree
101 AliTPCCalibViewerGUI *fCalibViewerGUI; //calib viewer gui used to display verbose information for one run
102 TGTabElement *fCalibViewerGUItab; //tab the calib view gui redies in
103 TH1* fCurrentHist; //histogram currently drawn in main canvas
104 TGraph* fCurrentGraph; //current graph
105 Int_t fCurrentRunDetails; //run number for wich details are currently shown
106 TString fOutputCacheDir; //output cache diretory for AliTPCCalibViewerGUI trees, created on the fly
107 TString fDrawString; //current draw string
108 TString fConfigFile; //configuration file keeping active branches and branch descriptions
109 AliTPCConfigParser *fConfigParser; //configuration parser
110 Bool_t fIsCustomDraw; //if custom draw string is selected
111 TVectorD fRunNumbers; //run numbers of current selection
112 TVectorD fTimeStamps; //timr stamps of current selection
113 TVectorD fValuesX; //values of current selection
114 TVectorD fValuesY; //values of current selection
116 Bool_t fNoGraph; //Whether to create a graph
117 Long64_t fGraphLimitEntries; //limit in number of entries in the chain for producing a graph
119 TMap *fMapRefTrees; //map of reference trees for the CalibViewer
121 //main canvas Top part, bottom part
122 TGCompositeFrame *fContTopBottom; // container for all GUI elements, vertical divided
123 //top left, centre, right
124 TGCompositeFrame *fContLCR; // container for all GUI elements, horizontal divided
126 TGCompositeFrame *fContLeft; // container for GUI elements on left side
127 TGGroupFrame *fContDrawOpt; // Subgroup for draw selection
128 TGCheckButton *fChkDrawOptSame; // draw option 'same'
129 TGCheckButton *fChkDrawOptSparse; // draw option 'sparse'
130 TGComboBox *fComboAddDrawOpt; // additional draw options combo box
131 TGGroupFrame *fContDrawSel; // Subgroup for draw selection
132 TGCompositeFrame *fContDrawSelSubRunTime; //Radio button subframe
133 TGRadioButton *fRadioXhist; // Radio button x-variable: show only 1D distribution
134 TGRadioButton *fRadioXrun; // Radio button x-variable: run
135 TGRadioButton *fRadioXtime; // Radio button x-variable: time
136 TGListBox *fListVariables; // listbox with possible variables
137 TGComboBox *fComboRunType; // run type selection box
138 TGLabel *fLblRunType; // run type label
139 TGNumberEntry *fNmbPar; // parameter number
140 TGLabel *fLblPar; // parameter name
141 TGListBox *fListCalibType; // calibration type selection box
142 TGGroupFrame *fContCalibType; // calibration type label
144 TGCompositeFrame *fContCenter; // container for GUI elements at the center
145 TRootEmbeddedCanvas *fCanvMain; // main drawing canvas
147 TGCompositeFrame *fContRight; // container for GUI elements on right side
148 TGGroupFrame *fContValues; // container to keep data point information
149 TGLabel *fLblRunNumber; // run number label
150 TGLabel *fLblRunTime; // time stamp label
151 TGLabel *fLblValueX; // value label
152 TGLabel *fLblValueY; // value label
153 TGLabel *fLblRunNumberVal; // run number of the data point hoovered
154 TGLabel *fLblRunTimeVal; // time stamp of the data point hoovered
155 TGLabel *fLblValueXVal; // value of the data point hoovered
156 TGLabel *fLblValueYVal; // value of the data point hoovered
157 TGTextButton *fBtnDumpRuns; // draw button
158 TGGroupFrame *fContAliases; // container to keep data point information
159 TGListBox *fListAliases; // list of aliases
161 TGCompositeFrame *fContCustom; // container for custom draw command GUI elements
162 TGCompositeFrame *fContCustomCuts; // container for custom cut options GUI elements
163 TGLabel *fLblCustomDraw; // label for custom draw string
164 TGLabel *fLblCustomCuts; // label for custom cuts string
165 TGComboBox *fComboCustomDraw; // combo box custom draw string
166 TGComboBox *fComboCustomCuts; // combo box custom cuts string
168 TObjArray *fTrashBox; //graphics objects to be deleted (histograms, graphs,...)
170 enum { kRadioXhist=10, kRadioXrun=11, kRadioXtime=12 };
171 enum { kBranchOnOff=0, kBranchTitle=1, kCalibType=2, kParamNames=3 };
173 void UpdateParLimits();
174 void UpdateParName();
175 void SetGuiTree(Int_t run);
177 void FillCalibTypes();
178 void SetInitialValues();
179 void CheckDrawGraph();
181 void UpdateValueArrays(Bool_t withGraph, const Double_t *xArr);
182 void SubstituteUnderscores(TString &s);
183 void GetHistogramTitle(TString &title);
186 AliTPCCalibViewerGUItime(const AliTPCCalibViewerGUItime &v);
187 AliTPCCalibViewerGUItime &operator = (const AliTPCCalibViewerGUItime &v); // assignment operator
189 ClassDef(AliTPCCalibViewerGUItime, 0)
193 ////////////////////////////////////////////////////////////////////////
197 ////////////////////////////////////////////////////////////////////////
199 class AliTPCCalibViewerGUItimeAddAliasFrame : public TObject {
201 AliTPCCalibViewerGUItimeAddAliasFrame(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h,
202 UInt_t options, AliTPCCalibViewerGUItime *gui, TString strAlias="");
203 virtual ~AliTPCCalibViewerGUItimeAddAliasFrame();
211 TGTransientFrame *fMain; //Main frame
212 TGTextEntry *fTxt1, *fTxt2; //text input
214 AliTPCCalibViewerGUItime *fGUI; //pointer to mother process
216 AliTPCCalibViewerGUItimeAddAliasFrame(const AliTPCCalibViewerGUItimeAddAliasFrame &r);
217 AliTPCCalibViewerGUItimeAddAliasFrame &operator = (const AliTPCCalibViewerGUItimeAddAliasFrame &r);
219 ClassDef(AliTPCCalibViewerGUItimeAddAliasFrame,0)