]>
Commit | Line | Data |
---|---|---|
fe0275ad | 1 | #include "Riostream.h" |
f59ecfbc | 2 | void LoadLibraries(); |
3 | void AddAnalysisTasks(); | |
4 | class AliAnalysisAlien; | |
5 | AliAnalysisAlien* CreateAlienHandler(const char *plugin_mode); | |
6 | ||
a05adbe9 | 7 | Int_t runNumbers[5] = {121040}; |
574b2e7b | 8 | |
9 | Bool_t doAOD = 0; | |
f59ecfbc | 10 | Bool_t doQAsym = 1; // output ok |
11 | Bool_t doVZERO = 1; // output ok but there is a 2nd file | |
12 | Bool_t doVertex = 1; // output ok | |
13 | Bool_t doSPD = 1; // output ok, needs RP | |
be4d3c6a | 14 | Bool_t doFMD = 1; // output ok |
f59ecfbc | 15 | Bool_t doTPC = 1; // output ok |
16 | Bool_t doEventStat = 1; // output ok | |
17 | Bool_t doSDD = 1; // outout ok needs RP | |
574b2e7b | 18 | Bool_t doSSDdEdx = 1; // testing |
8e52a034 | 19 | // new |
92238d29 | 20 | Bool_t doTRD = 1; // TRD |
8e52a034 | 21 | Bool_t doITS = 1; // ITS |
22 | Bool_t doCALO = 1; // Calorimeter | |
23 | Bool_t doMUONTrig = 1; // MUON trigger | |
a05adbe9 | 24 | Bool_t doImpParRes = 1; // Impact parameter resolution |
25 | Bool_t doMUON = 1; // MUON QA | |
26 | ||
8e52a034 | 27 | Bool_t doMUONEff = 0; // MUON efficiency NEEDS geometry |
2efff183 | 28 | Bool_t doV0 = 0; // V0 recosntruction performance NEEDS MCtruth |
f59ecfbc | 29 | |
a05adbe9 | 30 | TString train_name = "QA"; |
574b2e7b | 31 | //TString train_name = "TR019_PASS6"; |
a05adbe9 | 32 | TString job_tag = "QA15_LHC10d: PWG1 QA train"; |
574b2e7b | 33 | //TString job_tag = "TR019: LHC09d-Pass6 ESD filtering w. PhysSelection -> AOD (including muon deltas)"; |
a05adbe9 | 34 | TString root_version = "v5-26-00b-6"; |
35 | TString aliroot_version = "v4-20-01-AN"; | |
574b2e7b | 36 | TString grid_datadir = "/alice/data/2010/LHC10c"; |
37 | //TString grid_datadir = "/alice/data/2009/LHC09d"; | |
a05adbe9 | 38 | TString data_pattern = "*ESDs/pass2/*ESDs.root"; |
39 | //TString data_pattern = "*ESDs.root"; | |
be4d3c6a | 40 | TString alien_outdir = ""; |
574b2e7b | 41 | //TString alien_outdir = "/alice/cern.ch/user/m/mgheata/analysisDATA/output_QA007_PASS1_7TeV/000114917"; |
42 | //TString alien_outdir = "/alice/data/2009/LHC09d/analysis/PASS6/AOD"; | |
43 | TString mergeExcludes; | |
fe0275ad | 44 | |
574b2e7b | 45 | Bool_t useProductionMode = kTRUE; |
46 | Bool_t useMergeViaJDL = kTRUE; | |
47 | Bool_t useFastReadOption = kTRUE; | |
48 | Bool_t useOverwriteMode = kTRUE; | |
49 | Bool_t useDevelopmentVersion = kFALSE; | |
fe0275ad | 50 | |
f59ecfbc | 51 | void PilotAnalysis(const char *plugin_mode = "full") |
52 | { | |
53 | TGrid::Connect("alien://"); | |
54 | if (!gGrid || !gGrid->IsConnected()) { | |
55 | ::Error("PilotAnalysis", "No grid connection"); | |
56 | return; | |
57 | } | |
fe0275ad | 58 | // Write configuration |
59 | TString cdir = gSystem->WorkingDirectory(); | |
60 | gSystem->MakeDirectory(train_name); | |
61 | gSystem->ChangeDirectory(train_name); | |
62 | ofstream out; | |
63 | out.open(Form("%sConfig.C",train_name.Data()), ios::out); | |
64 | out << "{" << endl; | |
65 | out << " train_name = " << "\"" << train_name.Data() << "\";" << endl; | |
66 | out << " root_version = " << "\"" << root_version.Data() << "\";" << endl; | |
67 | out << " aliroot_version = " << "\"" << aliroot_version.Data() << "\";" << endl; | |
68 | out << " grid_datadir = " << "\"" << grid_datadir.Data() << "\";" << endl; | |
69 | if (!alien_outdir.Length()) alien_outdir = Form("output_%s",train_name.Data()); | |
70 | out << " alien_outdir = " << "\"" << alien_outdir.Data() << "\";" << endl; | |
574b2e7b | 71 | out << " doAOD = " << doAOD << ";" << endl; |
fe0275ad | 72 | out << " doQAsim = " << doQAsym << ";" << endl; |
73 | out << " doVZERO = " << doVZERO << ";" << endl; | |
74 | out << " doVertex = " << doVertex << ";" << endl; | |
75 | out << " doSPD = " << doSPD << ";" << endl; | |
76 | out << " doSDD = " << doSDD << ";" << endl; | |
574b2e7b | 77 | out << " doSSDdEdx = " << doSSDdEdx << ";" << endl; |
fe0275ad | 78 | out << " doFMD = " << doFMD << ";" << endl; |
79 | out << " doTPC = " << doTPC << ";" << endl; | |
a05adbe9 | 80 | out << " doTRD = " << doTRD << ";" << endl; |
81 | out << " doImpParRes = " << doImpParRes << ";" << endl; | |
82 | out << " doMUON = " << doMUON << ";" << endl; | |
fe0275ad | 83 | out << " doEventStat = " << doEventStat << ";" << endl; |
84 | out << "}" << endl; | |
85 | out.close(); | |
86 | ||
f59ecfbc | 87 | // Load libraries |
574b2e7b | 88 | gSystem->SetIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT -I$ALICE_ROOT/ITS -I$ALICE_ROOT/TRD"); |
f59ecfbc | 89 | LoadLibraries(); |
90 | // Create manager | |
91 | AliAnalysisManager *mgr = new AliAnalysisManager("PilotAnalysis", "Production train"); | |
574b2e7b | 92 | mgr->SetNSysInfo(100); |
f59ecfbc | 93 | // Input handler |
94 | AliESDInputHandlerRP *esdHandler = new AliESDInputHandlerRP(); | |
574b2e7b | 95 | esdHandler->SetReadFriends(kTRUE); |
f59ecfbc | 96 | esdHandler->SetActiveBranches("ESDfriend"); |
97 | mgr->SetInputEventHandler(esdHandler); | |
574b2e7b | 98 | if (doAOD) { |
99 | // AOD output handler | |
100 | AliAODHandler* aodHandler = new AliAODHandler(); | |
101 | aodHandler->SetOutputFileName("AliAOD.root"); | |
102 | if (!mergeExcludes.IsNull()) mergeExcludes += " "; | |
103 | mergeExcludes += "AliAOD.root"; | |
104 | mgr->SetOutputEventHandler(aodHandler); | |
105 | } | |
f59ecfbc | 106 | |
a05adbe9 | 107 | mgr->SetDebugLevel(0); |
fe0275ad | 108 | mgr->SetSaveCanvases(kTRUE); |
109 | ||
f59ecfbc | 110 | // AnalysisTasks |
111 | AddAnalysisTasks(); | |
112 | // Grid handler | |
fe0275ad | 113 | AliAnalysisAlien *alienHandler = CreateAlienHandler(plugin_mode); |
f59ecfbc | 114 | mgr->SetGridHandler(alienHandler); |
115 | if (mgr->InitAnalysis()) { | |
116 | mgr->PrintStatus(); | |
117 | mgr->StartAnalysis("grid"); | |
fe0275ad | 118 | TString alien_workdir = gGrid->GetHomeDirectory(); |
119 | alien_workdir += "analysisDATA"; | |
120 | TString configName = Form("%s/%sConfig.C", alien_workdir.Data(), train_name.Data()); | |
121 | if (strcmp(plugin_mode, "test")) { | |
122 | printf("=== Registering configuration file <%s>===\n", configName.Data()); | |
123 | if (AliAnalysisAlien::FileExists(configName.Data())) gGrid->Rm(configName.Data()); | |
124 | TFile::Cp(Form("file:%sConfig.C",train_name.Data()), Form("alien://%s", configName.Data())); | |
125 | } | |
f59ecfbc | 126 | } |
127 | } | |
128 | ||
129 | void LoadLibraries() | |
130 | { | |
e583cb58 | 131 | gSystem->Load("libANALYSIS"); |
132 | gSystem->Load("libANALYSISalice"); | |
133 | gSystem->Load("libCORRFW"); | |
134 | gSystem->Load("libTENDER"); | |
f59ecfbc | 135 | gSystem->Load("libPWG0base.so"); |
136 | gSystem->Load("libPWG0dep.so"); | |
137 | gSystem->Load("libPWG0selectors.so"); | |
138 | gSystem->Load("libPWG1.so"); | |
139 | gSystem->Load("libPWG2.so"); | |
140 | gSystem->Load("libPWG2forward.so"); | |
e583cb58 | 141 | |
e583cb58 | 142 | if (doCALO) { |
143 | gSystem->Load("libEMCALUtils"); | |
144 | gSystem->Load("libPWG4PartCorrBase"); | |
145 | gSystem->Load("libPWG4PartCorrDep"); | |
f59ecfbc | 146 | } |
574b2e7b | 147 | if(doMUONTrig || doAOD) { |
e583cb58 | 148 | gSystem->Load("libPWG3base"); |
149 | gSystem->Load("libPWG3muon"); | |
150 | gSystem->Load("libPWG3muondep"); | |
151 | } | |
f59ecfbc | 152 | } |
153 | ||
154 | void AddAnalysisTasks() | |
155 | { | |
574b2e7b | 156 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); |
157 | mgr->SetCommonFileName("QAresults.root"); | |
158 | // AOD creation with collision events | |
159 | if (doAOD) { | |
160 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskESDFilter.C"); | |
161 | mgr->RegisterExtraFile("AliAOD.Muons.root"); | |
162 | mgr->RegisterExtraFile("AliAOD.Dimuons.root"); | |
163 | AliAnalysisTaskESDfilter *taskesdfilter = AddTaskESDFilter(kFALSE, kTRUE, kTRUE, doEventStat); | |
164 | } | |
165 | // | |
166 | // Event Statistics (Jan Fiete) | |
167 | // | |
168 | ||
169 | if (doEventStat) { | |
170 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C"); | |
171 | AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection(); | |
a05adbe9 | 172 | // if (doMUON) physSelTask->GetPhysicsSelection()->SetUseMuonTriggers(); |
574b2e7b | 173 | mgr->RegisterExtraFile("event_stat.root"); |
174 | } | |
f59ecfbc | 175 | // Vertexing (A. Dainese) |
176 | // | |
177 | if (doVertex) { | |
178 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskVertexESD.C"); | |
179 | AliAnalysisTaskVertexESD* taskvertexesd = AddTaskVertexESD(); | |
180 | taskvertexesd->SelectCollisionCandidates(); | |
181 | } | |
182 | ||
183 | // TPC QA (E. Sicking) | |
184 | // | |
185 | if (doQAsym) { | |
186 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/PilotTrain/AddTaskQAsym.C"); | |
574b2e7b | 187 | AliAnalysisTaskSE * taskqasim = AddTaskQAsym(0); |
f59ecfbc | 188 | taskqasim->SelectCollisionCandidates(); |
189 | } | |
190 | // | |
191 | // VZERO QA (C. Cheshkov) | |
192 | // | |
193 | if (doVZERO) { | |
194 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/PilotTrain/AddTaskVZEROQA.C"); | |
195 | AliAnalysisTaskSE * taskv0qa = AddTaskVZEROQA(0); | |
e583cb58 | 196 | // taskv0qa->SelectCollisionCandidates(); |
f59ecfbc | 197 | } |
f59ecfbc | 198 | // |
199 | // TPC (Jacek Otwinowski) | |
200 | // | |
201 | if (doTPC) { | |
202 | gROOT->LoadMacro("$(ALICE_ROOT)/PWG1/TPC/macros/AddTaskPerformanceTPCQA.C"); | |
203 | AliPerformanceTask *tpcQA = AddTaskPerformanceTPCQA(kFALSE, kTRUE); | |
204 | } | |
205 | // | |
206 | // SPD (A. Mastroserio) | |
207 | // | |
208 | if (doSPD) { | |
209 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/PilotTrain/AddTaskSPDQA.C"); | |
210 | AliAnalysisTaskSE* taskspdqa = AddTaskSPDQA(); | |
574b2e7b | 211 | taskspdqa->SelectCollisionCandidates(); |
e583cb58 | 212 | } |
f59ecfbc | 213 | // |
214 | // SDD (F. Prino) | |
215 | // | |
216 | if (doSDD) { | |
217 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/PilotTrain/AddSDDPoints.C"); | |
218 | AliAnalysisTaskSE* tasksdd = AddSDDPoints(); | |
219 | tasksdd->SelectCollisionCandidates(); | |
220 | } | |
574b2e7b | 221 | // |
222 | // SSD dEdx (Marek Chojnacki) | |
223 | // | |
224 | if (doSSDdEdx) { | |
225 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/PilotTrain/AddTaskdEdxSSDQA.C"); | |
226 | AliAnalysisTaskSE* taskssddedx = AddTaskdEdxSSDQA(); | |
227 | taskssddedx->SelectCollisionCandidates(); | |
228 | } | |
8e52a034 | 229 | |
e583cb58 | 230 | // |
231 | // ITS | |
232 | // | |
233 | if (doITS) { | |
234 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskPerformanceITS.C"); | |
235 | AliAnalysisTaskITSTrackingCheck *itsQA = AddTaskPerformanceITS(kFALSE); | |
236 | } | |
8e52a034 | 237 | // |
238 | // TRD (Alex Bercuci, M. Fasel) | |
239 | // | |
240 | if(doTRD) { | |
e583cb58 | 241 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTrainPerformanceTRD.C"); |
92238d29 | 242 | // steer individual TRD tasks |
243 | Bool_t | |
244 | doCheckESD(kTRUE), // AliTRDcheckESD | |
245 | doCheckDET(kTRUE), // AliTRDcheckDET | |
246 | doEffic(kTRUE), // AliTRDefficiency | |
247 | doResolution(kTRUE),// AliTRDresolution | |
248 | doCheckPID(kTRUE), // AliTRDcheckPID | |
249 | doV0Monitor(kFALSE);// AliTRDv0Monitor | |
250 | AddTrainPerformanceTRD(Translate(doCheckESD, doCheckDET, doEffic, doResolution, doCheckPID, doV0Monitor)); | |
8e52a034 | 251 | } |
252 | ||
253 | // | |
254 | // Calorimetry (Gustavo Conesa) | |
255 | // | |
256 | ||
257 | if(doCALO) { | |
258 | gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/QA/AddTaskCalorimeterQA.C"); | |
259 | AliAnalysisTaskParticleCorrelation *taskCaloQA = AddTaskCalorimeterQA("ESD", kTRUE, kFALSE); | |
2efff183 | 260 | taskCaloQA->SetDebugLevel(0); |
8e52a034 | 261 | } |
262 | ||
263 | // | |
264 | // Muon Trigger | |
265 | // | |
266 | ||
267 | if(doMUONTrig) { | |
268 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskMTRchamberEfficiency.C"); | |
269 | AliAnalysisTaskTrigChEff *taskMuonTrig = AddTaskMTRchamberEfficiency(); | |
270 | } | |
271 | ||
272 | // | |
273 | // Muon Efficiency | |
274 | // | |
275 | ||
276 | if(doMUONEff) { | |
277 | gROOT->LoadMacro("$ALICE_ROOT/PWG3/muondep/AddTaskMUONTrackingEfficiency.C"); | |
278 | AliAnalysisTaskMuonTrackingEff *taskMuonTrackEff = AddTaskMUONTrackingEfficiency(); | |
279 | } | |
280 | ||
281 | // | |
282 | // V0-Decay Reconstruction (Ana Marin) | |
283 | // | |
284 | ||
285 | if (doV0) { | |
286 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskV0QA.C"); | |
287 | AliAnalysisTaskV0QA *taskv0QA = AddTaskV0QA(kFALSE); | |
288 | } | |
574b2e7b | 289 | // FMD (Hans Hjersing Dalsgaard) |
290 | // | |
291 | if (doFMD) { | |
292 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/PilotTrain/AddTaskFMD.C"); | |
293 | AliAnalysisTaskSE* taskfmd = AddTaskFMD(); | |
294 | taskfmd->SelectCollisionCandidates(); | |
295 | } | |
a05adbe9 | 296 | // Impact parameter resolution (xianbao.yuan@pd.infn.it, andrea.dainese@pd.infn.it) |
297 | // | |
298 | if (doImpParRes) { | |
299 | gROOT->LoadMacro("$ALICE_ROOT/PWG1/macros/AddTaskImpParRes.C"); | |
300 | AliAnalysisTaskSE* taskimpparres= AddTaskImpParRes(); | |
301 | taskimpparres->SelectCollisionCandidates(); | |
302 | } | |
303 | // MUON QA (Philippe Pillot) | |
304 | // | |
305 | if (doMUON) { | |
306 | gROOT->LoadMacro("$ALICE_ROOT/PWG3/muon/AddTaskMuonQA.C"); | |
307 | AliAnalysisTaskSE* taskmuonqa= AddTaskMuonQA(); | |
308 | } | |
f59ecfbc | 309 | } |
310 | ||
311 | //______________________________________________________________________________ | |
312 | AliAnalysisAlien* CreateAlienHandler(const char *plugin_mode) | |
313 | { | |
314 | // Check if user has a valid token, otherwise make one. This has limitations. | |
315 | // One can always follow the standard procedure of calling alien-token-init then | |
316 | // source /tmp/gclient_env_$UID in the current shell. | |
317 | if (!AliAnalysisGrid::CreateToken()) return NULL; | |
318 | AliAnalysisAlien *plugin = new AliAnalysisAlien(); | |
319 | // Set the run mode (can be "full", "test", "offline", "submit" or "terminate") | |
320 | plugin->SetRunMode(plugin_mode); | |
fe0275ad | 321 | if (useProductionMode) plugin->SetProductionMode(); |
322 | plugin->SetJobTag(job_tag); | |
f59ecfbc | 323 | plugin->SetNtestFiles(1); |
324 | // Set versions of used packages | |
f59ecfbc | 325 | plugin->SetAPIVersion("V1.1x"); |
fe0275ad | 326 | plugin->SetROOTVersion(root_version); |
327 | plugin->SetAliROOTVersion(aliroot_version); | |
f59ecfbc | 328 | // Declare input data to be processed. |
329 | // Method 1: Create automatically XML collections using alien 'find' command. | |
330 | // Define production directory LFN | |
fe0275ad | 331 | plugin->SetGridDataDir(grid_datadir); |
f59ecfbc | 332 | // Set data search pattern |
fe0275ad | 333 | plugin->SetDataPattern(data_pattern); |
f59ecfbc | 334 | // ...then add run numbers to be considered |
335 | // if (!iAODanalysis) plugin->SetRunRange(run_range[0], run_range[1]); | |
336 | plugin->SetRunPrefix("000"); | |
574b2e7b | 337 | // plugin->SetOutputSingleFolder("output"); |
f59ecfbc | 338 | plugin->SetOutputToRunNo(); |
574b2e7b | 339 | // Int_t run_numbers[30] = {104065, 104155, 104157, 104159, 104160, 104315, 104316, 104320, 104321, 104439, |
340 | // 104792, 104793, 104799, 104800, 104801, 104802, 104803, 104821, 104824, 104825, | |
341 | // 104841, 104845, 104849, 104852, 104865, 104867, 104876, 104892, 105143, 105160}; | |
342 | // Int_t run_numbers[8] = {114785, 114778, 114757, 114753, 114745, 114744, 114743, 114737}; | |
343 | // Int_t run_numbers[2] = {114785, 114917}; | |
344 | for (Int_t i=0; i<2; i++) { | |
345 | if (!runNumbers[i]) break; | |
346 | plugin->AddRunNumber(runNumbers[i]); | |
f59ecfbc | 347 | } |
348 | // Define alien work directory where all files will be copied. Relative to alien $HOME. | |
574b2e7b | 349 | plugin->SetGridWorkingDir(train_name); |
f59ecfbc | 350 | // Declare alien output directory. Relative to working directory. |
fe0275ad | 351 | if (alien_outdir.IsNull()) alien_outdir = Form("output_%s",train_name.Data()); |
352 | plugin->SetGridOutputDir(alien_outdir); | |
f59ecfbc | 353 | |
574b2e7b | 354 | if (useDevelopmentVersion) { |
355 | plugin->EnablePackage("STEERBase"); | |
356 | plugin->EnablePackage("ESD"); | |
357 | plugin->EnablePackage("AOD"); | |
358 | plugin->EnablePackage("ANALYSIS"); | |
359 | plugin->EnablePackage("ANALYSISalice"); | |
360 | } | |
f59ecfbc | 361 | |
362 | // Declare the analysis source files names separated by blancs. To be compiled runtime | |
363 | // using ACLiC on the worker nodes. | |
364 | // Declare all libraries (other than the default ones for the framework. These will be | |
365 | // loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here. | |
574b2e7b | 366 | plugin->AddIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT/ITS -I$ALICE_ROOT/TRD"); |
367 | ||
be4d3c6a | 368 | plugin->SetAdditionalLibs("libTENDER.so libPWG0base.so libPWG0dep.so libPWG0selectors.so libPWG1.so libPWG2.so \ |
574b2e7b | 369 | libPWG2forward.so libEMCALUtils.so libPWG4PartCorrBase.so libPWG4PartCorrDep.so \ |
be4d3c6a | 370 | libPWG3base.so libPWG3muon.so libPWG3muondep.so"); |
f59ecfbc | 371 | |
372 | // Declare the output file names separated by blancs. | |
373 | // (can be like: file.root or file.root@ALICE::Niham::File) | |
374 | plugin->SetDefaultOutputs(); | |
375 | // plugin->SetMergeExcludes(mergeExclude); | |
574b2e7b | 376 | plugin->SetMaxMergeFiles(20); |
f59ecfbc | 377 | plugin->SetNrunsPerMaster(1); |
378 | // Optionally define the files to be archived. | |
379 | // plugin->SetOutputArchive("log_archive.zip:stdout,stderr@ALICE::NIHAM::File root_archive.zip:AliAOD.root,AOD.tag.root@ALICE::NIHAM::File"); | |
380 | ||
381 | // Put default output files to archive | |
382 | TString listhists = ""; | |
383 | TString listaods = ""; | |
384 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
385 | TIter next(mgr->GetOutputs()); | |
386 | AliAnalysisDataContainer *output; | |
387 | while ((output=(AliAnalysisDataContainer*)next())) { | |
388 | const char *filename = output->GetFileName(); | |
389 | if (!(strcmp(filename, "default"))) { | |
390 | if (!mgr->GetOutputEventHandler()) continue; | |
391 | filename = mgr->GetOutputEventHandler()->GetOutputFileName(); | |
392 | if (listaods.Length()) listaods += ","; | |
393 | listaods += filename; | |
394 | } else { | |
395 | if (listhists.Contains(filename)) continue; | |
396 | if (listhists.Length()) listhists += ","; | |
397 | listhists += filename; | |
398 | } | |
399 | } | |
400 | if (mgr->GetExtraFiles().Length()) { | |
fe0275ad | 401 | if (listhists.Length()) listhists += ","; |
402 | listhists += mgr->GetExtraFiles(); | |
403 | listhists.ReplaceAll(" ", ","); | |
f59ecfbc | 404 | } |
405 | if (listhists.Length()) listhists = Form("hist_archive.zip:%s", listhists.Data()); | |
406 | if (listaods.Length()) listaods = Form("aod_archive.zip:%s", listaods.Data()); | |
407 | if (!listhists.Length()) { | |
408 | ::Fatal("AnalysisTrainNew", "No task output !"); | |
409 | } | |
fe0275ad | 410 | TString outputArchive = "log_archive.zip:stdout,stderr@disk=4"; |
f59ecfbc | 411 | if (listaods.Length()) { |
412 | outputArchive += " "; | |
413 | outputArchive += listaods; | |
fe0275ad | 414 | outputArchive += "@disk=4"; |
f59ecfbc | 415 | } |
416 | if (listhists.Length()) { | |
417 | outputArchive += " "; | |
418 | outputArchive += listhists; | |
fe0275ad | 419 | outputArchive += "@disk=4"; |
f59ecfbc | 420 | } |
574b2e7b | 421 | if (!mergeExcludes.IsNull()) plugin->SetMergeExcludes(mergeExcludes); |
f59ecfbc | 422 | // Set friends |
423 | // if (iAODanalysis && iPWG3d2h) | |
424 | // plugin->SetFriendChainName("AliAOD.VertexingHF.root"); | |
a05adbe9 | 425 | // plugin->SetOutputArchive(outputArchive); |
f59ecfbc | 426 | // Optionally set a name for the generated analysis macro (default MyAnalysis.C) |
fe0275ad | 427 | plugin->SetAnalysisMacro(Form("%s.C", train_name.Data())); |
f59ecfbc | 428 | // Optionally set maximum number of input files/subjob (default 100, put 0 to ignore) |
a05adbe9 | 429 | plugin->SetSplitMaxInputFileNumber(20); |
f59ecfbc | 430 | // Optionally set number of failed jobs that will trigger killing waiting sub-jobs. |
431 | // plugin->SetMaxInitFailed(5); | |
432 | // Optionally resubmit threshold. | |
433 | // plugin->SetMasterResubmitThreshold(90); | |
434 | // Optionally set time to live (default 30000 sec) | |
435 | plugin->SetTTL(70000); | |
436 | // Optionally set input format (default xml-single) | |
437 | plugin->SetInputFormat("xml-single"); | |
438 | // Optionally modify the name of the generated JDL (default analysis.jdl) | |
fe0275ad | 439 | plugin->SetJDLName(Form("%s.jdl", train_name.Data())); |
f59ecfbc | 440 | // Optionally modify the executable name (default analysis.sh) |
fe0275ad | 441 | plugin->SetExecutable(Form("%s.sh", train_name.Data())); |
f59ecfbc | 442 | // Optionally modify job price (default 1) |
443 | plugin->SetPrice(1); | |
444 | // Optionally modify split mode (default 'se') | |
445 | plugin->SetSplitMode("se"); | |
446 | plugin->SetExecutableCommand("aliroot -b -q"); | |
574b2e7b | 447 | // Merge via JDL |
448 | plugin->SetMergeViaJDL(useMergeViaJDL); | |
449 | // Use fastread option | |
450 | plugin->SetFastReadOption(useFastReadOption); | |
451 | // UseOverwrite mode | |
452 | plugin->SetOverwriteMode(useOverwriteMode); | |
f59ecfbc | 453 | return plugin; |
454 | } |