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