]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/EveDet/AliEveListAnalyserEditor.h
Backward compat changes do not need ifdefs
[u/mrichter/AliRoot.git] / EVE / EveDet / AliEveListAnalyserEditor.h
1 // Author: Benjamin Hess   29/01/2010
2
3 /*************************************************************************
4  * Copyright (C) 2009-2010, Alexandru Bercuci, Benjamin Hess.            *
5  * All rights reserved.                                                  *
6  *************************************************************************/
7
8 //////////////////////////////////////////////////////////////////////////
9 //                                                                      //
10 // AliEveListAnalyserEditor                                             //
11 //                                                                      //
12 // The AliEveListAnalyserEditor provides the graphical func-            //
13 // tionality for the AliEveListAnalyser. It creates the tabs            //
14 // and canvases, when they are needed and, as well, frees allocated     //
15 // memory on destruction (or if new events are loaded and thus some     //
16 // tabs are closed).                                                    //
17 // The function DrawHistos() accesses the temporary file created by the //
18 // AliEveListAnalyser and draws the desired data (the file will         //
19 // be created within the call of ApplyMacros()). Have a look at this    //
20 // function to learn more about the structure of the file and how to    //
21 // access the data.                                                     //
22 // You can add objects to the list (of analysis objects) "by clicking"! //
23 // To do this, click the "start" button in the "list" tab. Pressing it, //
24 // connects the class to signals of objects in the viewer.              //
25 // You have to kinds of selection:                                      //
26 //                                                                      //
27 // Secondary selection:                                                 //
28 // You can hold "CTRL"+"ALT" (depending on your system, "ALT" alone can //
29 // also be fine) and click an single object (e.g. a single cluster of a //
30 // TEvePointSet) in the viewer to add it to the list. If the object is  //
31 // already in the list, it will be removed from it!                     //
32 //                                                                      //
33 // Primary selection:                                                   //
34 // Just click the object you want to add in the viewer (or as well in   //
35 // the browser (left panel)). If the object is already in the list, it  //
36 // will be removed from it!                                             //
37 //                                                                      //
38 // For both cases: Note:                                                //
39 // If you have added all the desired objects, please press the "stop"   //
40 // button in the "list" tab to disconnect the class from the signals.   //
41 // If you want to remove an object, you HAVE to use the same procedure  //
42 // that you have used for adding it. e.g. you cannot(!) remove an       //
43 // object added by the secondary selection method by using the primary  //
44 // selection method!                                                    //
45 //////////////////////////////////////////////////////////////////////////
46
47 #ifndef AliEveListAnalyserEditor_H
48 #define AliEveListAnalyserEditor_H
49
50 #ifndef ROOT_TGedFrame
51 #include <TGedFrame.h>
52 #endif
53
54 #ifndef ROOT_TGFrame
55 #include <TGFrame.h>
56 #endif
57
58 class AliEveListAnalyser;
59 class AliTRDReconstructor;
60 class TCanvas;     
61 class TEveBrowser;           
62 class TEveGedEditor;
63 class TEveManager;
64 class TFile;
65 class TGButtonGroup;
66 class TGCheckButton;
67 class TGFileInfo;
68 class TGGroupFrame;
69 class TGHorizontal3DLine;
70 class TGHorizontalFrame;
71 class TGLabel;
72 class TGListBox;
73 class TGRadioButton;
74 class TGString;
75 class TGTab;
76 class TGTextButton;
77 class TGTextEntry;
78 class TGVerticalFrame;
79 class TH1;
80 class TMacroData;
81 class TMap;
82 class TMapIter;
83 class TTree;
84
85 class AliEveListAnalyserEditor: public TGedFrame
86 {
87 public:
88   AliEveListAnalyserEditor(const TGWindow* p = 0, Int_t width = 170, Int_t height = 30,
89                                        UInt_t options = kChildFrame, Pixel_t back = GetDefaultFrameBackground());
90   virtual ~AliEveListAnalyserEditor();
91   virtual void SetModel(TObject* obj);
92
93   void    AddMacro(const Char_t* name, const Char_t* path = ".");  
94   void    ApplyMacros();
95   void    BrowseMacros();
96   void    CloseTabs();
97   //void    DoAddPrimSelectedObjects();
98   //void    DoRemovePrimSelectedObjects();
99   void    DoResetObjectList();
100   void    DoStartAddingObjects();
101   void    DoStopAddingObjects();
102   void    DrawHistos();
103   Int_t   GetNSelectedHistograms() const;
104   void    HandleMacroPathSet();
105   void    HandleNewEventLoaded();
106   void    HandleTabChangedToIndex(Int_t);
107   void    NewMacros();
108   void    RemoveMacros();
109   void    SaveMacroList(TMap* list);
110   void    UpdateDataFromMacroListSelection();
111   void    UpdateHistoList();
112   void    UpdateMacroList();
113   void    UpdateMacroListSelection(Int_t ind);
114   
115 protected:
116   AliEveListAnalyser* fM;                                               // Model object
117
118   void InheritMacroList();                                                                
119
120 private:
121   AliEveListAnalyserEditor(const AliEveListAnalyserEditor&);            // Not implemented
122   AliEveListAnalyserEditor& operator=(const AliEveListAnalyserEditor&); // Not implemented 
123
124   // Help functions
125   void SetDrawingToHistoCanvasTab();        
126   void UpdateHistoCanvasTab();             
127
128   TCanvas*          fHistoCanvas;            // Canvas for the histograms
129   TGString*         fHistoCanvasName;        // Name of the histogram canvas
130
131   TMap*             fInheritedMacroList;     // Stores the from the analyse object list inherited macro list
132
133   Bool_t            fInheritSettings;        // Flag indicating, whether the macro list will be inherited from
134                                              // the previously loaded analyse object list within the next call of SetModel
135
136   TGHorizontalFrame* fBrowseFrame;           // Frame for features corresponding to searching macros
137   TGVerticalFrame*   fHistoFrame;            // Top frame for the histogram stuff
138   TGVerticalFrame*   fHistoSubFrame;         // Frame for the histogram buttons themselves
139   TGVerticalFrame*   fMainFrame;             // Top frame for macro functionality.
140   TGVerticalFrame*   fObjectFrame;           // Frame for features corresponding to adding objects to the list
141   
142   //TGTextButton*   fbAddPrimObjects;          // "Add selected object(s)" button
143   TGTextButton*   fbApplyMacros;             // "Apply macros" button
144   TGTextButton*   fbBrowse;                  // "Browse" button
145   TGTextButton*   fbDrawHisto;               // "Draw histogram" button
146   TGTextButton*   fbNew;                     // "New" button  
147   //TGTextButton*   fbRemovePrimObjects;       // "Remove selected object(s)" button
148   TGTextButton*   fbRemoveMacros;            // "Remove macros" button
149   TGTextButton*   fbReset;                   // "Reset" (list of added objects) button
150   TGTextButton*   fbStart;                   // "Start" (adding objects to list) button
151   TGTextButton*   fbStop;                    // "Stop" (adding objects to list) button
152   TGTextEntry*    fteField;                  // Text field to insert macro path manually
153   TGListBox*      ftlMacroList;              // To display the list of (process) macros
154   TGListBox*      ftlMacroSelList;           // To display the list of (selection) macros
155
156   TGFileInfo*     fFileInfo;                 // Holds data about opening macros
157   Char_t**        fFileTypes;                // File types (for macros)
158
159   // Some labels
160   TGLabel* fLabel1;
161   TGLabel* fLabel2;
162   TGLabel* fLabel3;
163   TGLabel* fLabel4;
164      
165   // Some lines
166   TGHorizontal3DLine *fLine1;
167   TGHorizontal3DLine *fLine2;
168   TGHorizontal3DLine *fLine3;
169   TGHorizontal3DLine *fLine4; 
170
171   TGCheckButton** fCheckButtons;            // Check buttons for histograms 
172
173   ClassDef(AliEveListAnalyserEditor, 0);    // Editor for AliEveListAnalyser.
174 };
175
176
177 //////////////////////////////////////////////////////////////////////////
178 //                                                                      //
179 // AliEveGeneralMacroWizard                                             //
180 //                                                                      //
181 // Wizard for creating new macros.                                      //
182 //                                                                      //
183 //////////////////////////////////////////////////////////////////////////
184
185 class TGTextEdit;
186 class TGComboBox;
187 class AliEveGeneralMacroWizard : public TGMainFrame
188 {
189 public:
190   AliEveGeneralMacroWizard(const TGWindow* p = 0);
191   void Create(Int_t type); //*SIGNAL*
192   void Create(Char_t *pname); //*SIGNAL*
193   void HandleCreate();
194   void HandleSelectionChanged(Int_t sel);
195
196 private:
197   AliEveGeneralMacroWizard(const AliEveGeneralMacroWizard&);
198   AliEveGeneralMacroWizard& operator=(const AliEveGeneralMacroWizard&);
199
200   TGTextButton *fbCancel;                  // "Cancel" button
201   TGTextButton *fbCreate;                  // "Done" button
202   TGComboBox   *fCombo;                    // "Type"
203   TGTextEdit   *fTextEdit;                 // "Comments"
204   TGTextEntry  *fTextIncludes;             // "Includes"
205   TGTextEntry  *fTextName;                 // "Name"
206   TGTextEntry  *fTextObjectType;           // "1st object type"  
207   TGTextEntry  *fTextObjectType2;          // "2nd object type"
208   
209   ClassDef(AliEveGeneralMacroWizard, 0);      // Helper class to create macro templates 
210 };
211
212 #endif