Adding new type of jobs (Marian)
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 Feb 2008 16:02:45 +0000 (16:02 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 8 Feb 2008 16:02:45 +0000 (16:02 +0000)
TPC/macros/testTPC/AliTPCjobs.cxx
TPC/macros/testTPC/action.sh [new file with mode: 0755]

index 34493d8..43d7f6f 100644 (file)
@@ -6,6 +6,7 @@
 .L $ALICE_ROOT/TPC/macros/testTPC/AliTPCjobs.cxx+
 AliTPCJobs jobs;
 jobs.fJobFile="job.list"
+jobs.ProcessAllJobs();
 */
 class AliTPCJobs : public TNamed{
 public:
@@ -20,8 +21,10 @@ public:
 
   TString  fJobFile;    
   TString  fWorkDir;
+  ClassDef(AliTPCJobs,0)
 };
 
+ ClassImp(AliTPCJobs)
 
 AliTPCJobs::AliTPCJobs(){
   // 
@@ -38,7 +41,7 @@ void AliTPCJobs::ProcessAllJobs(){
   Int_t counter=0;
   while (GetNextJob()){
     //
-    printf("PROCESSING JOB\n",counter);
+    printf("PROCESSING JOB\t%d\n",counter);
     counter++;
     if (!GetNextJob()) break;   
   }
@@ -104,6 +107,14 @@ void AliTPCJobs::ProcessJob(TString jobID, TString inputData, TString outputDir,
     printf("Exec\t%s\n", command);
     gSystem->Exec(command);
     //TFile::Cp(inputData.Data(), outputDir.Data());
+  }else{
+    char command[10000];
+    sprintf(command,"$ALICE_ROOT/TPC/macros/testTPC/action.sh %s %s %s %s", jobID.Data(), inputData.Data(), outputDir.Data(), action.Data());
+    printf("%s\n\n",command);
+    gSystem->Exec(command);
+    printf("\n\n");
+
   }
+  
   SetDone(jobID);
 }
diff --git a/TPC/macros/testTPC/action.sh b/TPC/macros/testTPC/action.sh
new file mode 100755 (executable)
index 0000000..d7512f6
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/bash
+#aguments
+#1 TString jobID, 
+#2 TString inputData
+#3 TString outputDir
+#4 TString   action
+
+echo $1
+echo $2
+echo $3
+echo $4
+
+
+mkdir -p /tmp/$USER/$1
+cd /tmp/$USER/$1
+which  xrdcp
+
+command xrdcp $2 data.root
+
+echo aliroot -b -q $ALICE_ROOT/TPC/macros/testTPC/$4.C
+
+command aliroot -b -q $ALICE_ROOT/TPC/macros/testTPC/$4.C
+
+for name in `ls *.root`; do
+  xrdcp $name $3/$4/$name
+done
+
+
+