o fix problems in ITS pid when using probabilities (combined pid) - Benjamin, Stefano
[u/mrichter/AliRoot.git] / STEER / macros / findClassesForAlias.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* findClassesForAlias(THashList &list, const char* aliasName)
11{
12
13 TObjArray* matchingTrClasses = new TObjArray(2);
14 TIter iter(&list);
15 TNamed *n = 0;
16 iter.Reset();
17 while((n = dynamic_cast<TNamed*>(iter.Next()))){
18 TString aliasList(n->GetTitle());
19 if(aliasList.Contains(aliasName)){
20 TObjArray* arrAliases = aliasList.Tokenize(',');
21 Int_t nAliases = arrAliases->GetEntries();
22 for(Int_t i=0; i<nAliases; i++){
23 TObjString *alias = (TObjString*) arrAliases->At(i);
da35953a 24 if(alias->String()==TString(aliasName)){
25 TObjString *trClass = new TObjString(n->GetName());
26 matchingTrClasses->Add(trClass);
27 }
28 }
29 }
30 }
31
13c9b3a4 32 if (matchingTrClasses->GetEntries() == 0){
33 Printf("No entries for the trigger alias \"%s\" were found. Returning null pointer.", aliasName);
34 return 0;
35 }
36
da35953a 37 return matchingTrClasses;
38}