1 //===================== ANALYSIS TRAIN =========================================
2 // To use: copy this macro to your work directory, modify the global part to match
3 // your needs, then run root.
4 // root[0] .L AnalysisTrain.C
5 // Grid full mode as below (other modes: test, offline, submit, terminate)
6 // root[1] AnalysisTrainNew("grid", "full")
7 // CAF mode (requires root v5-23-02 + aliroot v4-16-Rev08)
8 // root[2] AnalysisTrainNew("proof")
9 // Local mode requires AliESds.root or AliAOD.root in ./data directory
10 // root[3] AnalysisTrainNew("local")
11 // In proof and grid modes, a token is needed and sourcing the produced environment file.
13 // If 'saveTrain' flag is set, the train will generate a directory name and run
14 // in this directory. A configuration file 'ConfigTrain.C' will be generated.
15 // One can replay at any time the train via:
16 // root[1] AnalysisTrainNew(ana_mode, plugin_mode, "train_default_<date>/ConfigTrain.C")
18 //================== TRAIN NAME ============================================
19 //TString train_name = "GAMMAtest"; // *CHANGE ME* (no blancs or special characters)
20 TString train_name = "LHC09b4AOD"; // *CHANGE ME* (no blancs or special characters)
21 TString job_tag = "LHC09b4: standard AODs with MC info, AOD tags and pyxsec_hist"; // *CHANGE ME*
22 //==============================================================================
24 // ### Settings that make sense in PROOF only
25 //==============================================================================
26 TString proof_cluster = "alicecaf.cern.ch";
27 Bool_t useAFPAR = kFALSE; // use AF special par file
28 TString AFversion = "AF-v4-16";
29 // Change CAF dataset here
30 TString proof_dataset = "/COMMON/COMMON/LHC09a4_run8100X#/esdTree";
31 TString proof_outdir = "";
33 // ### Settings that make sense when using the Alien plugin
34 //==============================================================================
35 Bool_t usePLUGIN = kTRUE; // do not change
36 Bool_t useProductionMode = kTRUE; // use the plugin in production mode
37 // Usage of par files ONLY in grid mode and ONLY if the code is not available
38 // in the deployed AliRoot versions. Par file search path: local dir, if not there $ALICE_ROOT.
39 // To refresh par files, remove the ones in the workdir, then do "make <target.par>" in
41 Bool_t usePAR = kFALSE; // use par files for extra libs
42 Bool_t useCPAR = kFALSE; // use par files for common libs
43 TString root_version = "v5-24-00"; // *CHANGE ME IF MORE RECENT IN GRID*
44 TString aliroot_version = "v4-18-03-AN"; // *CHANGE ME IF MORE RECENT IN GRID*
45 // Change production base directory here
46 TString alien_datadir = "/alice/sim/LHC09b4/";
47 // AliEn output directory. If blank will become output_<train_name>
48 TString alien_outdir = "/alice/sim/LHC09b4/AOD";
49 // TString alien_outdir = "";
50 // Number of files merged in a chunk
51 Int_t maxMergeFiles = 50;
52 // Files that should not be merged
53 TString mergeExclude = "AliAOD.root AliAOD.VertexingHF.root";
54 // Files that should be archived
55 TString outputArchive = "aod_archive.zip:AliAOD.root,AOD.tag.root,pyxsec_hists.root@ALICE::NIHAM::File";
56 // Number of runs per master job
57 Int_t nRunsPerMaster = 1;
58 // Maximum number of files per job (gives size of AOD)
59 Int_t nFilesPerJob = 100;
61 Int_t run_range[2] = {117003, 117019}; // LHC09a4 *CHANGE ME*
62 //Int_t run_range[2] = {90000, 90040}; // LHC09a5
63 // ### Settings that make sense only for local analysis
64 //==============================================================================
65 // Change local xml dataset for local interactive analysis
66 TString local_xmldataset = "";
68 // ### Other flags to steer the analysis
69 //==============================================================================
70 Bool_t useDATE = kFALSE; // use date in train name
71 Bool_t useDBG = kTRUE; // activate debugging
72 Bool_t useMC = kTRUE; // use MC info
73 Bool_t useTAGS = kFALSE; // use ESD tags for selection
74 Bool_t useKFILTER = kTRUE; // use Kinematics filter
75 Bool_t useTR = kTRUE; // use track references
76 Bool_t useCORRFW = kFALSE; // do not change
77 Bool_t useAODTAGS = kTRUE; // use AOD tags
78 Bool_t saveTrain = kTRUE; // save train configuration as:
79 Bool_t saveProofToAlien = kFALSE; // save proof outputs in AliEn
80 // train_[trainName]_ddMonthyyyy_time.C
81 // ### Analysis modules to be included. Some may not be yet fully implemented.
82 //==============================================================================
83 Int_t iAODanalysis = 0; // Analysis on input AOD's
84 Int_t iAODhandler = 1; // Analysis produces an AOD or dAOD's
85 Int_t iESDfilter = 1; // ESD to AOD filter (barrel + muon tracks)
86 Int_t iMUONcopyAOD = 0; // Task that copies only muon events in a separate AOD (PWG3)
87 Int_t iJETAN = 0; // Jet analysis (PWG4) - needs ESD filter
88 Int_t iPWG4partcorr = 0; // Gamma-hadron correlations task (PWG4)
89 Int_t iPWG4gammaconv = 0; // Gamma conversion analysis (PWG4) # NOT YET WORKING - WAITING FOR FEEDBACK #
90 Int_t iPWG4omega3pi = 0; // Omega to 3 pi analysis (PWG4)
91 Int_t iPWG3vertexing = 0; // Vertexing HF task (PWG2)
92 Int_t iPWG2femto = 0; // Femtoscopy task (PWG2)
93 Int_t iPWG2spectra = 0; // Spectra tasks (PWG2
94 Int_t iPWG2protons = 0; // Proton-antiproton analysis
95 Int_t iPWG2checkcascade = 0; // Check cascades task
96 Int_t iPWG2perfcascade = 0; // Check performance cascade
97 Int_t iPWG2checkv0 = 0; // Check V0 task
98 Int_t iPWG2strange = 0; // Strangeness task
99 Int_t iPWG2flow = 0; // Flow analysis tasks (PWG2) = crashes in AliCFManager
100 Int_t iPWG2res = 0; // Resonances task (PWG2)
101 Int_t iPWG2kink = 0; // Kink analysis tasks (PWG2)
102 Int_t iPWG2kinkESDMC = 0; // Kink ESD-MC comparison (PWG2)
103 Int_t iPWG2kinkres = 0; // Kink resonances (PWG2)
104 Int_t iPWG2kinklikesign = 0; // Kink like-sign (PWG2)
105 Int_t iPWG2evchar = 0; // Event characteristics (PWG2)
106 Int_t iPWG2unicor = 0; // Unicor analysis (PWG2)
109 TString anaPars = "";
110 TString anaLibs = "";
111 // Function signatures
112 class AliAnalysisAlien;
114 //______________________________________________________________________________
115 void AnalysisTrainNew(const char *analysis_mode="grid",
116 const char *plugin_mode="full",
117 const char *config_file="")
119 // Main analysis train macro. If a configuration file is provided, all parameters
120 // are taken from there but may be altered by CheckModuleFlags.
121 if (strlen(config_file) && !LoadConfig(config_file)) return;
122 TString smode(analysis_mode);
124 if (saveTrain) WriteConfig();
125 // Check compatibility of selected modules
126 CheckModuleFlags(smode);
128 printf("==================================================================\n");
129 printf("=========== RUNNING ANALYSIS TRAIN %s IN %s MODE ==========\n", train_name.Data(),smode.Data());
130 printf("==================================================================\n");
131 printf("= Configuring analysis train for: =\n");
132 if (iAODanalysis) printf("= AOD analysis =\n");
133 else printf("= ESD analysis =\n");
134 if (iESDfilter) printf("= ESD filter =\n");
135 if (iMUONcopyAOD) printf("= MUON copy AOD =\n");
136 if (iJETAN) printf("= Jet analysis =\n");
138 printf("= PWG2 SPECTRA tasks : =\n");
139 if (iPWG2protons) printf("= PWG2 proton-antiproton =\n");
140 if (iPWG2checkcascade) printf("= PWG2 check cascades =\n");
141 if (iPWG2perfcascade) printf("= PWG2 performance cascades =\n");
142 if (iPWG2checkv0) printf("= PWG2 check V0 =\n");
143 if (iPWG2strange) printf("= PWG2 strangeness =\n");
145 if (iPWG2femto) printf("= PWG2 femtoscopy =\n");
146 if (iPWG2flow) printf("= PWG2 flow =\n");
147 if (iPWG2res) printf("= PWG2 resonances =\n");
149 printf("= PWG2 kink analysis tasks: =\n");
150 if (iPWG2kinkESDMC) printf("= PWG2 ESD-MC kinks =\n");
151 if (iPWG2kinkres) printf("= PWG2 kink resonances =\n");
152 if (iPWG2kinklikesign) printf("= PWG2 kink like-sign analysis =\n");
154 if (iPWG2evchar) printf("= PWG2 event characteristics =\n");
155 if (iPWG2unicor) printf("= PWG2 Unicor analysis =\n");
156 if (iPWG3vertexing) printf("= PWG3 vertexing =\n");
157 if (iPWG4partcorr) printf("= PWG4 gamma-hadron, pi0 and gamma-jet correlations =\n");
158 if (iPWG4gammaconv) printf("= PWG4 gamma conversion =\n");
159 if (iPWG4omega3pi) printf("= PWG4 omega to 3 pions =\n");
160 printf("==================================================================\n");
161 printf(":: use MC truth %d\n", (UInt_t)useMC);
162 printf(":: use KINE filter %d\n", (UInt_t)useKFILTER);
163 printf(":: use track refs %d\n", (UInt_t)useTR);
164 printf(":: use tags %d\n", (UInt_t)useTAGS);
165 printf(":: use AOD tags %d\n", (UInt_t)useAODTAGS);
166 printf(":: use debugging %d\n", (UInt_t)useDBG);
167 printf(":: use PAR files %d\n", (UInt_t)usePAR);
168 printf(":: use AliEn plugin %d\n", (UInt_t)usePLUGIN);
170 //==========================================================================
171 // Connect to back-end system
172 if (!Connect(smode)) {
173 ::Error("AnalysisTrain", "Could not connect to %s back-end", analysis_mode);
177 // Load common libraries and set include path
178 if (!LoadCommonLibraries(smode)) {
179 ::Error("AnalysisTrain", "Could not load common libraries");
183 // Make the analysis manager and connect event handlers
184 AliAnalysisManager *mgr = new AliAnalysisManager("Analysis Train", "Production train");
185 if (saveProofToAlien) mgr->SetSpecialOutputLocation(proof_outdir);
187 // Load analysis specific libraries
188 if (!LoadAnalysisLibraries(smode)) {
189 ::Error("AnalysisTrain", "Could not load analysis libraries");
193 // Create input handler (input container created automatically)
196 AliAODInputHandler *aodH = new AliAODInputHandler();
197 mgr->SetInputEventHandler(aodH);
200 AliESDInputHandler *esdHandler = new AliESDInputHandler();
201 if (useTAGS) esdHandler->SetReadTags();
202 mgr->SetInputEventHandler(esdHandler);
204 // Monte Carlo handler
205 if (useMC && !iAODanalysis) {
206 AliMCEventHandler* mcHandler = new AliMCEventHandler();
207 mgr->SetMCtruthEventHandler(mcHandler);
208 mcHandler->SetReadTR(useTR);
210 // AOD output container, created automatically when setting an AOD handler
212 // AOD output handler
213 AliAODHandler* aodHandler = new AliAODHandler();
214 aodHandler->SetOutputFileName("AliAOD.root");
215 mgr->SetOutputEventHandler(aodHandler);
217 aodHandler->SetCreateNonStandardAOD();
218 if (iJETAN) aodHandler->SetOutputFileName("AliAOD.Jets.root");
219 if (iPWG3vertexing) aodHandler->SetOutputFileName("AliAOD.VertexingHF.root");
222 // Debugging if needed
223 if (useDBG) mgr->SetDebugLevel(3);
225 //==========================================================================
226 // Create the chain. In this example it is created only from ALIEN files but
227 // can be done to work in batch or grid mode as well.
228 TChain *chain = CreateChain(smode, plugin_mode);
230 //==========================================================================
231 // Load the tasks configuration macros for all wagons. These files are supposed now to be
232 // in the current workdir, but in AliEn they will be in the file catalog,
233 // mapped from AliRoot and pecified in the jdl input list.
235 // For now connection to top input container and common AOD output container
236 // is done in this macro, but in future these containers will be connected
237 // from each task configuration macro.
239 if (iESDfilter && !iAODanalysis) {
240 // ESD filter task configuration.
241 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskESDFilter.C");
242 AliAnalysisTaskESDfilter *taskesdfilter = AddTaskESDFilter(useKFILTER);
247 AliAnalysisTaskTagCreator* tagTask = new AliAnalysisTaskTagCreator("AOD Tag Creator");
248 mgr->AddTask(tagTask);
249 AliAnalysisDataContainer *coutTags = mgr->CreateContainer("cTag", TTree::Class(),
250 AliAnalysisManager::kOutputContainer, "AOD.tag.root");
251 mgr->ConnectInput (tagTask, 0, mgr->GetCommonInputContainer());
252 mgr->ConnectOutput(tagTask, 1, coutTags);
257 gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskJets.C");
258 AliAnalysisTaskJets *taskjets = 0;
259 TString anatype = mgr->GetInputEventHandler()->GetDataType();
260 taskjets = AddTaskJets(anatype, "UA1");
261 taskjets = AddTaskJets(anatype, "Fastjet");
262 if (!taskjets) ::Warning("AnalysisTrainNew", "AliAnalysisTaskJets cannot run for this train conditions - EXCLUDED");
269 gROOT->LoadMacro("$ALICE_ROOT/PWG2/SPECTRA/macros/AddTaskProtons.C");
270 AliAnalysisTaskProtons *taskprotons = AddTaskProtons();
271 if (!taskprotons) ::Warning("AnalysisTrainNew", "AliAnalysisTaskProtons cannot run for this train conditions - EXCLUDED");
274 if (iPWG2checkcascade) {
275 gROOT->LoadMacro("$ALICE_ROOT/PWG2/SPECTRA/macros/AddTaskCheckCascade.C");
276 AliAnalysisTaskCheckCascade *taskcheckcascade = AddTaskCheckCascade();
277 if (!taskcheckcascade) ::Warning("AnalysisTrainNew", "AliAnalysisTaskCheckCascade cannot run for this train conditions - EXCLUDED");
281 gROOT->LoadMacro("$ALICE_ROOT/PWG2/SPECTRA/macros/AddTaskCheckV0.C");
282 AliAnalysisTaskCheckV0 *taskcheckV0 = AddTaskCheckV0();
283 if (!taskcheckV0) ::Warning("AnalysisTrainNew", "AliAnalysisTaskCheckV0 cannot run for this train conditions - EXCLUDED");
287 gROOT->LoadMacro("$ALICE_ROOT/PWG2/SPECTRA/macros/AddTaskStrange.C");
288 AliAnalysisTaskStrange *taskstrange = AddTaskStrange();
289 if (!taskstrange) ::Warning("AnalysisTrainNew", "AliAnalysisTaskStrange cannot run for this train conditions - EXCLUDED");
291 // performance cascades
292 if (iPWG2perfcascade) {
293 gROOT->LoadMacro("$ALICE_ROOT/PWG2/SPECTRA/macros/AddTaskCheckPerformanceCascade.C");
294 AliAnalysisTaskCheckPerformanceCascade *taskperfcascade = AddTaskCheckPerformanceCascade();
295 if (!taskperfcascade) ::Warning("AnalysisTrainNew", "AliAnalysisTaskCheckPerformanceCascade cannot run for this train conditions - EXCLUDED");
299 // Femtoscopy analysis modules
301 gROOT->LoadMacro("$ALICE_ROOT/PWG2/FEMTOSCOPY/macros/AddTaskFemto.C");
302 AliAnalysisTaskFemto *taskfemto = AddTaskFemto();
303 if (!taskfemto) ::Warning("AnalysisTrainNew", "AliAnalysisTaskFemto cannot run for this train conditions - EXCLUDED");
308 if (iPWG2kinkESDMC) {
309 gROOT->LoadMacro("$ALICE_ROOT/PWG2/KINK/macros/AddTaskKink.C");
310 AliAnalysisKinkESDMC *taskkink = AddTaskKink();
311 if (!taskkink) ::Warning("AnalysisTrainNew", "AliAnalysisKinkESDMC cannot run for this train conditions - EXCLUDED");
314 gROOT->LoadMacro("$ALICE_ROOT/PWG2/KINK/macros/AddTaskKinkResonance.C");
315 AliAnalysisTaskKinkResonance *taskkinkres = AddTaskKinkResonance();
316 if (!taskkinkres) ::Warning("AnalysisTrainNew", "AliAnalysisTaskKinkResonance cannot run for this train conditions - EXCLUDED");
318 if (iPWG2kinklikesign) {
319 gROOT->LoadMacro("$ALICE_ROOT/PWG2/KINK/macros/AddTaskKinkResonanceLikeSign.C");
320 AliResonanceKinkLikeSign *taskkinklikesign = AddTaskKinkResonanceLikeSign();
321 if (!taskkinklikesign) ::Warning("AnalysisTrainNew", "AliResonanceKinkLikeSign cannot run for this train conditions - EXCLUDED");
325 // Event characterization
327 gROOT->LoadMacro("$ALICE_ROOT/PWG2/EVCHAR/macros/AddTaskSPDdNdEta.C");
328 AliAnalysisTaskSPDdNdEta *taskspddndeta = AddTaskSPDdNdEta();
329 if (!taskspddndeta) ::Warning("AnalysisTrainNew", "AliAnalysisTaskSPDdNdEta cannot run for this train conditions - EXCLUDED");
330 taskspddndeta->SetReadMC(useMC);
335 gROOT->LoadMacro("$ALICE_ROOT/PWG2/UNICOR/AddTaskUnicor.C");
336 AliAnalysisTaskUnicor *taskunicor = AddTaskUnicor();
337 if (!taskspddndeta) ::Warning("AnalysisTrainNew", "AliAnalysisTaskUnicor cannot run for this train conditions - EXCLUDED");
342 gROOT->LoadMacro("$ALICE_ROOT/PWG2/FLOW/macros/AddTaskFlow.C");
344 Bool_t LYZ1SUM = kTRUE;
345 Bool_t LYZ1PROD = kTRUE;
346 Bool_t LYZ2SUM = kFALSE;
347 Bool_t LYZ2PROD = kFALSE;
348 Bool_t LYZEP = kFALSE;
352 Bool_t MCEP = kFALSE; //does not work yet 24/12/08
353 Bool_t kineFromESD = kTRUE;
354 Bool_t METHODS[] = {SP,LYZ1SUM,LYZ1PROD,LYZ2SUM,LYZ2PROD,LYZEP,GFC,QC,FQD,MCEP};
355 // Analysis type can be ESD, AOD, MC, ESDMC0, ESDMC1
356 TString type = "AOD";
357 if (!iAODanalysis) type = "ESD";
360 if (!kineFromESD) type += "1";
363 // Boolean to fill/not fill the QA histograms
365 // Boolean to use/not use weights for the Q vector
366 Bool_t WEIGHTS[] = {kFALSE,kFALSE,kFALSE}; //Phi, v'(pt), v'(eta)
367 AliAnalysisTaskFlowEvent* taskFE = AddTaskFlow(type,METHODS,QA,WEIGHTS);
368 if (!taskFE) ::Warning("AnalysisTrainNew", "AliAnalysisTaskFlowEvent cannot run for this train conditions - EXCLUDED");
373 gROOT->LoadMacro("$ALICE_ROOT/PWG2/RESONANCES/macros/train/AddAnalysisTaskRsn.C");
374 TString path = gROOT->GetMacroPath();
375 path += ":$ALICE_ROOT/PWG2/RESONANCES/macros/train";
376 gROOT->SetMacroPath(path);
377 AddAnalysisTaskRsn(kTRUE);
381 if (iPWG3vertexing) {
382 gROOT->LoadMacro("$ALICE_ROOT/PWG3/vertexingHF/AddTaskVertexingHF.C");
383 AliAnalysisTaskSEVertexingHF *taskvertexingHF = AddTaskVertexingHF();
384 if (!taskvertexingHF) ::Warning("AnalysisTrainNew", "AliAnalysisTaskSEVertexingHF cannot run for this train conditions - EXCLUDED");
387 // PWG4 hadron correlations
389 gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskPartCorr.C");
390 AliAnalysisTaskParticleCorrelation *taskpartcorrPHOS = AddTaskPartCorr("AOD", "PHOS");
391 if (!taskpartcorrPHOS) ::Warning("AnalysisTrainNew", "AliAnalysisTaskParticleCorrelation PHOS cannot run for this train conditions - EXCLUDED");
392 AliAnalysisTaskParticleCorrelation *taskpartcorrEMCAL = AddTaskPartCorr("AOD", "EMCAL");
393 if (!taskpartcorrEMCAL) ::Warning("AnalysisTrainNew", "AliAnalysisTaskParticleCorrelation EMCAL cannot run for this train conditions - EXCLUDED");
396 // PWG4 gamma conversion analysis
397 if (iPWG4gammaconv) {
398 gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskGammaConversion.C");
399 TString cdir = gSystem->WorkingDirectory();
400 gSystem->ChangeDirectory(gSystem->ExpandPathName("$ALICE_ROOT/PWG4/macros/"));
401 TString gcArguments = "-run-on-train -run-jet -run-chic -run-neutralmeson";
402 AliAnalysisTaskGammaConversion * taskGammaConversion = AddTaskGammaConversion(gcArguments,mgr->GetCommonInputContainer());
403 gSystem->ChangeDirectory(cdir);
404 if (!taskGammaConversion) ::Warning("AnalysisTrainNew", "AliAnalysisTaskGammaConversion cannot run for these train conditions - EXCLUDED");
407 // PWG4 omega to 3 pions analysis
409 gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskomega3pi.C");
410 AliAnalysisTaskOmegaPi0PiPi *taskomega3pi = AddTaskomega3pi();
411 if (!taskomega3pi) ::Warning("AnalysisTrainNew", "AliAnalysisTaskomega3pi cannot run for these train conditions - EXCLUDED");
414 //==========================================================================
415 // FOR THE REST OF THE TASKS THE MACRO AddTaskXXX() is not yet implemented/
418 if (mgr->InitAnalysis()) {
420 if (saveTrain || strlen(config_file)) gSystem->ChangeDirectory(train_name);
421 StartAnalysis(smode, chain);
422 if (saveTrain && smode=="GRID") {
423 AliAnalysisAlien *gridhandler = (AliAnalysisAlien*)mgr->GetGridHandler();
424 TString alien_workdir = gGrid->GetHomeDirectory();
425 if (iAODanalysis) alien_workdir += "analysisAOD";
426 else alien_workdir += "analysisESD";
427 alien_outdir = gridhandler->GetGridOutputDir();
428 printf("=== Registering ConfigTrain.C in the work directory <%s> ===\n",
429 alien_workdir.Data());
430 if (AliAnalysisAlien::FileExists(Form("%s/%sConfig.C", alien_workdir.Data(), train_name.Data())))
431 gGrid->Rm(Form("%s/%sConfig.C", alien_workdir.Data(), train_name.Data()));
432 TFile::Cp(Form("file:%sConfig.C",train_name.Data()), Form("alien://%s/%sConfig.C", alien_workdir.Data(), train_name.Data()));
437 //______________________________________________________________________________
438 void StartAnalysis(const char *mode, TChain *chain) {
441 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
442 if (!strcmp(mode, "LOCAL")) imode = 0;
443 if (!strcmp(mode, "PROOF")) imode = 1;
444 if (!strcmp(mode, "GRID")) imode = 2;
448 ::Error("AnalysisTrainNew.C::StartAnalysis", "Cannot create the chain");
451 mgr->StartAnalysis(mode, chain);
454 if (!proof_dataset.Length()) {
455 ::Error("AnalysisTrainNew.C::StartAnalysis", "proof_dataset is empty");
458 mgr->StartAnalysis(mode, proof_dataset, 1000);
462 if (!mgr->GetGridHandler()) {
463 ::Error("AnalysisTrainNew.C::StartAnalysis", "Grid plugin not initialized");
466 mgr->StartAnalysis("grid");
469 ::Error("AnalysisTrainNew.C::StartAnalysis", "Cannot create the chain");
472 mgr->StartAnalysis(mode, chain);
478 //______________________________________________________________________________
479 void CheckModuleFlags(const char *mode) {
480 // Checks selected modules and insure compatibility
482 if (!strcmp(mode, "LOCAL")) imode = 0;
483 if (!strcmp(mode, "PROOF")) imode = 1;
484 if (!strcmp(mode, "GRID")) imode = 2;
487 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PAR files enabled due to PROOF analysis");
492 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "AliEn plugin disabled since not in GRID mode");
498 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "MC usage disabled in analysis on AOD's");
500 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "AOD tags usage disabled in analysis on AOD's");
505 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "ESD filter disabled in analysis on AOD's");
509 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "JETAN disabled in analysis on AOD's without AOD handler");
512 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "iPWG4gammaconv disabled on AOD's without AOD handler");
515 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG4partcorr disabled on AOD's without AOD handler");
518 // Disable tasks that do not work yet on AOD data
520 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG2flow disabled on AOD's");
523 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG2femto disabled on AOD's");
526 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG2res disabled on AOD's");
529 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG2kink disabled in analysis on AOD's");
532 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG2unicor disabled in analysis on AOD's");
535 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG4evchar disabled on AOD's");
538 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG4omega3pi disabled on AOD's");
541 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG4partcorr disabled on AOD's");
546 if (!useMC) useTR = kFALSE;
548 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "iPWG2evchar disabled if not reading track references");
553 if (iPWG2perfcascade)
554 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG2perfcascade disabled without MC info");
555 iPWG2perfcascade = 0;
557 if (iJETAN && !iAODanalysis) iESDfilter=1;
558 if (iESDfilter) {iAODhandler=1; useCORRFW = kTRUE;}
559 if (iPWG2spectra || iPWG2flow || iPWG3vertexing) useCORRFW = kTRUE;
560 if (useKFILTER && !useMC) useKFILTER = kFALSE;
561 if (useAODTAGS && !iAODhandler) useAODTAGS = kFALSE;
564 //______________________________________________________________________________
565 Bool_t Connect(const char *mode) {
566 // Connect <username> to the back-end system.
568 if (!strcmp(mode, "LOCAL")) imode = 0;
569 if (!strcmp(mode, "PROOF")) imode = 1;
570 if (!strcmp(mode, "GRID")) imode = 2;
571 TString username = gSystem->Getenv("alien_API_USER");
576 if (!username.Length()) {
577 ::Error(Form("AnalysisTrainNew.C::Connect <%s>", mode), "Make sure you:\n \
578 1. Have called: alien-token-init <username>\n \
579 2. Have called: >source /tmp/gclient_env_$UID");
582 ::Info("AnalysisTrainNew.C::Connect", "Connecting user <%s> to PROOF cluster <%s>",
583 username.Data(), proof_cluster.Data());
584 gEnv->SetValue("XSec.GSI.DelegProxy", "2");
585 // TProof::Open(Form("%s@%s:31093", username.Data(), proof_cluster.Data()));
586 TProof::Open(Form("%s@%s", username.Data(), proof_cluster.Data()));
588 if (strcmp(gSystem->Getenv("XrdSecGSISRVNAMES"), "lxfsrd0506.cern.ch"))
589 ::Error(Form("AnalysisTrainNew.C::Connect <%s>", mode), "Environment XrdSecGSISRVNAMES different from lxfsrd0506.cern.ch");
592 TGrid::Connect("alien://");
594 TString homedir = gGrid->GetHomeDirectory();
595 TString workdir = homedir + train_name;
596 if (!gGrid->Cd(workdir)) {
598 if (gGrid->Mkdir(workdir)) {
599 gGrid->Cd(train_name);
600 ::Info("AnalysisTrainNew::Connect()", "Directory %s created", gGrid->Pwd());
603 gGrid->Mkdir("proof_output");
604 gGrid->Cd("proof_output");
605 proof_outdir = Form("alien://%s", gGrid->Pwd());
609 if (!username.Length()) {
610 ::Error(Form("AnalysisTrainNew.C::Connect <%s>", mode), "Make sure you:\n \
611 1. Have called: alien-token-init <username>\n \
612 2. Have called: >source /tmp/gclient_env_$UID");
615 if (usePLUGIN && !gSystem->Getenv("alien_CLOSE_SE")) {
616 ::Error(Form("AnalysisTrainNew.C::Connect <%s>", mode),
617 "When using the AliEn plugin it is preferable to define the \
618 variable alien_CLOSE_SE in your environment.");
621 ::Info("AnalysisTrainNew.C::Connect", "Connecting user <%s> to AliEn ...",
623 TGrid::Connect("alien://");
624 if (!gGrid || !gGrid->IsConnected()) return kFALSE;
627 ::Error("AnalysisTrainNew.C::Connect", "Unknown run mode: %s", mode);
630 ::Info("AnalysisTrainNew.C::Connect","Connected in %s mode", mode);
634 //______________________________________________________________________________
635 Bool_t LoadCommonLibraries(const char *mode)
637 // Load common analysis libraries.
639 if (!strcmp(mode, "LOCAL")) imode = 0;
640 if (!strcmp(mode, "PROOF")) imode = 1;
641 if (!strcmp(mode, "GRID")) imode = 2;
642 if (!gSystem->Getenv("ALICE_ROOT")) {
643 ::Error("AnalysisTrainNew.C::LoadCommonLibraries", "Analysis train requires that analysis libraries are compiled with a local AliRoot");
646 Bool_t success = kTRUE;
648 gSystem->Load("libTree.so");
649 gSystem->Load("libGeom.so");
650 gSystem->Load("libVMC.so");
651 gSystem->Load("libPhysics.so");
653 // Load framework classes. Par option ignored here.
658 success &= LoadLibrary("STEERBase", mode, kTRUE);
659 success &= LoadLibrary("ESD", mode, kTRUE);
660 success &= LoadLibrary("AOD", mode, kTRUE);
661 success &= LoadLibrary("ANALYSIS", mode, kTRUE);
662 success &= LoadLibrary("ANALYSISalice", mode, kTRUE);
663 if (useCORRFW) success &= LoadLibrary("CORRFW", mode, kTRUE);
665 success &= LoadLibrary("libSTEERBase.so", mode);
666 success &= LoadLibrary("libESD.so", mode);
667 success &= LoadLibrary("libAOD.so", mode);
668 success &= LoadLibrary("libANALYSIS.so", mode);
669 success &= LoadLibrary("libANALYSISalice.so", mode);
670 if (useCORRFW) success &= LoadLibrary("libCORRFW.so", mode);
671 gROOT->ProcessLine(".include $ALICE_ROOT/include");
676 if (useAFPAR && !gSystem->AccessPathName(AFversion)) ires = gProof->UploadPackage(AFversion);
678 success &= LoadLibrary("STEERBase", mode);
679 success &= LoadLibrary("ESD", mode);
680 success &= LoadLibrary("AOD", mode);
681 success &= LoadLibrary("ANALYSIS", mode);
682 success &= LoadLibrary("ANALYSISalice", mode);
683 if (useCORRFW) success &= LoadLibrary("CORRFW", mode);
685 ires = gProof->EnablePackage(AFversion);
686 if (ires<0) success = kFALSE;
687 if (useCORRFW) success &= LoadLibrary("CORRFW", mode);
691 ::Error("AnalysisTrainNew.C::LoadCommonLibraries", "Unknown run mode: %s", mode);
695 ::Info("AnalysisTrainNew.C::LoadCommodLibraries", "Load common libraries: SUCCESS");
696 ::Info("AnalysisTrainNew.C::LoadCommodLibraries", "Include path for Aclic compilation:\n%s",
697 gSystem->GetIncludePath());
699 ::Info("AnalysisTrainNew.C::LoadCommodLibraries", "Load common libraries: FAILED");
705 //______________________________________________________________________________
706 Bool_t LoadAnalysisLibraries(const char *mode)
708 // Load common analysis libraries.
709 Bool_t success = kTRUE;
711 if (!LoadLibrary("PWG3base", mode, kTRUE) ||
712 !LoadLibrary("PWG3muon", mode, kTRUE)) return kFALSE;
716 if (!LoadLibrary("JETAN", mode, kTRUE)) return kFALSE;
718 // PWG4 particle correlations
720 if (!LoadLibrary("PWG4PartCorrBase", mode, kTRUE) ||
721 !LoadLibrary("PWG4PartCorrDep", mode, kTRUE)) return kFALSE;
723 // PWG4 gamma conversion
724 if (iPWG4gammaconv) {
725 if (!LoadLibrary("PWG4GammaConv", mode, kTRUE)) return kFALSE;
727 // PWG4 omega to 3 pions
729 if (!LoadLibrary("PWG4omega3pi", mode, kTRUE)) return kFALSE;
733 if (!LoadLibrary("PWG2spectra", mode, kTRUE)) return kFALSE;
737 if (!LoadLibrary("PWG2flowCommon", mode, kTRUE) ||
738 !LoadLibrary("PWG2flowTasks", mode, kTRUE)) return kFALSE;
742 if (!LoadLibrary("PWG2resonances", mode, kTRUE)) return kFALSE;
746 if (!LoadLibrary("PWG2kink", mode, kTRUE)) return kFALSE;
750 if (!LoadLibrary("PWG2unicor", mode, kTRUE)) return kFALSE;
754 if (!LoadLibrary("PWG2evchar", mode, kTRUE)) return kFALSE;
758 if (!LoadLibrary("PWG2AOD", mode, kTRUE) ||
759 !LoadLibrary("PWG2femtoscopy", mode, kTRUE) ||
760 !LoadLibrary("PWG2femtoscopyUser", mode, kTRUE)) return kFALSE;
761 TFile::Cp(gSystem->ExpandPathName("$(ALICE_ROOT)/PWG2/FEMTOSCOPY/macros/ConfigFemtoAnalysis.C"), Form("%s/ConfigFemtoAnalysis.C", train_name.Data()));
762 anaLibs += "ConfigFemtoAnalysis.C ";
765 if (iPWG3vertexing) {
766 if (!LoadLibrary("PWG3base", mode, kTRUE) ||
767 !LoadLibrary("PWG3vertexingHF", mode, kTRUE)) return kFALSE;
769 ::Info("AnalysisTrainNew.C::LoadAnalysisLibraries", "Load other libraries: SUCCESS");
773 //______________________________________________________________________________
774 Bool_t LoadLibrary(const char *module, const char *mode, Bool_t rec=kFALSE)
776 // Load a module library in a given mode. Reports success.
779 TString smodule(module);
780 if (!strcmp(mode, "LOCAL")) imode = 0;
781 if (!strcmp(mode, "PROOF")) imode = 1;
782 if (!strcmp(mode, "GRID")) imode = 2;
785 ::Error("AnalysisTrainNew.C::LoadLibrary", "Empty module name");
788 // If a library is specified, just load it
789 if (smodule.EndsWith(".so")) {
790 mod.Remove(mod.Index(".so"));
791 result = gSystem->Load(mod);
793 ::Error("AnalysisTrainNew.C::LoadLibrary", "Could not load library %s", module);
796 if (rec) anaLibs += Form("%s.so ",mod.Data());
799 // Check if the library is already loaded
800 if (strlen(gSystem->GetLibraries(Form("%s.so", module), "", kFALSE)) > 0)
806 result = SetupPar(module);
807 if (rec) anaPars += Form("%s.par ", module);
809 result = gSystem->Load(Form("lib%s.so", module));
810 if (rec) anaLibs += Form("lib%s.so ", module);
814 result = gProof->UploadPackage(module);
816 result = gProof->UploadPackage(gSystem->ExpandPathName(Form("$ALICE_ROOT/%s.par", module)));
818 ::Error("AnalysisTrainNew.C::LoadLibrary", "Could not find module %s.par in current directory nor in $ALICE_ROOT", module);
822 result = gProof->EnablePackage(module);
828 ::Error("AnalysisTrainNew.C::LoadLibrary", "Could not load module %s", module);
835 //______________________________________________________________________________
836 TChain *CreateChain(const char *mode, const char *plugin_mode)
838 // Create the input chain
840 if (!strcmp(mode, "LOCAL")) imode = 0;
841 if (!strcmp(mode, "PROOF")) imode = 1;
842 if (!strcmp(mode, "GRID")) imode = 2;
843 TChain *chain = NULL;
848 if (!local_xmldataset.Length()) {
850 chain = new TChain("aodTree");
851 if (gSystem->AccessPathName("data/AliAOD.root"))
852 ::Error("AnalysisTrainNew.C::CreateChain", "File: AliAOD.root not in ./data dir");
854 if (!saveTrain) chain->Add("data/AliAOD.root");
855 else chain->Add("../data/AliAOD.root");
859 chain = CreateChainSingle(local_xmldataset, "aodTree");
862 if (!local_xmldataset.Length()) {
864 chain = new TChain("esdTree");
865 if (gSystem->AccessPathName("data/AliESDs.root"))
866 ::Error("AnalysisTrainNew.C::CreateChain", "File: AliESDs.root not in ./data dir");
868 if (!saveTrain) chain->Add("data/AliESDs.root");
869 else chain->Add("../data/AliESDs.root");
873 chain = CreateChainSingle(local_xmldataset, "esdTree");
881 AliAnalysisGrid *alienHandler = CreateAlienHandler(plugin_mode);
882 AliAnalysisManager::GetAnalysisManager()->SetGridHandler(alienHandler);
884 TString treeName = "esdTree";
885 if (iAODanalysis) treeName = "aodTree";
886 chain = CreateChainSingle("wn.xml", treeName);
891 if (chain && chain->GetNtrees()) return chain;
895 //______________________________________________________________________________
896 TChain* CreateChainSingle(const char* xmlfile, const char *treeName)
898 printf("*******************************\n");
899 printf("*** Getting the ESD Chain ***\n");
900 printf("*******************************\n");
901 TAlienCollection * myCollection = TAlienCollection::Open(xmlfile);
904 ::Error("AnalysisTrainNew.C::CreateChainSingle", "Cannot create an AliEn collection from %s", xmlfile) ;
908 TChain* chain = new TChain(treeName);
909 myCollection->Reset() ;
910 while ( myCollection->Next() ) chain->Add(myCollection->GetTURL("")) ;
915 //______________________________________________________________________________
916 Int_t SetupPar(char* pararchivename)
918 if (!pararchivename || !strlen(pararchivename)) return -1;
919 char processline[1024];
920 if (gSystem->AccessPathName(Form("%s.par", pararchivename))) {
921 if (!gSystem->AccessPathName(Form("%s/%s.par", gSystem->Getenv("ALICE_ROOT"),pararchivename))) {
922 ::Info("AnalysisTrainNew.C::SetupPar", "Getting %s.par from $ALICE_ROOT", pararchivename);
923 TFile::Cp(gSystem->ExpandPathName(Form("$ALICE_ROOT/%s.par", pararchivename)),
924 Form("%s.par",pararchivename));
926 ::Error("AnalysisTrainNew.C::SetupPar", "Cannot find %s.par", pararchivename);
930 if (usePLUGIN && saveTrain) gSystem->Exec(Form("ln -s ../%s.par %s",pararchivename, train_name.Data()));
931 gSystem->Exec(Form("tar xvzf %s.par", pararchivename));
933 TString ocwd = gSystem->WorkingDirectory();
934 if (!gSystem->ChangeDirectory(pararchivename)) return -1;
936 // check for BUILD.sh and execute
937 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
938 printf("*******************************\n");
939 printf("*** Building PAR archive ***\n");
940 printf("*******************************\n");
941 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
942 Error("runProcess","Cannot Build the PAR Archive! - Abort!");
947 // check for SETUP.C and execute
948 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
949 printf("*******************************\n");
950 printf("*** Setup PAR archive ***\n");
951 printf("*******************************\n");
952 gROOT->Macro("PROOF-INF/SETUP.C");
954 if (!gSystem->ChangeDirectory(ocwd.Data())) return -1;
958 //______________________________________________________________________________
959 AliAnalysisAlien* CreateAlienHandler(const char *plugin_mode)
961 // Check if user has a valid token, otherwise make one. This has limitations.
962 // One can always follow the standard procedure of calling alien-token-init then
963 // source /tmp/gclient_env_$UID in the current shell.
964 if (!AliAnalysisGrid::CreateToken()) return NULL;
965 AliAnalysisAlien *plugin = new AliAnalysisAlien();
966 // Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
967 plugin->SetRunMode(plugin_mode);
968 if (useProductionMode) plugin->SetProductionMode();
969 plugin->SetJobTag(job_tag);
970 plugin->SetNtestFiles(1);
971 // plugin->SetPreferedSE("ALICE::Legnaro::SE");
972 // Set versions of used packages
973 plugin->SetAPIVersion("V2.4");
974 plugin->SetROOTVersion(root_version);
975 plugin->SetAliROOTVersion(aliroot_version);
976 // Declare input data to be processed.
977 // Method 1: Create automatically XML collections using alien 'find' command.
978 // Define production directory LFN
979 plugin->SetGridDataDir(alien_datadir);
980 // Set data search pattern
981 if (iAODanalysis) plugin->SetDataPattern("*AliAOD.root");
982 else plugin->SetDataPattern("*ESD.tag.root");
983 // ...then add run numbers to be considered
984 plugin->SetRunRange(run_range[0], run_range[1]);
985 // for (Int_t i=0; i<10; i++) {
986 // if (run_numbers[i]==0) break;
987 // plugin->AddRunNumber(run_numbers[i]);
989 // Method 2: Declare existing data files (raw collections, xml collections, root file)
990 // If no path mentioned data is supposed to be in the work directory (see SetGridWorkingDir())
991 // XML collections added via this method can be combined with the first method if
992 // the content is compatible (using or not tags)
993 // plugin->AddDataFile("tag.xml");
994 // plugin->AddDataFile("/alice/data/2008/LHC08c/000057657/raw/Run57657.Merged.RAW.tag.root");
995 // Define alien work directory where all files will be copied. Relative to alien $HOME.
996 if (iAODanalysis) plugin->SetGridWorkingDir("analysisAOD");
997 else plugin->SetGridWorkingDir("analysisESD");
998 // Declare alien output directory. Relative to working directory.
999 if (!alien_outdir.Length()) alien_outdir = Form("output_%s",train_name.Data());
1000 plugin->SetGridOutputDir(alien_outdir);
1002 TString ana_sources = "";
1003 TString ana_add = "";
1004 if (usePAR && anaPars.Length()) {
1005 printf("%s\n", anaPars.Data());
1008 arr = anaPars.Tokenize(" ");
1010 while ((objstr=(TObjString*)next())) plugin->EnablePackage(objstr->GetString());
1014 // Declare the analysis source files names separated by blancs. To be compiled runtime
1015 // using ACLiC on the worker nodes.
1016 ana_sources = ana_sources.Strip();
1017 // Declare all libraries (other than the default ones for the framework. These will be
1018 // loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here.
1019 anaLibs = anaLibs.Strip();
1020 if (ana_sources.Length()) plugin->SetAnalysisSource(ana_sources);
1021 if (anaLibs.Length()) plugin->SetAdditionalLibs(anaLibs);
1023 // Declare the output file names separated by blancs.
1024 // (can be like: file.root or file.root@ALICE::Niham::File)
1025 plugin->SetDefaultOutputs();
1026 plugin->SetMergeExcludes(mergeExclude);
1027 plugin->SetMaxMergeFiles(maxMergeFiles);
1028 plugin->SetNrunsPerMaster(nRunsPerMaster);
1029 // Optionally define the files to be archived.
1030 // plugin->SetOutputArchive("log_archive.zip:stdout,stderr@ALICE::NIHAM::File root_archive.zip:AliAOD.root,AOD.tag.root@ALICE::NIHAM::File");
1031 plugin->SetOutputArchive(Form("log_archive.zip:stdout,stderr %s",outputArchive.Data()));
1032 // Optionally set a name for the generated analysis macro (default MyAnalysis.C)
1033 plugin->SetAnalysisMacro(Form("%s.C", train_name.Data()));
1034 // Optionally set maximum number of input files/subjob (default 100, put 0 to ignore)
1035 plugin->SetSplitMaxInputFileNumber(nFilesPerJob);
1036 // Optionally set number of failed jobs that will trigger killing waiting sub-jobs.
1037 // plugin->SetMaxInitFailed(5);
1038 // Optionally resubmit threshold.
1039 // plugin->SetMasterResubmitThreshold(90);
1040 // Optionally set time to live (default 30000 sec)
1041 plugin->SetTTL(30000);
1042 // Optionally set input format (default xml-single)
1043 plugin->SetInputFormat("xml-single");
1044 // Optionally modify the name of the generated JDL (default analysis.jdl)
1045 plugin->SetJDLName(Form("%s.jdl", train_name.Data()));
1046 // Optionally modify the executable name (default analysis.sh)
1047 plugin->SetExecutable(Form("%s.sh", train_name.Data()));
1048 // Optionally modify job price (default 1)
1049 plugin->SetPrice(1);
1050 // Optionally modify split mode (default 'se')
1051 plugin->SetSplitMode("se");
1055 //______________________________________________________________________________
1058 // Write train configuration in a file. The file name has the format:
1059 // train_[trainName]_ddMonthyyyy_time.C
1061 gSystem->Exec("date +%d%b%Y_%Hh%M > date.tmp");
1062 ifstream fdate("date.tmp");
1063 if (!fdate.is_open()) {
1064 ::Error("AnalysisTrainNew.C::Export","Could not generate file name");
1067 const char date[64];
1068 fdate.getline(date,64);
1070 gSystem->Exec("rm date.tmp");
1071 train_name = Form("train_%s_%s", train_name.Data(), date);
1073 train_name = Form("train_%s", train_name.Data());
1075 TString cdir = gSystem->WorkingDirectory();
1076 gSystem->MakeDirectory(train_name);
1077 gSystem->ChangeDirectory(train_name);
1079 out.open(Form("%sConfig.C",train_name.Data()), ios::out);
1081 ::Error("AnalysisTrainNew.C::Export", "Cannot open ConfigTrain.C for writing");
1085 out << " train_name = " << "\"" << train_name.Data() << "\";" << endl;
1086 out << " proof_cluster = " << "\"" << proof_cluster.Data() << "\";" << endl;
1087 out << " useAFPAR = " << useAFPAR << ";" << endl;
1089 out << " AFversion = " << AFversion.Data() << ";" << endl;
1090 out << " proof_dataset = " << "\"" << proof_dataset.Data() << "\";" << endl;
1091 out << " usePLUGIN = " << usePLUGIN << ";" << endl;
1092 out << " usePAR = " << usePAR << ";" << endl;
1093 out << " useCPAR = " << useCPAR << ";" << endl;
1094 out << " root_version = " << "\"" << root_version.Data() << "\";" << endl;
1095 out << " aliroot_version = " << "\"" << aliroot_version.Data() << "\";" << endl;
1096 out << " alien_datadir = " << "\"" << alien_datadir.Data() << "\";" << endl;
1097 if (!alien_outdir.Length()) alien_outdir = Form("output_%s",train_name.Data());
1098 out << " alien_outdir = " << "\"" << alien_outdir.Data() << "\";" << endl;
1099 out << " maxMergeFiles = " << maxMergeFiles << ";" << endl;
1100 out << " mergeExclude = " << "\"" << mergeExclude.Data() << "\";" << endl;
1101 out << " nRunsPerMaster = " << nRunsPerMaster << ";" << endl;
1102 out << " nFilesPerJob = " << nFilesPerJob << ";" << endl;
1103 // for (Int_t i=0; i<10; i++) {
1104 // if (run_numbers[i])
1105 // out << " run_numbers[" << i << "] = " << run_numbers[i] << ";" << endl;
1107 out << " run_range[0] = " << run_range[0] << ";" << endl;
1108 out << " run_range[1] = " << run_range[1] << ";" << endl;
1109 out << " useDBG = " << useDBG << ";" << endl;
1110 out << " useMC = " << useMC << ";" << endl;
1111 out << " useTAGS = " << useTAGS << ";" << endl;
1112 out << " useKFILTER = " << useKFILTER << ";" << endl;
1113 out << " useTR = " << useTR << ";" << endl;
1114 out << " useCORRFW = " << useCORRFW << ";" << endl;
1115 out << " useAODTAGS = " << useAODTAGS << ";" << endl;
1116 out << " saveTrain = " << "kFALSE;" << endl << endl;
1117 out << " // Analysis modules" << endl;
1118 out << " iAODanalysis = " << iAODanalysis << ";" << endl;
1119 out << " iAODhandler = " << iAODhandler << ";" << endl;
1120 out << " iESDfilter = " << iESDfilter << ";" << endl;
1121 out << " iMUONcopyAOD = " << iMUONcopyAOD << ";" << endl;
1122 out << " iJETAN = " << iJETAN << ";" << endl;
1123 out << " iPWG4partcorr = " << iPWG4partcorr << ";" << endl;
1124 out << " iPWG4gammaconv = " << iPWG4gammaconv << ";" << endl;
1125 out << " iPWG4omega3pi = " << iPWG4omega3pi << ";" << endl;
1126 out << " iPWG2femto = " << iPWG2femto << ";" << endl;
1127 out << " iPWG2spectra = " << iPWG2spectra << ";" << endl;
1128 out << " iPWG2protons = " << iPWG2protons << ";" << endl;
1129 out << " iPWG2checkcascade = " << iPWG2checkcascade << ";" << endl;
1130 out << " iPWG2perfcascade = " << iPWG2perfcascade << ";" << endl;
1131 out << " iPWG2checkv0 = " << iPWG2checkv0 << ";" << endl;
1132 out << " iPWG2strange = " << iPWG2strange << ";" << endl;
1133 out << " iPWG2flow = " << iPWG2flow << ";" << endl;
1134 out << " iPWG2res = " << iPWG2res << ";" << endl;
1135 out << " iPWG2kink = " << iPWG2kink << ";" << endl;
1136 out << " iPWG2kinkESDMC = " << iPWG2kinkESDMC << ";" << endl;
1137 out << " iPWG2kinkres = " << iPWG2kinkres << ";" << endl;
1138 out << " iPWG2kinklikesign = " << iPWG2kinklikesign << ";" << endl;
1139 out << " iPWG2unicor = " << iPWG2unicor << ";" << endl;
1140 out << " iPWG2evchar = " << iPWG2evchar << ";" << endl;
1142 ::Info("AnalysisTrainNew.C::WriteConfig", "Train configuration wrote to file %s", Form("config_%s.C", train_name.Data()));
1143 gSystem->ChangeDirectory(cdir);
1146 //______________________________________________________________________________
1147 Bool_t LoadConfig(const char *filename)
1149 // Read train configuration from file
1150 if (gSystem->AccessPathName(filename)) {
1151 ::Error("AnalysisTrainNew.C::LoadConfig", "Config file name not found");
1154 gROOT->ProcessLine(Form(".x %s", filename));
1155 ::Info("AnalysisTrainNew.C::LoadConfig", "Train configuration loaded from file %s", filename);