Adding macro to run the test pt task also on offline ESDs, plus corresponding documen...
authorzampolli <chiara.zampolli@cern.ch>
Mon, 22 Sep 2014 12:57:46 +0000 (14:57 +0200)
committerzampolli <chiara.zampolli@cern.ch>
Mon, 22 Sep 2014 12:57:46 +0000 (14:57 +0200)
HLT/global/physics/macros/README_AliHLTAnaManagerComponent
HLT/global/physics/macros/runTaskOffline.C [new file with mode: 0644]

index 8307442..383aa97 100644 (file)
@@ -12,3 +12,11 @@ To run an example using the AliHLTFlatAnaManagerComponent, please, run:
 rm galice.root; aliroot -b -q -l testconfigFlat.C'("GLOBAL-flat-esd-converter")' $ALICE_ROOT/HLT/exa/recraw-local.C'("raw.root","local://$ALICE_ROOT/OCDB", 0, 10, "HLT", "chains=RootWriter ignore-hltout")' 2>&1| tee recHLT.log
 
 Note that you need to have a raw.root file in your folder.
+
+
+*******************************************************************************
+
+To run the same AliAnalysisPtTask but on Offline ESDs (that you need locally, optionally with the 
+friends) run:
+
+aliroot -b -q runTaskOffline.C
diff --git a/HLT/global/physics/macros/runTaskOffline.C b/HLT/global/physics/macros/runTaskOffline.C
new file mode 100644 (file)
index 0000000..a247a08
--- /dev/null
@@ -0,0 +1,54 @@
+void runTaskOffline()
+{
+  // load analysis framework
+  gSystem->Load("libANALYSISalice");
+
+  gROOT->LoadMacro("$ALICE_ROOT/PWGUD/macros/CreateESDChain.C");
+
+  // for includes use either global setting in $HOME/.rootrc
+  // ACLiC.IncludePaths: -I$(ALICE_ROOT)/include
+  // or in each macro
+  gSystem->AddIncludePath("-I$ALICE_ROOT/include");
+  gROOT->Macro("$ALICE_ROOT/PWGPP/CalibMacros/CPass0/LoadLibraries.C");
+
+  // Create the analysis manager
+  AliAnalysisManager *mgr = new AliAnalysisManager("testAnalysis");
+
+  // Add ESD input handler
+  AliESDInputHandler* esdH = new AliESDInputHandler();
+  esdH->SetReadFriends(kTRUE);
+  esdH->SetActiveBranches("ESDfriend");
+
+  // Register input handler to manager
+  mgr->SetInputEventHandler(esdH);
+
+  // Create task
+
+  //gROOT->LoadMacro("AliAnalysisTaskPt.cxx+g");
+  AliAnalysisTaskPt *task = new AliAnalysisTaskPt("TaskPt");
+  task->SetUseFriends(kTRUE);
+  
+  // Add task
+  mgr->AddTask(task);
+
+  // Create containers for input/output
+  AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
+  AliAnalysisDataContainer *coutput = mgr->CreateContainer("chist", TList::Class(),    AliAnalysisManager::kOutputContainer, "Pt.ESD.1.root");
+
+  // Connect input/output
+  mgr->ConnectInput(task, 0, cinput);
+  mgr->ConnectOutput(task, 0, coutput);
+
+  // Enable debug printouts
+  mgr->SetDebugLevel(2);
+
+  if (!mgr->InitAnalysis())
+    return;
+
+  mgr->PrintStatus();
+
+  TChain *chain1 = new TChain("esdTree");
+  chain1->Add("AliESDs.root");
+
+  mgr->StartAnalysis("local", chain1);
+}