1 // Author: Benjamin Hess 29/01/2010
3 /*************************************************************************
4 * Copyright (C) 2009-2010, Alexandru Bercuci, Benjamin Hess. *
5 * All rights reserved. *
6 *************************************************************************/
8 //////////////////////////////////////////////////////////////////////////
10 // AliEveListAnalyserEditor //
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: //
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! //
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! //
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 //////////////////////////////////////////////////////////////////////////
47 #ifndef AliEveListAnalyserEditor_H
48 #define AliEveListAnalyserEditor_H
50 #ifndef ROOT_TGedFrame
51 #include <TGedFrame.h>
58 class AliEveListAnalyser;
59 class AliTRDReconstructor;
69 class TGHorizontal3DLine;
70 class TGHorizontalFrame;
78 class TGVerticalFrame;
85 class AliEveListAnalyserEditor: public TGedFrame
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);
93 void AddMacro(const Char_t* name, const Char_t* path = ".");
97 //void DoAddPrimSelectedObjects();
98 //void DoRemovePrimSelectedObjects();
99 void DoResetObjectList();
100 void DoStartAddingObjects();
101 void DoStopAddingObjects();
103 Int_t GetNSelectedHistograms() const;
104 void HandleMacroPathSet();
105 void HandleNewEventLoaded();
106 void HandleTabChangedToIndex(Int_t);
109 void SaveMacroList(TMap* list);
110 void UpdateDataFromMacroListSelection();
111 void UpdateHistoList();
112 void UpdateMacroList();
113 void UpdateMacroListSelection(Int_t ind);
116 AliEveListAnalyser* fM; // Model object
118 void InheritMacroList();
121 AliEveListAnalyserEditor(const AliEveListAnalyserEditor&); // Not implemented
122 AliEveListAnalyserEditor& operator=(const AliEveListAnalyserEditor&); // Not implemented
125 void SetDrawingToHistoCanvasTab();
126 void UpdateHistoCanvasTab();
128 TCanvas* fHistoCanvas; // Canvas for the histograms
129 TGString* fHistoCanvasName; // Name of the histogram canvas
131 TMap* fInheritedMacroList; // Stores the from the analyse object list inherited macro list
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
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
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
156 TGFileInfo* fFileInfo; // Holds data about opening macros
157 Char_t** fFileTypes; // File types (for macros)
166 TGHorizontal3DLine *fLine1;
167 TGHorizontal3DLine *fLine2;
168 TGHorizontal3DLine *fLine3;
169 TGHorizontal3DLine *fLine4;
171 TGCheckButton** fCheckButtons; // Check buttons for histograms
173 ClassDef(AliEveListAnalyserEditor, 0); // Editor for AliEveListAnalyser.
177 //////////////////////////////////////////////////////////////////////////
179 // AliEveGeneralMacroWizard //
181 // Wizard for creating new macros. //
183 //////////////////////////////////////////////////////////////////////////
187 class AliEveGeneralMacroWizard : public TGMainFrame
190 AliEveGeneralMacroWizard(const TGWindow* p = 0);
191 void Create(Int_t type); //*SIGNAL*
192 void Create(Char_t *pname); //*SIGNAL*
194 void HandleSelectionChanged(Int_t sel);
197 AliEveGeneralMacroWizard(const AliEveGeneralMacroWizard&);
198 AliEveGeneralMacroWizard& operator=(const AliEveGeneralMacroWizard&);
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"
209 ClassDef(AliEveGeneralMacroWizard, 0); // Helper class to create macro templates