]> git.uio.no Git - u/mrichter/AliRoot.git/commit - ANALYSIS/AliAnalysisTask.cxx
- AliAnalysisTask::OpenFile(i) opens and returns the file for the container
authoragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 Dec 2007 16:10:50 +0000 (16:10 +0000)
committeragheata <agheata@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 4 Dec 2007 16:10:50 +0000 (16:10 +0000)
commit13ef3bb0ae3d813ba9d1b701c4961bc8db4d0a80
treedfe9867b67f480b87a703b1bb4af5457461a9543
parent688513ccb56a5aad356eb6763296b697f63a15f4
- AliAnalysisTask::OpenFile(i) opens and returns the file for the container
connected at task output slot <i>. Works also in PROOF mode now.
- Added kSpecialOutput user-settable flag to AliAnalysisDataContainer. Output
containers that are to be dumped to a special file will be copied in PROOF mode from each
slave to a default remote location specified via AliAnalysisManager::SetSpecialOutputLocation()
File names will be prepended with the host name of the slave they were produced on.
One needs to open the special file in MyTask::CreateOutputObjects():
   OpenFile(iout_slot)
The files on the slaves will be closed by the system in SlaveTerminate phase.

Ex:
MyAnalysis.C
{
   mgr = new AliAnalysisManager("demo","");
   mgr->SetSpecialOutputLocation("root://lxb0000.cern.ch//alien/alice/"); // xrootd location
   MyTask *task = new MyTask();
   mgr->AddTask(task);
   // Create output container to be written in file sptree.root
   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("csp_tree", TTree::Class(), AliAnalysisManager::kOutputContainer, "sptree.root");
   coutput1->SetSpecialOutput();
   mgr->ConnectOutput(task,3,coutput1); // connect container to output #3 of MyTask
   ...
   mgr->StartAnalysis("proof", chain,...);
}

void MyTask::MyTask()
{
  ...
  DefineInput(3, TTree::Class());
  ...
}

void MyTask::CreateOutputObjects()
{
   ...
   TFile *f = OpenFile(3);
   ...
   fTreeOnOutput3 = new TTree(...)
}

void MyTask::Exec()
{
   ...   processing ...
   tree->Fill();
   PostData(3,tree);
}
ANALYSIS/AliAnalysisDataContainer.h
ANALYSIS/AliAnalysisManager.cxx
ANALYSIS/AliAnalysisManager.h
ANALYSIS/AliAnalysisTask.cxx
ANALYSIS/AliAnalysisTask.h