message: Use DownloadAODs.C from base class
diff: @@ -196,11 +196,6 @@ protected:
  TrainSetup::SaveSetup(asShellScript);
  SaveSummarize();
  SavedNdeta(asShellScript);
  -
  - if (!fRailway || fRailway->Mode() != Railway::kGrid) return;
  -
  - SaveDownloadAODs();
  - SaveMakeIndex();
  }
  void SavedNdeta(Bool_t asShellScript)
  {
  @@ -327,68 +322,6 @@ protected:
  << "// EOF" << std::endl;
  f.close();
  }
  - /**
  - * Make a ROOT Script to download the generated AODs
  - *
  - */
  - void SaveDownloadAODs()
  - {
  - std::ofstream f("DownloadAODs.C");
  - if (!f) {
  - Error("SaveDownloadAODs", "Failed to open DownloadAODs.C");
  - return;
  - }
  - f << "// Generated by " << ClassName() << "\n"
  - << "void DownloadAODs(Bool_t force=false)\n"
  - << "{\n"
  - << " if (!TGrid::Connect(\"alien://\")) {\n"
  - << " Error(\"DownloadAODs\",\"Failed to connect to AliEn\");\n"
  - << " return;\n"
  - << " }\n\n"
  - << " TString dir(\"" << fRailway->OutputPath() << "\");\n"
  - << " TString pat(\"*/AliAOD.root\");\n"
  - << " TGridResult* r = gGrid->Query(dir,pat);\n"
  - << " if (!r) {\n"
  - << " Error(\"DownloadAODs\",\"No result from query\");\n"
  - << " return;\n"
  - << " }\n\n"
  - << " Int_t n = r->GetEntries();\n"
  - << " Printf(\"=== Got a total of %d AOD files\",n);\n"
  - << " for (Int_t i = 0; i < n; i++) {\n"
  - << " TString path(r->GetKey(i, \"turl\"));\n"
  - << " TString dir(gSystem->DirName(path));\n"
  - << " TString sub(gSystem->BaseName(dir));\n"
  - << " TString subsub(gSystem->BaseName(gSystem->DirName(dir)));\n"
  - << " TString out = TString::Format(\"AliAOD_%s_%s.root\",\n"
  - << " subsub.Data(),sub.Data());\n"
  - << " if (!gSystem->AccessPathName(out.Data()) && !force) {\n"
  - << " Printf(\"=== Already have %s\",out.Data());\n"
  - << " continue;\n"
  - << " }\n"
  - << " Printf(\"=== Getting %s %s (%3d/%3d)\",\n"
  - << " subsub.Data(),sub.Data(),i,n);\n"
  - << " if (!TFile::Cp(path, out)) {\n"
  - << " Warning(\"DownloadAODs\",\"Failed to copy %s -> %s\",\n"
  - << " path.Data(), out.Data());\n"
  - << " continue;\n"
  - << " }\n"
  - << " }\n"
  - << "}\n"
  - << "// EOF\n"
  - << std::endl;
  - f.close();
  - }
  - void SaveMakeIndex()
  - {
  - std::ofstream out("MakeIndex.C");
  - out << "// Made by " << ClassName() << "\n"
  - << "void MakeIndex() {\n"
  - << " gROOT->LoadMacro(\"$ALICE_PHYSICS/PWGLF/FORWARD/trains/CreateIndex.C\");\n"
  - << " CreateIndex(\".\",\"aodTree\");\n"
  - << "}\n"
  - << "// EOD" << std::endl;
  - out.close();
  - }
  void PostShellCode(std::ostream& f)
  {
  f << " echo \"=== Summarizing results ...\"\n"
  