New analysis frameowrk using PROOF - Adding the needed macros.
authorpanos <panos@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 Mar 2007 12:57:05 +0000 (12:57 +0000)
committerpanos <panos@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 8 Mar 2007 12:57:05 +0000 (12:57 +0000)
PWG2/AnalysisMacros/Proof/demoCAF.C [new file with mode: 0644]
PWG2/AnalysisMacros/Proof/runAnalysis.C [new file with mode: 0644]

diff --git a/PWG2/AnalysisMacros/Proof/demoCAF.C b/PWG2/AnalysisMacros/Proof/demoCAF.C
new file mode 100644 (file)
index 0000000..bc0b714
--- /dev/null
@@ -0,0 +1,22 @@
+//________________________________________________________________________
+void demoCAF(TChain *chain, const char* mode) {
+  //____________________________________________//
+  // Make the analysis manager
+  AliAnalysisManager *mgr = new AliAnalysisManager("testAnalysis");
+  //____________________________________________//
+  // 1st Pt task
+  AliAnalysisTask *task1 = new AliAnalysisTaskPt("TaskPt");
+  mgr->AddTask(task1);
+  // Create containers for input/output
+  AliAnalysisDataContainer *cinput1 = mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
+  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("chist1", TH1::Class(),AliAnalysisManager::kOutputContainer, "Pt.ESD.1.root");
+  //____________________________________________//
+                                                                                                                                              
+  mgr->ConnectInput(task1,0,cinput1);
+  mgr->ConnectOutput(task1,0,coutput1);
+  if (mgr->InitAnalysis()) mgr->PrintStatus();
+  else return;
+
+  mgr->StartAnalysis(mode,chain);
+}                         
+                      
diff --git a/PWG2/AnalysisMacros/Proof/runAnalysis.C b/PWG2/AnalysisMacros/Proof/runAnalysis.C
new file mode 100644 (file)
index 0000000..74022f8
--- /dev/null
@@ -0,0 +1,39 @@
+void runAnalysis() {
+  TStopwatch timer;
+  timer.Start();
+  
+  runProofESD("AliAnalysisTaskPt.cxx+");
+
+  timer.Stop();
+  timer.Print();
+}
+
+//==========================================//
+void runProofESD(const char *selectorfile) {
+  //the next line should point to the local $ALICE_ROOT
+  //that contains the latest ANALYSIS developments
+  gSystem->AddIncludePath("-I\"$ALICE_ROOT/include\"");
+  printf("****** Connect to PROOF *******\n");
+  TProof::Open("proof://<username>@lxb6046.cern.ch"); 
+
+  // Enable the Analysis Package
+  gProof->UploadPackage("ESD.par");
+  gProof->EnablePackage("ESD");
+  gProof->UploadPackage("ANALYSIS.par");
+  gProof->EnablePackage("ANALYSIS");
+  
+  // You should get this macro and the txt file from:
+  // http://aliceinfo.cern.ch/Offline/Analysis/CAF/
+  gROOT->LoadMacro("CreateESDChain.C");
+  TChain* chain = 0x0;
+  chain = CreateESDChain("ESD100_110_v2.txt",10);
+
+  gROOT->LoadMacro(selectorfile);
+  gROOT->LoadMacro("demoCAF.C");
+  demoCAF(chain,"proof");
+  gSystem->Exec("rm -rf ESD ANALYSIS");
+}
+
+
+