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.
16 const char *configs = "RsnConfigNoSA.C RsnConfigSA.C",
17 const char *path = "$(ALICE_ROOT)/PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi"
20 // retrieve analysis manager
21 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
23 // create the task and connect with physics selection
24 AliRsnAnalysisSE *task = new AliRsnAnalysisSE("RsnAnalysis");
25 task->SetZeroEventPercentWarning(100.0);
26 task->SelectCollisionCandidates();
28 // add the task to manager
31 // load and execute all required configuration macroes in the string (arg #2)
32 TString sList = configs;
33 TObjArray *list = sList.Tokenize(" ");
34 Int_t nConfig = list->GetEntries();
36 for (iConfig = 0; iConfig < nConfig; iConfig++)
38 TObjString *ostr = (TObjString*)list->At(iConfig);
40 // the config macro is assumed to be stored in the path in argument #3
41 // and to have three arguments: task name, a free string of options and the path where it is stored
42 // --> all of them is a string, and then it must be passed with the quote marks
43 const char *macro = ostr->GetString().Data();
44 const char *argName = Form("\"%s\"", task->GetName());
45 const char *argOption = Form("\"%s\"", options);
46 const char *argPath = Form("\"%s\"", path);
47 gROOT->ProcessLine(Form(".x %s/%s(%s,%s,%s)", path, macro, argName, argOption, argPath));
50 // connect input container according to source choice
51 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
53 // create paths for the output in the common file
54 Char_t commonPath[500];
55 sprintf(commonPath, "%s", AliAnalysisManager::GetCommonFileName());
57 // create containers for output
58 AliAnalysisDataContainer *outputInfo = mgr->CreateContainer("RsnInfo", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
59 AliAnalysisDataContainer *outputHist = mgr->CreateContainer("RsnHist", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
60 mgr->ConnectOutput(task, 1, outputInfo);
61 mgr->ConnectOutput(task, 2, outputHist);