Possibility to store CAF output files on alien (Renu)
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 20 Sep 2009 13:06:06 +0000 (13:06 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 20 Sep 2009 13:06:06 +0000 (13:06 +0000)
PWG3/vertexingHF/RunAnalysisAODVertexingHF.C

index 8ce6096..e335a46 100644 (file)
@@ -15,12 +15,15 @@ void RunAnalysisAODVertexingHF()
 \r
   gSystem->SetIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT -I$ALICE_ROOT/include -I$ALICE_ROOT/ITS -I$ALICE_ROOT/TPC -I$ALICE_ROOT/CONTAINERS -I$ALICE_ROOT/STEER -I$ALICE_ROOT/TRD -I$ALICE_ROOT/macros -I$ALICE_ROOT/ANALYSIS -I$ALICE_ROOT/PWG3 -I$ALICE_ROOT/PWG3/vertexingHF -g"); \r
   //\r
+  TString trainName = "Test";\r
   TString analysisMode = "grid"; // "local", "grid", or "proof"\r
   TString inputMode    = "list"; // "list", "xml", or "dataset"\r
   Long64_t nentries=1234567890,firstentry=0;\r
   Bool_t useParFiles=kFALSE;\r
   Bool_t useAlienPlugin=kTRUE;\r
   TString pluginmode="test";\r
+  Bool_t saveProofToAlien=kFALSE;\r
+  TString proofOutdir = "";\r
   TString loadMacroPath="$ALICE_ROOT/PWG3/vertexingHF/";\r
   //TString loadMacroPath="./"; // this is normally needed for CAF\r
   //\r
@@ -34,6 +37,23 @@ void RunAnalysisAODVertexingHF()
     gEnv->SetValue("XSec.GSI.DelegProxy","2");\r
     TProof::Open("alicecaf");\r
     //TProof::Reset("alicecaf");\r
+    if(saveProofToAlien) {\r
+      TGrid::Connect("alien://");\r
+      if(gGrid) {\r
+       TString homedir = gGrid->GetHomeDirectory();\r
+       TString workdir = homedir + trainName;\r
+       if(!gGrid->Cd(workdir)) {\r
+         gGrid->Cd(homedir);\r
+         if(gGrid->Mkdir(workdir)) {\r
+           gGrid->Cd(trainName);\r
+           ::Info("VertexingTrain::Connect()", "Directory %s created", gGrid->Pwd());\r
+         }\r
+       }          \r
+       gGrid->Mkdir("proof_output");\r
+       gGrid->Cd("proof_output");\r
+       proofOutdir = Form("alien://%s", gGrid->Pwd());\r
+      } \r
+    }\r
   }\r
 \r
 \r
@@ -149,10 +169,12 @@ void RunAnalysisAODVertexingHF()
   // Connect plug-in to the analysis manager\r
   if(useAlienPlugin) mgr->SetGridHandler(alienHandler);\r
 \r
-\r
   // Input\r
   AliAODInputHandler *inputHandler = new AliAODInputHandler();\r
-  if(analysisMode=="proof") inputHandler->AddFriend("AliAOD.VertexingHF.root");\r
+  if(analysisMode=="proof") {\r
+    inputHandler->AddFriend("AliAOD.VertexingHF.root");\r
+    if(saveProofToAlien) mgr->SetSpecialOutputLocation(proofOutdir);\r
+  }\r
   mgr->SetInputEventHandler(inputHandler);\r
   //-------------------------------------------------------------------\r
 \r