Fixes for building of DA (Anshul)
[u/mrichter/AliRoot.git] / TPC / AliTPCCalibViewerGUItime.h
CommitLineData
5312f439 1#ifndef AliTPCCalibViewerGUItime_H
2#define AliTPCCalibViewerGUItime_H
3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
7/* $Id: AliTPCCalibViewerGUI.h,v */
8
9///////////////////////////////////////////////////////////////////////////////
10// //
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 //
14// //
15///////////////////////////////////////////////////////////////////////////////
16
17
18#ifndef ROOT_TGButton
19#include "TGWidget.h"
20#endif
21#ifndef ROOT_TGFrame
22#include "TGFrame.h"
23#endif
24
949d8707 25#include <TGComboBox.h>
5312f439 26#include <TString.h>
27#include <TVectorT.h>
28
29class TGCompositeFrame;
30class TRootEmbeddedCanvas;
31class TGTextButton;
32class TGListBox;
33class TGRadioButton;
34class TGGroupFrame;
35class TGLabel;
5312f439 36class TGTabElement;
949d8707 37class TGTextEntry;
5312f439 38
39class TFile;
40class TTree;
e6970ab5 41class TChain;
5312f439 42class TGraph;
6e7d7dc4 43class TObjArray;
5312f439 44
7390f655 45class TMap;
46
5312f439 47class AliTPCCalibViewerGUI;
6fb51ca4 48class AliTPCConfigParser;
5312f439 49
50
51
52class AliTPCCalibViewerGUItime : public TGCompositeFrame {
53public:
54 AliTPCCalibViewerGUItime(const TGWindow *p, UInt_t w, UInt_t h);
55 virtual ~AliTPCCalibViewerGUItime();
56
6e7d7dc4 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
59
6fb51ca4 60 void DrawGUI(const TGWindow */*p*/, UInt_t w, UInt_t h);
5312f439 61
6e7d7dc4 62 void UseFile(const char* fileName, const char* treeName);
798017c7 63 void UseChain(TChain *const chain);
6e7d7dc4 64 void UseConfigFile(const char* file="");
6fb51ca4 65 void Reload(Int_t first=1);
7390f655 66 void AddReferenceTree(const char* treeFileName, const char* refName="R");
5312f439 67
68
798017c7 69 void SetCalibViewerGUI(AliTPCCalibViewerGUI *const gui) {fCalibViewerGUI=gui;}
70 void SetCalibViewerGUItab(TGTabElement *const tab) {fCalibViewerGUItab=tab;}
e6970ab5 71 void SetCacheDir(const char* cachedir) {fOutputCacheDir=cachedir;}
6e7d7dc4 72 void SetConfigFileName(const char* file) {fConfigFile=file;}
e6970ab5 73
5312f439 74 const char* GetDrawString();
514fcaf7 75 const char* GetDrawOptionString();
76 const char* GetCustomDrawString() const {return fComboCustomDraw->GetTextEntry()?fComboCustomDraw->GetTextEntry()->GetText():"";}
6e7d7dc4 77 void GetCutString(TString &cutStr);
78 TChain* GetChain() const {return fTree;}
949d8707 79 //
80 TGTextEntry* GetDrawEntry() {return fComboCustomDraw->GetTextEntry();}
81 TGTextEntry* GetCutsEntry() {return fComboCustomCuts->GetTextEntry();}
82 TGTextEntry* GetDrawOptEntry() {return fComboAddDrawOpt->GetTextEntry();}
5312f439 83 //Slots
84 void DoDraw();
85 void DoDumpRuns();
86 void DoCustomDraw();
87 void DoCustomCutsDraw();
88 void DoParLimitChange();
89 void DoNewSelection(); // decides whether to redraw if user makes another selection
6fb51ca4 90 void DoChangeSelectionList() {Reload(0);}
5312f439 91 void HandleButtonsDrawSel(Int_t id = -1);
6fb51ca4 92 void MouseMove(Int_t event, Int_t x, Int_t y, TObject */*selected*/);
514fcaf7 93 void DoNewSelectionAliases();
94 void DoAddAlias();
95 void DoDelAlias();
96 void UpdateAliasList();
b85468dd 97 TCanvas * GetCanvas(){ return fCanvMain->GetCanvas();}
7390f655 98 private:
5312f439 99 TFile* fFile; //file that keeps the tree
6e7d7dc4 100 TChain* fTree; //internal tree
5312f439 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
6fb51ca4 108 TString fConfigFile; //configuration file keeping active branches and branch descriptions
109 AliTPCConfigParser *fConfigParser; //configuration parser
5312f439 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
6e7d7dc4 115 //
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
7390f655 118 //
119 TMap *fMapRefTrees; //map of reference trees for the CalibViewer
5312f439 120 //GUI elements
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
125 //content left
126 TGCompositeFrame *fContLeft; // container for GUI elements on left side
6e7d7dc4 127 TGGroupFrame *fContDrawOpt; // Subgroup for draw selection
128 TGCheckButton *fChkDrawOptSame; // draw option 'same'
129 TGComboBox *fComboAddDrawOpt; // additional draw options combo box
5312f439 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
6fb51ca4 136 TGComboBox *fComboRunType; // run type selection box
137 TGLabel *fLblRunType; // run type label
5312f439 138 TGNumberEntry *fNmbPar; // parameter number
139 TGLabel *fLblPar; // parameter name
6fb51ca4 140 TGListBox *fListCalibType; // calibration type selection box
141 TGGroupFrame *fContCalibType; // calibration type label
5312f439 142 //content centre
143 TGCompositeFrame *fContCenter; // container for GUI elements at the center
144 TRootEmbeddedCanvas *fCanvMain; // main drawing canvas
145 //content right
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
514fcaf7 157 TGGroupFrame *fContAliases; // container to keep data point information
158 TGListBox *fListAliases; // list of aliases
5312f439 159 //content bottom
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
6e7d7dc4 166 //
167 TObjArray *fTrashBox; //graphics objects to be deleted (histograms, graphs,...)
5312f439 168
169 enum { kRadioXhist=10, kRadioXrun=11, kRadioXtime=12 };
6fb51ca4 170 enum { kBranchOnOff=0, kBranchTitle=1, kCalibType=2, kParamNames=3 };
5312f439 171
172 void UpdateParLimits();
6fb51ca4 173 void UpdateParName();
5312f439 174 void SetGuiTree(Int_t run);
6fb51ca4 175 void FillRunTypes();
176 void FillCalibTypes();
177 void SetInitialValues();
6e7d7dc4 178 void CheckDrawGraph();
179 Bool_t CheckChain();
93425263 180 void UpdateValueArrays(Bool_t withGraph, const Double_t *xArr);
6fb51ca4 181 const char* SubstituteUnderscores(const char* in);
6e7d7dc4 182 void GetHistogramTitle(TString &title);
7390f655 183 void AdjustYRange();
6e7d7dc4 184private:
5312f439 185 AliTPCCalibViewerGUItime(const AliTPCCalibViewerGUItime &v);
186 AliTPCCalibViewerGUItime &operator = (const AliTPCCalibViewerGUItime &v); // assignment operator
187
188 ClassDef(AliTPCCalibViewerGUItime, 0)
189
190};
191
514fcaf7 192////////////////////////////////////////////////////////////////////////
193//
194// GUI Alias frame
195//
196////////////////////////////////////////////////////////////////////////
197
198class AliTPCCalibViewerGUItimeAddAliasFrame : public TObject {
199public:
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();
203
204 // slots
205 void DoOK();
206 void DoCancel();
207
208
209private:
210 TGTransientFrame *fMain; //Main frame
211 TGTextEntry *fTxt1, *fTxt2; //text input
212
213 AliTPCCalibViewerGUItime *fGUI; //pointer to mother process
214
215 AliTPCCalibViewerGUItimeAddAliasFrame(const AliTPCCalibViewerGUItimeAddAliasFrame &r);
216 AliTPCCalibViewerGUItimeAddAliasFrame &operator = (const AliTPCCalibViewerGUItimeAddAliasFrame &r);
217
218 ClassDef(AliTPCCalibViewerGUItimeAddAliasFrame,0)
219};
220
5312f439 221#endif