2 // This is an example steering macro for running RSN analysis task
3 // with the AliEn plugin on PROOF.
7 // - runMode = AliEn plugin run mode
8 // - suffix = eventual suffix which is attached to the automatic name created for outputs
9 // - partname = a string which defines the resonance name (used for output)
10 // - runList = configuration file whith gives list of runs, pattern, prefix, options and AliEn path
11 // - split = corresponding JDL value
12 // - nmerge = number of outputs to be merged per stage
14 // - taskList = a string containin all the 'add-task' macros to be used
15 // - taskPath = the uniqu pathe where all 'add-task' macros (and all their needs) are stored
17 // - workDirBase = path of the working directory (starting from AliEn home)
18 // - outDir = path of the output directory (w.r. to workDir)
22 // - in case the source is an ESD, and if inputs are a MC production
23 // the MC input handler is created by default
26 // In principle, the user should never modify this macro.
30 const char *runMode = "full",
32 const char *dataSet = "/alice/data/LHC10h_000137162#esdTree",
33 const char *clusterName = "alice-caf.cern.ch",
34 const char *testFile = "pbpb_data.txt",
35 const char *runOptions = "esd_data_phys_cent",
36 const char *analysisOptions = "tpcpid_tofpid",
37 const char *outName = "test_proof.root",
38 const char *taskList = "AddRsnAnalysisTask.C",
39 //const char *taskPath = "$(ALICE_ROOT)/PWG2/RESONANCES/macros/train"
40 const char *taskPath = "$(HOME)/code/resonances/alice-rsn-package/PWG2resonances/RESONANCES/macros/test/pulvir"
44 // === PREPARATION ==============================================================================
47 // this option is not needed when using plugin
48 // gEnv->SetValue("XSec.GSI.DelegProxy","2");
51 TString opt(runOptions);
53 Bool_t useTender = opt.Contains("TENDER");
54 Bool_t isMC = opt.Contains("MC") || (!opt.Contains("DATA"));
55 ::Info("runPlugin.C", "useTender = %d", useTender);
56 ::Info("runPlugin.C", "isMC = %d", isMC );
57 ::Info("runPlugin.C", "runOpts = %s", runOptions);
58 ::Info("runPlugin.C", "anaOpts = %s", analysisOptions);
60 // basic configurations
61 gROOT->LoadMacro(Form("%s/AnalysisSetup.C", taskPath));
62 AnalysisSetup(isMC, nmix, runOptions, outName, taskPath);
65 // === PLUGIN CONFIGURATION =====================================================================
68 // load and execute plugin configuration macro
69 // pass to the macro, as FIRST argument, the common name
70 // which is used for the output, since it must be equal
71 // to the one defined here for the common output (for merging)
72 gROOT->LoadMacro("PluginByRunProof.C");
74 // build the list of arguments (for them see the 'PluginByRun.C' code)
75 TString args("PluginByRunProof(");
76 args += Form("\"%s\", ", dataSet);
77 args += Form("\"%s\", ", testFile);
78 args += Form("\"%s\") ", clusterName);
81 AliAnalysisAlien *plugin = (AliAnalysisAlien*)gROOT->ProcessLine(args.Data());
84 plugin->SetRunMode(runMode);
87 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
89 mgr->SetGridHandler(plugin);
92 // === ANALYSIS EXECUTION =======================================================================
95 gROOT->LoadMacro(Form("%s/AddRsnAnalysisTask.C", taskPath));
96 AddRsnAnalysisTask(isMC, kFALSE, runOptions, analysisOptions);
98 // initialize and start analysis
99 if (!mgr->InitAnalysis()) {
100 ::Error("runPlugin.C", "Failed to init analysis");
104 mgr->StartAnalysis("proof");