2 AliAnalysisGrid* CreateAlienHandler(const char * runlist, TList * listCode, const char * mode, Bool_t isMC)
4 // FIXME: different paths
5 // Check if user has a valid token, otherwise make one. This has limitations.
6 // One can always follow the standard procedure of calling alien-token-init then
7 // source /tmp/gclient_env_$UID in the current shell.
8 if (!AliAnalysisGrid::CreateToken()) return NULL;
9 AliAnalysisAlien *plugin = new AliAnalysisAlien();
10 plugin->SetOverwriteMode();
11 // Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
12 plugin->SetRunMode(mode);
13 // Set versions of used packages
14 // FIXME: PAR FILES OPTIONAL?
15 plugin->SetAPIVersion("V1.1x");
16 plugin->SetROOTVersion("v5-27-06b");
17 // plugin->SetAliROOTVersion("v4-21-09-AN");
18 // PAR files: I'm using a modified ANALYSISalice package, so I need to load par files for everything
19 plugin->EnablePackage("STEERBase");
20 plugin->EnablePackage("ESD");
21 plugin->EnablePackage("AOD");
22 plugin->EnablePackage("CORRFW");
23 plugin->EnablePackage("ANALYSIS");
24 plugin->EnablePackage("ANALYSISalice");
25 plugin->EnablePackage("OADB");
28 // Declare input data to be processed.
29 // Method 1: Create automatically XML collections using alien 'find' command.
30 // Define production directory LFN
32 plugin->SetGridDataDir("/alice/data/2010/LHC10h/");
34 plugin->SetGridDataDir("/alice/sim/LHC10h8/");
36 // Set data search pattern
38 plugin->SetDataPattern("*/pass1/*AliESDs.root");
40 plugin->SetDataPattern("AliESDs.root");
42 plugin->SetNrunsPerMaster(1); // One run per master job
44 // ...then add run numbers to be considered
45 plugin->AddRunNumber(runlist);
48 plugin->SetGridWorkingDir("LambdaK0/");
49 plugin->SetGridOutputDir("out");
51 // plugin->SetDefaultOutputs(kFALSE);
52 // plugin->SetOutputFiles("EventStat_temp.root lambdak0.root");
53 // plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
56 // Declare the analysis source files names separated by blancs. To be compiled runtime
57 // using ACLiC on the worker nodes.
59 // Load additional stuff
60 TString cxxToLoad, hToLoad;
61 TIterator * iter = listToLoad->MakeIterator();
64 while (str = (TObjString*) iter->Next()) {
65 cxxToLoad = cxxToLoad + (first ? "" : " ") + str->String();
66 str->String().ReplaceAll("cxx","h");
67 hToLoad = hToLoad + (first ? "" : " ") + str->String();
70 plugin->SetAnalysisSource(cxxToLoad.Data());
71 plugin->SetAdditionalLibs((hToLoad + " " + cxxToLoad).Data());
75 // Optionally set a name for the generated analysis macro (default MyAnalysis.C)
76 plugin->SetAnalysisMacro("AnalysisStrange.C");
77 // Optionally set maximum number of input files/subjob (default 100, put 0 to ignore)
78 //plugin->SetSplitMaxInputFileNumber(100);
79 plugin->SetSplitMaxInputFileNumber(50);
80 // Optionally set number of failed jobs that will trigger killing waiting sub-jobs.
81 plugin->SetMaxInitFailed(5);
82 // Optionally resubmit threshold.
83 plugin->SetMasterResubmitThreshold(90);
84 // Optionally set time to live (default 30000 sec)
85 plugin->SetTTL(90000);
86 // Optionally set input format (default xml-single)
87 plugin->SetInputFormat("xml-single");
88 // Optionally modify the name of the generated JDL (default analysis.jdl)
89 plugin->SetJDLName("TaskStrange.jdl");
90 // Optionally modify job price (default 1)
92 // Optionally modify split mode (default 'se')
93 plugin->SetSplitMode("se");