Make the macros run for PROOF and PROOFLite
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 May 2009 16:26:21 +0000 (16:26 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 4 May 2009 16:26:21 +0000 (16:26 +0000)
PWG2/FEMTOSCOPY/AliFemto/AliAnalysisTaskFemto.cxx
PWG2/FEMTOSCOPY/macros/AddTaskFemto.C
PWG2/FEMTOSCOPY/macros/Proof/runProof.C
PWG2/FEMTOSCOPY/macros/Train/PWG2Train2/ConfigFemtoAnalysis.C

index 42d3fc66c567f76b6c575035ad5ecd1973ef8940..42eb885357ee0d669a3f919b35ea8bb592c712f6 100644 (file)
@@ -11,6 +11,7 @@
 #include "TCanvas.h"\r
 #include "TSystem.h"\r
 #include "TFile.h"\r
+#include "TInterpreter.h"\r
 \r
 #include "AliAnalysisTask.h"\r
 \r
@@ -27,7 +28,7 @@ ClassImp(AliAnalysisTaskFemto)
 \r
 // Default name for the setup macro of femto analysis  \r
 // This function MUST be defined in the separate file !!!\r
-extern AliFemtoManager *ConfigFemtoAnalysis();\r
+// extern AliFemtoManager *ConfigFemtoAnalysis();\r
 \r
 //________________________________________________________________________\r
   AliAnalysisTaskFemto::AliAnalysisTaskFemto(const char *name): \r
@@ -135,7 +136,9 @@ void AliAnalysisTaskFemto::ConnectInputData(Option_t *) {
 void AliAnalysisTaskFemto::CreateOutputObjects() {\r
   printf("Creating Femto Analysis objects\n");\r
 \r
-  SetFemtoManager(ConfigFemtoAnalysis());\r
+  gROOT->LoadMacro("ConfigFemtoAnalysis.C");\r
+  //  fJetFinder = (AliJetFinder*) gInterpreter->ProcessLine("ConfigJetAnalysis()");\r
+  SetFemtoManager((AliFemtoManager *) gInterpreter->ProcessLine("ConfigFemtoAnalysis()"));\r
 \r
   TList *tOL;\r
   fOutputList = fManager->Analysis(0)->GetOutputList();\r
index ba8770cc95de6c274c1d15d7295a99bcae85fb05..8796d89113cd8a52d4f7e52e5138683666a2fe4b 100644 (file)
@@ -30,7 +30,14 @@ AliAnalysisTaskFemto *AddTaskFemto()
   // C. Create the task, add it to manager.
   //===========================================================================
   gSystem->SetIncludePath("-I$ROOTSYS/include  -I./PWG2AOD/AOD -I./PWG2femtoscopy/FEMTOSCOPY/AliFemto -I./PWG2femtoscopyUser/FEMTOSCOPY/AliFemtoUser -I$ALICE_ROOT/include");
-  gROOT->LoadMacro("ConfigFemtoAnalysis.C++");
+  if (dynamic_cast<TProofLite *> gProof) {
+    gProof->Exec(".L ConfigFemtoAnalysis.C");
+  }
+  else if (gProof) {
+    gProof->Load("ConfigFemtoAnalysis.C");
+  }
+  //  gROOT->LoadMacro("ConfigFemtoAnalysis.C++");
+
   AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto");
   mgr->AddTask(taskfemto);
 
index ec758cf50be76840526619eb017134a27bc2f09a..234bfec1b3d18380ab86044fc84d033f36952068 100644 (file)
@@ -1,23 +1,16 @@
-void runProof(int dataType=0, const char *dataSource="ESD82XX_30K.txt") {
-  // Run on PROOF with data from:
-  // dataType =
-  // 0 - a local file list
-  // 1 - a PROOF dataset
-  // 
-  // for dataTpye = 0
-  // dataSource is the list file name
-  // for dataType = 1
-  // dataSource is the PROOF dataset name
-
+void runProof(const char *chainlistfile, int nEvents=0, int offset=0, int domc=0, int prooflite=0) {
   TStopwatch timer;
   timer.Start();
+  
+  printf("*** Open PROOF ***");
+  if (prooflite) 
+    TProof::Open("");
+  else
+    TProof::Open("alicecaf");
 
-  printf("*** Connect to PROOF ***\n");
-  // ****
-  // You have to change this to Your own username !!!!
-  TProof::Open("akisiel@lxb6046.cern.ch");
-  //
-  // ****
+  gSystem->Load("libProofPlayer.so");
+  gSystem->Load("libVMC.so");
+  gSystem->Load("libXMLIO.so");
 
   gProof->UploadPackage("STEERBase.par");
   gProof->EnablePackage("STEERBase");
@@ -35,49 +28,81 @@ void runProof(int dataType=0, const char *dataSource="ESD82XX_30K.txt") {
   gProof->EnablePackage("PWG2femtoscopy");
   gProof->UploadPackage("PWG2femtoscopyUser.par");
   gProof->EnablePackage("PWG2femtoscopyUser");
-  gSystem->SetIncludePath("-I$ROOTSYS/include -I./PWG2femtoscopy/FEMTOSCOPY/AliFemto -I./PWG2femtoscopyUser/FEMTOSCOPY/AliFemtoUser -I./ESD -I./AOD -I./ANALYSIS -I./PWG2AOD/AOD");
-  gProof->AddIncludePath("./PWG2AOD/AOD");
-  gProof->AddIncludePath("./PWG2femtoscopy/FEMTOSCOPY/AliFemto");
-  gProof->AddIncludePath("./PWG2femtoscopyUser/FEMTOSCOPY/AliFemtoUser");
+    
+  gSystem->SetIncludePath("-I$ROOTSYS/include -I./STEERBase/ -I./ESD/ -I./AOD/ -I./ANALYSIS/ -I./ANALYSISalice/ -I./PWG2AOD/AOD -I./PWG2femtoscopy/FEMTOSCOPY/AliFemto -I./PWG2femtoscopyUser/FEMTOSCOPY/AliFemtoUser");
+  gProof->Exec(".L AddTaskFemto.C",kTRUE);
+  gROOT->LoadMacro("AddTaskFemto.C");
+  cout << "Loaded AddTaskFemto macro "<< endl;
 
-  gProof->Load("ConfigFemtoAnalysis.C++g");
-  //  gProof->Load("AliAnalysisTaskFemto.cxx++g");
+  gProof->ShowEnabledPackages();
 
+  //ANALYSIS PART
   TChain *chain = 0x0;
-
-  if (dataType == 0) {
+  if (prooflite) {
     gROOT->LoadMacro("CreateESDChain.C");
-    chain = CreateESDChain("ESD82XX_30K.txt",200);
+    chain = CreateESDChain(chainlistfile,10000);
   }
 
   //____________________________________________//
   // Make the analysis manager
   AliAnalysisManager *mgr = new AliAnalysisManager("TestManager");
   AliESDInputHandler* esdH = new AliESDInputHandler;
+
   esdH->SetInactiveBranches("FMD CaloCluster");
   mgr->SetInputEventHandler(esdH);  
+
+  if (domc) {
+    AliMCEventHandler *mcH = new AliMCEventHandler;
+    mgr->SetMCtruthEventHandler(mcH);
+  }
   //____________________________________________//
   // 1st Pt task
-  AliAnalysisTaskFemto *task1 = new AliAnalysisTaskFemto("TaskFemto");
-
-  mgr->AddTask(task1);
 
-  // Create containers for input/output
-  AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
-  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clist1", TList::Class(),AliAnalysisManager::kOutputContainer,"Femto.ESD.root");
-  
-  //____________________________________________//
-  mgr->ConnectInput(task1,0,cinput1);
-  mgr->ConnectOutput(task1,0,coutput1);
+  AliAnalysisTaskFemto *taskfemto = AddTaskFemto();
 
   if (!mgr->InitAnalysis()) return;
   mgr->PrintStatus();
-  if (dataType == 0)
-    mgr->StartAnalysis("proof",chain);
-  else if (dataType == 1)
-    mgr->StartAnalysis("proof",dataSource, -1, 0);
+  if (prooflite) 
+    mgr->StartAnalysis("proof",chain,2000000,0);
+  else 
+    mgr->StartAnalysis("proof",chainlistfile,nEvents,offset);
 
   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;
+}
index 7827e1ac0357d081f135986a9fae65495b5ff782..a14ac55952e4c8968277bd78f190de626580a4a4 100644 (file)
@@ -18,6 +18,7 @@
 #include "AliFemtoSimpleAnalysis.h"
 #include "AliFemtoBasicEventCut.h"
 #include "AliFemtoESDTrackCut.h"
+#include "AliFemtoCorrFctn.h"
 #include "AliFemtoCutMonitorParticleYPt.h"
 #include "AliFemtoCutMonitorParticleVertPos.h"
 #include "AliFemtoCutMonitorParticleMomRes.h"