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 AddAnalysisTaskRsnTest
14 (const char *dataLabel, const char *configMacro = "ConfigTaskRsnTest.C")
16 // retrieve analysis manager
17 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
19 // initialize task with all available slots, even if not all of them will be used:
20 AliRsnAnalysisSE *task = new AliRsnAnalysisSE("RsnAnalysis");
21 task->SetZeroEventPercentWarning(100.0);
22 //task->SelectCollisionCandidates();
23 //task->SetMCOnly(kTRUE);
25 // load and execute configuration macro
26 gROOT->LoadMacro(configMacro);
27 if (!RsnConfigTask(task, dataLabel)) return kFALSE;
30 if (!RsnConfigTask(task, dataLabel, kTRUE , kTRUE , kFALSE)) return kFALSE;
31 if (!RsnConfigTask(task, dataLabel, kTRUE , kFALSE, kFALSE)) return kFALSE;
32 if (!RsnConfigTask(task, dataLabel, kFALSE, kTRUE , kFALSE)) return kFALSE;
33 if (!RsnConfigTask(task, dataLabel, kFALSE, kFALSE, kFALSE)) return kFALSE;
34 if (!RsnConfigTask(task, dataLabel, kFALSE, kTRUE , kTRUE )) return kFALSE;
35 if (!RsnConfigTask(task, dataLabel, kFALSE, kFALSE, kTRUE )) return kFALSE;
38 // add the task to manager
41 // connect input container according to source choice
42 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
44 // create paths for the output in the common file
45 Char_t commonPath[500];
46 sprintf(commonPath, "%s", AliAnalysisManager::GetCommonFileName());
48 // create containers for output
49 AliAnalysisDataContainer *outputInfo = mgr->CreateContainer("RsnInfo", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
50 AliAnalysisDataContainer *outputHist = mgr->CreateContainer("RsnHist", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
51 mgr->ConnectOutput(task, 1, outputInfo);
52 mgr->ConnectOutput(task, 2, outputHist);