1 #ifndef AliEveTRDTrackList_H
2 #define AliEveTRDTrackList_H
4 #include <TEveElement.h>
6 #define SIGNATURE_ERROR -1
7 #define NOT_EXIST_ERROR -2
11 #define MAX_MACRO_NAME_LENGTH 100
12 #define MAX_MACRO_PATH_LENGTH 300
13 #define MAX_APPLY_COMMAND_LENGTH 50
15 #define UNSETBIT(n,i) ((n) &= ~BIT(i))
24 class TTreeSRedirector;
26 class AliEveTRDTrackList: public TEveElementList
28 friend class AliEveTRDTrackListEditor;
33 // Maximum length (number of characters) for a macro name:
34 fkMaxMacroNameLength = MAX_MACRO_NAME_LENGTH,
35 // Maximum length (number of characters) for a macro path:
36 fkMaxMacroPathLength = MAX_MACRO_PATH_LENGTH,
37 // Maximum length (number of characters) for a macro pathname:
38 fkMaxMacroPathNameLength = MAX_MACRO_NAME_LENGTH + MAX_MACRO_PATH_LENGTH,
39 // Maximum length (number of characters) for "apply macro" commands in addition to the length of the name, path...
40 fkMaxApplyCommandLength = MAX_APPLY_COMMAND_LENGTH
43 AliEveTRDTrackList(const Text_t* n = "AliEveTRDTrackList", const Text_t* t = "", Bool_t doColor = kFALSE);
44 virtual ~AliEveTRDTrackList();
46 Int_t AddMacro(const Char_t* path, const Char_t* name, // Adds a macro (path/name) to the corresponding list
47 Bool_t forceReload = kFALSE); // (automatic recognition / check) -> library will be
48 // built, if it does not exist, or updated, if the
49 // macro code has been changed. If forceReload is
50 // kTRUE, the library will always be (re-)built!
51 void AddMacroFast(const Char_t* entry, // Adds an entry to the corresponding list (cf. below)
52 Bool_t toSelectionList);
53 void AddMacroFast(const Char_t* path, const Char_t* name, // Adds a macro (path/name) to the selection (process)
54 Bool_t toSelectionList); // macro list, if second parameter is kTRUE (kFALSE).
55 // No checks are performed (fast) and no libraries are
56 // loaded. Do use only, if library already exists!
57 virtual void AddStandardMacros(); // Adds standard macros to the lists
58 void ApplyProcessMacros(TList* iterator); // Uses the iterator (for the selected process
59 // macros) to apply the selected macros to the data
60 void ApplySelectionMacros(TList* iterator); // Uses the iterator (for the selected selection
61 // macros) to apply the selected macros to the data
62 Char_t* MakeMacroEntry(const Char_t* path, const Char_t* name); // Constructs an entry for the macro
63 // lists with path and name
64 void RemoveProcessMacros(TList* iterator); // Uses the iterator (for the selected process
65 // macros) to remove the process macros from
66 // the corresponding list.
67 void RemoveSelectionMacros(TList* iterator); // Uses the iterator (for the selected selection
68 // macros) to remove the selection macros from
69 // the corresponding list.
72 TList* fMacroList; // List of (process) macros
73 TList* fMacroSelList; // List of (selection) macros
74 TList* fDataFromMacroList; // List of macros that currently have data for histograms
76 TTreeSRedirector *fDataTree; // Tree containing data for histograms
78 Int_t fHistoDataSelected; // Stores the selection for the data of the histograms
79 Int_t fMacroListSelected; // Stores the selection of the process macro list
80 Int_t fMacroSelListSelected; // Stores the selection of the selection macro list
82 Char_t fSelectedTab; // Holds the index of the selected tab
84 Char_t GetSelectedTab() // Get the selected tab
85 { return fSelectedTab; }
87 Bool_t HistoDataIsSelected(Int_t index) // Is entry in list selected?
88 { return TESTBIT(fHistoDataSelected, index); }
90 Bool_t MacroListIsSelected(Int_t index) // Is entry in list selected?
91 { return TESTBIT(fMacroListSelected, index); }
93 Bool_t MacroSelListIsSelected(Int_t index) // Is entry in list selected?
94 { return TESTBIT(fMacroSelListSelected, index); }
96 Bool_t IsHistogramMacro(const Char_t* name); // Returns kTRUE, if a macro with name "name" has been
97 // loaded into a shared library and has the signature
98 // of a process macro of type 2 (histogram) -> NO
99 // additional check with mangled name!!
101 void SetHistoDataSelection(Int_t index, Bool_t set) // Set selection of entry in list
102 { if (set) SETBIT(fHistoDataSelected, index); else UNSETBIT(fHistoDataSelected, index); }
104 void SetMacroListSelection(Int_t index, Bool_t set) // Set selection of entry in list
105 { if (set) SETBIT(fMacroListSelected, index); else UNSETBIT(fMacroListSelected, index); }
107 void SetMacroSelListSelection(Int_t index, Bool_t set) // Set selection of entry in list
108 { if (set) SETBIT(fMacroSelListSelected, index); else UNSETBIT(fMacroSelListSelected, index); }
110 void SetSelectedTab(Int_t index) // Set the selected tab
111 { fSelectedTab = (Char_t)index; }
114 AliEveTRDTrackList(const AliEveTRDTrackList&); // Not implemented
115 AliEveTRDTrackList& operator=(const AliEveTRDTrackList&); // Not implemented
117 ClassDef(AliEveTRDTrackList, 0); // Class containing a list of tracks