]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/macros/train/LHC2010-pp7TeV/AddRsnAnalysisKStar.C
Coverity fixes 14823 to 14837
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / macros / train / LHC2010-pp7TeV / AddRsnAnalysisKStar.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 AddRsnAnalysisKStar
14 (
15   const char *options     = "", 
16   const char *taskName    = "RsnAnalysis",
17   const char *configMacro = "RsnConfigKStar",
18   const char *configPath  = "$(ALICE_INSTALL)/PWG2/RESONANCES/macros/train/LHC2010-pp7TeV"
19 )
20 {
21   // retrieve analysis manager
22   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
23     
24   // create the task and connect with physics selection
25   AliRsnAnalysisSE *task = new AliRsnAnalysisSE(taskName);
26   task->SetZeroEventPercentWarning(100.0);
27   task->SelectCollisionCandidates();
28
29   // add the task to manager
30   mgr->AddTask(task);
31   
32   // execute the related config with settings for adding and not adding ITS-SA
33   gROOT->ProcessLine(Form(".x %s/%s(%s,%s,%s)", configPath, configMacro, taskName, options                , configPath));
34   gROOT->ProcessLine(Form(".x %s/%s(%s,%s,%s)", configPath, configMacro, taskName, Form("its+%s", options), configPath));
35   
36   // connect input container according to source choice
37   mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
38
39   // create paths for the output in the common file
40   Char_t commonPath[500];
41   sprintf(commonPath, "%s", AliAnalysisManager::GetCommonFileName());
42
43   // create containers for output
44   AliAnalysisDataContainer *outputInfo = mgr->CreateContainer("RsnInfo", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
45   AliAnalysisDataContainer *outputHist = mgr->CreateContainer("RsnHist", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
46   mgr->ConnectOutput(task, 1, outputInfo);
47   mgr->ConnectOutput(task, 2, outputHist);
48
49   return kTRUE;
50 }