]>
Commit | Line | Data |
---|---|---|
9cc5e012 | 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(); | |
61e0c8c0 | 7 | |
5c09ff70 | 8 | // Set if you want to use par files on Grid: |
9 | Bool_t bUseParFiles = kFALSE; | |
10 | ||
9cc5e012 | 11 | // Set the run mode (can be "full", "test", "offline", "submit" or "terminate") |
a02a1889 | 12 | //plugin->SetRunMode("test"); |
13 | //plugin->SetRunMode("offline"); | |
14 | //plugin->SetRunMode("submit"); | |
15 | plugin->SetRunMode("full"); | |
16 | //plugin->SetRunMode("terminate"); | |
f630b0f9 | 17 | plugin->SetNtestFiles(1); // Relevant only for run mode "test" |
61e0c8c0 | 18 | |
9cc5e012 | 19 | // Set versions of used packages |
20 | plugin->SetAPIVersion("V1.1x"); | |
8544d490 | 21 | plugin->SetROOTVersion("v5-27-06b"); |
22 | plugin->SetAliROOTVersion("v4-21-04-AN"); | |
5c09ff70 | 23 | |
61e0c8c0 | 24 | // Declare input data to be processed - can be done in two ways: |
25 | // METHOD 1: Create automatically XML collections using alien 'find' command. | |
26 | // ============================================================================ | |
27 | // Example 1: MC production (set in macro runFlowTask.C: DATA = kFALSE) | |
8544d490 | 28 | //plugin->SetGridDataDir("/alice/sim/LHC10d4"); |
29 | //plugin->SetDataPattern("*AliESDs.root"); // The default data pattern, other may be "*tag.root", "*ESD.tag.root", etc | |
30 | //plugin->AddRunNumber(119844); // Alternatively use e.g. plugin->SetRunRange(105044,106044); to add more runs in one go | |
31 | //plugin->SetOutputToRunNo(); | |
61e0c8c0 | 32 | // ============================================================================ |
33 | // Example 2: Real data (set in macro runFlowTask.C: DATA = kTRUE, MCEP = kFALSE) | |
8544d490 | 34 | plugin->SetGridDataDir("/alice/data/2010/LHC10h"); |
35 | plugin->SetDataPattern("*ESDs/pass1/*ESDs.root"); | |
36 | plugin->SetRunPrefix("000"); // IMPORTANT! | |
37 | plugin->AddRunNumber(137042); | |
5c09ff70 | 38 | // plugin->AddRunNumber(119844); // Alternatively use e.g. plugin->SetRunRange(104044,106044); to add more runs in one go |
8544d490 | 39 | plugin->SetOutputToRunNo(); |
61e0c8c0 | 40 | // ============================================================================ |
41 | ||
42 | // METHOD 2: Declare existing data files (raw collections, xml collections, root file) | |
9cc5e012 | 43 | // If no path mentioned data is supposed to be in the work directory (see SetGridWorkingDir()) |
44 | // XML collections added via this method can be combined with the first method if | |
45 | // the content is compatible (using or not tags) | |
46 | //plugin->AddDataFile("hijingWithoutFlow10000Evts.xml"); | |
47 | // plugin->AddDataFile("/alice/data/2008/LHC08c/000057657/raw/Run57657.Merged.RAW.tag.root"); | |
48 | // Define alien work directory where all files will be copied. Relative to alien $HOME. | |
a02a1889 | 49 | plugin->SetGridWorkingDir("data"); |
9cc5e012 | 50 | // Declare alien output directory. Relative to working directory. |
a02a1889 | 51 | plugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output |
9cc5e012 | 52 | // Declare the analysis source files names separated by blancs. To be compiled runtime |
53 | // using ACLiC on the worker nodes: | |
54 | // ... (if this is needed see in official tutorial example how to do it!) | |
55 | ||
56 | // Declare all libraries (other than the default ones for the framework. These will be | |
57 | // loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here. | |
5c09ff70 | 58 | if(!bUseParFiles) |
59 | { | |
60 | plugin->SetAdditionalLibs("libPWG2flowCommon.so libPWG2flowTasks.so"); | |
61 | } else // load libs via par files | |
62 | { | |
63 | plugin->EnablePackage("PWG2flowCommon.par"); | |
64 | plugin->EnablePackage("PWG2flowTasks.par"); | |
65 | } | |
a02a1889 | 66 | // Do not specify your outputs by hand anymore: |
67 | plugin->SetDefaultOutputs(kTRUE); | |
68 | // To specify your outputs by hand set plugin->SetDefaultOutputs(kFALSE); and comment in line plugin->SetOutputFiles("..."); | |
69 | // and plugin->SetOutputArchive("..."); bellow. | |
9cc5e012 | 70 | // Declare the output file names separated by blancs. |
71 | // (can be like: file.root or file.root@ALICE::Niham::File) | |
a02a1889 | 72 | // plugin->SetOutputFiles("AnalysisResults.root"); |
9cc5e012 | 73 | // Optionally define the files to be archived. |
a02a1889 | 74 | // plugin->SetOutputArchive("log_archive.zip:stdout,stderr@ALICE::NIHAM::File root_archive.zip:*.root@ALICE::NIHAM::File"); |
75 | // plugin->SetOutputArchive("log_archive.zip:stdout,stderr"); | |
76 | // plugin->SetOutputArchive("log_archive.zip:"); | |
9cc5e012 | 77 | // Optionally set a name for the generated analysis macro (default MyAnalysis.C) |
78 | plugin->SetAnalysisMacro("flowAnalysis.C"); | |
79 | // Optionally set maximum number of input files/subjob (default 100, put 0 to ignore) | |
80 | plugin->SetSplitMaxInputFileNumber(100); | |
a02a1889 | 81 | // Optionally set number of runs per masterjob: |
82 | plugin->SetNrunsPerMaster(1); | |
83 | // Optionally set overwrite mode. Will trigger overwriting input data colections AND existing output files: | |
84 | plugin->SetOverwriteMode(kTRUE); | |
9cc5e012 | 85 | // Optionally set number of failed jobs that will trigger killing waiting sub-jobs. |
86 | plugin->SetMaxInitFailed(5); | |
87 | // Optionally resubmit threshold. | |
88 | plugin->SetMasterResubmitThreshold(90); | |
89 | // Optionally set time to live (default 30000 sec) | |
5c09ff70 | 90 | plugin->SetTTL(100000); |
9cc5e012 | 91 | // Optionally set input format (default xml-single) |
92 | plugin->SetInputFormat("xml-single"); | |
93 | // Optionally modify the name of the generated JDL (default analysis.jdl) | |
94 | plugin->SetJDLName("flowAnalysis.jdl"); | |
95 | // Optionally modify job price (default 1) | |
96 | plugin->SetPrice(1); | |
97 | // Optionally modify split mode (default 'se') | |
98 | plugin->SetSplitMode("se"); | |
99 | ||
100 | return plugin; | |
101 | } |