end-of-line normalization
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / Kinks / macros / AddTaskKinkMC.C
CommitLineData
a65a7e70 1AliAnalysisKinkESDMC* AddTaskKinkMC(TString lCustomName="")
2{
3 //pp settings
4 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
5 if (!mgr)
6 {
7 ::Error("AddKinkTask", "No analysis manager to connect to.");
8 return NULL;
9 }
10 // Check the analysis type using the event handlers connected to the analysis manager.
11 //==============================================================================
12 if (!mgr->GetInputEventHandler())
13 {
14 ::Error("AddKinkTask", "This task requires an input event handler");
15 return NULL;
16 }
17
18 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
19 if(type.Contains("AOD"))
20 {
21 ::Error("AddKinkTask", "This task requires to run on ESD");
22 return NULL;
23 }
24
25 //TString outputFileName = AliAnalysisManager::GetCommonFileName();
26 //outputFileName += ":PWG2SpectraTOF";
27
28 AliAnalysisKinkESDMC* task = new AliAnalysisKinkESDMC("AliAnalysisKinkESDMC");
29
30 //task->SetMC("kFALSE"); // 26/11/12
31
32task->SetMulCut(0,1002);
33 mgr->AddTask(task);
34
35 //Attach input
36 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
37// mgr->ConnectInput(task,0,mgr->GetCommonInputContainer());
38 mgr->ConnectInput(task,0,cinput);
39
40 TString lContainerName="PWGLFKinksMC";
41 lContainerName.Append(lCustomName);
42 AliAnalysisDataContainer *coutput1= mgr->CreateContainer(lContainerName.Data(),TList::Class(), AliAnalysisManager::kOutputContainer,"AnalysisResultsMC.root");
43 mgr->ConnectOutput(task, 1, coutput1);
44
45
46 return task;
47
48}
49