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