]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCCalibViewerGUItime.h
AliTPCcalibDB.cxx.diff Change magnetic field return value from kG...
[u/mrichter/AliRoot.git] / TPC / AliTPCCalibViewerGUItime.h
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
25 // #include <TGButton.h>
26 // #include <TGListBox.h>
27 // #include <TGComboBox.h>
28 // #include <TGNumberEntry.h>
29 // #include <TRootEmbeddedCanvas.h>
30 // #include <TGSplitter.h>
31 // #include <TGButtonGroup.h>
32 // #include <TGLabel.h>
33 // #include <TGTab.h>
34 #include <TString.h>
35 #include <TVectorT.h>
36
37 class TGCompositeFrame;
38 class TRootEmbeddedCanvas;
39 class TGTextButton;
40 class TGListBox;
41 class TGRadioButton;
42 class TGGroupFrame;
43 class TGLabel;
44 class TGComboBox;
45 class TGTabElement;
46
47 class TFile;
48 class TTree;
49 class TChain;
50 class TGraph;
51
52 class AliTPCCalibViewerGUI;
53 class AliTPCConfigParser;
54
55
56
57 class AliTPCCalibViewerGUItime : public TGCompositeFrame {
58 public:
59   AliTPCCalibViewerGUItime(const TGWindow *p, UInt_t w, UInt_t h);
60   virtual ~AliTPCCalibViewerGUItime();
61   
62   static TObjArray* ShowGUI(const char* fileName = 0);             // initialize and show GUI standalone
63
64   void DrawGUI(const TGWindow */*p*/, UInt_t w, UInt_t h);
65   
66   void UseFile(const char* fileName);
67   void Reload(Int_t first=1);
68
69   
70   void SetCalibViewerGUI(AliTPCCalibViewerGUI *gui) {fCalibViewerGUI=gui;}
71   void SetCalibViewerGUItab(TGTabElement *tab) {fCalibViewerGUItab=tab;}
72   void SetConfigFile(const char* file) {fConfigFile=file;}
73   void SetCacheDir(const char* cachedir) {fOutputCacheDir=cachedir;}
74   
75   const char* GetDrawString();
76   const char* GetCutString();
77   //Slots
78   void DoDraw();
79   void DoDumpRuns();
80   void DoCustomDraw();
81   void DoCustomCutsDraw();
82   void DoParLimitChange();
83   void DoNewSelection();                    // decides whether to redraw if user makes another selection
84   void DoChangeSelectionList() {Reload(0);}
85   void HandleButtonsDrawSel(Int_t id = -1);              
86   void MouseMove(Int_t event, Int_t x, Int_t y, TObject */*selected*/);
87   
88 // private:
89   TFile*  fFile;                          //file that keeps the tree
90   TChain*  fTree;                          //internal tree
91   AliTPCCalibViewerGUI *fCalibViewerGUI;  //calib viewer gui used to display verbose information for one run
92   TGTabElement *fCalibViewerGUItab;       //tab the calib view gui redies in
93   TH1*    fCurrentHist;                   //histogram currently drawn in main canvas
94   TGraph* fCurrentGraph;                  //current graph
95   Int_t   fCurrentRunDetails;             //run number for wich details are currently shown
96   TString fOutputCacheDir;                //output cache diretory for AliTPCCalibViewerGUI trees, created on the fly
97   TString fDrawString;                    //current draw string
98   TString fConfigFile;                    //configuration file keeping active branches and branch descriptions
99   AliTPCConfigParser *fConfigParser;      //configuration parser
100   Bool_t  fIsCustomDraw;                  //if custom draw string is selected
101   TVectorD fRunNumbers;                   //run numbers of current selection
102   TVectorD fTimeStamps;                   //timr stamps of current selection
103   TVectorD fValuesX;                      //values of current selection
104   TVectorD fValuesY;                      //values of current selection
105   
106   //GUI elements
107   //main canvas Top part, bottom part
108   TGCompositeFrame    *fContTopBottom;      // container for all GUI elements, vertical divided
109   //top left, centre, right
110   TGCompositeFrame    *fContLCR;            // container for all GUI elements, horizontal divided
111   //content left
112   TGCompositeFrame    *fContLeft;           // container for GUI elements on left side
113   TGGroupFrame        *fContDrawSel;        // Subgroup for draw selection
114   TGCompositeFrame    *fContDrawSelSubRunTime; //Radio button subframe
115   TGRadioButton       *fRadioXhist;         // Radio button x-variable: show only 1D distribution
116   TGRadioButton       *fRadioXrun;          // Radio button x-variable: run
117   TGRadioButton       *fRadioXtime;         // Radio button x-variable: time
118   TGListBox           *fListVariables;      // listbox with possible variables
119   TGComboBox          *fComboRunType;       // run type selection box
120   TGLabel             *fLblRunType;         // run type label
121   TGNumberEntry       *fNmbPar;             // parameter number
122   TGLabel             *fLblPar;             // parameter name
123   TGListBox           *fListCalibType;      // calibration type selection box
124   TGGroupFrame        *fContCalibType;      // calibration type label
125   //content centre
126   TGCompositeFrame    *fContCenter;         // container for GUI elements at the center
127   TRootEmbeddedCanvas *fCanvMain;           // main drawing canvas
128   //content right 
129   TGCompositeFrame    *fContRight;          // container for GUI elements on right side
130   TGGroupFrame        *fContValues;         // container to keep data point information
131   TGLabel             *fLblRunNumber;       // run number label
132   TGLabel             *fLblRunTime;         // time stamp label
133   TGLabel             *fLblValueX;          // value label
134   TGLabel             *fLblValueY;          // value label
135   TGLabel             *fLblRunNumberVal;    // run number of the data point hoovered
136   TGLabel             *fLblRunTimeVal;      // time stamp of the data point hoovered
137   TGLabel             *fLblValueXVal;       // value of the data point hoovered
138   TGLabel             *fLblValueYVal;       // value of the data point hoovered
139   TGTextButton        *fBtnDumpRuns;        // draw button
140   //content bottom
141   TGCompositeFrame    *fContCustom;         // container for custom draw command GUI elements
142   TGCompositeFrame    *fContCustomCuts;     // container for custom cut options GUI elements
143   TGLabel             *fLblCustomDraw;      // label for custom draw string
144   TGLabel             *fLblCustomCuts;      // label for custom cuts string
145   TGComboBox          *fComboCustomDraw;    // combo box custom draw string
146   TGComboBox          *fComboCustomCuts;    // combo box custom cuts string
147   
148   enum { kRadioXhist=10, kRadioXrun=11, kRadioXtime=12 };
149   enum { kBranchOnOff=0, kBranchTitle=1, kCalibType=2, kParamNames=3 };
150   
151   void UpdateParLimits();
152   void UpdateParName();
153   void SetGuiTree(Int_t run);
154   void FillRunTypes();
155   void FillCalibTypes();
156   void SetInitialValues();
157   const char* SubstituteUnderscores(const char* in);
158   
159   AliTPCCalibViewerGUItime(const AliTPCCalibViewerGUItime &v);
160   AliTPCCalibViewerGUItime &operator = (const AliTPCCalibViewerGUItime &v);         // assignment operator
161   
162   ClassDef(AliTPCCalibViewerGUItime, 0)
163     
164 };
165
166 #endif