Fix neccessary for local merge
[u/mrichter/AliRoot.git] / STEER / findAliasesForClass.C
CommitLineData
da35953a 1#include "ARVersion.h"
2#if !defined(__CINT__) || defined(__MAKECINT__)
3#include <TNamed.h>
4#include <THashList.h>
5#include <TObjArray.h>
6#include <TString.h>
7#include <TObjString.h>
8#endif
9
10TObjArray* findAliasesForClass(THashList &list, const char* className)
11{
12
13 TObjArray* matchingTrAliases = new TObjArray(2);
14 TNamed *n = dynamic_cast<TNamed*>(list.FindObject(className));
15 TString aliasList = n->GetTitle();
16 TObjArray* arrAliases = aliasList.Tokenize(',');
17 Int_t nAliases = arrAliases->GetEntries();
18 for(Int_t i=0; i<nAliases; i++){
19 TObjString *alias = dynamic_cast<TObjString*>(arrAliases->At(i));
20 matchingTrAliases->Add(alias);
21 }
22
23 return matchingTrAliases;
24}