2 AliAnalysisGrid* CreateAlienHandler(TString dataset, TList * listToLoad, const char * mode = "full", Bool_t isMC = 0)
6 // Check if user has a valid token, otherwise make one. This has limitations.
7 // One can always follow the standard procedure of calling alien-token-init then
8 // source /tmp/gclient_env_$UID in the current shell.
9 // if (!AliAnalysisGrid::CreateToken()) return NULL;
10 TGrid::Connect("alien:");
12 AliAnalysisAlien *plugin = new AliAnalysisAlien();
13 // Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
14 plugin->SetRunMode(mode);
15 //plugin->SetRunMode("test");
16 // Set versions of used packages
17 plugin->SetAPIVersion("V1.1x");
18 plugin->SetROOTVersion("v5-27-06-2");
19 plugin->SetAliROOTVersion("v4-21-03-AN");
20 // Declare input data to be processed.
21 // Method 1: Create automatically XML collections using alien 'find' command.
22 // Define production directory LFN
24 // /alice/data/2009/LHC09d/000104892/ESDs/pass6/
25 plugin->SetGridDataDir(dataset);
26 // Set data search pattern
27 plugin->SetDataPattern("AliESDs.root");
28 // ...then add run numbers to be considered
29 // plugin->AddRunNumber(104892);
30 // plugin->AddRunNumber(300001);
31 // Method 2: Declare existing data files (raw collections, xml collections, root file)
32 // If no path mentioned data is supposed to be in the work directory (see SetGridWorkingDir())
33 // XML collections added via this method can be combined with the first method if
34 // the content is compatible (using or not tags)
35 // plugin->AddDataFile("tag.xml");
36 // plugin->AddDataFile("/alice/data/2008/LHC08c/000057657/raw/Run57657.Merged.RAW.tag.root");
37 // Define alien work directory where all files will be copied. Relative to alien $HOME.
38 TString output = "MultPb/Output_";
39 dataset.ReplaceAll("/","_");
41 plugin->SetGridWorkingDir(output.Data());
42 // Declare alien output directory. Relative to working directory.
43 plugin->SetGridOutputDir("out");
44 // Declare the analysis source files names separated by blancs. To be compiled runtime
45 // using ACLiC on the worker nodes.
46 TIterator * iter = listToLoad->MakeIterator();
47 TObjString * name = 0;
49 // while (name = (TObjString *)iter->Next()) {
50 // gSystem->ExpandPathName(name->String());
51 // name->String().ReplaceAll("+","");
52 // sources = sources + name->String() + " ";
54 while (name = (TObjString *)iter->Next()) {
55 gSystem->ExpandPathName(name->String());
56 name->String().ReplaceAll("+","");
57 sources = sources + gSystem->BaseName(name->String().Data()) + " ";
59 plugin->SetAnalysisSource(sources.Data());
60 // Declare all libraries (other than the default ones for the framework. These will be
61 // loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here.
62 // plugin->SetAdditionalLibs("AliCollisionsNormalization.cxx AliCollisionNormalizationTask.cxx AliPhysicsSelection.cxx AliCollisionsNormalization.h AliCollisionNormalizationTask.h AliPhysicsSelection.h");
63 // iter = listToLoad->MakeIterator();
66 // while (name = (TObjString *)iter->Next()) {
67 // gSystem->ExpandPathName(name->String());
68 // name->String().ReplaceAll("+","");
69 // sources = sources + gSystem->BaseName(name->String().Data()) + " ";
71 // while (name = (TObjString *)iter->Next()) {
72 // gSystem->ExpandPathName(name->String());
73 // name->String().ReplaceAll("+","");
74 // sources = sources + name->String() + " ";
76 plugin->SetAdditionalLibs(sources.Data());
77 // I'm using a modified ANALYSISalice package, so I need to load par files for everything
78 // plugin->EnablePackage("STEERBase");
79 // plugin->EnablePackage("ESD");
80 // plugin->EnablePackage("AOD");
81 // plugin->EnablePackage("CORRFW");
82 // plugin->EnablePackage("ANALYSIS");
83 // plugin->EnablePackage("ANALYSISalice");
85 // Declare the output file names separated by blancs.
86 // (can be like: file.root or file.root@ALICE::Niham::File)
87 // plugin->SetDefaultOutputs(kFALSE);
88 // plugin->SetOutputFiles(Form("EventStat_temp.root %s",outfilename));
89 // plugin->SetOutputFiles("EventStat_temp.root multPbPbtracks.root");
90 // Optionally define the files to be archived.
91 // plugin->SetOutputArchive("log_archive.zip:stdout,stderr@ALICE::NIHAM::File root_archive.zip:*.root@ALICE::NIHAM::File");
92 // plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
93 // Optionally set a name for the generated analysis macro (default MyAnalysis.C)
94 plugin->SetAnalysisMacro("AnalysisMultPb.C");
95 // Optionally set maximum number of input files/subjob (default 100, put 0 to ignore)
96 plugin->SetSplitMaxInputFileNumber(100);
97 // Optionally set number of failed jobs that will trigger killing waiting sub-jobs.
98 plugin->SetMaxInitFailed(5);
99 // Optionally resubmit threshold.
100 plugin->SetMasterResubmitThreshold(90);
101 // Optionally set time to live (default 30000 sec)
102 plugin->SetTTL(30000);
103 // Optionally set input format (default xml-single)
104 plugin->SetInputFormat("xml-single");
105 // Optionally modify the name of the generated JDL (default analysis.jdl)
106 plugin->SetJDLName("TaskMultPb.jdl");
107 // Optionally modify job price (default 1)
109 // Optionally modify split mode (default 'se')
110 plugin->SetSplitMode("se");