1 //=============================================================================
3 // *** AddTaskFemto.C ***
5 // This macro initialize a complete AnalysisTask object for femtoscopy.
7 //=============================================================================
9 //AliAnalysisTaskFemto *AddTaskFemto(const char *configMacroName="ConfigFemtoAna//lysis.C", const char *configMacroParameters="" )
11 AliAnalysisTaskFemto *AddTaskFemto(TString configMacroName, const char *containerName="femtolist", const char *configMacroParameters="" )
14 // Creates a proton analysis task and adds it to the analysis manager.
16 // A. Get the pointer to the existing analysis manager via the static access method.
17 //==============================================================================
18 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
20 Error("AddTaskFemto", "No analysis manager to connect to.");
24 // B. Check the analysis type using the event handlers connected to the analysis
25 // manager. The availability of MC handler cann also be checked here.
26 //==============================================================================
27 if (!mgr->GetInputEventHandler()) {
28 ::Error("AddTaskFemto", "This task requires an input event handler");
31 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
32 cout << "Found " <<type << " event handler" << endl;
34 // C. Create the task, add it to manager.
35 //===========================================================================
36 // gSystem->SetIncludePath("-I$ROOTSYS/include -I./PWG2AOD/AOD -I./PWG2femtoscopy/FEMTOSCOPY/AliFemto -I./PWG2femtoscopyUser/FEMTOSCOPY/AliFemtoUser -I$ALICE_ROOT/include");
38 if (TProofMgr::GetListOfManagers()->GetEntries()) {
39 // if (dynamic_cast<TProofLite *> gProof) {
40 // char *macrocommand[10000];
41 // sprintf(macrocommand, ".L %s", configMacroName);
42 // gProof->Exec(macrocommand);
45 gProof->Load(configMacroName);
47 // gROOT->LoadMacro("ConfigFemtoAnalysis.C++");
49 //was befere aliroot 5.04.33: AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto",configMacroName);
50 AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto",configMacroName,kFALSE);
51 mgr->AddTask(taskfemto);
53 // D. Configure the analysis task. Extra parameters can be used via optional
54 // arguments of the AddTaskXXX() function.
55 //===========================================================================
57 // E. Create ONLY the output containers for the data produced by the task.
58 // Get and connect other common input/output containers via the manager as below
59 //==============================================================================
60 TString outputfile = AliAnalysisManager::GetCommonFileName();
61 outputfile += ":PWG2FEMTO";
62 AliAnalysisDataContainer *cout_femto = mgr->CreateContainer("femtolist", TList::Class(),
63 AliAnalysisManager::kOutputContainer,outputfile);
66 mgr->ConnectInput(taskfemto, 0, mgr->GetCommonInputContainer());
67 mgr->ConnectOutput(taskfemto, 0, cout_femto);
69 // Return task pointer at the end