1 // Author: Benjamin Hess 29/01/2010
3 /*************************************************************************
4 * Copyright (C) 2009-2010, Alexandru Bercuci, Benjamin Hess. *
5 * All rights reserved. *
6 *************************************************************************/
8 #ifndef AliEveTRDTrackListEditor_H
9 #define AliEveTRDTrackListEditor_H
11 //////////////////////////////////////////////////////////////////////////
13 // AliEveTRDTrackListEditor //
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 //////////////////////////////////////////////////////////////////////////
26 #ifndef ROOT_TGedFrame
27 #include <TGedFrame.h>
35 class AliEveTRDTrackList;
36 class AliTRDReconstructor;
46 class TGHorizontal3DLine;
47 class TGHorizontalFrame;
55 class TGVerticalFrame;
62 class AliEveTRDTrackListEditor: public TGedFrame
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);
70 void AddMacro(const Char_t* name, const Char_t* path = ".");
75 Int_t GetNSelectedHistograms() const;
76 void HandleMacroPathSet();
77 void HandleNewEventLoaded();
78 void HandleTabChangedToIndex(Int_t);
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);
90 AliEveTRDTrackList* fM; // Model object
92 void InheritMacroList();
96 AliEveTRDTrackListEditor(const AliEveTRDTrackListEditor&); // Not implemented
97 AliEveTRDTrackListEditor& operator=(const AliEveTRDTrackListEditor&); // Not implemented
99 TCanvas* fHistoCanvas; // Canvas for the histograms
100 TGString* fHistoCanvasName; // Name of the histogram canvas
102 TMap* fInheritedMacroList; // Stores the from the track list inherited macro list
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
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
116 TGRadioButton** frbColor; // Radio buttons for the color model
117 TGRadioButton** frbTrack; // Radio buttons for the track model
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
128 TGFileInfo* fFileInfo; // Holds data about opening macros
129 Char_t** fFileTypes; // File types (for macros)
138 TGHorizontal3DLine *fLine1;
139 TGHorizontal3DLine *fLine2;
140 TGHorizontal3DLine *fLine3;
141 TGHorizontal3DLine *fLine4;
142 TGHorizontal3DLine *fLine5;
144 TGCheckButton** fCheckButtons; // Check buttons for histograms
147 void SetDrawingToHistoCanvasTab(Int_t canvas=1);
148 void UpdateHistoCanvasTab(Int_t canvas=1);
150 ClassDef(AliEveTRDTrackListEditor, 0); // Editor for AliEveTRDTrackList.
153 //////////////////////////////////////////////////////////////////////////
155 // AliEveTRDMacroWizard //
157 // Wizard for creating new macros. //
159 //////////////////////////////////////////////////////////////////////////
163 class AliEveTRDMacroWizard : public TGMainFrame
166 AliEveTRDMacroWizard(const TGWindow* p = 0);
167 void Create(Int_t type); //*SIGNAL*
168 void Create(Char_t *pname); //*SIGNAL*
172 AliEveTRDMacroWizard(const AliEveTRDMacroWizard&);
173 AliEveTRDMacroWizard& operator=(const AliEveTRDMacroWizard&);
177 TGTextEdit *fTextEdit;
178 TGTextButton *fbCreate; // "Done" button
179 TGTextButton *fbCancel; // "Cancel" button
181 ClassDef(AliEveTRDMacroWizard, 0); // Helper class to create macro templates