AliRoot Core  3dc7879 (3dc7879)
AliTPCCalibViewerGUItime.h
Go to the documentation of this file.
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 
12 
13 
14 #ifndef ROOT_TGButton
15 #include "TGWidget.h"
16 #endif
17 #ifndef ROOT_TGFrame
18 #include "TGFrame.h"
19 #endif
20 
21 #include <TGComboBox.h>
22 #include <TString.h>
23 #include <TVectorT.h>
24 
25 class TGCompositeFrame;
26 class TRootEmbeddedCanvas;
27 class TGTextButton;
28 class TGListBox;
29 class TGRadioButton;
30 class TGGroupFrame;
31 class TGLabel;
32 class TGTabElement;
33 class TGTextEntry;
34 
35 class TFile;
36 class TTree;
37 class TChain;
38 class TGraph;
39 class TObjArray;
40 
41 class TMap;
42 
44 class AliTPCConfigParser;
45 
46 
47 
48 class AliTPCCalibViewerGUItime : public TGCompositeFrame {
49 public:
50  AliTPCCalibViewerGUItime(const TGWindow *p, UInt_t w, UInt_t h);
51  virtual ~AliTPCCalibViewerGUItime();
52 
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
55 
56  void DrawGUI(const TGWindow */*p*/, UInt_t w, UInt_t h);
57 
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");
63 
64 
66  void SetCalibViewerGUItab(TGTabElement *const tab) {fCalibViewerGUItab=tab;}
67  void SetCacheDir(const char* cachedir) {fOutputCacheDir=cachedir;}
68  void SetConfigFileName(const char* file) {fConfigFile=file;}
69 
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;}
75  //
76  TGTextEntry* GetDrawEntry() {return fComboCustomDraw->GetTextEntry();}
77  TGTextEntry* GetCutsEntry() {return fComboCustomCuts->GetTextEntry();}
78  TGTextEntry* GetDrawOptEntry() {return fComboAddDrawOpt->GetTextEntry();}
79  //Slots
80  void DoDraw();
81  void DoDumpRuns();
82  void DoCustomDraw();
83  void DoCustomCutsDraw();
84  void DoParLimitChange();
85  void DoNewSelection(); // decides whether to redraw if user makes another selection
87  void HandleButtonsDrawSel(Int_t id = -1);
88  void MouseMove(Int_t event, Int_t x, Int_t y, TObject */*selected*/);
89  void DoNewSelectionAliases();
90  void DoAddAlias();
91  void DoDelAlias();
92  void UpdateAliasList();
93  TCanvas * GetCanvas(){ return fCanvMain->GetCanvas();}
94  private:
95  TFile* fFile;
96  TChain* fTree;
98  TGTabElement *fCalibViewerGUItab;
99  TH1* fCurrentHist;
100  TGraph* fCurrentGraph;
102  TString fOutputCacheDir;
103  TString fDrawString;
104  TString fConfigFile;
106  Bool_t fIsCustomDraw;
107  TVectorD fRunNumbers;
108  TVectorD fTimeStamps;
109  TVectorD fValuesX;
110  TVectorD fValuesY;
111  //
112  Bool_t fNoGraph;
114  //
115  TMap *fMapRefTrees;
116  //GUI elements
117  //main canvas Top part, bottom part
118  TGCompositeFrame *fContTopBottom;
119  //top left, centre, right
120  TGCompositeFrame *fContLCR;
121  //content left
122  TGCompositeFrame *fContLeft;
123  TGGroupFrame *fContDrawOpt;
124  TGCheckButton *fChkDrawOptSame;
125  TGCheckButton *fChkDrawOptSparse;
126  TGComboBox *fComboAddDrawOpt;
127  TGGroupFrame *fContDrawSel;
128  TGCompositeFrame *fContDrawSelSubRunTime;
129  TGRadioButton *fRadioXhist;
130  TGRadioButton *fRadioXrun;
131  TGRadioButton *fRadioXtime;
132  TGListBox *fListVariables;
133  TGComboBox *fComboRunType;
134  TGLabel *fLblRunType;
135  TGNumberEntry *fNmbPar;
136  TGLabel *fLblPar;
137  TGListBox *fListCalibType;
138  TGGroupFrame *fContCalibType;
139  //content centre
140  TGCompositeFrame *fContCenter;
141  TRootEmbeddedCanvas *fCanvMain;
142  //content right
143  TGCompositeFrame *fContRight;
144  TGGroupFrame *fContValues;
145  TGLabel *fLblRunNumber;
146  TGLabel *fLblRunTime;
147  TGLabel *fLblValueX;
148  TGLabel *fLblValueY;
149  TGLabel *fLblRunNumberVal;
150  TGLabel *fLblRunTimeVal;
151  TGLabel *fLblValueXVal;
152  TGLabel *fLblValueYVal;
153  TGTextButton *fBtnDumpRuns;
154  TGGroupFrame *fContAliases;
155  TGListBox *fListAliases;
156  //content bottom
157  TGCompositeFrame *fContCustom;
158  TGCompositeFrame *fContCustomCuts;
159  TGLabel *fLblCustomDraw;
160  TGLabel *fLblCustomCuts;
161  TGComboBox *fComboCustomDraw;
162  TGComboBox *fComboCustomCuts;
163  //
165 
166  enum { kRadioXhist=10, kRadioXrun=11, kRadioXtime=12 };
168 
169  void UpdateParLimits();
170  void UpdateParName();
171  void SetGuiTree(Int_t run);
172  void FillRunTypes();
173  void FillCalibTypes();
174  void SetInitialValues();
175  void CheckDrawGraph();
176  Bool_t CheckChain();
177  void UpdateValueArrays(Bool_t withGraph, const Double_t *xArr);
178  void SubstituteUnderscores(TString &s);
179  void GetHistogramTitle(TString &title);
180  void AdjustYRange();
181 private:
183  AliTPCCalibViewerGUItime &operator = (const AliTPCCalibViewerGUItime &v); // assignment operator
184 
185  ClassDef(AliTPCCalibViewerGUItime, 0)
186 
187 };
188 
190 //
191 // GUI Alias frame
192 //
194 
196 public:
197  AliTPCCalibViewerGUItimeAddAliasFrame(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h,
198  UInt_t options, AliTPCCalibViewerGUItime *gui, TString strAlias="");
200 
201  // slots
202  void DoOK();
203  void DoCancel();
204 
205 
206 private:
207  TGTransientFrame *fMain;
208  TGTextEntry *fTxt1, *fTxt2;
209 
211 
214 
218 };
219 
220 #endif
TGGroupFrame * fContDrawSel
Subgroup for draw selection.
AliTPCCalibViewerGUItime(const TGWindow *p, UInt_t w, UInt_t h)
TGCompositeFrame * fContCenter
container for GUI elements at the center
Bool_t fIsCustomDraw
if custom draw string is selected
Class for Parsing simple text configuration files.
TGCheckButton * fChkDrawOptSame
draw option &#39;same&#39;
TGGroupFrame * fContValues
container to keep data point information
TGRadioButton * fRadioXtime
Radio button x-variable: time.
TGLabel * fLblPar
parameter name
TString fDrawString
current draw string
TGLabel * fLblValueY
value label
TGCompositeFrame * fContTopBottom
container for all GUI elements, vertical divided
TGTextButton * fBtnDumpRuns
draw button
#define TObjArray
void UpdateValueArrays(Bool_t withGraph, const Double_t *xArr)
void SetCacheDir(const char *cachedir)
GUI for the AliTPCCalibViewer used for the calibration monitor All functionalities of the AliTPCCalib...
TGLabel * fLblCustomCuts
label for custom cuts string
AliTPCCalibViewerGUItime * fGUI
pointer to mother process
TGRadioButton * fRadioXrun
Radio button x-variable: run.
TGLabel * fLblCustomDraw
label for custom draw string
Float_t p[]
Definition: kNNTest.C:133
TGCompositeFrame * fContCustom
container for custom draw command GUI elements
AliTPCCalibViewerGUI * fCalibViewerGUI
calib viewer gui used to display verbose information for one run
void SetCalibViewerGUItab(TGTabElement *const tab)
TChain * chain
TVectorD fValuesX
values of current selection
TGraph * fCurrentGraph
current graph
TVectorD fTimeStamps
timr stamps of current selection
TString fileName(const char *dir, int runNumber, const char *da, int i, const char *type)
void UseConfigFile(const char *file="")
TGGroupFrame * fContAliases
container to keep data point information
TGCompositeFrame * fContDrawSelSubRunTime
Radio button subframe.
TH1 * fCurrentHist
histogram currently drawn in main canvas
TGLabel * fLblValueXVal
value of the data point hoovered
TGLabel * fLblRunNumber
run number label
AliTPCConfigParser * fConfigParser
configuration parser
TMap * fMapRefTrees
map of reference trees for the CalibViewer
TString fConfigFile
configuration file keeping active branches and branch descriptions
TVectorD fRunNumbers
run numbers of current selection
TGGroupFrame * fContDrawOpt
Subgroup for draw selection.
TGLabel * fLblRunType
run type label
TGCompositeFrame * fContLCR
container for all GUI elements, horizontal divided
void AddReferenceTree(const char *treeFileName, const char *refName="R")
TGCheckButton * fChkDrawOptSparse
draw option &#39;sparse&#39;
void SetCalibViewerGUI(AliTPCCalibViewerGUI *const gui)
const char * GetCustomDrawString() const
Int_t fCurrentRunDetails
run number for wich details are currently shown
TFile * fFile
file that keeps the tree
TGLabel * fLblRunTime
time stamp label
TGLabel * fLblRunNumberVal
run number of the data point hoovered
TVectorD fValuesY
values of current selection
void MouseMove(Int_t event, Int_t x, Int_t y, TObject *)
TGNumberEntry * fNmbPar
parameter number
void DrawGUI(const TGWindow *, UInt_t w, UInt_t h)
TObjArray * fTrashBox
graphics objects to be deleted (histograms, graphs,...)
AliTPCCalibViewerGUItime & operator=(const AliTPCCalibViewerGUItime &v)
TRootEmbeddedCanvas * fCanvMain
main drawing canvas
TGComboBox * fComboAddDrawOpt
additional draw options combo box
AliTPCCalibViewerGUI * gui
Definition: startGUI.C:6
Bool_t fNoGraph
Whether to create a graph.
TGComboBox * fComboCustomCuts
combo box custom cuts string
static TObjArray * ShowGUI(const char *fileName=0, const char *treeName="dcs")
TGListBox * fListVariables
listbox with possible variables
TGLabel * fLblValueX
value label
Long64_t fGraphLimitEntries
limit in number of entries in the chain for producing a graph
TGCompositeFrame * fContCustomCuts
container for custom cut options GUI elements
void UseChain(TChain *const chain)
TGListBox * fListCalibType
calibration type selection box
TGComboBox * fComboCustomDraw
combo box custom draw string
TGLabel * fLblValueYVal
value of the data point hoovered
void UseFile(const char *fileName, const char *treeName)
TGTabElement * fCalibViewerGUItab
tab the calib view gui redies in
void SetConfigFileName(const char *file)
TGRadioButton * fRadioXhist
Radio button x-variable: show only 1D distribution.
TGCompositeFrame * fContRight
container for GUI elements on right side
TGLabel * fLblRunTimeVal
time stamp of the data point hoovered
GUI for displaying calibration entires over time Calibration Trees are created using the macro TPC/Ca...
TGComboBox * fComboRunType
run type selection box
TGListBox * fListAliases
list of aliases
int main(int argc, char **argv)
Definition: TPCCEda.cxx:91
TChain * fTree
internal tree
TGCompositeFrame * fContLeft
container for GUI elements on left side
void GetHistogramTitle(TString &title)
TString fOutputCacheDir
output cache diretory for AliTPCCalibViewerGUI trees, created on the fly
TGGroupFrame * fContCalibType
calibration type label