Added the possibility to the user to manage own PID
[u/mrichter/AliRoot.git] / PWGPP / pid / AddTaskLambdaBayes.C
CommitLineData
9c668341 1AliAnalysisTask *AddTaskLambdaBayes(Bool_t ismc=kFALSE,Bool_t qa=kTRUE,Int_t filterbit=4,Int_t typeCol=2){
a8ad4709 2
3 //get the current analysis manager
4 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
5 if (!mgr) {
6 Error("No manager found in AddTaskVZERO. Why?");
7 return 0;
8 }
9 // currently don't accept AOD input
10 if (!mgr->GetInputEventHandler()->InheritsFrom(AliAODInputHandler::Class())) {
11 Error("AddTaskLambdaBayes","This task works only with AOD input!");
12 return 0;
13 }
14
15 //========= Add tender to the ANALYSIS manager and set default storage =====
16 char mytaskName[100];
17 snprintf(mytaskName,100,"AliAnalysisTaskLambdaBayes.cxx");
18
19 AliAnalysisTaskLambdaBayes *task = new AliAnalysisTaskLambdaBayes(mytaskName);
20 if(ismc) task->SetMC();
21 if(qa) task->SetQA();
22 task->SetEtaCut(0.8);
23 task->SetFilterBit(filterbit);
9c668341 24 task->SetTypeCollisions(typeCol);
a8ad4709 25
520899fb 26 AliPIDmaxProb *userCut = new AliPIDmaxProb("maxProbProton");
27 task->SetPIDuserCut(userCut);
28
a8ad4709 29 mgr->AddTask(task);
30
31 //Attach input to my tasks
32 AliAnalysisDataContainer *cinput = mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
33 mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
34
35 // Attach output to my tasks
36 AliAnalysisDataContainer *cOutputL= mgr->CreateContainer("contLambdaBayes1",TList::Class(), AliAnalysisManager::kOutputContainer,
37AliAnalysisManager::GetCommonFileName());
38 mgr->ConnectOutput(task, 1, cOutputL);
39
40 AliAnalysisDataContainer *cOutputL2= mgr->CreateContainer("contLambdaBayes2",TList::Class(), AliAnalysisManager::kOutputContainer,
41AliAnalysisManager::GetCommonFileName());
42 mgr->ConnectOutput(task, 2, cOutputL2);
43
44 AliAnalysisDataContainer *cOutputL3= mgr->CreateContainer("contLambdaBayes3",TList::Class(), AliAnalysisManager::kOutputContainer,
45AliAnalysisManager::GetCommonFileName());
46 mgr->ConnectOutput(task, 3, cOutputL3);
47
48 return task;
49}
50