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 // interpret config string
24 TString strDataLabel(options);
25 Bool_t isSim = strDataLabel.Contains("sim");
26 Bool_t isMC = strDataLabel.Contains("MC");
28 // initialize task with all available slots, even if not all of them will be used:
29 AliRsnAnalysisSE *task = new AliRsnAnalysisSE("RsnAnalysis");
30 task->SetZeroEventPercentWarning(100.0);
31 task->SelectCollisionCandidates();
32 if (isMC) task->SetMCOnly(kTRUE);
34 // if not MC kinematics, set cuts for events : primary vertex range and type
37 AliRsnCutPrimaryVertex *cutVertex = new AliRsnCutPrimaryVertex("cutVertex", 10.0, 0, kFALSE);
38 task->GetEventCuts()->AddCut(cutVertex);
39 task->GetEventCuts()->SetCutScheme("cutVertex");
42 // add the task to manager
45 // load and execute configuration macroes
46 TString sList(configs);
47 TObjArray *list = sList.Tokenize(" ");
48 Int_t nConfig = list->GetEntries();
50 for (iConfig = 0; iConfig < nConfig; iConfig++)
52 TObjString *ostr = (TObjString*)list->At(iConfig);
53 cout << "***** Processing config macro '" << ostr->GetString().Data() << endl;
54 gROOT->ProcessLine(Form(".x %s/%s(\"%s\",\"%s\")", path, ostr->GetString().Data(), task->GetName(), options));
57 // connect input container according to source choice
58 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
60 // create paths for the output in the common file
61 Char_t commonPath[500];
62 sprintf(commonPath, "%s", AliAnalysisManager::GetCommonFileName());
64 // create containers for output
65 AliAnalysisDataContainer *outputInfo = mgr->CreateContainer("RsnInfo", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
66 AliAnalysisDataContainer *outputHist = mgr->CreateContainer("RsnHist", TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
67 mgr->ConnectOutput(task, 1, outputInfo);
68 mgr->ConnectOutput(task, 2, outputHist);