ROOT logo
//
// This is an example steering macro for running RSN analysis task
// with the AliEn plugin on PROOF.
//
// Inputs:
//
//   - runMode     = AliEn plugin run mode
//   - suffix      = eventual suffix which is attached to the automatic name created for outputs
//   - partname    = a string which defines the resonance name (used for output)
//   - runList     = configuration file whith gives list of runs, pattern, prefix, options and AliEn path
//   - split       = corresponding JDL value
//   - nmerge      = number of outputs to be merged per stage
//
//   - taskList    = a string containin all the 'add-task' macros to be used
//   - taskPath    = the uniqu pathe where all 'add-task' macros (and all their needs) are stored
//
//   - workDirBase = path of the working directory (starting from AliEn home)
//   - outDir      = path of the output directory (w.r. to workDir)
//
// Notes:
//
//   - in case the source is an ESD, and if inputs are a MC production
//     the MC input handler is created by default
//
//
// In principle, the user should never modify this macro.
//
void runPluginProof
(
   const char *runMode         = "full",
   Int_t       nmix            = 0,
   const char *dataSet         = "/alice/data/LHC10h_000137162#esdTree",
   const char *clusterName     = "alice-caf.cern.ch",
   const char *testFile        = "pbpb_data.txt",
   const char *runOptions      = "esd_data_phys_cent",
   const char *analysisOptions = "tpcpid_tofpid",
   const char *outName         = "test_proof.root",
   const char *taskList        = "AddRsnAnalysisTask.C",
   //const char *taskPath        = "$(ALICE_ROOT)/PWG2/RESONANCES/macros/train"
   const char *taskPath        = "$(HOME)/code/resonances/alice-rsn-package/PWG2resonances/RESONANCES/macros/test/pulvir"
)
{
   //
   // === PREPARATION ==============================================================================
   //
   
   // this option is not needed when using plugin
   // gEnv->SetValue("XSec.GSI.DelegProxy","2");
   
   // some options
   TString opt(runOptions);
   opt.ToUpper();
   Bool_t useTender = opt.Contains("TENDER");
   Bool_t isMC      = opt.Contains("MC") || (!opt.Contains("DATA"));
   ::Info("runPlugin.C", "useTender = %d", useTender);
   ::Info("runPlugin.C", "isMC      = %d", isMC     );
   ::Info("runPlugin.C", "runOpts   = %s", runOptions);
   ::Info("runPlugin.C", "anaOpts   = %s", analysisOptions);
   
   // basic configurations
   gROOT->LoadMacro(Form("%s/AnalysisSetup.C", taskPath));
   AnalysisSetup(isMC, nmix, runOptions, outName, taskPath);

   //
   // === PLUGIN CONFIGURATION =====================================================================
   //

   // load and execute plugin configuration macro
   // pass to the macro, as FIRST argument, the common name
   // which is used for the output, since it must be equal
   // to the one defined here for the common output (for merging)
   gROOT->LoadMacro("PluginByRunProof.C");

   // build the list of arguments (for them see the 'PluginByRun.C' code)
   TString args("PluginByRunProof(");
   args += Form("\"%s\", ", dataSet);
   args += Form("\"%s\", ", testFile);
   args += Form("\"%s\") ", clusterName);

   // create the plugin
   AliAnalysisAlien *plugin = (AliAnalysisAlien*)gROOT->ProcessLine(args.Data());

   // set run mode
   plugin->SetRunMode(runMode);
   
   // add to manager
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) return;
   mgr->SetGridHandler(plugin);
   
   //
   // === ANALYSIS EXECUTION =======================================================================
   //

   gROOT->LoadMacro(Form("%s/AddRsnAnalysisTask.C", taskPath));
   AddRsnAnalysisTask(isMC, kFALSE, runOptions, analysisOptions);
   
   // initialize and start analysis
   if (!mgr->InitAnalysis()) {
      ::Error("runPlugin.C", "Failed to init analysis");
      return;
   }
   mgr->PrintStatus();
   mgr->StartAnalysis("proof");
}
 runPluginProof.C:1
 runPluginProof.C:2
 runPluginProof.C:3
 runPluginProof.C:4
 runPluginProof.C:5
 runPluginProof.C:6
 runPluginProof.C:7
 runPluginProof.C:8
 runPluginProof.C:9
 runPluginProof.C:10
 runPluginProof.C:11
 runPluginProof.C:12
 runPluginProof.C:13
 runPluginProof.C:14
 runPluginProof.C:15
 runPluginProof.C:16
 runPluginProof.C:17
 runPluginProof.C:18
 runPluginProof.C:19
 runPluginProof.C:20
 runPluginProof.C:21
 runPluginProof.C:22
 runPluginProof.C:23
 runPluginProof.C:24
 runPluginProof.C:25
 runPluginProof.C:26
 runPluginProof.C:27
 runPluginProof.C:28
 runPluginProof.C:29
 runPluginProof.C:30
 runPluginProof.C:31
 runPluginProof.C:32
 runPluginProof.C:33
 runPluginProof.C:34
 runPluginProof.C:35
 runPluginProof.C:36
 runPluginProof.C:37
 runPluginProof.C:38
 runPluginProof.C:39
 runPluginProof.C:40
 runPluginProof.C:41
 runPluginProof.C:42
 runPluginProof.C:43
 runPluginProof.C:44
 runPluginProof.C:45
 runPluginProof.C:46
 runPluginProof.C:47
 runPluginProof.C:48
 runPluginProof.C:49
 runPluginProof.C:50
 runPluginProof.C:51
 runPluginProof.C:52
 runPluginProof.C:53
 runPluginProof.C:54
 runPluginProof.C:55
 runPluginProof.C:56
 runPluginProof.C:57
 runPluginProof.C:58
 runPluginProof.C:59
 runPluginProof.C:60
 runPluginProof.C:61
 runPluginProof.C:62
 runPluginProof.C:63
 runPluginProof.C:64
 runPluginProof.C:65
 runPluginProof.C:66
 runPluginProof.C:67
 runPluginProof.C:68
 runPluginProof.C:69
 runPluginProof.C:70
 runPluginProof.C:71
 runPluginProof.C:72
 runPluginProof.C:73
 runPluginProof.C:74
 runPluginProof.C:75
 runPluginProof.C:76
 runPluginProof.C:77
 runPluginProof.C:78
 runPluginProof.C:79
 runPluginProof.C:80
 runPluginProof.C:81
 runPluginProof.C:82
 runPluginProof.C:83
 runPluginProof.C:84
 runPluginProof.C:85
 runPluginProof.C:86
 runPluginProof.C:87
 runPluginProof.C:88
 runPluginProof.C:89
 runPluginProof.C:90
 runPluginProof.C:91
 runPluginProof.C:92
 runPluginProof.C:93
 runPluginProof.C:94
 runPluginProof.C:95
 runPluginProof.C:96
 runPluginProof.C:97
 runPluginProof.C:98
 runPluginProof.C:99
 runPluginProof.C:100
 runPluginProof.C:101
 runPluginProof.C:102
 runPluginProof.C:103
 runPluginProof.C:104
 runPluginProof.C:105
 runPluginProof.C:106