]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveDet/AliEveListAnalyserEditor.h
new class "List Analyser" by Ben Hess
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveListAnalyserEditor.h
1 // Author: Benjamin Hess   06/11/2009
2
3 /*************************************************************************
4  * Copyright (C) 2009, Alexandru Bercuci, Benjamin Hess.                 *
5  * All rights reserved.                                                  *
6  *************************************************************************/
7
8 #ifndef AliEveListAnalyserEditor_H
9 #define AliEveListAnalyserEditor_H
10
11
12 // TODO: Documentation
13 //////////////////////////////////////////////////////////////////////////
14 //                                                                      //
15 // AliEveListAnalyserEditor                                     //
16 //                                                                      //
17 // The AliEveListAnalyserEditor provides the graphical func-    //
18 // tionality for the AliEveListAnalyser. It creates the tabs    //
19 // and canvases, when they are needed and, as well, frees allocated     //
20 // memory on destruction (or if new events are loaded and thus some     //
21 // tabs are closed).                                                    //
22 // The function DrawHistos() accesses the temporary file created by the //
23 // AliEveListAnalyser and draws the desired data (the file will //
24 // be created within the call of ApplyMacros()). Have a look at this    //
25 // function to learn more about the structure of the file and how to    //
26 // access the data.                                                     //
27 //////////////////////////////////////////////////////////////////////////
28
29 #ifndef ROOT_TGedFrame
30 #include <TGedFrame.h>
31 #endif
32
33 #ifndef ROOT_TGFrame
34 #include <TGFrame.h>
35 #endif
36
37 //class AliEveTRDTrack;
38 class AliEveListAnalyser;
39 class AliTRDReconstructor;
40 class TCanvas;     
41 class TEveBrowser;           
42 class TEveGedEditor;
43 class TEveManager;
44 class TFile;
45 class TGButtonGroup;
46 class TGCheckButton;
47 class TGFileInfo;
48 class TGGroupFrame;
49 class TGHorizontal3DLine;
50 class TGHorizontalFrame;
51 class TGLabel;
52 class TGListBox;
53 class TGRadioButton;
54 class TGString;
55 class TGTab;
56 class TGTextButton;
57 class TGTextEntry;
58 class TGVerticalFrame;
59 class TH1;
60 class TMacroData;
61 class TMap;
62 class TMapIter;
63 class TTree;
64
65 class AliEveListAnalyserEditor: public TGedFrame
66 {
67 public:
68   AliEveListAnalyserEditor(const TGWindow* p = 0, Int_t width = 170, Int_t height = 30,
69                                        UInt_t options = kChildFrame, Pixel_t back = GetDefaultFrameBackground());
70   virtual ~AliEveListAnalyserEditor();
71   virtual void SetModel(TObject* obj);
72
73   void    AddMacro(const Char_t* name, const Char_t* path = ".");  
74   void    ApplyMacros();
75   void    BrowseMacros();
76   void    CloseTabs();
77   void    DrawHistos();
78   Int_t   GetNSelectedHistograms() const;
79   void    HandleMacroPathSet();
80   void    HandleNewEventLoaded();
81   void    HandleTabChangedToIndex(Int_t);
82   void    NewMacros();
83   void    RemoveMacros();
84   void    SaveMacroList(TMap* list);
85 //  void    SetTrackColor(Int_t ind);
86 //  void    SetTrackModel(Int_t ind);
87   void    UpdateDataFromMacroListSelection();
88   void    UpdateHistoList();
89   void    UpdateMacroList();
90   void    UpdateMacroListSelection(Int_t ind);
91   
92 protected:
93   AliEveListAnalyser* fM;                                               // Model object
94
95   void InheritMacroList();                               
96   void InheritStyle();                                    
97
98 private:
99   AliEveListAnalyserEditor(const AliEveListAnalyserEditor&);            // Not implemented
100   AliEveListAnalyserEditor& operator=(const AliEveListAnalyserEditor&); // Not implemented 
101
102   TCanvas*          fHistoCanvas;            // Canvas for the histograms
103   TGString*         fHistoCanvasName;        // Name of the histogram canvas
104
105   TMap*             fInheritedMacroList;     // Stores the from the analyse object list inherited macro list
106
107   Bool_t            fInheritSettings;        // Flag indicating, whether the macro list will be inherited from
108                                              // the previously loaded analyse object list within the next call of SetModel
109
110 // TODO: Old version with "style" still alive has comment:
111 // Flag indicating, whether the macro list and the style settings will be 
112 // inherited from the previously loaded track list within the next call 
113 // of SetModel
114
115 //  TGHorizontalFrame* fStyleFrame;            // Frame for the style stuff
116   TGVerticalFrame*   fMainFrame;             // Top frame for macro functionality.
117   TGVerticalFrame*   fHistoFrame;            // Top frame for the histogram stuff
118   TGVerticalFrame*   fHistoSubFrame;         // Frame for the histogram buttons themselves
119   TGHorizontalFrame* fBrowseFrame;           // Frame for features corresponding to searching macros
120 //  TGButtonGroup*     fbgStyleColor;          // Button group for the color model
121 //  TGButtonGroup*     fbgStyleTrack;          // Button group for the track model
122   
123 //  TGRadioButton**    frbColor;               // Radio buttons for the color model
124 //  TGRadioButton**    frbTrack;               // Radio buttons for the track model
125
126   TGTextButton*   fbBrowse;                  // "Browse" button
127   TGTextButton*   fbNew;                     // "New" button
128   TGTextButton*   fbApplyMacros;             // "Apply macros" button
129   TGTextButton*   fbRemoveMacros;            // "Remove macros" button
130   TGTextButton*   fbDrawHisto;               // "Draw histogram" button
131   TGTextEntry*    fteField;                  // Text field to insert macro path manually
132   TGListBox*      ftlMacroList;              // To display the list of (process) macros
133   TGListBox*      ftlMacroSelList;           // To display the list of (selection) macros
134
135   TGFileInfo*     fFileInfo;                 // Holds data about opening macros
136   Char_t**        fFileTypes;                // File types (for macros)
137
138   // Some labels
139   TGLabel* fLabel1;
140   TGLabel* fLabel2;
141   TGLabel* fLabel3;
142   TGLabel* fLabel4;
143      
144   // Some lines
145   TGHorizontal3DLine *fLine1;
146   TGHorizontal3DLine *fLine2;
147   TGHorizontal3DLine *fLine3;
148   TGHorizontal3DLine *fLine4;
149 //  TGHorizontal3DLine *fLine5;  
150
151   TGCheckButton** fCheckButtons;            // Check buttons for histograms
152
153   // Help functions
154   void SetDrawingToHistoCanvasTab();        
155   void UpdateHistoCanvasTab();              
156
157   ClassDef(AliEveListAnalyserEditor, 0);    // Editor for AliEveListAnalyser.
158 };
159
160
161 //////////////////////////////////////////////////////////////////////////
162 //                                                                      //
163 // AliEveGeneralMacroWizard                                             //
164 //                                                                      //
165 // Wizard for creating new macros.                                      //
166 //                                                                      //
167 //////////////////////////////////////////////////////////////////////////
168
169 class TGTextEdit;
170 class TGComboBox;
171 class AliEveGeneralMacroWizard : public TGMainFrame
172 {
173 public:
174   AliEveGeneralMacroWizard(const TGWindow* p = 0);
175   void Create(Int_t type); //*SIGNAL*
176   void Create(Char_t *pname); //*SIGNAL*
177   void HandleCreate();
178
179 private:
180   AliEveGeneralMacroWizard(const AliEveGeneralMacroWizard&);
181   AliEveGeneralMacroWizard& operator=(const AliEveGeneralMacroWizard&);
182
183   TGTextEntry *fTextName;
184   TGTextEntry *fTextObjectType;
185   TGComboBox  *fCombo;
186   TGTextEdit  *fTextEdit;
187   TGTextButton *fbCreate;                  // "Done" button
188   TGTextButton *fbCancel;                  // "Cancel" button
189   
190   ClassDef(AliEveGeneralMacroWizard, 0);      // Helper class to create macro templates 
191 };
192
193 #endif