+ // Returns the type of the corresponding macro.
+ // 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 RemoveMacros respectively.
+
+ AliEveTRDTrackListMacroType type = kUnknown;
+
+ // Re-do the check of the macro type
+ if (!UseList){
+ // Single track select macro or single track histo macro?
+ TFunction* f = gROOT->GetGlobalFunctionWithPrototype(name, "const AliTRDtrackV1*", kTRUE);
+ if (f != 0x0)
+ {
+ // Some additional check (is the parameter EXACTLY of the desired type?)
+ if (strstr(f->GetMangledName(), "oPconstsPAliTRDtrackV1mUsP") != 0x0)
+ {
+ // Single track select macro?
+ if (!strcmp(f->GetReturnTypeName(), "Bool_t"))
+ {
+ type = kSingleTrackSelect;
+ }
+ // single track histo macro?
+ else if (!strcmp(f->GetReturnTypeName(), "TH1*"))
+ {
+ type = kSingleTrackHisto;
+ }
+ }
+ }
+ // Single track analyse macro?
+ else if ((f = gROOT->GetGlobalFunctionWithPrototype(name, "const AliTRDtrackV1*, Double_t*&, Int_t&", kTRUE))
+ != 0x0)
+ {
+ if (!strcmp(f->GetReturnTypeName(), "void"))
+ {
+ // Some additional check (are the parameters EXACTLY of the desired type?)
+ if (strstr(f->GetMangledName(), "oPconstsPAliTRDtrackV1mUsP") != 0x0 &&
+ strstr(f->GetMangledName(), "cODouble_tmUaNsP") != 0x0 &&
+ strstr(f->GetMangledName(), "cOInt_taNsP") != 0x0)
+ {
+ type = kSingleTrackAnalyse;
+ }
+ }
+ }
+ // Correlated tracks select macro or correlated tracks histo macro?
+ else if ((f = gROOT->GetGlobalFunctionWithPrototype(name, "const AliTRDtrackV1*, const AliTRDtrackV1*", kTRUE))
+ != 0x0)
+ {
+ // Some additional check (is the parameter EXACTLY of the desired type?)
+ if (strstr(f->GetMangledName(), "oPconstsPAliTRDtrackV1mUsP") != 0x0 &&
+ strstr(f->GetMangledName(), "cOconstsPAliTRDtrackV1mUsP") != 0x0)
+ {
+ // Correlated track select macro?
+ if (!strcmp(f->GetReturnTypeName(), "Bool_t"))
+ {
+ type = kCorrelTrackSelect;
+ }
+ // Correlated track histo macro?
+ else if (!strcmp(f->GetReturnTypeName(), "TH1*"))
+ {
+ type = kCorrelTrackHisto;
+ }
+ }
+ }
+ // Correlated tracks analyse macro?
+ else if ((f = gROOT->GetGlobalFunctionWithPrototype(name,
+ "const AliTRDtrackV1*, const AliTRDtrackV1*, Double_t*&, Int_t&", kTRUE))
+ != 0x0)
+ {
+ if (!strcmp(f->GetReturnTypeName(), "void"))
+ {
+ // Some additional check (is the parameter EXACTLY of the desired type?)
+ if (strstr(f->GetMangledName(), "oPconstsPAliTRDtrackV1mUsP") != 0x0 &&
+ strstr(f->GetMangledName(), "cOconstsPAliTRDtrackV1mUsP") != 0x0 &&
+ strstr(f->GetMangledName(), "cODouble_tmUaNsP") != 0x0 &&
+ strstr(f->GetMangledName(), "cOInt_taNsP") != 0x0)
+ {
+ type = kCorrelTrackAnalyse;
+ }
+ }
+ }
+ }
+ // Use list to look up the macro type
+ else
+ {
+ TMacroData* macro = 0;
+ macro = (TMacroData*)fMacroList->GetValue(name);
+ if (macro == 0) return kUnknown;
+
+ type = macro->GetType();
+ switch (type)
+ {
+ case kSingleTrackSelect:
+ case kSingleTrackAnalyse:
+ case kSingleTrackHisto:
+ case kCorrelTrackSelect:
+ case kCorrelTrackAnalyse:
+ case kCorrelTrackHisto:
+ break;
+ default:
+ type = kUnknown;
+ break;
+ }
+ }