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