Write some scripts
authorcholm <Christian.Holm.Christensen@cern.ch>
Tue, 18 Nov 2014 09:55:03 +0000 (10:55 +0100)
committercholm <Christian.Holm.Christensen@cern.ch>
Tue, 18 Nov 2014 09:55:03 +0000 (10:55 +0100)
PWGLF/FORWARD/analysis2/trains/MakeFMDMCTrackTrain.C

index 53d23bd..01f39e9 100644 (file)
@@ -126,6 +126,9 @@ protected:
   {
     TrainSetup::SaveSetup(asShellScript);
     SaveSummarize();
+    SaveAnalyseNTuple();
+    SaveReFit();
+
 
     if (!fRailway || fRailway->Mode() != Railway::kGrid) return;
 
@@ -213,6 +216,56 @@ protected:
       << std::endl;
     f.close();
   }   
+  /** 
+   * Make a ROOT Script to download the generated AODs
+   * 
+   */
+  void SaveAnalyseNTuple()
+  {
+    std::ofstream f("AnalyseNTuple.C");
+    if (!f) { 
+      Error("SaveAnalyseNTuple", "Failed to open AnalyseNTuple.C");
+      return;
+    }
+    f << "// Generated by " << ClassName() << "\n"
+      << "// Process with bare ROOT in ProofLite\n"
+      << "void AnalyseNTuple(Bool_t proof=true,\n"
+      << "                   Long64_t max=-1,\n"
+      << "                   const char* opt=\"\")\n"
+      << "{\n"
+      << "  const char* fwd=\"$ALICE_ROOT/PWGLF/FORWARD/analysis2\";\n"
+      << "  gSystem->AddIncludePath(\"-I${ALICE_ROOT}/include\");\n"
+      << "  gROOT->Macro(Form(\"%s/scripts/LoadLibs.C\",fwd));\n"
+      << "  gROOT->LoadMacro(Form(\"%s/scripts/TupleSelector.C+%s\",\n"
+      << "                        fwd, opt));\n"
+      << "  if (proof) TupleSelector::Proof(maxEvents, opt);\n"
+      << "  else       TupleSelector::Run(maxEvents);\n"
+      << "}\n"
+      << "// EOF" << std::endl;
+    f.close();
+  }
+  void SaveReFit()
+  {
+    std::ofstream f("ReFit.C");
+    if (!f) { 
+      Error("SaveRerun", "Failed to open ReFit.C script");
+      return;
+    }
+    f << std::boolalpha 
+      << "// Generated by " << ClassName() << "\n"
+      << "// If force=true, then force set parameters\n"
+      << "//\n"
+      << "void ReFit(Bool_t      force=false,\n"
+      << "           const char* filename=\"forward_mctracks.root\")\n"
+      << "{\n"
+      << "  const char* fwd=\"$ALICE_ROOT/PWGLF/FORWARD/analysis2\";\n"
+      << "  gROOT->LoadMacro(Form(\"%s/corrs/RerunTrackELoss.C\",fwd));\n"
+      << "  RerunTrackELoss(force,filename);\n"
+      << "}\n"
+      << "// EOF" << std::endl;
+    f.close();
+  }
+
   void PostShellCode(std::ostream& f)
   {
     f << "  echo \"=== Summarizing results ...\"\n"