New task for 2particle correlations with PID for triggers at low pT (Debojit Sarkar...
[u/mrichter/AliRoot.git] / PWGCF / Correlations / macros / TriggerPID / AddAliTwoParticlePIDCorrTask.C
1 TString fileNameBase="AnalysisResults.root";
2 AliAnalysisTask*  AddAliTwoParticlePIDCorrTask()
3 {
4   TString taskname = "pPbPIDCorr";
5   taskname.Append("taskssssssssss");
6   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
7   if (!mgr) {
8     ::Error("AddTaskPIDCorr", "No analysis manager to connect to.");
9     return NULL;
10   }
11   
12   if (!mgr->GetInputEventHandler()) {
13     ::Error("AddTaskPIDCorr", "This task requires an input event handler");
14     return NULL;
15   }
16   TString type = mgr->GetInputEventHandler()->GetDataType();
17
18    AliTwoParticlePIDCorr *taskpPbPIDCorr = new AliTwoParticlePIDCorr("TwoParticlePIDCorrTask");
19    
20    //Trigger - Physics Selection
21    taskpPbPIDCorr->SelectCollisionCandidates(AliVEvent::kINT7);
22    mgr->AddTask(taskpPbPIDCorr);
23    
24    AliAnalysisDataContainer *coutFA = mgr->CreateContainer(taskname.Data(), 
25                                                           TList::Class(),
26                                                           AliAnalysisManager::kOutputContainer,fileNameBase.Data());
27
28   mgr->ConnectInput(taskpPbPIDCorr, 0, mgr->GetCommonInputContainer());
29   mgr->ConnectOutput(taskpPbPIDCorr, 1, coutFA);
30   
31   return taskpPbPIDCorr;
32 }