]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/AliAnalysisAlien.cxx
Histograms axis for new latency window
[u/mrichter/AliRoot.git] / ANALYSIS / AliAnalysisAlien.cxx
index 1b124924868ddf3cef9e0c8460b8f6c194160712..628834b5d35ddb4a0bda96085f1bccb35f4de787 100644 (file)
@@ -922,6 +922,7 @@ Bool_t AliAnalysisAlien::CreateJDL()
          TIter next(fPackages);
          TObject *obj;
          while ((obj=next())) {
+            if (FileExists(obj->GetName())) gGrid->Rm(obj->GetName());
             Info("CreateJDL", "\n#####   Copying dependency: <%s> to your alien workspace", obj->GetName());
             TFile::Cp(Form("file:%s",obj->GetName()), Form("alien://%s/%s", workdir.Data(), obj->GetName()));
          }   
@@ -1800,20 +1801,21 @@ void AliAnalysisAlien::WriteAnalysisMacro()
       out << "   gSystem->Load(\"libPhysics\");" << endl << endl;
       out << "   gSystem->Load(\"libMinuit\");" << endl << endl;
       if (fAdditionalRootLibs.Length()) {
-       // in principle libtree /lib geom libvmc etc. can go into this list, too
-       out << "// Add aditional libraries" << endl;
-       TObjArray *list = fAdditionalRootLibs.Tokenize(" ");
-       TIter next(list);
-       TObjString *str;
-       while((str=(TObjString*)next())) {
-         if (str->GetString().Contains(".so"))
-           out << "   gSystem->Load(\"" << str->GetString().Data() << "\");" << endl;
+         // in principle libtree /lib geom libvmc etc. can go into this list, too
+         out << "// Add aditional libraries" << endl;
+         TObjArray *list = fAdditionalRootLibs.Tokenize(" ");
+         TIter next(list);
+         TObjString *str;
+         while((str=(TObjString*)next())) {
+            if (str->GetString().Contains(".so"))
+            out << "   gSystem->Load(\"" << str->GetString().Data() << "\");" << endl;
          }
-       if (list) delete list;
+         if (list) delete list;
       }
+      out << "// include path" << endl;
+      if (fIncludePath.Length()) out << "   gSystem->AddIncludePath(\"" << fIncludePath.Data() << "\");" << endl;
+      out << "   gSystem->AddIncludePath(\"-I$ALICE_ROOT/include\");" << endl << endl;
       out << "// Load analysis framework libraries" << endl;
-
-
       if (!fPackages) {
          out << "   gSystem->Load(\"libSTEERBase\");" << endl;
          out << "   gSystem->Load(\"libESD\");" << endl;
@@ -1877,9 +1879,6 @@ void AliAnalysisAlien::WriteAnalysisMacro()
             out << "   if (!SetupPar(\"" << obj->GetName() << "\")) return;" << endl;
          }   
       }   
-      out << "// include path" << endl;
-      if (fIncludePath.Length()) out << "   gSystem->AddIncludePath(\"" << fIncludePath.Data() << "\");" << endl;
-      out << "   gSystem->AddIncludePath(\"-I$ALICE_ROOT/include\");" << endl << endl;
       if (fAdditionalLibs.Length()) {
          out << "// Add aditional AliRoot libraries" << endl;
          TObjArray *list = fAdditionalLibs.Tokenize(" ");
@@ -1937,6 +1936,13 @@ void AliAnalysisAlien::WriteAnalysisMacro()
       out << "      return;" << endl;
       out << "   }" << endl << endl;
       out << "   mgr->PrintStatus();" << endl;
+      if (AliAnalysisManager::GetAnalysisManager()) {
+         if (AliAnalysisManager::GetAnalysisManager()->GetDebugLevel()>2) {
+            out << "   gEnv->SetValue(\"XNet.Debug\", \"1\");" << endl;
+         } else {
+            out << "   AliLog::SetGlobalLogLevel(AliLog::kError);" << endl;
+         }
+      }   
       out << "   mgr->StartAnalysis(\"localfile\", chain);" << endl;
       out << "   timer.Stop();" << endl;
       out << "   timer.Print();" << endl;
@@ -2156,9 +2162,15 @@ void AliAnalysisAlien::WriteProductionFile(const char *filename) const
    out << locjdl << " " << njobspermaster << endl;
    Int_t nmasterjobs = fInputFiles->GetEntries();
    for (Int_t i=0; i<nmasterjobs; i++) {
-      out << Form("%s", fInputFiles->At(i)->GetName()) << " " << Form("%03d", i) << endl;
+      TString runOutDir = gSystem->BaseName(fInputFiles->At(i)->GetName());
+      runOutDir.ReplaceAll(".xml", "");
+      if (fOutputToRunNo)
+         out << Form("%s", fInputFiles->At(i)->GetName()) << " " << runOutDir << endl;
+      else
+         out << Form("%s", fInputFiles->At(i)->GetName()) << " " << Form("%03d", i) << endl;
    }
    Info("WriteProductionFile", "\n#####   Copying production file <%s> to your work directory", filename);
+   if (FileExists(filename)) gGrid->Rm(filename);
    TFile::Cp(Form("file:%s",filename), Form("alien://%s/%s", workdir.Data(),filename));   
 }