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.
13 Bool_t AddRsnAnalysisMult
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 // initialize multiplicity bins
24 Int_t multMin[] = {0, 0, 6, 10, 15, 23 , 6, 11, 21, 31, 51, 76, 101, 126, 151, 201 };
25 Int_t multMax[] = {0, 5, 9, 14, 22, 100000000, 10, 20, 30, 50, 75, 100, 125, 150, 200, 100000000};
26 Int_t nmult = sizeof(multMin) / sizeof(multMin[0]);
28 // initialize several tasks, each one with different multiplicity cut
29 // and all with the same primary vertex + pile-up cut
30 for (Int_t i = 0; i < nmult; i++)
32 // create the task and connect with physics selection
33 AliRsnAnalysisSE *task = new AliRsnAnalysisSE(Form("RsnAnalysis_%d", i));
34 task->SetZeroEventPercentWarning(100.0);
35 task->SelectCollisionCandidates();
37 // add the task to manager
40 // load and execute all required configuration macroes in the string (arg #2)
41 TString sList = configs;
42 TObjArray *list = sList.Tokenize(" ");
43 Int_t nConfig = list->GetEntries();
45 for (iConfig = 0; iConfig < nConfig; iConfig++)
47 TObjString *ostr = (TObjString*)list->At(iConfig);
49 // the config macro is assumed to be stored in the path in argument #3
50 // and to have three arguments: task name, a free string of options and the path where it is stored
51 // --> all of them is a string, and then it must be passed with the quote marks
52 const char *macro = ostr->GetString().Data();
53 const char *argName = Form("\"%s\"", task->GetName());
54 const char *argOption = Form("\"%s\"", options);
55 const char *argPath = Form("\"%s\"", path);
56 const char *argMult = Form("%d, %d", multMin[i], multMax[i]);
57 gROOT->ProcessLine(Form(".x %s/%s(%s,%s,%s, %s)", path, macro, argName, argOption, argPath, argMult));
60 // connect input container according to source choice
61 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
63 // create paths for the output in the common file
64 Char_t commonPath[500];
65 sprintf(commonPath, "%s", AliAnalysisManager::GetCommonFileName());
67 // create containers for output
68 AliAnalysisDataContainer *outputInfo = mgr->CreateContainer(Form("RsnInfo_%d", i), TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
69 AliAnalysisDataContainer *outputHist = mgr->CreateContainer(Form("RsnHist_%d", i), TList::Class(), AliAnalysisManager::kOutputContainer, commonPath);
70 mgr->ConnectOutput(task, 1, outputInfo);
71 mgr->ConnectOutput(task, 2, outputHist);
73 } // end loop on tasks