]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCCalibViewerGUItime.h
Changes of Jens Wiechula
[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 class TObjArray;
52
53 class AliTPCCalibViewerGUI;
54 class AliTPCConfigParser;
55
56
57
58 class AliTPCCalibViewerGUItime : public TGCompositeFrame {
59 public:
60   AliTPCCalibViewerGUItime(const TGWindow *p, UInt_t w, UInt_t h);
61   virtual ~AliTPCCalibViewerGUItime();
62   
63   static TObjArray* ShowGUI(const char* fileName = 0, const char* treeName="dcs");             // initialize and show GUI standalone
64   static TObjArray* ShowGUI(TChain* chain);                                         // initialize and show GUI standalone
65   
66   void DrawGUI(const TGWindow */*p*/, UInt_t w, UInt_t h);
67   
68   void UseFile(const char* fileName, const char* treeName);
69   void UseChain(TChain *chain);
70   void UseConfigFile(const char* file="");
71   void Reload(Int_t first=1);
72
73   
74   void SetCalibViewerGUI(AliTPCCalibViewerGUI *gui) {fCalibViewerGUI=gui;}
75   void SetCalibViewerGUItab(TGTabElement *tab) {fCalibViewerGUItab=tab;}
76   void SetCacheDir(const char* cachedir) {fOutputCacheDir=cachedir;}
77   void SetConfigFileName(const char* file) {fConfigFile=file;}
78   
79   const char* GetDrawString();
80   const char* GetDrawOption();
81   void GetCutString(TString &cutStr);
82   TChain* GetChain() const {return fTree;}
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
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   
94 private:
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
111   //
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
114   //GUI elements
115   //main canvas Top part, bottom part
116   TGCompositeFrame    *fContTopBottom;      // container for all GUI elements, vertical divided
117   //top left, centre, right
118   TGCompositeFrame    *fContLCR;            // container for all GUI elements, horizontal divided
119   //content left
120   TGCompositeFrame    *fContLeft;           // container for GUI elements on left side
121   TGGroupFrame        *fContDrawOpt;        // Subgroup for draw selection
122   TGCheckButton       *fChkDrawOptSame;     // draw option 'same'
123   TGComboBox          *fComboAddDrawOpt;    // additional draw options combo box
124   TGGroupFrame        *fContDrawSel;        // Subgroup for draw selection
125   TGCompositeFrame    *fContDrawSelSubRunTime; //Radio button subframe
126   TGRadioButton       *fRadioXhist;         // Radio button x-variable: show only 1D distribution
127   TGRadioButton       *fRadioXrun;          // Radio button x-variable: run
128   TGRadioButton       *fRadioXtime;         // Radio button x-variable: time
129   TGListBox           *fListVariables;      // listbox with possible variables
130   TGComboBox          *fComboRunType;       // run type selection box
131   TGLabel             *fLblRunType;         // run type label
132   TGNumberEntry       *fNmbPar;             // parameter number
133   TGLabel             *fLblPar;             // parameter name
134   TGListBox           *fListCalibType;      // calibration type selection box
135   TGGroupFrame        *fContCalibType;      // calibration type label
136   //content centre
137   TGCompositeFrame    *fContCenter;         // container for GUI elements at the center
138   TRootEmbeddedCanvas *fCanvMain;           // main drawing canvas
139   //content right 
140   TGCompositeFrame    *fContRight;          // container for GUI elements on right side
141   TGGroupFrame        *fContValues;         // container to keep data point information
142   TGLabel             *fLblRunNumber;       // run number label
143   TGLabel             *fLblRunTime;         // time stamp label
144   TGLabel             *fLblValueX;          // value label
145   TGLabel             *fLblValueY;          // value label
146   TGLabel             *fLblRunNumberVal;    // run number of the data point hoovered
147   TGLabel             *fLblRunTimeVal;      // time stamp of the data point hoovered
148   TGLabel             *fLblValueXVal;       // value of the data point hoovered
149   TGLabel             *fLblValueYVal;       // value of the data point hoovered
150   TGTextButton        *fBtnDumpRuns;        // draw button
151   //content bottom
152   TGCompositeFrame    *fContCustom;         // container for custom draw command GUI elements
153   TGCompositeFrame    *fContCustomCuts;     // container for custom cut options GUI elements
154   TGLabel             *fLblCustomDraw;      // label for custom draw string
155   TGLabel             *fLblCustomCuts;      // label for custom cuts string
156   TGComboBox          *fComboCustomDraw;    // combo box custom draw string
157   TGComboBox          *fComboCustomCuts;    // combo box custom cuts string
158   //
159   TObjArray *fTrashBox;                   //graphics objects to be deleted (histograms, graphs,...)
160   
161   enum { kRadioXhist=10, kRadioXrun=11, kRadioXtime=12 };
162   enum { kBranchOnOff=0, kBranchTitle=1, kCalibType=2, kParamNames=3 };
163   
164   void UpdateParLimits();
165   void UpdateParName();
166   void SetGuiTree(Int_t run);
167   void FillRunTypes();
168   void FillCalibTypes();
169   void SetInitialValues();
170   void CheckDrawGraph();
171   Bool_t CheckChain();
172   void UpdateValueArrays(Bool_t withGraph);
173   const char* SubstituteUnderscores(const char* in);
174   void GetHistogramTitle(TString &title);
175 private:
176   AliTPCCalibViewerGUItime(const AliTPCCalibViewerGUItime &v);
177   AliTPCCalibViewerGUItime &operator = (const AliTPCCalibViewerGUItime &v);         // assignment operator
178   
179   ClassDef(AliTPCCalibViewerGUItime, 0)
180     
181 };
182
183 #endif