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