Adding th new jdl, macro and executable - to be used as a template for the batch...
authorpanos <panos@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 Mar 2007 07:32:45 +0000 (07:32 +0000)
committerpanos <panos@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 29 Mar 2007 07:32:45 +0000 (07:32 +0000)
PWG2/AnalysisMacros/Batch/analysisESD.jdl [new file with mode: 0644]
PWG2/AnalysisMacros/Batch/root.sh [new file with mode: 0644]
PWG2/AnalysisMacros/Batch/runProcess.C [new file with mode: 0644]

diff --git a/PWG2/AnalysisMacros/Batch/analysisESD.jdl b/PWG2/AnalysisMacros/Batch/analysisESD.jdl
new file mode 100644 (file)
index 0000000..198caec
--- /dev/null
@@ -0,0 +1,41 @@
+# this is the startup process for root
+Executable="root.sh";
+Jobtag={"comment:AliEn tutorial batch example - ESD"};
+
+# we split per storage element
+Split="se";
+
+# we want each job to read 100 input files
+SplitMaxInputFileNumber="5";
+
+# this job has to run in the ANALYSIS partition
+Requirements=( member(other.GridPartitions,"Analysis") );
+
+# we need ROOT and the API service configuration package
+Packages={"APISCONFIG::V2.2","pchrist@ROOT::v5.15.04"};
+TTL = "30000";
+
+#ROOT will read this collection file to know, which files to analyze
+InputDataList="wn.xml";
+
+#ROOT requires the collection file in the xml-single format
+InputDataListFormat="merge:/alice/cern.ch/user/p/pchrist/test/ESD/global.xml";
+
+# this is our collection file containing the files to be analyzed
+InputDataCollection="LF:/alice/cern.ch/user/p/pchrist/test/ESD/global.xml,nodownload";
+
+InputFile= {"LF:/alice/cern.ch/user/p/pchrist/test/ESD/runProcess.C",
+            "LF:/alice/cern.ch/user/p/pchrist/test/ESD/demoBatch.C",
+            "LF:/alice/cern.ch/user/p/pchrist/test/ESD/ESD.par",
+            "LF:/alice/cern.ch/user/p/pchrist/test/ESD/ANALYSIS.par",
+            "LF:/alice/cern.ch/user/p/pchrist/test/ESD/AliAnalysisTaskPt.h",
+            "LF:/alice/cern.ch/user/p/pchrist/test/ESD/AliAnalysisTaskPt.cxx"};
+
+# Output archive           
+OutputArchive={"log_archive:stdout,stderr@Alice::CERN::se","root_archive.zip:*.root@Alice::CERN::se"};
+
+# Output directory
+OutputDir="/alice/cern.ch/user/p/pchrist/test/ESD/output/#alien_counter#";
+
+# email
+Email="Panos.Christakoglou@cern.ch";
diff --git a/PWG2/AnalysisMacros/Batch/root.sh b/PWG2/AnalysisMacros/Batch/root.sh
new file mode 100644 (file)
index 0000000..d2b686a
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+export GCLIENT_SERVER_LIST="pcapiserv04.cern.ch:10000|pcapiserv05.cern.ch:10000|pcapiserv06.cern.ch:10000|pcapiserv07.cern.ch:10000"
+echo ===========================
+echo $PATH 
+echo $ROOTSYS
+echo $LD_LIBRARY_PATH
+echo ==========================
+
+root -b -x runProcess.C;
+
diff --git a/PWG2/AnalysisMacros/Batch/runProcess.C b/PWG2/AnalysisMacros/Batch/runProcess.C
new file mode 100644 (file)
index 0000000..74697ff
--- /dev/null
@@ -0,0 +1,67 @@
+void runProcess() {
+  TStopwatch timer;
+  timer.Start();
+
+  printf("*** Connect to AliEn ***\n");
+  TGrid::Connect("alien://");
+  gSystem->Load("libProofPlayer.so");
+
+  //____________________________________________________//
+  //_____________Setting up ESD.par_____________________//
+  //____________________________________________________//
+  setupPar("ESD");
+  gSystem->Load("libVMC.so");
+  gSystem->Load("libESD.so");
+
+  //_____________________________________________________________//
+  //_____________Setting up ANALYSIS_NEW.par_____________________//
+  //_____________________________________________________________//
+  setupPar("ANALYSIS");
+  gSystem->Load("libANALYSIS.so");
+
+  gROOT->LoadMacro("AliAnalysisTaskPt.cxx+");
+  gROOT->LoadMacro("demoBatch.C");
+  demoBatch();
+
+  //gROOT->LoadMacro("CreateXML.C");
+  //CreateXML();
+
+  timer.Stop();
+  timer.Print();
+}
+
+Int_t setupPar(const char* pararchivename) {
+  ///////////////////
+  // Setup PAR File//
+  ///////////////////
+  if (pararchivename) {
+    char processline[1024];
+    sprintf(processline,".! tar xvzf %s.par",pararchivename);
+    gROOT->ProcessLine(processline);
+    const char* ocwd = gSystem->WorkingDirectory();
+    gSystem->ChangeDirectory(pararchivename);
+
+    // check for BUILD.sh and execute
+    if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
+      printf("*******************************\n");
+      printf("*** Building PAR archive    ***\n");
+      printf("*******************************\n");
+
+      if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
+        Error("runProcess","Cannot Build the PAR Archive! - Abort!");
+        return -1;
+      }
+    }
+    // check for SETUP.C and execute
+    if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
+      printf("*******************************\n");
+      printf("*** Setup PAR archive       ***\n");
+      printf("*******************************\n");
+      gROOT->Macro("PROOF-INF/SETUP.C");
+    }
+    
+    gSystem->ChangeDirectory("../");
+  }
+
+  return 1;
+}