Adapted for submission on the Grid
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Apr 2008 12:54:47 +0000 (12:54 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Apr 2008 12:54:47 +0000 (12:54 +0000)
PWG4/macros/ana.sh [new file with mode: 0755]
PWG4/macros/anaGammaAnalysis.C
PWG4/macros/anaSplitMerge.jdl [new file with mode: 0644]

diff --git a/PWG4/macros/ana.sh b/PWG4/macros/ana.sh
new file mode 100755 (executable)
index 0000000..00a6c2a
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+# ana.sh
+# 
+#
+# Created by schutz on 09.04.08.
+# Copyright 2008 ALICE. All rights reserved.
+
+export INDIR=$1
+export PATTERN=Run
+export NEVENT=$2
+export MODE=$3
+alienroot -b  <<EOF
+.L anaGammaAnalysis.C
+anaGammaAnalysis($MODE)
+EOF
index ff00296df769eb00581ffe3f1093c817b223be01..6ae27ecd353a7c4dd525bd69d1418533047cc67d 100644 (file)
@@ -26,10 +26,10 @@ enum anaModes {mLocal, mLocalCAF,mPROOF,mGRID};
 //Settings to read locally several files
 //The differnt values are default, they can be set with environmental 
 //variables: OUTDIR, PATTERN, NEVENT, respectivelly
-char * kInDir = "/data/"; 
-char * kPattern = "Run"; // Data are in diles /data/Run0, 
+char * kInDir = "/home/group/alice/schutz/analysis/PWG4/data"; 
+char * kPattern = ""; // Data are in diles /data/Run0, 
 // /Data/Run1 ...
-Int_t kEvent = 3; // Number of files
+Int_t kEvent = 1; // Number of files
 
 
 //Scale histograms from file. Change to kTRUE when xsection file exists
@@ -41,7 +41,7 @@ const char * kXSFileName = "pyxsec.root";
 const Int_t kNumberOfEventsPerFile = 100; 
 
 
-void anaGammaAnalysis(Int_t mode=mLocal, TString configName = "ConfigGammaAnalysis")
+void anaGammaAnalysis(Int_t mode=mLocal, TString configName = "ConfigESDGammaDirect")
 {
   // Main
   
@@ -217,41 +217,49 @@ void SetupPar(char* pararchivename, Bool_t decomp = kTRUE)
   //Load par files, create analysis libraries
   //For testing, if par file already decompressed and modified
   //classes then do not decompress.
+  TString cdir(Form("%s", gSystem->WorkingDirectory() )) ; 
+  TString parpar(Form("%s.par", pararchivename)) ; 
+  if ( gSystem->AccessPathName(parpar.Data()) ) {
+    gSystem->ChangeDirectory(gSystem->Getenv("ALICE_ROOT")) ;
+    TString processline(Form(".! make %s", parpar.Data())) ; 
+    gROOT->ProcessLine(processline.Data()) ;
+    gSystem->ChangeDirectory(cdir) ; 
+    processline = Form(".! mv /tmp/%s .", parpar.Data()) ;
+    gROOT->ProcessLine(processline.Data()) ;
+  } 
+  if ( gSystem->AccessPathName(pararchivename) ) {  
+    TString processline = Form(".! tar xvzf %s",parpar.Data()) ;
+    gROOT->ProcessLine(processline.Data());
+  }
 
-  if (pararchivename) {
-    char processline[1024];
-    if(decomp){
-      sprintf(processline,".! tar xvzf %s.par",pararchivename);
-      gROOT->ProcessLine(processline);
-    }
-    TString ocwd = gSystem->WorkingDirectory();
-    gSystem->ChangeDirectory(pararchivename);
+  TString 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");
     
-    // 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");
+    if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
+      Error("runProcess","Cannot Build the PAR Archive! - Abort!");
+      return -1;
     }
-    
-    gSystem->ChangeDirectory(ocwd.Data());
-    printf("Current dir: %s\n", ocwd.Data());
   }
+  // 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(ocwd.Data());
+  printf("Current dir: %s\n", ocwd.Data());
 }
 
 
