1 #ifndef AliEveTRDTrackList_H
2 #define AliEveTRDTrackList_H
4 #include <TEveElement.h>
5 #include <EveDet/AliEveTRDData.h>
7 #define SIGNATURE_ERROR -1
8 #define NOT_EXIST_ERROR -2
12 #define MAX_MACRO_NAME_LENGTH 100
13 #define MAX_MACRO_PATH_LENGTH 300
14 #define MAX_APPLY_COMMAND_LENGTH 50
23 class TTreeSRedirector;
25 class AliEveTRDTrackList: public TEveElementList
27 friend class AliEveTRDTrackListEditor;
32 // Maximum length (number of characters) for a macro name:
33 fkMaxMacroNameLength = MAX_MACRO_NAME_LENGTH,
34 // Maximum length (number of characters) for a macro path:
35 fkMaxMacroPathLength = MAX_MACRO_PATH_LENGTH,
36 // Maximum length (number of characters) for a macro pathname:
37 fkMaxMacroPathNameLength = MAX_MACRO_NAME_LENGTH + MAX_MACRO_PATH_LENGTH,
38 // Maximum length (number of characters) for "apply macro" commands in addition to the length of the name, path...
39 fkMaxApplyCommandLength = MAX_APPLY_COMMAND_LENGTH
42 AliEveTRDTrackList(const Text_t* n = "AliEveTRDTrackList", const Text_t* t = "", Bool_t doColor = kFALSE);
43 virtual ~AliEveTRDTrackList();
45 Int_t AddMacro(const Char_t* path, const Char_t* name, // Adds a macro (path/name) to the corresponding list
46 Bool_t forceReload = kFALSE); // (automatic recognition / check) -> library will be
47 // built, if it does not exist, or updated, if the
48 // macro code has been changed. If forceReload is
49 // kTRUE, the library will always be (re-)built!
50 void AddMacroFast(const Char_t* entry, // Adds an entry to the corresponding list (cf. below)
51 Bool_t toSelectionList);
52 void AddMacroFast(const Char_t* path, const Char_t* name, // Adds a macro (path/name) to the selection (process)
53 Bool_t toSelectionList); // macro list, if second parameter is kTRUE (kFALSE).
54 // No checks are performed (fast) and no libraries are
55 // loaded. Do use only, if library already exists!
56 virtual void AddStandardMacros(); // Adds standard macros to the lists
57 Bool_t ApplyProcessMacros(TList* iterator); // Uses the iterator (for the selected process
58 // macros) to apply the selected macros to the data.
59 // Return kTRUE on success, otherwise kFALSE. If there
60 // no process macros selected, kTRUE is returned (no
62 void ApplySelectionMacros(TList* iterator); // Uses the iterator (for the selected selection
63 // macros) to apply the selected macros to the data
64 Char_t* MakeMacroEntry(const Char_t* path, const Char_t* name); // Constructs an entry for the macro
65 // lists with path and name
66 void RemoveProcessMacros(TList* iterator); // Uses the iterator (for the selected process
67 // macros) to remove the process macros from
68 // the corresponding list.
69 void RemoveSelectionMacros(TList* iterator); // Uses the iterator (for the selected selection
70 // macros) to remove the selection macros from
71 // the corresponding list.
72 //void SetTrackStyleState(UChar_t c); // Sets the track model and the color model for each track in the list
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
79 TTreeSRedirector *fDataTree; // Tree containing data for histograms
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
85 Char_t fSelectedTab; // Holds the index of the selected tab
86 UChar_t fSelectedStyle; // Holds the selected track style
88 Char_t GetSelectedTab() // Gets the selected tab
89 { return fSelectedTab; }
91 UChar_t GetSelectedTrackStyle() // Gets the selected track style
92 { return fSelectedStyle; }
93 Bool_t HistoDataIsSelected(Int_t index) // Is entry in list selected?
94 { return TESTBIT(fHistoDataSelected, index); }
96 Bool_t MacroListIsSelected(Int_t index) // Is entry in list selected?
97 { return TESTBIT(fMacroListSelected, index); }
99 Bool_t MacroSelListIsSelected(Int_t index) // Is entry in list selected?
100 { return TESTBIT(fMacroSelListSelected, index); }
102 Bool_t IsHistogramMacro(const Char_t* name); // Returns kTRUE, if a macro with name "name" has been
103 // loaded into a shared library and has the signature
104 // of a process macro of type 2 (histogram) -> NO
105 // additional check with mangled name!!
107 void SetHistoDataSelection(Int_t index, Bool_t set) // Set selection of entry in list
108 { if (set) SETBIT(fHistoDataSelected, index); else CLRBIT(fHistoDataSelected, index); }
110 void SetMacroListSelection(Int_t index, Bool_t set) // Set selection of entry in list
111 { if (set) SETBIT(fMacroListSelected, index); else CLRBIT(fMacroListSelected, index); }
113 void SetMacroSelListSelection(Int_t index, Bool_t set) // Set selection of entry in list
114 { if (set) SETBIT(fMacroSelListSelected, index); else CLRBIT(fMacroSelListSelected, index); }
116 void SetSelectedTab(Int_t index) // Sets the selected tab
117 { fSelectedTab = (Char_t)index; }
119 void SetSelectedTrackStyle(UChar_t index) // Sets the selected track style
120 { fSelectedStyle = index; }
122 void UpdateTrackStyle(AliEveTRDTrack::AliEveTRDTrackState s, UChar_t ss=0);
125 AliEveTRDTrackList(const AliEveTRDTrackList&); // Not implemented
126 AliEveTRDTrackList& operator=(const AliEveTRDTrackList&); // Not implemented
128 ClassDef(AliEveTRDTrackList, 0); // Class containing a list of tracks