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 char* GetDrawString();
75 const char* 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 TGComboBox *fComboAddDrawOpt; // additional draw options combo box
130 TGGroupFrame *fContDrawSel; // Subgroup for draw selection
131 TGCompositeFrame *fContDrawSelSubRunTime; //Radio button subframe
132 TGRadioButton *fRadioXhist; // Radio button x-variable: show only 1D distribution
133 TGRadioButton *fRadioXrun; // Radio button x-variable: run
134 TGRadioButton *fRadioXtime; // Radio button x-variable: time
135 TGListBox *fListVariables; // listbox with possible variables
136 TGComboBox *fComboRunType; // run type selection box
137 TGLabel *fLblRunType; // run type label
138 TGNumberEntry *fNmbPar; // parameter number
139 TGLabel *fLblPar; // parameter name
140 TGListBox *fListCalibType; // calibration type selection box
141 TGGroupFrame *fContCalibType; // calibration type label
143 TGCompositeFrame *fContCenter; // container for GUI elements at the center
144 TRootEmbeddedCanvas *fCanvMain; // main drawing canvas
146 TGCompositeFrame *fContRight; // container for GUI elements on right side
147 TGGroupFrame *fContValues; // container to keep data point information
148 TGLabel *fLblRunNumber; // run number label
149 TGLabel *fLblRunTime; // time stamp label
150 TGLabel *fLblValueX; // value label
151 TGLabel *fLblValueY; // value label
152 TGLabel *fLblRunNumberVal; // run number of the data point hoovered
153 TGLabel *fLblRunTimeVal; // time stamp of the data point hoovered
154 TGLabel *fLblValueXVal; // value of the data point hoovered
155 TGLabel *fLblValueYVal; // value of the data point hoovered
156 TGTextButton *fBtnDumpRuns; // draw button
157 TGGroupFrame *fContAliases; // container to keep data point information
158 TGListBox *fListAliases; // list of aliases
160 TGCompositeFrame *fContCustom; // container for custom draw command GUI elements
161 TGCompositeFrame *fContCustomCuts; // container for custom cut options GUI elements
162 TGLabel *fLblCustomDraw; // label for custom draw string
163 TGLabel *fLblCustomCuts; // label for custom cuts string
164 TGComboBox *fComboCustomDraw; // combo box custom draw string
165 TGComboBox *fComboCustomCuts; // combo box custom cuts string
167 TObjArray *fTrashBox; //graphics objects to be deleted (histograms, graphs,...)
169 enum { kRadioXhist=10, kRadioXrun=11, kRadioXtime=12 };
170 enum { kBranchOnOff=0, kBranchTitle=1, kCalibType=2, kParamNames=3 };
172 void UpdateParLimits();
173 void UpdateParName();
174 void SetGuiTree(Int_t run);
176 void FillCalibTypes();
177 void SetInitialValues();
178 void CheckDrawGraph();
180 void UpdateValueArrays(Bool_t withGraph, const Double_t *xArr);
181 const char* SubstituteUnderscores(const char* in);
182 void GetHistogramTitle(TString &title);
185 AliTPCCalibViewerGUItime(const AliTPCCalibViewerGUItime &v);
186 AliTPCCalibViewerGUItime &operator = (const AliTPCCalibViewerGUItime &v); // assignment operator
188 ClassDef(AliTPCCalibViewerGUItime, 0)
192 ////////////////////////////////////////////////////////////////////////
196 ////////////////////////////////////////////////////////////////////////
198 class AliTPCCalibViewerGUItimeAddAliasFrame : public TObject {
200 AliTPCCalibViewerGUItimeAddAliasFrame(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h,
201 UInt_t options, AliTPCCalibViewerGUItime *gui, TString strAlias="");
202 virtual ~AliTPCCalibViewerGUItimeAddAliasFrame();
210 TGTransientFrame *fMain; //Main frame
211 TGTextEntry *fTxt1, *fTxt2; //text input
213 AliTPCCalibViewerGUItime *fGUI; //pointer to mother process
215 AliTPCCalibViewerGUItimeAddAliasFrame(const AliTPCCalibViewerGUItimeAddAliasFrame &r);
216 AliTPCCalibViewerGUItimeAddAliasFrame &operator = (const AliTPCCalibViewerGUItimeAddAliasFrame &r);
218 ClassDef(AliTPCCalibViewerGUItimeAddAliasFrame,0)