]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
-
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 10 Sep 2008 15:38:52 +0000 (15:38 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 10 Sep 2008 15:38:52 +0000 (15:38 +0000)
pop up only one histogram tab per track list and better macro
recognition procedure

EVE/EveDet/AliEveTRDTrackList.cxx
EVE/EveDet/AliEveTRDTrackListEditor.cxx

index 26505d8a4402f61978fa15d1d5c2984d8b0b5ddf..ddd1bf3b6b541be70e5a97b0ee75f89025743d0d 100644 (file)
@@ -125,24 +125,25 @@ Int_t AliEveTRDTrackList::AddMacro(const Char_t* path, const Char_t* nameC)
 
   // Selection macro?
   TFunction* f = gROOT->GetGlobalFunctionWithPrototype(name, "AliTRDtrackV1*", kTRUE);
-  if (f != 0x0)
-  {
-    if (!strcmp(f->GetReturnTypeName(), "Bool_t")) 
-    {
-      hasCorrectSignature = kTRUE;
-      isSelectionMacro = kTRUE;
+  if (f != 0x0){
+    if (!strcmp(f->GetReturnTypeName(), "Bool_t")){
+      // Some additional check (is the parameter EXACTLY of the desired type?)
+      if (strstr(f->GetMangledName(), "AliTRDtrackV1mUsP") != 0x0) {
+        hasCorrectSignature = kTRUE;
+        isSelectionMacro = kTRUE;
+      }
     }
-  }
-  // Process macro?
-  else
-  {
+  } else {  // Process macro?
     f = gROOT->GetGlobalFunctionWithPrototype(name, "AliTRDtrackV1*, Double_t*&, Int_t&", kTRUE);
-    if (f != 0x0)
-    {
-      if (!strcmp(f->GetReturnTypeName(), "void"))
-      {
-        hasCorrectSignature = kTRUE;
-        isSelectionMacro = kFALSE;
+    if (f != 0x0) {
+      if (!strcmp(f->GetReturnTypeName(), "void")) {
+        // Some additional check (are the parameters EXACTLY of the desired type?)
+        if (strstr(f->GetMangledName(), "AliTRDtrackV1mUsP") != 0x0 &&
+            strstr(f->GetMangledName(), "Double_tmUaNsP") != 0x0 &&
+            strstr(f->GetMangledName(), "Int_taNsP") != 0x0){
+          hasCorrectSignature = kTRUE;
+          isSelectionMacro = kFALSE;
+        }
       }
     }
   }
index b63670dec17431e4ce2efcdd32eb88a756830942..9490b18ba3f9b5c890069e5418916ced8b1d8802 100644 (file)
@@ -5,6 +5,7 @@
 #include <TGFileDialog.h>
 #include <TFile.h>
 #include <TGButton.h>
+#include <TGedEditor.h>     ////// MAYBE THIS CAN BE REMOVED
 #include <TGTextEntry.h>
 #include <TGTextView.h>
 #include <TGListBox.h>
@@ -124,11 +125,11 @@ AliEveTRDTrackListEditor::AliEveTRDTrackListEditor(const TGWindow* p, Int_t widt
   fFileInfo->fMultipleSelection = kTRUE;
 
   // Set focus on "Apply macros" tab
-  //this->TGCompositeFrame::ShowFrame((TGFrame*)fMainFrame);
   //fMainFrame->TGWindow::RequestFocus();
   //Update();
 }
 
+//______________________________________________________
 AliEveTRDTrackListEditor::~AliEveTRDTrackListEditor()
 {
   if (fFileTypes != 0)
@@ -144,6 +145,7 @@ AliEveTRDTrackListEditor::~AliEveTRDTrackListEditor()
   }
 }
 
+//______________________________________________________
 void AliEveTRDTrackListEditor::AddMacro(const Char_t* path, const Char_t* name)
 {
   Int_t result = fM->AddMacro(path, name);
@@ -174,6 +176,7 @@ void AliEveTRDTrackListEditor::AddMacro(const Char_t* path, const Char_t* name)
   }
 }
 
+//______________________________________________________
 void AliEveTRDTrackListEditor::ApplyMacros()
 {
   // First apply the selection macros
@@ -206,19 +209,18 @@ void AliEveTRDTrackListEditor::ApplyMacros()
   }
     
   TTree* t = 0;
-  for (Int_t i = 0; i < iterator->GetEntries(); i++)
-  {
+  for (Int_t i = 0; i < iterator->GetEntries(); i++) {
     t = (TTree*)file->Get(Form("TrackData%d", i));
-    if (t != 0)
-    {
+    if (t != 0) {
       gEve->AddCanvasTab(Form("Macro%d", i));
       t->Draw(Form("Macro%d", i), "1");
  
       delete t;
       t = 0;
-    }
-    else
-    {
+
+      // ONLY DISPLAY ONE MACRO (the first one possible) -> Remove the next line to display all
+      break;
+    } else {
       Error("Apply macros", Form("No data for macro%d found!", i));
       new TGMsgBox(gClient->GetRoot(), GetMainFrame(), "Error - Apply macros", 
                    Form("No data for macro%d found!", i), kMBIconExclamation, kMBOk);  
@@ -232,10 +234,14 @@ void AliEveTRDTrackListEditor::ApplyMacros()
   iterator = 0;  
 
   // Update histogram tab (data has to be reloaded)
+  //fHistoFrame->TGWindow::RequestFocus();
+  //fGedEditor->TGCompositeFrame::ShowFrame(fHistoFrame);
   SetModel(fM);
   Update();
 }
 
+
+//______________________________________________________
 void AliEveTRDTrackListEditor::BrowseMacros()
 {
   new TGFileDialog(gClient->GetRoot(), GetMainFrame(), kFDOpen, fFileInfo);
@@ -265,6 +271,7 @@ void AliEveTRDTrackListEditor::BrowseMacros()
   //if (fileInfo->fFileNamesList == 0)  fileInfo->fFileNamesList = new TList();
 }
 
+//______________________________________________________
 void AliEveTRDTrackListEditor::DrawHistos()
 {
   Int_t nHistograms = GetNSelectedHistograms();
@@ -379,6 +386,7 @@ void AliEveTRDTrackListEditor::DrawHistos()
   file = 0;
 }
 
+//______________________________________________________
 Int_t AliEveTRDTrackListEditor::GetNSelectedHistograms()
 {
   Int_t count = 0;
@@ -391,6 +399,7 @@ Int_t AliEveTRDTrackListEditor::GetNSelectedHistograms()
   return count;
 }
 
+//______________________________________________________
 void AliEveTRDTrackListEditor::HandleMacroPathSet()
 {
   if (strlen(fteField->GetText()) != 0)
@@ -446,6 +455,7 @@ void AliEveTRDTrackListEditor::HandleMacroPathSet()
   }
 }
 
+//______________________________________________________
 void AliEveTRDTrackListEditor::RemoveMacros()
 {
   TList* iterator = new TList();
@@ -465,6 +475,8 @@ void AliEveTRDTrackListEditor::RemoveMacros()
   iterator = 0;
 }
 
+
+//______________________________________________________
 void AliEveTRDTrackListEditor::SetModel(TObject* obj)
 {
   // Set model object
@@ -474,6 +486,7 @@ void AliEveTRDTrackListEditor::SetModel(TObject* obj)
   UpdateHistoList();  
 }
 
+//______________________________________________________
 void AliEveTRDTrackListEditor::UpdateHistoList()
 {
   fHistoSubFrame->TGCompositeFrame::RemoveAll();
@@ -495,6 +508,8 @@ void AliEveTRDTrackListEditor::UpdateHistoList()
   }  
 }
 
+
+//______________________________________________________
 void AliEveTRDTrackListEditor::UpdateMacroList()
 {
   ftlMacroList->RemoveAll();