]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/SPECTRA/LambdaK0PbPb/CreateAlienHandler.C
Removing deprecated linearization and MC rescaling (now part of the centrality framework)
[u/mrichter/AliRoot.git] / PWG2 / SPECTRA / LambdaK0PbPb / CreateAlienHandler.C
1
2 AliAnalysisGrid* CreateAlienHandler(const char * runlist, TList * listCode, const char * mode, Bool_t isMC)
3 {
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");
26
27
28   // Declare input data to be processed.
29   // Method 1: Create automatically XML collections using alien 'find' command.
30   // Define production directory LFN
31    if(!isMC) 
32      plugin->SetGridDataDir("/alice/data/2010/LHC10h/");
33    else
34      plugin->SetGridDataDir("/alice/sim/LHC10h8/");
35
36    // Set data search pattern
37    if(!isMC)
38      plugin->SetDataPattern("*/pass1/*AliESDs.root");
39    else
40      plugin->SetDataPattern("AliESDs.root");
41
42    plugin->SetNrunsPerMaster(1); // One run per master job
43
44    // ...then add run numbers to be considered   
45    plugin->AddRunNumber(runlist);
46
47
48    plugin->SetGridWorkingDir("LambdaK0/");
49    plugin->SetGridOutputDir("out");
50
51    // plugin->SetDefaultOutputs(kFALSE);
52    // plugin->SetOutputFiles("EventStat_temp.root lambdak0.root");
53    // plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
54
55  
56   // Declare the analysis source files names separated by blancs. To be compiled runtime
57   // using ACLiC on the worker nodes.
58
59    // Load additional stuff
60    TString cxxToLoad, hToLoad;
61    TIterator * iter = listToLoad->MakeIterator();
62    TObjString * str = 0;
63    Bool_t first = kTRUE;
64    while (str = (TObjString*) iter->Next()) {
65      cxxToLoad = cxxToLoad + (first ? "" : " ") + str->String();
66      str->String().ReplaceAll("cxx","h");
67      hToLoad = hToLoad + (first ? "" : " ") + str->String();
68      first = kFALSE;
69    }
70    plugin->SetAnalysisSource(cxxToLoad.Data());
71    plugin->SetAdditionalLibs((hToLoad + " " + cxxToLoad).Data());
72
73
74
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)
91   plugin->SetPrice(1);      
92   // Optionally modify split mode (default 'se')    
93   plugin->SetSplitMode("se");
94   
95   return plugin;
96 }