2 // This macro serves to add the RSN analysis task to the steering macro.
5 // - dataLabel = a string with informations about the type of data
6 // which could be needed to be ported to the config macro
8 // - configMacro = macro which configures the analysis; it has *ALWAYS*
9 // defined inside a function named 'RsnConfigTask()',
10 // whatever the name of the macro itself, whose first two
11 // arguments must have to be the task and the 'dataLabel' argument.
13 Bool_t AddRsnAnalysisTask
18 const char *path = "$(ALICE_ROOT)/PWG2/RESONANCES/macros/train",
19 const char *taskName = "RSNtask"
22 // retrieve analysis manager
23 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
25 // create the task and connect with physics selection
26 AliRsnAnalysisTask *task = new AliRsnAnalysisTask(taskName);
27 task->SetZeroEventPercentWarning(100.0);
28 task->SelectCollisionCandidates();
29 task->SetMixing(isMix);
30 ::Info("AddRsnAnalysisTask.C", "Mixing: %s", (task->IsMixing() ? "YES" : "NO"));
31 ::Info("AddRsnAnalysisTask.C", "MC: %s", (isMC ? "YES" : "NO"));
33 // add the task to manager
36 // add the event computations with the options to eventually select centrality cut
37 gROOT->LoadMacro(Form("%s/AddRsnEventComputations.C", path));
38 AddRsnEventComputations(isMC, options);
40 // add all configs for phi
41 gROOT->LoadMacro(Form("%s/RsnConfigPhi.C", path));
42 RsnConfigPhi(isMC, "tpcpid_tofpid", path, taskName);
43 //RsnConfigPhi(isMC, "itspid_tpcpid_tofpid", path, taskName);
45 // in case of MC, add efficiency tasks
47 gROOT->LoadMacro(Form("%s/AddRsnAnalysisTaskEffPhi.C", path));
48 AddRsnAnalysisTaskEffPhi("tpcpid_tofpid");
49 //AddRsnAnalysisTaskEffPhi("itspid_tpcpid_tofpid");
52 // connect input container according to source choice
53 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
55 // create paths for the output in the common file
56 Char_t commonPath[500];
57 sprintf(commonPath, "%s", AliAnalysisManager::GetCommonFileName());
59 // create containers for output
60 AliAnalysisDataContainer *outputInfo = mgr->CreateContainer("RsnInfo", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
61 AliAnalysisDataContainer *outputHist = mgr->CreateContainer("RsnHist", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
62 mgr->ConnectOutput(task, 1, outputInfo);
63 mgr->ConnectOutput(task, 2, outputHist);