1 //=============================================================================
3 // *** AddTaskFemto.C ***
5 // This macro initialize a complete AnalysisTask object for femtoscopy.
7 //=============================================================================
9 AliAnalysisTaskFemto *AddTaskFemto(const char *configMacroName="ConfigFemtoAnalysis.C")
11 // Creates a proton analysis task and adds it to the analysis manager.
13 // A. Get the pointer to the existing analysis manager via the static access method.
14 //==============================================================================
15 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
17 Error("AddTaskFemto", "No analysis manager to connect to.");
21 // B. Check the analysis type using the event handlers connected to the analysis
22 // manager. The availability of MC handler cann also be checked here.
23 //==============================================================================
24 if (!mgr->GetInputEventHandler()) {
25 ::Error("AddTaskFemto", "This task requires an input event handler");
28 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
30 // C. Create the task, add it to manager.
31 //===========================================================================
32 // gSystem->SetIncludePath("-I$ROOTSYS/include -I./PWG2AOD/AOD -I./PWG2femtoscopy/FEMTOSCOPY/AliFemto -I./PWG2femtoscopyUser/FEMTOSCOPY/AliFemtoUser -I$ALICE_ROOT/include");
34 if (TProofMgr::GetListOfManagers()->GetEntries()) {
35 if (dynamic_cast<TProofLite *> gProof) {
36 char *macrocommand[10000];
37 sprintf(macrocommand, ".L %s", configMacroName);
38 gProof->Exec(macrocommand);
41 gProof->Load(configMacroName);
43 // gROOT->LoadMacro("ConfigFemtoAnalysis.C++");
45 AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto",configMacroName);
46 mgr->AddTask(taskfemto);
48 // D. Configure the analysis task. Extra parameters can be used via optional
49 // arguments of the AddTaskXXX() function.
50 //===========================================================================
52 // E. Create ONLY the output containers for the data produced by the task.
53 // Get and connect other common input/output containers via the manager as below
54 //==============================================================================
55 AliAnalysisDataContainer *cout_femto = mgr->CreateContainer("femtolist", TList::Class(),
56 AliAnalysisManager::kOutputContainer,"Femto.ESD.root");
58 mgr->ConnectInput(taskfemto, 0, mgr->GetCommonInputContainer());
59 mgr->ConnectOutput(taskfemto, 0, cout_femto);
61 // Return task pointer at the end