]>
Commit | Line | Data |
---|---|---|
fe104c65 | 1 | AliAnalysisTaskParticleCorrelation *AddTaskPi0() |
2 | { | |
3 | // Creates a Pi0->gg identification task and adds it to the analysis manager. | |
4 | ||
5 | // Get the pointer to the existing analysis manager via the static access method. | |
6 | //============================================================================== | |
7 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
8 | if (!mgr) { | |
9 | Error("AddTaskGammaHadronCorr", "No analysis manager to connect to."); | |
10 | return NULL; | |
11 | } | |
12 | ||
13 | // This task requires an ESD input handler and an AOD output handler. | |
14 | // Check this using the analysis manager. | |
15 | //=============================================================================== | |
16 | TString type = mgr->GetInputEventHandler()->GetDataType(); | |
17 | if (!type.Contains("ESD")) { | |
18 | Error("AddTaskESDFilter", "ESD filtering task needs the manager to have an ESD input handler."); | |
19 | return NULL; | |
20 | } | |
21 | // Check if AOD output handler exist. | |
22 | AliAODHandler *aod_h = (AliAODHandler*)mgr->GetOutputEventHandler(); | |
23 | if (!aod_h) { | |
24 | Error("AddTaskESDFilter", "ESD filtering task needs the manager to have an AOD output handler."); | |
25 | return NULL; | |
26 | } | |
27 | ||
28 | // Create the task, add it to the manager and configure it. | |
29 | //=========================================================================== | |
30 | AliAnalysisTaskParticleCorrelation * taskpartcorr = new AliAnalysisTaskParticleCorrelation ("PWG4-Pi0"); | |
31 | mgr->AddTask(taskpartcorr); | |
32 | taskpartcorr->SetConfigFileName("ConfigAnalysisPi0"); | |
33 | // Output histograms list for particle correlation analysis | |
34 | AliAnalysisDataContainer *cout_partcorr = mgr->CreateContainer("pi0histos", TList::Class(), | |
35 | AliAnalysisManager::kOutputContainer, "pi0histos.root"); | |
36 | ||
37 | // Connect to data containers | |
38 | mgr->ConnectInput (taskpartcorr, 0, mgr->GetCommonInputContainer()); | |
39 | mgr->ConnectOutput (taskpartcorr, 1, cout_partcorr ); | |
40 | return taskpartcorr; | |
41 | } | |
42 |