]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Insert html documentation (Ben)
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Sep 2008 07:56:37 +0000 (07:56 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 24 Sep 2008 07:56:37 +0000 (07:56 +0000)
EVE/EveDet/AliEveTRDTrackList.cxx
EVE/EveDet/AliEveTRDTrackList.h
EVE/EveDet/AliEveTRDTrackListEditor.cxx
EVE/EveDet/AliEveTRDTrackListEditor.h

index 0ef500c63f7550d2ee8abca1cfb74e8c8104f1f9..7cfb6182b880506b56c0662dbdfcbcbebab2bdf7 100644 (file)
@@ -1,3 +1,52 @@
+//////////////////////////////////////////////////////////////////////////
+//                                                                      //
+// An AliEveTRDTrackList is, in principal, a TEveElementList with some  //
+// sophisticated features. You can add macros to this list, which then  //
+// can be applied to the list of tracks (these tracks can be added to   //
+// the list in the same way as for the TEveElementList). In general,    //
+// please use AddMacro(...) for this purpose.                           //
+// Macros that are no longer needed can be removed from the list via    //
+// RemoveSelectionMacros(...) or RemoveProcessMacros(...) respectively. //
+// This function takes an iterator of the list of entries that are to   //
+// be removed. An entry looks like:                                     //
+// "MacroName.C (Path: MacroPath)". This is the way, the information    //
+// about a macro is stored in the AliEveTRDTrackList. If you have path  //
+// and name of a macro, use MakeMacroEntry(...) to get the corresponding//
+// entry. The type of the macros is stored in a map. You can get the    //
+// macro type via GetMacroType(...).                                    //
+// With ApplySelectionMacros(...) or ApplyProcessMacros(...)            //
+// respectively you can apply the macros to the track list via          //
+// iterators (same style like for RemoveProcessMacros(...) (cf. above)).//
+// Selection macros (de-)select macros according to a selection rule    //
+// by setting the rnr-state of the tracks.                              //
+// If multiple selection macros are applied, a track is selected, if    //
+// all selection macros select the track.                               //
+// Process macros create data or histograms, which will be stored in    //
+// a temporary file. The editor of this class will access this file     //
+// and draw all the stuff within it's DrawHistos() function. The file   //
+// will be deleted by the destructor.                                   //
+//                                                                      //
+// Currently, the following macro types are supported:                  //
+// Selection macros:                                                    //
+// Bool_t YourMacro(const AliTRDtrackV1*);                              //
+// Bool_t YourMacro(const AliTRDtrackV1*, const AliTRDtrackV1*);        //
+//                                                                      //
+// Process macros:                                                      //
+// void YourMacro(const AliTRDtrackV1*, Double_t*&, Int_t&);            //
+// void YourMacro(const AliTRDtrackV1*, const AliTRDtrackV1*,           //
+//                Double_t*&, Int_t&);                                  //
+// TH1* YourMacro(const AliTRDtrackV1*);                                //
+// TH1* YourMacro(const AliTRDtrackV1*, const AliTRDtrackV1*);          //
+//                                                                      //
+// The macros which take 2 tracks are applied to all pairs              //
+// fullfilling the selection criteria.                                  //
+//                                                                      //
+// Authors :                                                            //
+//    A.Bercuci <A.Bercuci@gsi.de>                                      //
+//    B.Hess <Hess@Stud.Uni-Heidelberg.de>                              //
+//////////////////////////////////////////////////////////////////////////
+
+
 // Uncomment to display debugging infos
 //#define ALIEVETRDTRACKLIST_DEBUG
 
@@ -33,6 +82,8 @@ AliEveTRDTrackList::AliEveTRDTrackList(const Text_t* n, const Text_t* t, Bool_t
   fSelectedTab(1),                              // Standard tab: "Apply macros" (index 1)
   fSelectedStyle(0)
 {
+  // Creates the AliEveTRDTrackList.
+
   // Only accept childs of type AliEveTRDTrack
   SetChildClass(AliEveTRDTrack::Class());
 
@@ -57,6 +108,8 @@ AliEveTRDTrackList::AliEveTRDTrackList(const Text_t* n, const Text_t* t, Bool_t
 //______________________________________________________
 AliEveTRDTrackList::~AliEveTRDTrackList()
 {
+  // Frees allocated memory (lists etc.).
+
   if (fMacroList != 0)
   {
     fMacroList->Delete();
@@ -94,15 +147,24 @@ AliEveTRDTrackList::~AliEveTRDTrackList()
 //______________________________________________________
 Int_t AliEveTRDTrackList::AddMacro(const Char_t* path, const Char_t* nameC, Bool_t forceReload)
 {
-  // First check the type of the macro:
-  // If it has the signature of a selection macro:
-  // Bool_t MacroName(AliTRDtrackV1*)
-  // it is assumed to be a selection macro.
-  // If it has the signature of a process macro:
-  // void MacroName(AliTRDtrackV1*, Double_t*&, Int_t&)
-  // it is assumed to be a process macro.
-  // In all other cases: Macro is rejected
-  
+  // Checks, if the file exists and if the signature is correct.
+  // If these criteria are fullfilled, the library for this macro is built
+  // and the macro is added to the corresponding list.
+  // Supported macro types:
+  // Selection macros:                                                    
+  // Bool_t YourMacro(const AliTRDtrackV1*)
+  // Bool_t YourMacro(const AliTRDtrackV1*, const AliTRDtrackV1*)
+  //
+  // Process macros:                                                      
+  // void YourMacro(const AliTRDtrackV1*, Double_t*&, Int_t&)             
+  // void YourMacro(const AliTRDtrackV1*, const AliTRDtrackV1*,           
+  //                Double_t*&, Int_t&)                                   
+  // TH1* YourMacro(const AliTRDtrackV1*)                                 
+  // TH1* YourMacro(const AliTRDtrackV1*, const AliTRDtrackV1*)           
+  //                                                                      
+  // The macros which take 2 tracks are applied to all pairs              
+  // fullfilling the selection criteria.                                  
+
   Char_t* entryName = MakeMacroEntry(path, nameC);
 
   Char_t pathname[fkMaxMacroPathNameLength];
@@ -195,6 +257,8 @@ Int_t AliEveTRDTrackList::AddMacro(const Char_t* path, const Char_t* nameC, Bool
 //______________________________________________________
 void AliEveTRDTrackList::AddMacroFast(const Char_t* entry, AliEveTRDTrackListMacroType type)
 {
+  // Adds an entry to the corresponding list (cf. overloaded function).
+
   switch (type)
   {
     case kSingleTrackSelect:
@@ -229,6 +293,10 @@ void AliEveTRDTrackList::AddMacroFast(const Char_t* entry, AliEveTRDTrackListMac
 //______________________________________________________
 void AliEveTRDTrackList::AddMacroFast(const Char_t* path, const Char_t* name, AliEveTRDTrackListMacroType type)
 {
+  // Adds a macro (path/name) to the list associated with the "type" parameter.
+  // No checks are performed (fast) and no libraries are loaded. 
+  // Do use only, if library already exists!
+
   Char_t* entry = MakeMacroEntry(path, name);
   if (entry != 0)
   {
@@ -253,6 +321,8 @@ void AliEveTRDTrackList::AddMacroFast(const Char_t* path, const Char_t* name, Al
 //______________________________________________________
 void AliEveTRDTrackList::AddStandardMacros()
 {
+  // Adds standard macros to the lists.
+
   // Add your standard macros here, e.g.: 
   // To add a macro use:
   // AddMacro("$(ALICE_ROOT)/myFolder", "myMacroName.C");
@@ -268,6 +338,10 @@ void AliEveTRDTrackList::AddStandardMacros()
 //______________________________________________________
 Bool_t AliEveTRDTrackList::ApplyProcessMacros(TList* iterator)
 {
+  // Uses the iterator (for the selected process macros) to apply the selected macros to the data.
+  // Returns kTRUE on success, otherwise kFALSE. If there no process macros selected, kTRUE is returned 
+  // (this is no error!).
+
   // No process macros need to be processed
   if (iterator->GetEntries() <= 0)  return kTRUE;
 
@@ -553,6 +627,10 @@ Bool_t AliEveTRDTrackList::ApplyProcessMacros(TList* iterator)
 //______________________________________________________
 void AliEveTRDTrackList::ApplySelectionMacros(TList* iterator)
 {
+  // Uses the iterator (for the selected selection macros) to apply the selected macros to the data.
+  // The rnr-states of the tracks are set according to the result of the macro calls (kTRUE, if all
+  // macros return kTRUE for this track, otherwise: kFALSE).
+
   Char_t name[fkMaxMacroNameLength];
   Char_t cmd[(fkMaxMacroNameLength + fkMaxApplyCommandLength)];
 
@@ -676,6 +754,14 @@ void AliEveTRDTrackList::ApplySelectionMacros(TList* iterator)
 //______________________________________________________
 AliEveTRDTrackList::AliEveTRDTrackListMacroType AliEveTRDTrackList::GetMacroType(const Char_t* entry, Bool_t UseList)
 {
+  // Returns the type of the macro of the corresponding entry (i.e. "macro.C (Path: path)"). 
+  // If you have only the name and the path, you can simply use MakeMacroEntry.
+  // If "UseList" is kTRUE, the type will be looked up in the internal list (very fast). But if this list
+  // does not exist, you have to use kFALSE for this parameter. Then the type will be determined by the
+  // prototype! NOTE: It is assumed that the macro has been compiled! If not, the return value is not
+  // predictable, but normally will be kUnknown.
+  // Note: AddMacro(Fast) will update the internal list and RemoveProcess(/Selection)Macros respectively.
+
   AliEveTRDTrackListMacroType type = kUnknown;
 
   // Re do the check of the macro type
@@ -799,6 +885,8 @@ AliEveTRDTrackList::AliEveTRDTrackListMacroType AliEveTRDTrackList::GetMacroType
 //______________________________________________________
 Char_t* AliEveTRDTrackList::MakeMacroEntry(const Char_t* path, const Char_t* name)
 {
+  // Constructs an entry for the macro lists with path and name.  
+
   Char_t* entry = new Char_t[(fkMaxMacroPathNameLength + 30)];
   memset(entry, '\0', sizeof(Char_t) * (fkMaxMacroPathNameLength + 30));
 
@@ -813,6 +901,9 @@ Char_t* AliEveTRDTrackList::MakeMacroEntry(const Char_t* path, const Char_t* nam
 //______________________________________________________
 void AliEveTRDTrackList::RemoveProcessMacros(TList* iterator) 
 {
+  // Uses the iterator (for the selected process macros) to remove the process macros from 
+  // the corresponding list.
+   
   TObjString* obj = 0;
   for (Int_t i = 0; i < iterator->GetEntries(); i++)
   {
@@ -828,6 +919,9 @@ void AliEveTRDTrackList::RemoveProcessMacros(TList* iterator)
 //______________________________________________________
 void AliEveTRDTrackList::RemoveSelectionMacros(TList* iterator) 
 {
+  // Uses the iterator (for the selected selection macros) to remove the selection macros from 
+  // the corresponding list.
+  
   TObjString* obj = 0;
   for (Int_t i = 0; i < iterator->GetEntries(); i++)
   {
@@ -843,6 +937,8 @@ void AliEveTRDTrackList::RemoveSelectionMacros(TList* iterator)
 //______________________________________________________
 void AliEveTRDTrackList::UpdateTrackStyle(AliEveTRDTrack::AliEveTRDTrackState s, UChar_t ss)
 {
+  // Updates the track style and sets this style for each track.
+
   switch(s)
   {
     case AliEveTRDTrack::kSource:
index 86a6be8d2b15f83d63104c6b35268734f0bb47e4..36f6ccf4c021b56c532a09540aca55fd0aa7cd49 100644 (file)
@@ -1,6 +1,61 @@
+// Author: Alexandru Bercuci and Benjamin Hess
+// Last change: 23/09/2008
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
 #ifndef AliEveTRDTrackList_H
 #define AliEveTRDTrackList_H
 
+//////////////////////////////////////////////////////////////////////////
+//                                                                      //
+// AliEveTRDTrackList                                                   //
+//                                                                      //
+// An AliEveTRDTrackList is, in principal, a TEveElementList with some  //
+// sophisticated features. You can add macros to this list, which then  //
+// can be applied to the list of tracks (these tracks can be added to   //
+// the list in the same way as for the TEveElementList). In general,    //
+// please use AddMacro(...) for this purpose.                           //
+// Macros that are no longer needed can be removed from the list via    //
+// RemoveSelectionMacros(...) or RemoveProcessMacros(...) respectively. //
+// This function takes an iterator of the list of entries that are to   //
+// be removed. An entry looks like:                                     //
+// "MacroName.C (Path: MacroPath)". This is the way, the information    //
+// about a macro is stored in the AliEveTRDTrackList. If you have path  //
+// and name of a macro, use MakeMacroEntry(...) to get the corresponding//
+// entry. The type of the macros is stored in a map. You can get the    //
+// macro type via GetMacroType(...).                                    //
+// With ApplySelectionMacros(...) or ApplyProcessMacros(...)            //
+// respectively you can apply the macros to the track list via          //
+// iterators (same style like for RemoveProcessMacros(...) (cf. above)).//
+// Selection macros (de-)select macros according to a selection rule    //
+// by setting the rnr-state of the tracks.                              //
+// If multiple selection macros are applied, a track is selected, if    //
+// all selection macros select the track.                               //
+// Process macros create data or histograms, which will be stored in    //
+// a temporary file. The editor of this class will access this file     //
+// and draw all the stuff within it's DrawHistos() function. The file   //
+// will be deleted by the destructor.                                   //
+//                                                                      //
+// Currently, the following macro types are supported:                  //
+// Selection macros:                                                    //
+// Bool_t YourMacro(const AliTRDtrackV1*);                              //
+// Bool_t YourMacro(const AliTRDtrackV1*, const AliTRDtrackV1*);        //
+//                                                                      //
+// Process macros:                                                      //
+// void YourMacro(const AliTRDtrackV1*, Double_t*&, Int_t&);            //
+// void YourMacro(const AliTRDtrackV1*, const AliTRDtrackV1*,           //
+//                Double_t*&, Int_t&);                                  //
+// TH1* YourMacro(const AliTRDtrackV1*);                                //
+// TH1* YourMacro(const AliTRDtrackV1*, const AliTRDtrackV1*);          //
+//                                                                      //
+// The macros which take 2 tracks are applied to all pairs              //
+// fullfilling the selection criteria.                                  //
+//////////////////////////////////////////////////////////////////////////
+
+
 #include <TEveElement.h>
 #include <EveDet/AliEveTRDData.h>
 
@@ -62,38 +117,41 @@ public:
                                                                 // built, if it does not exist, or updated, if the 
                                                                 // macro code has been changed. If forceReload is
                                                                 // kTRUE, the library will always be (re-)built!
-  void AddMacroFast(const Char_t* entry,                        // Adds an entry to the corresponding list (cf. below)
-                    AliEveTRDTrackListMacroType type);     
+
+  void AddMacroFast(const Char_t* entry,                        // Adds an entry to the corresponding list (cf. 
+                    AliEveTRDTrackListMacroType type);          // overloaded function)
+
   void AddMacroFast(const Char_t* path, const Char_t* name,     // Adds a macro (path/name) to the list associated 
                     AliEveTRDTrackListMacroType type);          // with the "type" parameter.
                                                                 // No checks are performed (fast) and no libraries are
                                                                 // loaded. Do use only, if library already exists!
   virtual void AddStandardMacros();                             // Adds standard macros to the lists
+
   Bool_t ApplyProcessMacros(TList* iterator);                   // Uses the iterator (for the selected process 
                                                                 // macros) to apply the selected macros to the data.
-                                                                // Return kTRUE on success, otherwise kFALSE. If there
+                                                                // Returns kTRUE on success, otherwise kFALSE. If there
                                                                 // no process macros selected, kTRUE is returned (no 
                                                                 // error!).
-  void ApplySelectionMacros(TList* iterator);                   // Uses the iterator (for the selected selection
-                                                                // macros) to apply the selected macros to the data
-  AliEveTRDTrackListMacroType GetMacroType(const Char_t* entry, // Returns the type of the macro of the corresponding
-                                           Bool_t UseList = kTRUE);// entry (i.e. "macro.C (Path: path)"). If you have 
-                                                                // only the name and the path, you can simply use
-                                                                // MakeMacroEntry.
-                                                                // If "UseList" is kTRUE, the type will be looked up
-                                                                // in the internal list (very fast). But if this list
-                                                                // does not exist, you have to use kFALSE for this 
-                                                                // parameter. Then the type will be determined by the
-                                                                // prototype! NOTE: It is assumed that the macro has
-                                                                // been compiled! If not, the return value is not.
-                                                                // predictable, but normally will be kUnknown.
-                                                                // Note: AddMacro(Fast) will update the internal list 
-                                                                // and RemoveProcess(/Selection)Macros respectively.
+
+  // Uses the iterator (for the selected selection macros) to apply the selected macros to the data.
+  void ApplySelectionMacros(TList* iterator);                   
+
+  // Returns the type of the macro of the corresponding entry (i.e. "macro.C (Path: path)"). 
+  // If you have only the name and the path, you can simply use MakeMacroEntry.
+  // If "UseList" is kTRUE, the type will be looked up in the internal list (very fast). But if this list
+  // does not exist, you have to use kFALSE for this parameter. Then the type will be determined by the
+  // prototype! NOTE: It is assumed that the macro has been compiled! If not, the return value is not
+  // predictable, but normally will be kUnknown.
+  // Note: AddMacro(Fast) will update the internal list and RemoveProcess(/Selection)Macros respectively. 
+  AliEveTRDTrackListMacroType GetMacroType(const Char_t* entry, Bool_t UseList = kTRUE); 
+                                                               
   Char_t* MakeMacroEntry(const Char_t* path, const Char_t* name);  // Constructs an entry for the macro
                                                                    // lists with path and name   
+
   void RemoveProcessMacros(TList* iterator);                    // Uses the iterator (for the selected process
                                                                 // macros) to remove the process macros from 
-                                                                // the corresponding list.    
+                                                                // the corresponding list.   
   void RemoveSelectionMacros(TList* iterator);                  // Uses the iterator (for the selected selection
                                                                 // macros) to remove the selection macros from 
                                                                 // the corresponding list.  
@@ -144,7 +202,8 @@ protected:
   void SetSelectedTrackStyle(UChar_t index)                 // Sets the selected track style
     { fSelectedStyle = index;  }
 
-  void UpdateTrackStyle(AliEveTRDTrack::AliEveTRDTrackState s, UChar_t ss = 0); // Updates the track style
+  void UpdateTrackStyle(AliEveTRDTrack::AliEveTRDTrackState s, UChar_t ss = 0); // Updates the track style and sets
+                                                                                // this style for each track
 
 
 private:
index ab26ce5b3cb2799631856dc5a004430519e5d130..74d49a6b74bc183f54265f0d6a6186bd9c3a80fe 100644 (file)
@@ -1,3 +1,20 @@
+//////////////////////////////////////////////////////////////////////////
+//                                                                      //
+// The AliEveTRDTrackListEditor provides the graphical functionality    //
+// for the AliEveTRDTrackList. It creates the tabs and canvases, when   //
+// they are needed and, as well, frees allocated memory on destruction  //
+// (or if new events are loaded and thus some tabs are closed).         //
+// The function DrawHistos() accesses the temporary file created by the //
+// AliEveTRDTrackList and draws the desired data (the file will be      //
+// created within the call of ApplyMacros()). Have a look at this       //
+// function to learn more about the structure of the file and how to    //
+// access the data.                                                     //
+//                                                                      //
+// Authors :                                                            //
+//    A.Bercuci <A.Bercuci@gsi.de>                                      //
+//    B.Hess <Hess@Stud.Uni-Heidelberg.de>                              //
+//////////////////////////////////////////////////////////////////////////
+
 #include <EveDet/AliEveTRDData.h>
 #include <EveDet/AliEveTRDTrackList.h>
 #include "AliEveTRDTrackListEditor.h"
@@ -62,6 +79,8 @@ AliEveTRDTrackListEditor::AliEveTRDTrackListEditor(const TGWindow* p, Int_t widt
   fLine1(0), fLine2(0), fLine3(0), fLine4(0), fLine5(0),
   fCheckButtons(0)
 {
+  // Creates the AliEveTRDTrackListEditor.
+
   // Style stuff
   fLine5 = new TGHorizontal3DLine(this, 194, 8);
   AddFrame(fLine5, new TGLayoutHints(kLHintsLeft  | kLHintsTop, 2, 2, 8, 8));
@@ -205,6 +224,9 @@ AliEveTRDTrackListEditor::AliEveTRDTrackListEditor(const TGWindow* p, Int_t widt
 //______________________________________________________
 AliEveTRDTrackListEditor::~AliEveTRDTrackListEditor()
 {
+  // Destructor: Closes all tabs created by this object and
+  // frees the corresponding memory.
+
   if (fFileTypes != 0)
   {
     delete [] fFileTypes;
@@ -229,6 +251,9 @@ AliEveTRDTrackListEditor::~AliEveTRDTrackListEditor()
 //______________________________________________________
 void AliEveTRDTrackListEditor::AddMacro(const Char_t* path, const Char_t* name)
 {
+  // Adds the macro path/name to the macro list. A warning is provided, if there is
+  // something wrong, e.g. if the macro does not have the correct signature.
+
   Int_t result = fM->AddMacro(path, name);
 
   switch (result)
@@ -260,6 +285,8 @@ void AliEveTRDTrackListEditor::AddMacro(const Char_t* path, const Char_t* name)
 //______________________________________________________
 void AliEveTRDTrackListEditor::ApplyMacros()
 {
+  // Applies the selected macros and updates the view.
+
   Bool_t success = kFALSE;
 
   // First apply the selection macros
@@ -305,6 +332,9 @@ void AliEveTRDTrackListEditor::ApplyMacros()
 //______________________________________________________
 void AliEveTRDTrackListEditor::BrowseMacros()
 {
+  // Creates a file-dialog. The selected files will be added to the macro list
+  // via AddMacro(...).
+
   new TGFileDialog(gClient->GetRoot(), GetMainFrame(), kFDOpen, fFileInfo);
   
   if (fFileInfo->fIniDir != 0 && fFileInfo->fFileNamesList != 0)
@@ -335,6 +365,8 @@ void AliEveTRDTrackListEditor::BrowseMacros()
 //______________________________________________________
 void AliEveTRDTrackListEditor::CloseTabs()
 {
+  // Closes + deletes the tabs created by this object
+
   if (fHistoCanvas != 0)
   {
     // Close the created tab, if it exists
@@ -354,6 +386,9 @@ void AliEveTRDTrackListEditor::CloseTabs()
 //______________________________________________________
 void AliEveTRDTrackListEditor::DrawHistos()
 {
+  // Accesses the temporary data file created by the last call of ApplyMacros() and draws
+  // histograms according to the selection in the "Histograms"-tab.
   Int_t nHistograms = GetNSelectedHistograms();
   if (nHistograms <= 0)
   {
@@ -567,6 +602,8 @@ void AliEveTRDTrackListEditor::DrawHistos()
 //______________________________________________________
 Int_t AliEveTRDTrackListEditor::GetNSelectedHistograms()
 {
+  // Returns the number of selected macros (or rather: Their data) in the "Histograms"-tab
+
   Int_t count = 0;
   
   for (Int_t i = 0; i < fM->fDataFromMacroList->GetEntries(); i++)
@@ -580,6 +617,10 @@ Int_t AliEveTRDTrackListEditor::GetNSelectedHistograms()
 //______________________________________________________
 void AliEveTRDTrackListEditor::HandleMacroPathSet()
 {
+  // Takes the input of the text field (adding a macro), checks if the macro can be
+  // accessed (and that it exists) and adds the macro to the macro list via AddMacro(...).
+  // You can use environment variables in the text field, e.g. "$ALICE_ROOT/Eve/alice-macro/myMacro.C".
+
   if (strlen(fteField->GetText()) != 0)
   {  
     // Expand the pathname
@@ -642,6 +683,10 @@ void AliEveTRDTrackListEditor::HandleMacroPathSet()
 //______________________________________________________
 void AliEveTRDTrackListEditor::HandleNewEventLoaded()
 {
+  // Closes the tabs created by this object and sets a flag that will
+  // cause the function SetModel() to inherit the macro lists + style
+  // for the next AliEveTRDTrackList from the current one.
+
   // Inherit the macro list and track style for the next track list!
   fInheritSettings = kTRUE;
 
@@ -652,13 +697,18 @@ void AliEveTRDTrackListEditor::HandleNewEventLoaded()
 //______________________________________________________
 void AliEveTRDTrackListEditor::HandleTabChangedToIndex(Int_t index)
 {
+  // Saves the current tab in the current AliEveTRDTrackList.
+
   fM->SetSelectedTab(index);
 }
 
 //______________________________________________________
 void AliEveTRDTrackListEditor::InheritMacroList()
 {
-  // The old macro lists are stored in the corresponding list boxes -> add them to the track list
+  // The old macro lists are stored in the corresponding list boxes. This function will add
+  // these lists to the newly loaded AliEveTRDTrackList (or better replace the AliEveTRDTrackList's
+  // macro lists by these lists). With this, the settings will be inherited from the previously loaded
+  // AliEveTRDTrackList.
     
   // Selection macros
   fM->fMacroSelList->Delete();
@@ -680,7 +730,9 @@ void AliEveTRDTrackListEditor::InheritMacroList()
 //______________________________________________________
 void AliEveTRDTrackListEditor::InheritStyle()
 {
-  // The old styles are stored in the corresponding button groups -> set them in track list
+  // The old styles are stored in the corresponding button groups. This function will replace
+  // the style settings of the newly loaded AliEveTRDTrackList with the old styles. With this, the settings
+  // will be inherited from the previously loaded AliEveTRDTrackList.
 
   for (Int_t ind = 0; ind < 3; ind++)
   {
@@ -703,6 +755,8 @@ void AliEveTRDTrackListEditor::InheritStyle()
 //______________________________________________________
 void AliEveTRDTrackListEditor::RemoveMacros()
 {
+  // Removes the selected macros from the corresponding lists.
+
   TList* iterator = new TList();
   
   ftlMacroList->GetSelectedEntries(iterator);
@@ -727,6 +781,9 @@ void AliEveTRDTrackListEditor::RemoveMacros()
 //______________________________________________________
 void AliEveTRDTrackListEditor::SetDrawingToHistoCanvasTab()
 {
+  // Sets gPad to the tab with the name of the current AliEveTRDTrackList. If this tab does
+  // not exist, it will be created. Otherwise, it is re-used.
+
   // If the tab with the canvas has been closed, the canvas will be deleted.
   // So, if there is no tab, set the canvas pointer to zero and recreate it in a new tab.
   if (fHistoCanvas != 0) 
@@ -748,7 +805,9 @@ void AliEveTRDTrackListEditor::SetDrawingToHistoCanvasTab()
 //______________________________________________________
 void AliEveTRDTrackListEditor::SetModel(TObject* obj)
 {  
-  // Set model object
+  // Sets the model object, updates the related data in the GUI and
+  // inherits settings (cf. Inherit*(...)), if the flag fInheritSettings is set to kTRUE.
+
   fM = dynamic_cast<AliEveTRDTrackList*>(obj);
 
   if (fM == 0) 
@@ -796,6 +855,9 @@ void AliEveTRDTrackListEditor::SetModel(TObject* obj)
 //______________________________________________________
 void AliEveTRDTrackListEditor::SetTrackColor(Int_t ind)
 {
+  // Sets the color model for the tracks, updates the tracks with this model and
+  // redraws the scene.
+
   switch(ind)
   { 
     case AliTRDReconstructor::kLQPID:
@@ -815,6 +877,9 @@ void AliEveTRDTrackListEditor::SetTrackColor(Int_t ind)
 //______________________________________________________
 void AliEveTRDTrackListEditor::SetTrackModel(Int_t ind)
 {
+  // Sets the track model for the tracks, updates the tracks with this model and
+  // redraws the scene.
+
   switch(ind)
   { 
     case AliEveTRDTrack::kRieman:
@@ -834,6 +899,10 @@ void AliEveTRDTrackListEditor::SetTrackModel(Int_t ind)
 //______________________________________________________
 void AliEveTRDTrackListEditor::UpdateDataFromMacroListSelection()
 {
+  // Saves the current selection in the "Histograms"-tab to the current
+  // AliEveTRDTrackList. This means that the selection is updated and won't
+  // get lost, if another editor is loaded in Eve.
+
   for (Int_t i = 0; i < fM->fDataFromMacroList->GetEntries(); i++)
   {
     fM->SetHistoDataSelection(i, fCheckButtons[i]->IsOn());
@@ -843,6 +912,8 @@ void AliEveTRDTrackListEditor::UpdateDataFromMacroListSelection()
 //______________________________________________________
 void AliEveTRDTrackListEditor::UpdateHistoCanvasTab()
 {
+   // Updates the histogram and the corresponding tab (including titles).
+
   // Update name of the tab (tab has been set to current tab!)
   fHistoCanvasName->SetString(fM->GetName());  
 
@@ -859,6 +930,9 @@ void AliEveTRDTrackListEditor::UpdateHistoCanvasTab()
 //______________________________________________________
 void AliEveTRDTrackListEditor::UpdateHistoList()
 {
+  // Reloads (updates) the buttons in the "Histograms"-tab via
+  // the current AliEveTRDTrackList (data).
+
   fHistoSubFrame->TGCompositeFrame::Cleanup();
   
   // Set buttons for histograms
@@ -883,6 +957,9 @@ void AliEveTRDTrackListEditor::UpdateHistoList()
 //______________________________________________________
 void AliEveTRDTrackListEditor::UpdateMacroList()
 {
+  // Reloads (updates) the macro list (selection AND process macros) via
+  // the current AliEveTRDTrackList (data).
+
   ftlMacroList->RemoveAll();
  
   TObjString* iter = (TObjString*)fM->fMacroList->First();
@@ -927,6 +1004,10 @@ void AliEveTRDTrackListEditor::UpdateMacroList()
 //______________________________________________________
 void AliEveTRDTrackListEditor::UpdateMacroListSelection(Int_t ind)
 {
+  // Saves the current selection in the process macro list to the current
+  // AliEveTRDTrackList. This means that the selection is updated and won't
+  // get lost, if another editor is loaded in Eve.
+
   // Toggle selected item
   fM->SetMacroListSelection(ind, !fM->MacroListIsSelected(ind));
 }
@@ -934,6 +1015,10 @@ void AliEveTRDTrackListEditor::UpdateMacroListSelection(Int_t ind)
 //______________________________________________________
 void AliEveTRDTrackListEditor::UpdateMacroSelListSelection(Int_t ind)
 {
+  // Saves the current selection in the selection macro list to the current
+  // AliEveTRDTrackList. This means that the selection is updated and won't
+  // get lost, if another editor is loaded in Eve.
+
   // Toggle selected item
   fM->SetMacroSelListSelection(ind, !fM->MacroSelListIsSelected(ind));
 }
index 01123fd8f0d058929fe7399ae0c89da345f51943..90b1eb098936639f032e2e13a63cfecb206125bd 100644 (file)
@@ -1,6 +1,33 @@
+// Author: Alexandru Bercuci and Benjamin Hess
+// Last change: 23/09/2008
+/**************************************************************************
+ * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
+ * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for          *
+ * full copyright notice.                                                 *
+ **************************************************************************/
+
 #ifndef AliEveTRDTrackListEditor_H
 #define AliEveTRDTrackListEditor_H
 
+//////////////////////////////////////////////////////////////////////////
+//                                                                      //
+// AliEveTRDTrackListEditor                                             //
+//                                                                      //
+// The AliEveTRDTrackListEditor provides the graphical functionality    //
+// for the AliEveTRDTrackList. It creates the tabs and canvases, when   //
+// they are needed and, as well, frees allocated memory on destruction  //
+// (or if new events are loaded and thus some tabs are closed).         //
+// The function DrawHistos() accesses the temporary file created by the //
+// AliEveTRDTrackList and draws the desired data (the file will be      //
+// created within the call of ApplyMacros()). Have a look at this       //
+// function to learn more about the structure of the file and how to    //
+// access the data.                                                     //
+//                                                                      //
+// Authors :                                                            //
+//    A.Bercuci <A.Bercuci@gsi.de>                                      //
+//    B.Hess <Hess@Stud.Uni-Heidelberg.de>                              //
+//////////////////////////////////////////////////////////////////////////
+
 #include <TGedFrame.h>
 
 class AliEveTRDTrack;
@@ -40,7 +67,7 @@ public:
   void AddMacro(const Char_t* path, const Char_t* name);  // Adds macro to the macro list
   void ApplyMacros();                                     // Apply macros
   void BrowseMacros();                                    // Browse macros
-  void CloseTabs();                                       // Closes + deletes all the tabs opened created by this class
+  void CloseTabs();                                       // Closes + deletes all the tabs created by this class
   void DrawHistos();                                      // Draw histograms
   Int_t GetNSelectedHistograms();                         // Get the number of selected histograms for drawing
   void HandleMacroPathSet();                              // Handles the "macro path set"-signal
@@ -107,8 +134,7 @@ private:
   TGHorizontal3DLine *fLine4;
   TGHorizontal3DLine *fLine5;  
 
-  // Check buttons for histograms
-  TGCheckButton** fCheckButtons;
+  TGCheckButton** fCheckButtons;            // Check buttons for histograms
 
   // Help functions
   void SetDrawingToHistoCanvasTab();        // Sets focus on the tab for histograms and makes fHistoCanvas be the