]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/macros/test/AddAnalysisTaskRsnTest.C
Implemented a correction for the warnings related to misformatted string in 'Form...
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / macros / test / AddAnalysisTaskRsnTest.C
1 //
2 // This macro serves to add the RSN analysis task to the steering macro.
3 //
4 // Inputs:
5 //   - dataLabel   = a string with informations about the type of data
6 //                   which could be needed to be ported to the config macro
7 //                   to set up some cuts
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.
12 // 
13 Bool_t AddAnalysisTaskRsnTest
14 (const char *dataLabel, const char *configMacro = "ConfigTaskRsnTest.C")
15 {
16   // retrieve analysis manager
17   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
18
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);
24
25   // load and execute configuration macro
26   gROOT->LoadMacro(configMacro);
27   if (!RsnConfigTask(task, dataLabel)) return kFALSE;
28   /*
29   //                                  perf    its     expPID
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;
36   */
37
38   // add the task to manager
39   mgr->AddTask(task);
40
41   // connect input container according to source choice
42   mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
43
44   // create paths for the output in the common file
45   Char_t commonPath[500];
46   sprintf(commonPath, "%s", AliAnalysisManager::GetCommonFileName());
47
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);
53
54   return kTRUE;
55 }