--- /dev/null
+AliAnalysisTaskParticleCorrelation *AddTaskGammaHadronCorr()
+{
+// Creates a gamma-hadron correlations task and adds it to the analysis manager.
+
+ // Get the pointer to the existing analysis manager via the static access method.
+ //==============================================================================
+ AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+ if (!mgr) {
+ Error("AddTaskGammaHadronCorr", "No analysis manager to connect to.");
+ return NULL;
+ }
+
+ // This task requires an ESD input handler and an AOD output handler.
+ // Check this using the analysis manager.
+ //===============================================================================
+ TString type = mgr->GetInputEventHandler()->GetDataType();
+ if (!type.Contains("ESD")) {
+ Error("AddTaskESDFilter", "ESD filtering task needs the manager to have an ESD input handler.");
+ return NULL;
+ }
+ // Check if AOD output handler exist.
+ AliAODHandler *aod_h = (AliAODHandler*)mgr->GetOutputEventHandler();
+ if (!aod_h) {
+ Error("AddTaskESDFilter", "ESD filtering task needs the manager to have an AOD output handler.");
+ return NULL;
+ }
+
+ // Create the task, add it to the manager and configure it.
+ //===========================================================================
+ AliAnalysisTaskParticleCorrelation * taskpartcorr = new AliAnalysisTaskParticleCorrelation ("ParticleCorrelations");
+ mgr->AddTask(taskpartcorr);
+ taskpartcorr->SetConfigFileName("ConfigAnalysisGammaHadronCorrelation");
+ // Output histograms list for particle correlation analysis
+ AliAnalysisDataContainer *cout_partcorr = mgr->CreateContainer("partcorrhist", TList::Class(),
+ AliAnalysisManager::kOutputContainer, "partcorrhist.root");
+
+ // Connect to data containers
+ mgr->ConnectInput (taskpartcorr, 0, mgr->GetCommonInputContainer());
+ mgr->ConnectOutput (taskpartcorr, 1, cout_partcorr );
+ return taskpartcorr;
+}
+
--- /dev/null
+AliAnalysisTaskParticleCorrelation *AddTaskPi0()
+{
+// Creates a Pi0->gg identification task and adds it to the analysis manager.
+
+ // Get the pointer to the existing analysis manager via the static access method.
+ //==============================================================================
+ AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+ if (!mgr) {
+ Error("AddTaskGammaHadronCorr", "No analysis manager to connect to.");
+ return NULL;
+ }
+
+ // This task requires an ESD input handler and an AOD output handler.
+ // Check this using the analysis manager.
+ //===============================================================================
+ TString type = mgr->GetInputEventHandler()->GetDataType();
+ if (!type.Contains("ESD")) {
+ Error("AddTaskESDFilter", "ESD filtering task needs the manager to have an ESD input handler.");
+ return NULL;
+ }
+ // Check if AOD output handler exist.
+ AliAODHandler *aod_h = (AliAODHandler*)mgr->GetOutputEventHandler();
+ if (!aod_h) {
+ Error("AddTaskESDFilter", "ESD filtering task needs the manager to have an AOD output handler.");
+ return NULL;
+ }
+
+ // Create the task, add it to the manager and configure it.
+ //===========================================================================
+ AliAnalysisTaskParticleCorrelation * taskpartcorr = new AliAnalysisTaskParticleCorrelation ("PWG4-Pi0");
+ mgr->AddTask(taskpartcorr);
+ taskpartcorr->SetConfigFileName("ConfigAnalysisPi0");
+ // Output histograms list for particle correlation analysis
+ AliAnalysisDataContainer *cout_partcorr = mgr->CreateContainer("pi0histos", TList::Class(),
+ AliAnalysisManager::kOutputContainer, "pi0histos.root");
+
+ // Connect to data containers
+ mgr->ConnectInput (taskpartcorr, 0, mgr->GetCommonInputContainer());
+ mgr->ConnectOutput (taskpartcorr, 1, cout_partcorr );
+ return taskpartcorr;
+}
+
--- /dev/null
+AliAnalysisTaskProtons *AddTaskProtons(const char *analysisType="Hybrid",
+ const char *pidMode="Bayesian")
+{
+// Creates a proton analysis task and adds it to the analysis manager.
+
+ // Get the pointer to the existing analysis manager via the static access method.
+ //==============================================================================
+ AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+ if (!mgr) {
+ Error("AddTaskESDFilter", "No analysis manager to connect to.");
+ return NULL;
+ }
+
+ // Check the analysis type using the event handlers connected to the analysis manager.
+ //==============================================================================
+ if (!mgr->GetInputEventHandler()) {
+ ::Error("AddTaskProtons", "This task requires an input event handler");
+ return NULL;
+ }
+ TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
+ gROOT->LoadMacro("$ALICE_ROOT/PWG2/configProtonAnalysis.C");
+ AliProtonAnalysis *pa = 0;
+ if (type=="ESD") pa = GetProtonAnalysisObject("ESD", analysisType, pidMode);
+ else if (type=="AOD") pa = GetProtonAnalysisObject("AOD", analysisType, pidMode);
+ else pa = GetProtonAnalysisObject("MC", analysisType, pidMode);
+
+ // Create the task, add it to manager and configure it.
+ //===========================================================================
+ AliAnalysisTaskProtons *taskproton = new AliAnalysisTaskProtons("TaskProtons");
+ mgr->AddTask(taskproton);
+ taskproton->SetAnalysisObject(pa);
+
+ // Create ONLY the output containers for the data produced by the task.
+ // Get and connect other common input/output containers via the manager as below
+ //==============================================================================
+ AliAnalysisDataContainer *cout_proton = mgr->CreateContainer("protonhist", TList::Class(),
+ AliAnalysisManager::kOutputContainer,"protonhist.root");
+ mgr->ConnectInput(taskproton, 0, mgr->GetCommonInputContainer());
+ mgr->ConnectOutput(taskproton, 0, cout_proton);
+
+ // Return task pointer at the end
+ return taskproton;
+}