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 ::Info("Adding efficiency");
48 gROOT->LoadMacro(Form("%s/AddRsnAnalysisTaskEffPhi.C", path));
49 AddRsnAnalysisTaskEffPhi(options, "tpcpid_tofpid");
50 //AddRsnAnalysisTaskEffPhi(options, "itspid_tpcpid_tofpid");
53 // connect input container according to source choice
54 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
56 // create paths for the output in the common file
57 Char_t commonPath[500];
58 sprintf(commonPath, "%s", AliAnalysisManager::GetCommonFileName());
60 // create containers for output
61 AliAnalysisDataContainer *outputInfo = mgr->CreateContainer("RsnInfo", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
62 AliAnalysisDataContainer *outputHist = mgr->CreateContainer("RsnHist", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
63 mgr->ConnectOutput(task, 1, outputInfo);
64 mgr->ConnectOutput(task, 2, outputHist);