// 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;
+ }
}
}
}
#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>
fFileInfo->fMultipleSelection = kTRUE;
// Set focus on "Apply macros" tab
- //this->TGCompositeFrame::ShowFrame((TGFrame*)fMainFrame);
//fMainFrame->TGWindow::RequestFocus();
//Update();
}
+//______________________________________________________
AliEveTRDTrackListEditor::~AliEveTRDTrackListEditor()
{
if (fFileTypes != 0)
}
}
+//______________________________________________________
void AliEveTRDTrackListEditor::AddMacro(const Char_t* path, const Char_t* name)
{
Int_t result = fM->AddMacro(path, name);
}
}
+//______________________________________________________
void AliEveTRDTrackListEditor::ApplyMacros()
{
// First apply the selection macros
}
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);
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);
//if (fileInfo->fFileNamesList == 0) fileInfo->fFileNamesList = new TList();
}
+//______________________________________________________
void AliEveTRDTrackListEditor::DrawHistos()
{
Int_t nHistograms = GetNSelectedHistograms();
file = 0;
}
+//______________________________________________________
Int_t AliEveTRDTrackListEditor::GetNSelectedHistograms()
{
Int_t count = 0;
return count;
}
+//______________________________________________________
void AliEveTRDTrackListEditor::HandleMacroPathSet()
{
if (strlen(fteField->GetText()) != 0)
}
}
+//______________________________________________________
void AliEveTRDTrackListEditor::RemoveMacros()
{
TList* iterator = new TList();
iterator = 0;
}
+
+//______________________________________________________
void AliEveTRDTrackListEditor::SetModel(TObject* obj)
{
// Set model object
UpdateHistoList();
}
+//______________________________________________________
void AliEveTRDTrackListEditor::UpdateHistoList()
{
fHistoSubFrame->TGCompositeFrame::RemoveAll();
}
}
+
+//______________________________________________________
void AliEveTRDTrackListEditor::UpdateMacroList()
{
ftlMacroList->RemoveAll();