Correcly adds prefix to AddRunNumber list of entries (S.Carrazza)
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 7 Apr 2011 09:41:34 +0000 (09:41 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 7 Apr 2011 09:41:34 +0000 (09:41 +0000)
ANALYSIS/AliAnalysisAlien.cxx

index 3e78fb7..a752bc3 100644 (file)
@@ -411,8 +411,17 @@ void AliAnalysisAlien::AddRunList(const char* runList)
 void AliAnalysisAlien::AddRunNumber(const char* run)
 {
 // Add a run number to the list of runs to be processed.
-   if (fRunNumbers.Length()) fRunNumbers += " ";
-   fRunNumbers += run;
+   TString runs = run;
+   TObjString *os;
+   TObjArray *arr = runs.Tokenize(" ");
+   TIter next(arr);
+   TString prefix; 
+   prefix.Append(fRunPrefix, fRunPrefix.Index("%d"));
+   while ((os=(TObjString*)next())){
+       if (fRunNumbers.Length()) fRunNumbers += " ";
+       fRunNumbers += Form("%s%s", prefix.Data(), os->GetString().Data());
+   }
+   delete arr;
 }   
 
 //______________________________________________________________________________