]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/FLOW/macros/CreateAlienHandler.C
1.) runFlowTask.C:
[u/mrichter/AliRoot.git] / PWG2 / FLOW / macros / CreateAlienHandler.C
1 AliAnalysisGrid* CreateAlienHandler() {
2   // Check if user has a valid token, otherwise make one. This has limitations.
3   // One can always follow the standard procedure of calling alien-token-init 
4   // then source /tmp/gclient_env_$UID in the current shell.
5   if (!AliAnalysisGrid::CreateToken()) return NULL;
6   AliAnalysisAlien *plugin = new AliAnalysisAlien();
7   
8   // Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
9   plugin->SetRunMode("test");
10   plugin->SetNtestFiles(2); // Relevant only for run mode "test" 
11
12   // Set versions of used packages
13   plugin->SetAPIVersion("V1.1x");
14   plugin->SetROOTVersion("v5-26-00b-2");
15   plugin->SetAliROOTVersion("v4-19-10-AN");
16
17   // Declare input data to be processed - can be done in two ways:
18   // METHOD 1: Create automatically XML collections using alien 'find' command.
19   // ============================================================================
20   //  Example 1: MC production (set in macro runFlowTask.C: DATA = kFALSE)
21   // plugin->SetGridDataDir("/alice/sim/LHC10a10");
22   // plugin->SetDataPattern("*AliESDs.root"); // The default data pattern, other may be "*tag.root", "*ESD.tag.root", etc
23   // plugin->AddRunNumber(105054); // Alternatively use e.g. plugin->SetRunRange(105044,106044); to add more runs in one go  
24   // plugin->SetOutputToRunNo();  
25   // ============================================================================
26   //  Example 2: Real data (set in macro runFlowTask.C: DATA = kTRUE, MCEP = kFALSE)
27   plugin->SetGridDataDir("/alice/data/2009/LHC09d");
28   plugin->SetDataPattern("*ESDs/pass5/*ESDs.root");
29   plugin->SetRunPrefix("000");
30   plugin->AddRunNumber(104044); 
31   plugin->AddRunNumber(104892); // Alternatively use e.g. plugin->SetRunRange(104044,106044); to add more runs in one go 
32   plugin->SetOutputToRunNo();  
33   // ============================================================================
34  
35   // METHOD 2: Declare existing data files (raw collections, xml collections, root file)
36   // If no path mentioned data is supposed to be in the work directory (see SetGridWorkingDir())
37   // XML collections added via this method can be combined with the first method if
38   // the content is compatible (using or not tags)
39   //plugin->AddDataFile("hijingWithoutFlow10000Evts.xml");
40   //   plugin->AddDataFile("/alice/data/2008/LHC08c/000057657/raw/Run57657.Merged.RAW.tag.root");
41   // Define alien work directory where all files will be copied. Relative to alien $HOME.
42   plugin->SetGridWorkingDir("realData/900GeV");
43   // Declare alien output directory. Relative to working directory.
44   plugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output
45   // Declare the analysis source files names separated by blancs. To be compiled runtime
46   // using ACLiC on the worker nodes:
47   // ... (if this is needed see in official tutorial example how to do it!)
48
49   // Declare all libraries (other than the default ones for the framework. These will be
50   // loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here.
51   plugin->SetAdditionalLibs("libPWG2flowCommon.so libPWG2flowTasks.so");
52   // Declare the output file names separated by blancs.
53   // (can be like: file.root or file.root@ALICE::Niham::File)
54   plugin->SetOutputFiles("AnalysisResults.root ");
55   // Optionally define the files to be archived.
56   //   plugin->SetOutputArchive("log_archive.zip:stdout,stderr@ALICE::NIHAM::File root_archive.zip:*.root@ALICE::NIHAM::File");
57   //plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
58   plugin->SetOutputArchive("log_archive.zip:");
59   // Optionally set a name for the generated analysis macro (default MyAnalysis.C)
60   plugin->SetAnalysisMacro("flowAnalysis.C");
61   // Optionally set maximum number of input files/subjob (default 100, put 0 to ignore)
62   plugin->SetSplitMaxInputFileNumber(100);
63   // Optionally set number of failed jobs that will trigger killing waiting sub-jobs.
64   plugin->SetMaxInitFailed(5);
65   // Optionally resubmit threshold.
66   plugin->SetMasterResubmitThreshold(90);
67   // Optionally set time to live (default 30000 sec)
68   plugin->SetTTL(20000);
69   // Optionally set input format (default xml-single)
70   plugin->SetInputFormat("xml-single");
71   // Optionally modify the name of the generated JDL (default analysis.jdl)
72   plugin->SetJDLName("flowAnalysis.jdl");
73   // Optionally modify job price (default 1)
74   plugin->SetPrice(1);      
75   // Optionally modify split mode (default 'se')    
76   plugin->SetSplitMode("se");
77
78   return plugin;
79 }