]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/STRANGENESS/Correlations/macros/AddTaskV0ChCorrelations.C
Adding two other arguments (for V0 selection) to AddTaskV0ChCorrelations.
[u/mrichter/AliRoot.git] / PWGLF / STRANGENESS / Correlations / macros / AddTaskV0ChCorrelations.C
CommitLineData
1a9b2de7 1// runV0ChCorrelations.C
2//
3// AddTask for AliAnalysisTaskV0ChCorrelations task
4//
1bc7b87b 5AliAnalysisTaskV0ChCorrelations *AddTaskV0ChCorrelations(const Bool_t bMCtruth=kFALSE,
6 Float_t DcaDToPV = 0.5,
7 Float_t DcaV0D = 0.1
8 )
1a9b2de7 9{
10 // Creates a V0Ch correlations analysis task and adds it to the analysis manager.
11
12 // Get the pointer to the existing analysis manager via the static access method.
13 //==============================================================================
14
15 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
16 if (!mgr) {
17 ::Error("AddTaskV0ChCorrelations", "No analysis manager to connect to.");
18 return NULL;
19 }
20
21 // mc event handlerrunEx01.C
22 if(bMCtruth) {
23 AliMCEventHandler* mchandler = new AliMCEventHandler();
24 // Not reading track references
25 mchandler->SetReadTR(kFALSE);
26 mgr->SetMCtruthEventHandler(mchandler);
27 }
28
29 // create task
30 AliAnalysisTaskV0ChCorrelations* task = new AliAnalysisTaskV0ChCorrelations("V0ChCorrelations_task");
1bc7b87b 31 task->SetDcaDToPV(DcaDToPV);
32 task->SetDcaV0D(DcaV0D);
1a9b2de7 33 mgr->AddTask(task);
34
35 // Create ONLY the output containers for the data produced by the task.
36 // Get and connect other common input/output containers via the manager as below
37 //==============================================================================
38 TString outputFileName = AliAnalysisManager::GetCommonFileName();
39 outputFileName = "list.grid.v0ch.root";
40
41 // create containers for input/output
42 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
43 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("coutput1", TList::Class(), AliAnalysisManager::kOutputContainer, outputFileName);
44
45 // connect input/output
46 mgr->ConnectInput(task, 0, cinput);
47 mgr->ConnectOutput(task, 1, coutput1);
48
49 // Return task pointer at the end
50 return task;
51}
52