ROOT logo
AliAnalysisTask *AddTaskLambdaBayes(Bool_t ismc=kFALSE,Bool_t qa=kTRUE,Int_t filterbit=4,Int_t typeCol=2,Bool_t toEP=kFALSE,Int_t species=4){

  //get the current analysis manager
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    Error("No manager found in AddTaskVZERO. Why?");
    return 0;
  }
  // currently don't accept AOD input
  if (!mgr->GetInputEventHandler()->InheritsFrom(AliAODInputHandler::Class())) {
    Error("AddTaskLambdaBayes","This task works only with AOD input!");
    return 0;
  }

  //========= Add tender to the ANALYSIS manager and set default storage =====
  char mytaskName[100];
  snprintf(mytaskName,100,"AliAnalysisTaskLambdaBayes.cxx"); 

  AliAnalysisTaskLambdaBayes *task = new AliAnalysisTaskLambdaBayes(mytaskName);
  if(ismc) task->SetMC();
  if(qa) task->SetQA();
  task->SetEtaCut(0.8);
  task->SetFilterBit(filterbit);
  task->SetTypeCollisions(typeCol);
  task->SetCorrEP(toEP);
  task->SetRefSpecies(species);

  AliPIDmaxProb *userCut = new AliPIDmaxProb("maxProbProton");
  userCut->RequireTPC();
  userCut->RequireTOF();
  task->SetPIDuserCut(userCut);

  mgr->AddTask(task);

  //Attach input to my tasks
  AliAnalysisDataContainer *cinput = mgr->CreateContainer("cchain1",TChain::Class(),AliAnalysisManager::kInputContainer);
  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());

  // Attach output to my tasks
  AliAnalysisDataContainer *cOutputL= mgr->CreateContainer("contLambdaBayes1",TList::Class(), AliAnalysisManager::kOutputContainer, 
AliAnalysisManager::GetCommonFileName());
  mgr->ConnectOutput(task, 1, cOutputL);

  AliAnalysisDataContainer *cOutputL2= mgr->CreateContainer("contLambdaBayes2",TList::Class(), AliAnalysisManager::kOutputContainer, 
AliAnalysisManager::GetCommonFileName());
  mgr->ConnectOutput(task, 2, cOutputL2);

  AliAnalysisDataContainer *cOutputL3= mgr->CreateContainer("contLambdaBayes3",TList::Class(), AliAnalysisManager::kOutputContainer, 
AliAnalysisManager::GetCommonFileName());
  mgr->ConnectOutput(task, 3, cOutputL3);

  return task;
}

 AddTaskLambdaBayes.C:1
 AddTaskLambdaBayes.C:2
 AddTaskLambdaBayes.C:3
 AddTaskLambdaBayes.C:4
 AddTaskLambdaBayes.C:5
 AddTaskLambdaBayes.C:6
 AddTaskLambdaBayes.C:7
 AddTaskLambdaBayes.C:8
 AddTaskLambdaBayes.C:9
 AddTaskLambdaBayes.C:10
 AddTaskLambdaBayes.C:11
 AddTaskLambdaBayes.C:12
 AddTaskLambdaBayes.C:13
 AddTaskLambdaBayes.C:14
 AddTaskLambdaBayes.C:15
 AddTaskLambdaBayes.C:16
 AddTaskLambdaBayes.C:17
 AddTaskLambdaBayes.C:18
 AddTaskLambdaBayes.C:19
 AddTaskLambdaBayes.C:20
 AddTaskLambdaBayes.C:21
 AddTaskLambdaBayes.C:22
 AddTaskLambdaBayes.C:23
 AddTaskLambdaBayes.C:24
 AddTaskLambdaBayes.C:25
 AddTaskLambdaBayes.C:26
 AddTaskLambdaBayes.C:27
 AddTaskLambdaBayes.C:28
 AddTaskLambdaBayes.C:29
 AddTaskLambdaBayes.C:30
 AddTaskLambdaBayes.C:31
 AddTaskLambdaBayes.C:32
 AddTaskLambdaBayes.C:33
 AddTaskLambdaBayes.C:34
 AddTaskLambdaBayes.C:35
 AddTaskLambdaBayes.C:36
 AddTaskLambdaBayes.C:37
 AddTaskLambdaBayes.C:38
 AddTaskLambdaBayes.C:39
 AddTaskLambdaBayes.C:40
 AddTaskLambdaBayes.C:41
 AddTaskLambdaBayes.C:42
 AddTaskLambdaBayes.C:43
 AddTaskLambdaBayes.C:44
 AddTaskLambdaBayes.C:45
 AddTaskLambdaBayes.C:46
 AddTaskLambdaBayes.C:47
 AddTaskLambdaBayes.C:48
 AddTaskLambdaBayes.C:49
 AddTaskLambdaBayes.C:50
 AddTaskLambdaBayes.C:51
 AddTaskLambdaBayes.C:52
 AddTaskLambdaBayes.C:53
 AddTaskLambdaBayes.C:54
 AddTaskLambdaBayes.C:55