]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCCalibViewerGUItime.h
update PID fluctuations analysis (Satyajit Jena <Satyajit.Jena@cern.ch>)
[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
bf05fdb7 74 const TString GetDrawString();
75 const TString GetDrawOptionString();
514fcaf7 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'
f416ad83 129 TGCheckButton *fChkDrawOptSparse; // draw option 'sparse'
6e7d7dc4 130 TGComboBox *fComboAddDrawOpt; // additional draw options combo box
5312f439 131 TGGroupFrame *fContDrawSel; // Subgroup for draw selection
132 TGCompositeFrame *fContDrawSelSubRunTime; //Radio button subframe
133 TGRadioButton *fRadioXhist; // Radio button x-variable: show only 1D distribution
134 TGRadioButton *fRadioXrun; // Radio button x-variable: run
135 TGRadioButton *fRadioXtime; // Radio button x-variable: time
136 TGListBox *fListVariables; // listbox with possible variables
6fb51ca4 137 TGComboBox *fComboRunType; // run type selection box
138 TGLabel *fLblRunType; // run type label
5312f439 139 TGNumberEntry *fNmbPar; // parameter number
140 TGLabel *fLblPar; // parameter name
6fb51ca4 141 TGListBox *fListCalibType; // calibration type selection box
142 TGGroupFrame *fContCalibType; // calibration type label
5312f439 143 //content centre
144 TGCompositeFrame *fContCenter; // container for GUI elements at the center
145 TRootEmbeddedCanvas *fCanvMain; // main drawing canvas
146 //content right
147 TGCompositeFrame *fContRight; // container for GUI elements on right side
148 TGGroupFrame *fContValues; // container to keep data point information
149 TGLabel *fLblRunNumber; // run number label
150 TGLabel *fLblRunTime; // time stamp label
151 TGLabel *fLblValueX; // value label
152 TGLabel *fLblValueY; // value label
153 TGLabel *fLblRunNumberVal; // run number of the data point hoovered
154 TGLabel *fLblRunTimeVal; // time stamp of the data point hoovered
155 TGLabel *fLblValueXVal; // value of the data point hoovered
156 TGLabel *fLblValueYVal; // value of the data point hoovered
157 TGTextButton *fBtnDumpRuns; // draw button
514fcaf7 158 TGGroupFrame *fContAliases; // container to keep data point information
159 TGListBox *fListAliases; // list of aliases
5312f439 160 //content bottom
161 TGCompositeFrame *fContCustom; // container for custom draw command GUI elements
162 TGCompositeFrame *fContCustomCuts; // container for custom cut options GUI elements
163 TGLabel *fLblCustomDraw; // label for custom draw string
164 TGLabel *fLblCustomCuts; // label for custom cuts string
165 TGComboBox *fComboCustomDraw; // combo box custom draw string
166 TGComboBox *fComboCustomCuts; // combo box custom cuts string
6e7d7dc4 167 //
168 TObjArray *fTrashBox; //graphics objects to be deleted (histograms, graphs,...)
5312f439 169
170 enum { kRadioXhist=10, kRadioXrun=11, kRadioXtime=12 };
6fb51ca4 171 enum { kBranchOnOff=0, kBranchTitle=1, kCalibType=2, kParamNames=3 };
5312f439 172
173 void UpdateParLimits();
6fb51ca4 174 void UpdateParName();
5312f439 175 void SetGuiTree(Int_t run);
6fb51ca4 176 void FillRunTypes();
177 void FillCalibTypes();
178 void SetInitialValues();
6e7d7dc4 179 void CheckDrawGraph();
180 Bool_t CheckChain();
93425263 181 void UpdateValueArrays(Bool_t withGraph, const Double_t *xArr);
bf05fdb7 182 void SubstituteUnderscores(TString &s);
6e7d7dc4 183 void GetHistogramTitle(TString &title);
7390f655 184 void AdjustYRange();
6e7d7dc4 185private:
5312f439 186 AliTPCCalibViewerGUItime(const AliTPCCalibViewerGUItime &v);
187 AliTPCCalibViewerGUItime &operator = (const AliTPCCalibViewerGUItime &v); // assignment operator
188
189 ClassDef(AliTPCCalibViewerGUItime, 0)
190
191};
192
514fcaf7 193////////////////////////////////////////////////////////////////////////
194//
195// GUI Alias frame
196//
197////////////////////////////////////////////////////////////////////////
198
199class AliTPCCalibViewerGUItimeAddAliasFrame : public TObject {
200public:
201 AliTPCCalibViewerGUItimeAddAliasFrame(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h,
202 UInt_t options, AliTPCCalibViewerGUItime *gui, TString strAlias="");
203 virtual ~AliTPCCalibViewerGUItimeAddAliasFrame();
204
205 // slots
206 void DoOK();
207 void DoCancel();
208
209
210private:
211 TGTransientFrame *fMain; //Main frame
212 TGTextEntry *fTxt1, *fTxt2; //text input
213
214 AliTPCCalibViewerGUItime *fGUI; //pointer to mother process
215
216 AliTPCCalibViewerGUItimeAddAliasFrame(const AliTPCCalibViewerGUItimeAddAliasFrame &r);
217 AliTPCCalibViewerGUItimeAddAliasFrame &operator = (const AliTPCCalibViewerGUItimeAddAliasFrame &r);
218
219 ClassDef(AliTPCCalibViewerGUItimeAddAliasFrame,0)
220};
221
5312f439 222#endif