]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/findAliasesForClass.C
Correct handling of seeds for MC on the fly trains
[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));
13c9b3a4 15 if(!n){
16 Printf("No entry for a trigger-class named \"%s\"",className);
17 return;
18 }
da35953a 19 TString aliasList = n->GetTitle();
20 TObjArray* arrAliases = aliasList.Tokenize(',');
21 Int_t nAliases = arrAliases->GetEntries();
22 for(Int_t i=0; i<nAliases; i++){
23 TObjString *alias = dynamic_cast<TObjString*>(arrAliases->At(i));
24 matchingTrAliases->Add(alias);
25 }
26
27 return matchingTrAliases;
28}