]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/RESONANCES/macros/lego_train/old/SetupAnalysisPlugin.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / macros / lego_train / old / SetupAnalysisPlugin.C
CommitLineData
3248b3db 1#ifndef __CINT__
2#include <TSystem.h>
3#include <ANALYSIS/AliAnalysisAlien.h>
4#endif
5
6AliAnalysisGrid *SetupAnalysisPlugin(TString analysisMode)
7{
8
9 AliAnalysisAlien *plugin = new AliAnalysisAlien();
10
11 // Overwrite all generated files, datasets and output results from a previous session
12 plugin->SetOverwriteMode();
13 // Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
14 plugin->SetRunMode(analysisMode.Data()); // VERY IMPORTANT - DECRIBED BELOW
15
16 // seutp aliroot version
17 TString alirootVersion = gSystem->GetFromPipe("aliroot --version | awk '{print $3}'");
18// alirootVersion="v5-02-05-AN";
19 plugin->SetAliROOTVersion(alirootVersion.Data());
20 // adds Proof setting
21 MySetupAnalysisPluginProof(plugin,analysisMode);
22
23 // adds AliEn settings
24 MySetupAnalysisPluginAliEn(plugin);
25
26 return plugin;
27}
28
29void MySetupAnalysisPluginProof(AliAnalysisAlien *plugin,TString analysisMode)
30{
31
32 plugin->SetProofParameter("PROOF_UseMergers", "-1");
33 if (!analysisMode.CompareTo("full")) plugin->SetProofParameter("PROOF_ForceLocal", "1");
34 plugin->SetProofCluster("alice-caf.cern.ch");
35// plugin->SetProofCluster("alice-caf.cern.ch:1099");
36// plugin->SetProofCluster("skaf.saske.sk");
37// plugin->SetProofCluster("skaf.saske.sk:1099");
38 plugin->SetProofCluster("kiaf.sdfarm.kr");
39
40 // May need to reset proof. Supported modes: 0-no reset, 1-soft, 2-hard
41 plugin->SetProofReset(0);
42// May limit the number of workers per slave. If used with SetNproofWorkers, SetParallel(nproofworkers) will be called after connection
43// plugin->SetNproofWorkers(1);
44// plugin->SetNproofWorkersPerSlave(1);
45// May request connection to alien upon connection to grid
46// plugin->SetProofConnectGrid(kTRUE);
47
48// plugin->SetNproofWorkers(10);
49// May use a specific version of root installed in proof
50// plugin->SetRootVersionForProof("VO_ALICE@ROOT::v5-28-00d");
51// plugin->SetRootVersionForProof("current");
52// May set the aliroot mode. Check http://aaf.cern.ch/node/83
53 plugin->SetAliRootMode("default"); // Loads AF libs by default
54// plugin->SetAliRootMode("ALIROOT"); // Loads AF libs by default
55// May request ClearPackages (individual ClearPackage not supported)
56// plugin->SetClearPackages();
57// Plugin test mode works only providing a file containing test file locations
58
59 // test file
60 plugin->SetFileForTestMode("files.txt");
61
62 // dataset
63 plugin->SetProofDataSet("/alice/sim/LHC11a10b_000137539_AOD048");
64
65 // list of datasets in txt file
66 plugin->SetProofDataSet("ds.txt");
67
68 //++++++++++++++ end PROOF ++++++++++++++++
69
70}
71
72void MySetupAnalysisPluginAliEn(AliAnalysisAlien *plugin)
73{
74
75// plugin->SetAPIVersion("V1.1x");
76// plugin->SetROOTVersion("v5-28-00c");
77// // plugin->SetAliROOTVersion("v4-20-13-AN");
78// plugin->SetExecutableCommand("aliroot -b -q");
79//
80//
81// // Method 1: Create automatically XML collections using alien 'find' command.
82// // Define production directory LFN
83//
84// Int_t nRunsPerMaster = 0;
85// Int_t maxRunsPerMaster = 100;
86// TString runs = "";
87// // DATA
88// plugin->SetGridDataDir("/alice/data/2010/LHC10b");
89// plugin->SetDataPattern("*ESDs/pass2/*ESDs.root"); // real data check reco pass and data base directory
90// plugin->SetRunPrefix("000"); // real data
91// runs = "117222, 117220, 117116, 117112, 117109, 117099, 117092, 117063, 117060, 117059, 117053, 117052, 117050, 117048, 116643, 116574, 116571, 116562, 116403, 116402, 116288, 116102, 115414, 115401, 115393, 115193, 115186, 114931";
92// plugin->SetSplitMaxInputFileNumber(1);
93// // // AOD
94// // plugin->SetGridDataDir("/alice/data/2010/LHC10b");
95// // plugin->SetDataPattern("*ESDs/pass2/AOD034/*AliAOD.root");
96// // plugin->SetRunPrefix("000"); // real data
97//
98// // plugin->SetDataPattern("*tag.root"); // Use ESD tags (same applies for AOD's)
99// // ...then add run numbers to be considered
100// // plugin->AddRunNumber(125020); // simulated
101//
102// // // sim
103// // plugin->SetGridDataDir("/alice/sim/LHC10d4/");
104// // plugin->SetDataPattern("*ESDs.root"); // real data check reco pass and data base directory
105// // plugin->SetRunPrefix(""); // sim data
106// // runs = "120829,120825";
107// // // runs = "120829,120825,120824,120823,120822,120821,120820,120758,120750";
108// // plugin->SetSplitMaxInputFileNumber(10);
109//
110// plugin->SetGridDataDir("/alice/data/2010/LHC10h");
111// plugin->SetDataPattern("*ESDs/pass2/*ESDs.root"); // real data check reco pass and data base directory
112// plugin->SetRunPrefix("000"); // real data
113// runs = "137366";
114// // runs = "137366, 138200, 139172";
115// plugin->SetSplitMaxInputFileNumber(100);
116//
117//
118// // AOD
119// // runs = "117220";
120// TObjArray *array = runs.Tokenize(",");
121// TObjString *str;
122// TString strr, strr2_1, strr2_2;
123// for (Int_t i = 0; i < array->GetEntriesFast(); i++) {
124// str = (TObjString *) array->At(i);
125// strr = str->GetString();
126// if (!strr.IsNull()) {
127// plugin->AddRunNumber(strr.Atoi());
128// nRunsPerMaster++;
129// }
130// }
131//
132//
133// if (nRunsPerMaster > maxRunsPerMaster) nRunsPerMaster = maxRunsPerMaster;
134// plugin->SetNrunsPerMaster(nRunsPerMaster);
135//
136// // Method 2: Declare existing data files (raw collections, xml collections, root file)
137// // If no path mentioned data is supposed to be in the work directory (see SetGridWorkingDir())
138// // XML collections added via this method can be combined with the first method if
139// // the content is compatible (using or not tags)
140// // plugin->AddDataFile("tag.xml");
141// // plugin->AddDataFile("/alice/data/2008/LHC08c/000057657/raw/Run57657.Merged.RAW.tag.root");
142//
143// // Define alien work directory where all files will be copied. Relative to alien $HOME.
144// plugin->SetGridWorkingDir("work/rsn/PbPb/0001/");
145// // Declare alien output directory. Relative to working directory.
146// plugin->SetGridOutputDir("output"); // In this case will be $HOME/work/output
147// // Declare the analysis source files names separated by blancs. To be compiled runtime
148// // using ACLiC on the worker nodes.
149// // plugin->SetAnalysisSource("AliAnalysisTaskCustomMix.cxx");
150// // plugin->SetAdditionalRootLibs("CORRFW PWG2resonances");
151// // plugin->SetAdditionalRootLibs("PWG2resonances");
152// // plugin->SetAdditionalRootLibs("PWG2resonances");
153// //
154// // plugin->SetAdditionalLibs("AliAnalysisTaskCustomMix.h AliAnalysisTaskCustomMix.cxx");
155// // plugin->EnablePackage("PWG2resonances");
156// // plugin->EnablePackage("");
157// // plugin->EnablePackage("");
158// // Declare all libraries (other than the default ones for the framework. These will be
159// // loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here.
160//
161// // No need for output file names. Procedure is automatic.
162// // plugin->SetOutputFiles("Pt.ESD.1.root");
163// // plugin->SetDefaultOutputs();
164// // No need define the files to be archived. Note that this is handled automatically by the plugin.
165// // plugin->SetOutputArchive("log_archive.zip:stdout,stderr");
166// // Set a name for the generated analysis macro (default MyAnalysis.C) Make this unique !
167// plugin->SetAnalysisMacro("AnalysisTest.C");
168// // Optionally set maximum number of input files/subjob (default 100, put 0 to ignore). The optimum for an analysis
169// // is correlated with the run time - count few hours TTL per job, not minutes !
170// // plugin->SetSplitMaxInputFileNumber(1);
171// // Optionally set number of failed jobs that will trigger killing waiting sub-jobs.
172// // plugin->SetMaxInitFailed(5);
173// // Optionally resubmit threshold.
174// plugin->SetMasterResubmitThreshold(90);
175// // Optionally set time to live (default 30000 sec)
176// // plugin->SetTTL(20000);
177// // 23h 30m
178// plugin->SetTTL(84600);
179//
180// // Optionally set input format (default xml-single)
181// plugin->SetInputFormat("xml-single");
182// // Optionally modify the name of the generated JDL (default analysis.jdl)
183// plugin->SetJDLName("TaskMix.jdl");
184// // Optionally modify job price (default 1)
185// plugin->SetPrice(1);
186// // Optionally modify split mode (default 'se')
187// plugin->SetSplitMode("se");
188// // set number of files to test
189// plugin->SetNtestFiles(2);
190//
191// plugin->SetKeepLogs(kTRUE);
192
193}