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 RsnConfigDipNoSA.C RsnConfigDipSA.C",
17 const char *path = "$(ALICE_ROOT)/PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi"
20 // retrieve analysis manager
21 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
23 // initialize task with all available slots, even if not all of them will be used:
24 AliRsnAnalysisSE *task = new AliRsnAnalysisSE("RsnAnalysis");
25 task->SetZeroEventPercentWarning(100.0);
26 task->SelectCollisionCandidates();
28 // set cuts for events : primary vertex range and type
29 gROOT->LoadMacro("$(ALICE_ROOT)/PWG2/RESONANCES/macros/train/LHC2010-7TeV-phi/ConfigESDCutsTPC.C");
30 AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE);
31 task->GetEventCuts()->AddCut(cutVertex);
32 task->GetEventCuts()->SetCutScheme(cutVertex->GetName());
34 // add the task to manager
37 // load and execute configuration macroes
38 TString sList(configs);
39 TObjArray *list = sList.Tokenize(" ");
40 Int_t nConfig = list->GetEntries();
42 for (iConfig = 0; iConfig < nConfig; iConfig++)
44 TObjString *ostr = (TObjString*)list->At(iConfig);
45 cout << "***** Processing config macro '" << ostr->GetString().Data() << endl;
46 gROOT->ProcessLine(Form(".x %s/%s(\"%s\",\"%s\")", path, ostr->GetString().Data(), task->GetName(), options));
49 // connect input container according to source choice
50 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
52 // create paths for the output in the common file
53 Char_t commonPath[500];
54 sprintf(commonPath, "%s", AliAnalysisManager::GetCommonFileName());
56 // create containers for output
57 AliAnalysisDataContainer *outputInfo = mgr->CreateContainer("RsnInfo", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
58 AliAnalysisDataContainer *outputHist = mgr->CreateContainer("RsnHist", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
59 mgr->ConnectOutput(task, 1, outputInfo);
60 mgr->ConnectOutput(task, 2, outputHist);