]>
Commit | Line | Data |
---|---|---|
2ef0687e | 1 | #ifndef AliEveTRDTrackList_H |
2 | #define AliEveTRDTrackList_H | |
3 | ||
4 | #include <TEveElement.h> | |
2ef0687e | 5 | |
caaf90d2 | 6 | #define SIGNATURE_ERROR -1 |
7 | #define NOT_EXIST_ERROR -2 | |
8 | #define WARNING 0 | |
9 | #define SUCCESS 1 | |
10 | ||
4f6473f6 | 11 | #define MAX_MACRO_NAME_LENGTH 100 |
12 | #define MAX_MACRO_PATH_LENGTH 300 | |
13 | #define MAX_APPLY_COMMAND_LENGTH 50 | |
14 | ||
15 | #define UNSETBIT(n,i) ((n) &= ~BIT(i)) | |
16 | ||
caaf90d2 | 17 | class AliEveTRDTrack; |
18 | class AliTRDtrackV1; | |
19 | class TFile; | |
20 | class TFunction; | |
c413e8d4 | 21 | class TH1; |
22 | class TObjString; | |
caaf90d2 | 23 | class TList; |
24 | class TTreeSRedirector; | |
2ef0687e | 25 | |
26 | class AliEveTRDTrackList: public TEveElementList | |
27 | { | |
28 | friend class AliEveTRDTrackListEditor; | |
29 | ||
30 | public: | |
4f6473f6 | 31 | enum |
32 | { | |
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 | |
41 | }; | |
42 | ||
2ef0687e | 43 | AliEveTRDTrackList(const Text_t* n = "AliEveTRDTrackList", const Text_t* t = "", Bool_t doColor = kFALSE); |
caaf90d2 | 44 | virtual ~AliEveTRDTrackList(); |
45 | ||
c413e8d4 | 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! | |
caaf90d2 | 57 | virtual void AddStandardMacros(); // Adds standard macros to the lists |
ea24e1bc | 58 | Bool_t ApplyProcessMacros(TList* iterator); // Uses the iterator (for the selected process |
59 | // macros) to apply the selected macros to the data. | |
60 | // Return kTRUE on success, otherwise kFALSE. If there | |
61 | // no process macros selected, kTRUE is returned (no | |
62 | // error!). | |
caaf90d2 | 63 | void ApplySelectionMacros(TList* iterator); // Uses the iterator (for the selected selection |
64 | // macros) to apply the selected macros to the data | |
65 | Char_t* MakeMacroEntry(const Char_t* path, const Char_t* name); // Constructs an entry for the macro | |
66 | // lists with path and name | |
67 | void RemoveProcessMacros(TList* iterator); // Uses the iterator (for the selected process | |
68 | // macros) to remove the process macros from | |
69 | // the corresponding list. | |
70 | void RemoveSelectionMacros(TList* iterator); // Uses the iterator (for the selected selection | |
71 | // macros) to remove the selection macros from | |
72 | // the corresponding list. | |
4f6473f6 | 73 | |
74 | protected: | |
75 | TList* fMacroList; // List of (process) macros | |
76 | TList* fMacroSelList; // List of (selection) macros | |
77 | TList* fDataFromMacroList; // List of macros that currently have data for histograms | |
78 | ||
79 | TTreeSRedirector *fDataTree; // Tree containing data for histograms | |
80 | ||
81 | Int_t fHistoDataSelected; // Stores the selection for the data of the histograms | |
82 | Int_t fMacroListSelected; // Stores the selection of the process macro list | |
83 | Int_t fMacroSelListSelected; // Stores the selection of the selection macro list | |
84 | ||
85 | Char_t fSelectedTab; // Holds the index of the selected tab | |
86 | ||
87 | Char_t GetSelectedTab() // Get the selected tab | |
88 | { return fSelectedTab; } | |
89 | ||
90 | Bool_t HistoDataIsSelected(Int_t index) // Is entry in list selected? | |
91 | { return TESTBIT(fHistoDataSelected, index); } | |
92 | ||
93 | Bool_t MacroListIsSelected(Int_t index) // Is entry in list selected? | |
94 | { return TESTBIT(fMacroListSelected, index); } | |
95 | ||
96 | Bool_t MacroSelListIsSelected(Int_t index) // Is entry in list selected? | |
97 | { return TESTBIT(fMacroSelListSelected, index); } | |
98 | ||
c413e8d4 | 99 | Bool_t IsHistogramMacro(const Char_t* name); // Returns kTRUE, if a macro with name "name" has been |
100 | // loaded into a shared library and has the signature | |
101 | // of a process macro of type 2 (histogram) -> NO | |
102 | // additional check with mangled name!! | |
103 | ||
4f6473f6 | 104 | void SetHistoDataSelection(Int_t index, Bool_t set) // Set selection of entry in list |
105 | { if (set) SETBIT(fHistoDataSelected, index); else UNSETBIT(fHistoDataSelected, index); } | |
106 | ||
107 | void SetMacroListSelection(Int_t index, Bool_t set) // Set selection of entry in list | |
c413e8d4 | 108 | { if (set) SETBIT(fMacroListSelected, index); else UNSETBIT(fMacroListSelected, index); } |
4f6473f6 | 109 | |
110 | void SetMacroSelListSelection(Int_t index, Bool_t set) // Set selection of entry in list | |
c413e8d4 | 111 | { if (set) SETBIT(fMacroSelListSelected, index); else UNSETBIT(fMacroSelListSelected, index); } |
4f6473f6 | 112 | |
113 | void SetSelectedTab(Int_t index) // Set the selected tab | |
114 | { fSelectedTab = (Char_t)index; } | |
115 | ||
2ef0687e | 116 | private: |
117 | AliEveTRDTrackList(const AliEveTRDTrackList&); // Not implemented | |
caaf90d2 | 118 | AliEveTRDTrackList& operator=(const AliEveTRDTrackList&); // Not implemented |
2ef0687e | 119 | |
3f797131 | 120 | ClassDef(AliEveTRDTrackList, 0); // Class containing a list of tracks |
2ef0687e | 121 | }; |
122 | ||
123 | #endif |