AliPhysics  5eaf189 (5eaf189)
AddTaskDmesonMCPerform.C
Go to the documentation of this file.
3  TString dpluscutfilename="")
4 {
5  //
6 
7  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
8  if (!mgr) {
9  ::Error("AddTaskMCPerform", "No analysis manager to connect to.");
10  }
11 
12  AliRDHFCutsDplustoKpipi* analysiscutsdp=0x0;
13  if(dpluscutfilename!="") {
14  TFile* fileDpcuts=TFile::Open(dpluscutfilename.Data());
15  if(!fileDpcuts ||(fileDpcuts&& !fileDpcuts->IsOpen())){
16  AliFatal("Input file not found : check your cut object");
17  }else{
18  analysiscutsdp = (AliRDHFCutsDplustoKpipi*)fileDpcuts->Get("AnalysisCuts");
19  }
20  }
21 
23  // task->SetAODMismatchProtection(-1);
24  task->SetUseCentrality(centOpt);
25  if(analysiscutsdp) task->SetDplusAnalysisCuts(analysiscutsdp);
26  mgr->AddTask(task);
27 
28 
29  // Create containers for input/output
30 
31  TString outname = "coutputDperf";
32  outname += suffix.Data();
33 
34  TString outputfile = AliAnalysisManager::GetCommonFileName();
35  outputfile += ":PWGHF_D2H_MCPerform";
36 
37 
38  AliAnalysisDataContainer *coutputDmc = mgr->CreateContainer(outname,
39  TList::Class(),
40  AliAnalysisManager::kOutputContainer,
41  outputfile.Data());
42  mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
43  mgr->ConnectOutput(task,1,coutputDmc);
44 
45  return task;
46 }
void SetDplusAnalysisCuts(AliRDHFCutsDplustoKpipi *cts)
Class for cuts on AOD reconstructed D+->Kpipi.
int Int_t
Definition: External.C:63
AliAnalysisTaskDmesonMCPerform * AddTaskDmesonMCPerform(TString suffix="", Int_t centOpt=AliRDHFCuts::kCentOff, TString dpluscutfilename="")