]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/CDB/AliCalibViewerGUItime.h
CMake: Retrieve Git information
[u/mrichter/AliRoot.git] / STEER / CDB / AliCalibViewerGUItime.h
1 #ifndef ALICALIBVIEWERGUITIME_H
2 #define ALICALIBVIEWERGUITIME_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: AliCalibViewerGUItime.h,v */
8
9 ///////////////////////////////////////////////////////////////////////////////
10 //                                                                           //
11 //  GUI for displaying calibration entries over run/time                     //
12 //                                                                           //
13 ///////////////////////////////////////////////////////////////////////////////
14
15
16 #ifndef ROOT_TGButton
17 #include <TGWidget.h>
18 #endif
19 #ifndef ROOT_TGFrame
20 #include <TGFrame.h>
21 #endif
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 TGComboBox;
31 class TGGroupFrame;
32 class TGLabel;
33 class TGTabElement;
34 class TGWindow;
35
36 class TFile;
37 class TTree;
38 class TChain;
39 class TGraph;
40 class TObjArray;
41
42 class TMap;
43
44 class AliBaseCalibViewerGUI;
45
46 class AliCalibViewerGUItime : public TGCompositeFrame {
47 public:
48   AliCalibViewerGUItime(const TGWindow *p, UInt_t w, UInt_t h, const Char_t* det = "TRD");
49   virtual ~AliCalibViewerGUItime();
50
51   static TObjArray* ShowGUI(TChain* chain);   // launch the time trending GUI and load a chain
52   static TObjArray* ShowGUI();        // launch the empty time trending GUI
53
54   void DrawGUI(const TGWindow */*p*/, UInt_t w, UInt_t h);
55   
56   void UseFile(const char* fileName, const char* treeName);
57   void UseChain(TChain *chain = 0);
58   void Reload(Int_t first=1);
59   void AddReferenceTree(const char* treeFileName, const char* refName="R");
60   
61   void SetCalibViewerGUI(AliBaseCalibViewerGUI *gui) {fCalibViewerGUI=gui;}
62   void SetCalibViewerGUItab(TGTabElement *tab) {fCalibViewerGUItab=tab;}
63   void SetCacheDir(const char* cachedir) {fOutputCacheDir=cachedir;}
64   
65   const char* GetDrawString();
66   const char* GetDrawOption() const;
67   void GetCutString(TString &cutStr);
68   TChain* GetChain() const {return fTree;}
69   //Slots
70   void DoDraw();
71   void DoDumpRuns();
72   void DoCustomDraw();
73   void DoCustomCutsDraw();
74   void DoParLimitChange();
75   void DoNewSelection();                    // decides whether to redraw if user makes another selection
76   void DoChangeSelectionList() {Reload(0);}
77   void HandleButtonsDrawSel(Int_t id = -1);              
78   void MouseMove(Int_t event, Int_t x, Int_t y, TObject */*selected*/);
79   void SavePicture();
80   void HandleLoadRunTextEntry();
81   void HandleLoadRunButtons();
82   
83  private:
84   TString fDetector;                       // TPC/TRD
85
86   TFile*  fFile;                          //file that keeps the tree
87   TChain*  fTree;                         //internal tree
88   AliBaseCalibViewerGUI *fCalibViewerGUI;  //calib viewer gui used to display verbose information for one run
89   TGTabElement *fCalibViewerGUItab;       //tab the calib view gui redies in
90   TH1*    fCurrentHist;                   //histogram currently drawn in main canvas
91   TGraph* fCurrentGraph;                  //current graph
92   Int_t   fCurrentRunDetails;             //run number for wich details are currently shown
93   TString fOutputCacheDir;                //output cache diretory for AliTPCCalibViewerGUI trees, created on the fly
94   TString fDrawString;                    //current draw string
95   Bool_t  fIsCustomDraw;                  //if custom draw string is selected
96   TVectorD fRunNumbers;                   //run numbers of current selection
97   TVectorD fTimeStamps;                   //timr stamps of current selection
98   TVectorD fValuesX;                      //values of current selection
99   TVectorD fValuesY;                      //values of current selection
100   //
101   Bool_t  fNoGraph;                       //Whether to create a graph
102   Long64_t fGraphLimitEntries;            //limit in number of entries in the chain for producing a graph
103   //
104   TMap *fMapRefTrees;                      //map of reference trees for the CalibViewer
105   //GUI elements
106   //main canvas Top part, bottom part
107   TGCompositeFrame    *fContTopBottom;      // container for all GUI elements, vertical divided
108   //top left, centre, right
109   TGCompositeFrame    *fContLCR;            // container for all GUI elements, horizontal divided
110   //content left
111   TGCompositeFrame    *fContLeft;           // container for GUI elements on left side
112   TGGroupFrame        *fContDrawOpt;        // Subgroup for draw selection
113   TGCheckButton       *fChkDrawOptSame;     // draw option 'same'
114   TGComboBox          *fComboAddDrawOpt;    // additional draw options combo box
115   TGGroupFrame        *fContDrawSel;        // Subgroup for draw selection
116   TGCompositeFrame    *fContDrawSelSubRunTime; //Radio button subframe
117   TGRadioButton       *fRadioXhist;         // Radio button x-variable: show only 1D distribution
118   TGRadioButton       *fRadioXrun;          // Radio button x-variable: run
119   TGRadioButton       *fRadioXtime;         // Radio button x-variable: time
120   TGListBox           *fListVariables;      // listbox with possible variables
121   TGComboBox          *fComboRunType;       // run type selection box
122   TGLabel             *fLblRunType;         // run type label
123   TGNumberEntry       *fNmbPar;             // parameter number
124   TGLabel             *fLblPar;             // parameter name
125   TGListBox           *fListCalibType;      // calibration type selection box
126   TGGroupFrame        *fContCalibType;      // calibration type label
127   //content centre
128   TGCompositeFrame    *fContCenter;         // container for GUI elements at the center
129   TRootEmbeddedCanvas *fCanvMain;           // main drawing canvas
130   //content right 
131   TGCompositeFrame    *fContRight;          // container for GUI elements on right side
132   TGGroupFrame        *fContValues;         // container to keep data point information
133   TGLabel             *fLblRunNumber;       // run number label
134   TGLabel             *fLblRunTime;         // time stamp label
135   TGLabel             *fLblValueX;          // value label
136   TGLabel             *fLblValueY;          // value label
137   TGLabel             *fLblRunNumberVal;    // run number of the data point hoovered
138   TGLabel             *fLblRunTimeVal;      // time stamp of the data point hoovered
139   TGLabel             *fLblValueXVal;       // value of the data point hoovered
140   TGLabel             *fLblValueYVal;       // value of the data point hoovered
141   TGTextButton        *fBtnDumpRuns;        // draw button
142   TGTextButton        *fBtnSave;            // Save button
143
144   TGGroupFrame        *fContLoad;           // Load file container
145   TGCompositeFrame    *fContFilename;       // filename container
146   TGCompositeFrame    *fContConfigFile;     // config file container
147   TGCompositeFrame    *fContTreeName;       // tree name container
148   TGLabel             *fLblTreeName;        // tree name label
149   TGTextEntry         *fTxtFilename;        // filename text entry
150   TGTextEntry         *fTxtConfigFile;      // config file text entry
151   TGTextEntry         *fTxtTreeName;        // tree name text entry
152   TGButton            *fBtnLoadFile;        // load file button
153
154   //content bottom
155   TGCompositeFrame    *fContCustom;         // container for custom draw command GUI elements
156   TGCompositeFrame    *fContCustomCuts;     // container for custom cut options GUI elements
157   TGLabel             *fLblCustomDraw;      // label for custom draw string
158   TGLabel             *fLblCustomCuts;      // label for custom cuts string
159   TGComboBox          *fComboCustomDraw;    // combo box custom draw string
160   TGComboBox          *fComboCustomCuts;    // combo box custom cuts string
161   //
162   TObjArray *fTrashBox;                   //graphics objects to be deleted (histograms, graphs,...)
163   
164   enum { kRadioXhist=10, kRadioXrun=11, kRadioXtime=12 };
165   enum { kBranchOnOff=0, kBranchTitle=1, kCalibType=2, kParamNames=3 };
166   
167   void UpdateParLimits();
168   void UpdateParName();
169   void SetGuiTree(Int_t run);
170   void FillRunTypes();
171   void FillCalibTypes();
172   void SetInitialValues();
173   void CheckDrawGraph();
174   Bool_t CheckChain();
175   void UpdateValueArrays(Bool_t withGraph);
176   const char* SubstituteUnderscores(const char* in);
177   void GetHistogramTitle(TString &title);
178   void AdjustYRange();
179 private:
180   AliCalibViewerGUItime(const AliCalibViewerGUItime &v);
181   AliCalibViewerGUItime &operator = (const AliCalibViewerGUItime &v);         // assignment operator
182   
183   ClassDef(AliCalibViewerGUItime, 1)
184     
185 };
186
187 #endif