message: Fix addtask for MC
diff: @@ -28,18 +28,32 @@ AliAnalysisTaskStrangenessVsMultiplicityMCRun2 *AddTaskStrangenessVsMultiplicity
  Printf("Set OutputFileName : \n %s\n", outputFileName.Data() );
  - AliAnalysisDataContainer *coutputList = mgr->CreateContainer(Form("cList%s",lExtraOutputName.Data()),
  - TList::Class(),
  - AliAnalysisManager::kOutputContainer,
  - outputFileName );
  - AliAnalysisDataContainer *coutputListV0 = mgr->CreateContainer(Form("cListV0%s",lExtraOutputName.Data()),
  - TList::Class(),
  - AliAnalysisManager::kOutputContainer,
  - outputFileName );
  - AliAnalysisDataContainer *coutputListCascade = mgr->CreateContainer(Form("cListCascade%s",lExtraOutputName.Data()),
  + TString lC[9];
  + lC[0] = "cList";
  + lC[1] = "cListV0";
  + lC[2] = "cListXiMinus";
  + lC[3] = "cListXiPlus";
  + lC[4] = "cListOmegaMinus";
  + lC[5] = "cListOmegaPlus";
  + lC[6] = "cTreeEvent";
  + lC[7] = "cTreeV0";
  + lC[8] = "cTreeCascade";
  +
  + for(Int_t iname=0;iname<9;iname++)
  + lC[iname] += lExtraOutputName.Data();
  +
  + AliAnalysisDataContainer *coutputLists[6];
  + for(Int_t ilist=0;ilist<6;ilist++){
  + coutputLists[ilist] = mgr->CreateContainer(lC[ilist].Data(),
  TList::Class(),
  AliAnalysisManager::kOutputContainer,
  outputFileName );
  + }
  +
  + AliAnalysisDataContainer *coutputTree = 0x0;
  + AliAnalysisDataContainer *coutputTreeV0 = 0x0;
  + AliAnalysisDataContainer *coutputTreeCascade = 0x0;
  +
  if( lSaveEventTree ){
  AliAnalysisDataContainer *coutputTree = mgr->CreateContainer(Form("cTreeEvent%s",lExtraOutputName.Data()),
  TTree::Class(),
  @@ -65,9 +79,8 @@ AliAnalysisTaskStrangenessVsMultiplicityMCRun2 *AddTaskStrangenessVsMultiplicity
  //Recommendation: Tree as a single output slot
  mgr->ConnectInput (taskAuxiliary, 0, mgr->GetCommonInputContainer());
  - mgr->ConnectOutput(taskAuxiliary, 1, coutputList);
  - mgr->ConnectOutput(taskAuxiliary, 2, coutputListV0);
  - mgr->ConnectOutput(taskAuxiliary, 3, coutputListCascade);
  + for(Int_t ilist=0;ilist<6;ilist++){
  + mgr->ConnectOutput(taskAuxiliary, ilist+1, coutputLists[ilist]);
  if ( lSaveEventTree ) mgr->ConnectOutput(taskAuxiliary, 4, coutputTree);
  if ( lSaveV0 ) mgr->ConnectOutput(taskAuxiliary, 5, coutputTreeV0);
  