1 AliProtonFeedDownAnalysisTask* AddTaskProtonFeedDownAnalysis(const char *analysisType="Hybrid",const char *pidMode="Bayesian")
3 // Creates a proton analysis task and adds it to the analysis manager.
5 // Get the pointer to the existing analysis manager via the static access method.
6 //==============================================================================
7 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
9 ::Error("AddTaskProtons", "No analysis manager to connect to.");
13 // Check the analysis type using the event handlers connected to the analysis manager.
14 //==============================================================================
15 if (!mgr->GetInputEventHandler()) {
16 ::Error("AddTaskProtons", "This task requires an input event handler");
19 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
20 gROOT->LoadMacro("$ALICE_ROOT/PWG2/SPECTRA/macros/configProtonFeedDownAnalysis.C");
21 AliProtonFeedDownAnalysis *pa = 0;
22 if (type=="ESD") pa = GetProtonFeedDownAnalysisObject("ESD", analysisType, pidMode);
23 else if (type=="AOD") pa = GetProtonFeedDownAnalysisObject("AOD", analysisType, pidMode);
26 // Create the task, add it to manager and configure it.
27 //===========================================================================
28 AliProtonFeedDownAnalysisTask *taskproton = new AliProtonFeedDownAnalysisTask("TaskProtons");
29 mgr->AddTask(taskproton);
30 taskproton->SetAnalysisObject(pa);
32 // Create ONLY the output containers for the data produced by the task.
33 // Get and connect other common input/output containers via the manager as below
34 //==============================================================================
35 TString outputFileName = AliAnalysisManager::GetCommonFileName();
36 outputFileName += ":PWG2BaryonRatioFeedDownAnalysis";
37 AliAnalysisDataContainer *cout_proton = mgr->CreateContainer("protonFeedDown", TList::Class(),AliAnalysisManager::kOutputContainer,outputFileName.Data());
38 mgr->ConnectInput(taskproton, 0, mgr->GetCommonInputContainer());
39 mgr->ConnectOutput(taskproton, 0, cout_proton);
41 // Return task pointer at the end