+
 TChain * CreateChain(const anaModes mode, Double_t &xsection, Int_t &ntrials, Int_t &nfiles){
   //Creates data chain
   TChain *chain;
@@ -353,7 +361,9 @@ TChain * CreateChain(const anaModes mode, Double_t &xsection, Int_t &ntrials, In
       return ;
     }
 
-#ifdef WITHALIEN
+    gSystem->Load("libNetx.so") ; 
+    gSystem->Load("libRAliEn.so"); 
+    TGrid::Connect("alien://") ;
     TGridCollection * collection =  (TGridCollection*)gROOT->ProcessLine(Form("TAlienCollection::Open(\"%s\", 0)", kXML));
     if (! collection) {
       AliError(Form("%s not found", kXML)) ; 
@@ -361,14 +371,14 @@ TChain * CreateChain(const anaModes mode, Double_t &xsection, Int_t &ntrials, In
     }
     
     TGridResult* result = collection->GetGridResult("",0 ,0);
-    TList* analysisfilelist = result->GetFileInfoList();
-    
     // Makes the ESD chain 
     printf("*** Getting the Chain       ***\n");
-    chain->AddFileInfoList(analysisfilelist);
-    
-#endif
-
+    chain = new TChain("esdTree") ;
+    for (Int_t index = 0; index < result->GetEntries(); index++) {
+      TString alienURL = result->GetKey(index, "turl") ; 
+      cout << "================== " << alienURL << endl ; 
+      chain->Add(alienURL) ; 
+    }
   }// xml analysis
   
   gSystem->ChangeDirectory(ocwd.Data());
diff --git a/PWG4/macros/anaSplitMerge.jdl b/PWG4/macros/anaSplitMerge.jdl
new file mode 100644 (file)
index 0000000..bd70b1f
--- /dev/null
@@ -0,0 +1,31 @@
+Executable="/alice/cern.ch/user/s/schutz/bin/ana.sh";
+Jobtag ={"Analysis: Processing ESD collection for run $1"};
+Packages={"VO_ALICE@ROOT::v5-18-00b", "VO_ALICE@APISCONFIG::V2.4"};
+
+
+TTL=72000;
+
+InputFile={"LF:/alice/cern.ch/user/s/schutz/analysis/macro/anaGammaAnalysis.C",
+           "LF:/alice/cern.ch/user/s/schutz/analysis/macro/ConfigESDGammaDirect.C",
+           "LF:/alice/cern.ch/user/s/schutz/analysis/par/STEERBase.par",
+           "LF:/alice/cern.ch/user/s/schutz/analysis/par/ANALYSIS.par",
+           "LF:/alice/cern.ch/user/s/schutz/analysis/par/AOD.par",
+           "LF:/alice/cern.ch/user/s/schutz/analysis/par/PWG4Gamma.par",
+           "LF:/alice/cern.ch/user/s/schutz/analysis/par/ESD.par"};
+
+OutputArchive={"log_archive:stdout,stderr,*.log@ALICE::Subatech::DPM",
+               "root_archive:*.root@ALICE::Subatech::DPM"};
+
+OutputDir = "/alice/cern.ch/user/s/schutz/analysis/output/gammajetpp14/$1/#alien_split_03i#";
+
+InputDataCollection = "LF:/alice/cern.ch/user/s/schutz/analysis/collection/collection$1.xml,nodownload";
+
+InputDataListFormat = "xml-single";
+InputDataList = "collection.xml";
+
+Split = "se";
+
+SplitMaxInputFileNumber = "30";
+OutputFile="gammahistos.root";
+MergeOutputDir = "/alice/cern.ch/user/s/schutz/analysis/output/gammajetpp14";
+Merge = {"gammahistos.root:/alice/cern.ch/user/s/schutz/analysis/jdl/mergerootfile.jdl:gammahistos-merged.root"};