Bug fixes
[u/mrichter/AliRoot.git] / ANALYSIS / macros / AnalysisTrainNew.C
CommitLineData
a42c0df6 1//===================== ANALYSIS TRAIN =========================================
c6e7c68c 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")
15dac83a 9// Local mode requires AliESds.root or AliAOD.root in ./data directory
c6e7c68c 10// root[3] AnalysisTrainNew("local")
7581b1bc 11// In proof and grid modes, a token is needed and sourcing the produced environment file.
a42c0df6 12//
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")
c6e7c68c 17
a42c0df6 18//================== TRAIN NAME ============================================
e4080179 19TString train_name = "TR004_LHC09a1ESD"; // *CHANGE ME* (no blancs or special characters)
20TString job_tag = "TR004: ESD+MC analysis -> AOD + delta AOD + histograms"; // *CHANGE ME*
a42c0df6 21//==============================================================================
22
23// ### Settings that make sense in PROOF only
24//==============================================================================
25TString proof_cluster = "alicecaf.cern.ch";
26Bool_t useAFPAR = kFALSE; // use AF special par file
6e428ea7 27TString AFversion = "AF-v4-17";
7581b1bc 28// Change CAF dataset here
a42c0df6 29TString proof_dataset = "/COMMON/COMMON/LHC09a4_run8100X#/esdTree";
b160b576 30TString proof_outdir = "";
c6e7c68c 31
a42c0df6 32// ### Settings that make sense when using the Alien plugin
33//==============================================================================
34Bool_t usePLUGIN = kTRUE; // do not change
5c4c538a 35Bool_t useProductionMode = kTRUE; // use the plugin in production mode
a42c0df6 36// Usage of par files ONLY in grid mode and ONLY if the code is not available
7581b1bc 37// in the deployed AliRoot versions. Par file search path: local dir, if not there $ALICE_ROOT.
38// To refresh par files, remove the ones in the workdir, then do "make <target.par>" in
39// AliRoot.
a42c0df6 40Bool_t usePAR = kFALSE; // use par files for extra libs
41Bool_t useCPAR = kFALSE; // use par files for common libs
e4080179 42TString root_version = "v20091109"; // *CHANGE ME IF MORE RECENT IN GRID*
43TString aliroot_version = "v4-18-09-AN"; // *CHANGE ME IF MORE RECENT IN GRID*
a42c0df6 44// Change production base directory here
e4080179 45TString alien_datadir = "/alice/sim/PDC_09/LHC09a4";
371c967e 46// AliEn output directory. If blank will become output_<train_name>
e4080179 47TString alien_outdir = "/alice/sim/PDC_09/LHC09a4/analysis/ESD/TR004";
526b1502 48// TString alien_outdir = "";
275942e0 49// Number of files merged in a chunk
50Int_t maxMergeFiles = 50;
51// Files that should not be merged
e4080179 52TString mergeExclude = "AliAOD.root AliAOD.VertexingHF.root AliAOD.Jets.root";
6e428ea7 53// Make replicas on the storages below
54TString outputStorages = "ALICE::NIHAM::File,ALICE::CNAF::SE,ALICE::FZK::SE,ALICE::GSI::SE,ALICE::Legnaro::SE";
275942e0 55// Number of runs per master job
2a47e7b4 56Int_t nRunsPerMaster = 10;
275942e0 57// Maximum number of files per job (gives size of AOD)
e4080179 58Int_t nFilesPerJob = 100; // !
275942e0 59// Set the run range
e4080179 60//Int_t run_range[2] = {70000, 70220}; // LHC09a4 *CHANGE ME*
61Int_t run_range[2] = {81007, 81007};
a42c0df6 62// ### Settings that make sense only for local analysis
63//==============================================================================
64// Change local xml dataset for local interactive analysis
65TString local_xmldataset = "";
c6e7c68c 66
a42c0df6 67// ### Other flags to steer the analysis
68//==============================================================================
371c967e 69Bool_t useDATE = kFALSE; // use date in train name
e4080179 70Bool_t useDBG = kTRUE; // activate debugging
a42c0df6 71Bool_t useMC = kTRUE; // use MC info
e4080179 72Bool_t useTAGS = kTRUE; // use ESD tags for selection
73Bool_t useKFILTER = kTRUE; // use Kinematics filter
6e428ea7 74Bool_t useTR = kTRUE; // use track references
a42c0df6 75Bool_t useCORRFW = kFALSE; // do not change
6e428ea7 76Bool_t useAODTAGS = kFALSE; // use AOD tags
a42c0df6 77Bool_t saveTrain = kTRUE; // save train configuration as:
b160b576 78Bool_t saveProofToAlien = kFALSE; // save proof outputs in AliEn
a42c0df6 79 // train_[trainName]_ddMonthyyyy_time.C
80// ### Analysis modules to be included. Some may not be yet fully implemented.
81//==============================================================================
82Int_t iAODanalysis = 0; // Analysis on input AOD's
e4080179 83Int_t iAODhandler = 1; // Analysis produces an AOD or dAOD's
84Int_t iESDfilter = 1; // ESD to AOD filter (barrel + muon tracks)
a42c0df6 85Int_t iMUONcopyAOD = 0; // Task that copies only muon events in a separate AOD (PWG3)
e4080179 86Int_t iJETAN = 1; // Jet analysis (PWG4) - needs ESD filter
87Int_t iPWG4partcorr = 1; // Gamma-hadron correlations task (PWG4)
6e428ea7 88Int_t iPWG4gammaconv = 1; // Gamma conversion analysis (PWG4) # NOT YET WORKING - WAITING FOR FEEDBACK #
89Int_t iPWG4omega3pi = 1; // Omega to 3 pi analysis (PWG4)
e4080179 90Int_t iPWG3vertexing = 1; // Vertexing HF task (PWG2)
6e428ea7 91Int_t iPWG3hfe = 1; // Electrons analysis (PWG3)
e4080179 92Int_t iPWG3d2h = 1; // D0->2 hadrons (PWG3)
6e428ea7 93Int_t iPWG2femto = 1; // Femtoscopy task (PWG2)
94Int_t iPWG2spectra = 1; // Spectra tasks (PWG2
95Int_t iPWG2protons = 1; // Proton-antiproton analysis
96Int_t iPWG2checkcascade = 1; // Check cascades task
97Int_t iPWG2perfcascade = 1; // Check performance cascade
98Int_t iPWG2checkv0 = 1; // Check V0 task
99Int_t iPWG2strange = 1; // Strangeness task
100Int_t iPWG2flow = 1; // Flow analysis tasks (PWG2) = crashes in AliCFManager
101Int_t iPWG2res = 1; // Resonances task (PWG2)
e4080179 102Int_t iPWG2rsneff = 1; // Resonances efficiency
6e428ea7 103Int_t iPWG2kink = 1; // Kink analysis tasks (PWG2)
104Int_t iPWG2kinkESDMC = 1; // Kink ESD-MC comparison (PWG2)
105Int_t iPWG2kinkres = 1; // Kink resonances (PWG2)
106Int_t iPWG2kinklikesign = 1; // Kink like-sign (PWG2)
107Int_t iPWG2evchar = 1; // Event characteristics (PWG2)
108Int_t iPWG2unicor = 1; // Unicor analysis (PWG2)
e4080179 109Int_t iPWG2forward = 1; // FMD analysis (PWG2)
6e428ea7 110
111// ### Configuration macros used for each module
112//==============================================================================
113TString configPWG2femto = "$ALICE_ROOT/PWG2/FEMTOSCOPY/macros/Train/Train3/ConfigFemtoAnalysis.C";
e4080179 114TString configPWG3d2h = "$ALICE_ROOT/PWG3/vertexingHF/ConfigVertexingHF.C";
a42c0df6 115// Temporaries.
c6e7c68c 116TString anaPars = "";
117TString anaLibs = "";
118// Function signatures
5c4c538a 119class AliAnalysisAlien;
c6e7c68c 120
121//______________________________________________________________________________
a42c0df6 122void AnalysisTrainNew(const char *analysis_mode="grid",
123 const char *plugin_mode="full",
124 const char *config_file="")
c6e7c68c 125{
a42c0df6 126// Main analysis train macro. If a configuration file is provided, all parameters
127// are taken from there but may be altered by CheckModuleFlags.
128 if (strlen(config_file) && !LoadConfig(config_file)) return;
c6e7c68c 129 TString smode(analysis_mode);
a42c0df6 130 smode.ToUpper();
c6e7c68c 131 // Check compatibility of selected modules
132 CheckModuleFlags(smode);
e4080179 133 if (saveTrain) WriteConfig();
c6e7c68c 134
135 printf("==================================================================\n");
a42c0df6 136 printf("=========== RUNNING ANALYSIS TRAIN %s IN %s MODE ==========\n", train_name.Data(),smode.Data());
c6e7c68c 137 printf("==================================================================\n");
138 printf("= Configuring analysis train for: =\n");
139 if (iAODanalysis) printf("= AOD analysis =\n");
140 else printf("= ESD analysis =\n");
141 if (iESDfilter) printf("= ESD filter =\n");
c6e7c68c 142 if (iMUONcopyAOD) printf("= MUON copy AOD =\n");
143 if (iJETAN) printf("= Jet analysis =\n");
0d5d317c 144 if (iPWG2spectra) {
145 printf("= PWG2 SPECTRA tasks : =\n");
146 if (iPWG2protons) printf("= PWG2 proton-antiproton =\n");
147 if (iPWG2checkcascade) printf("= PWG2 check cascades =\n");
148 if (iPWG2perfcascade) printf("= PWG2 performance cascades =\n");
149 if (iPWG2checkv0) printf("= PWG2 check V0 =\n");
150 if (iPWG2strange) printf("= PWG2 strangeness =\n");
151 }
6e428ea7 152 if (iPWG2femto) {
153 printf("= PWG2 femtoscopy =\n");
154 printf(" +++ configured by: %s\n", configPWG2femto.Data());
155 }
c6e7c68c 156 if (iPWG2flow) printf("= PWG2 flow =\n");
157 if (iPWG2res) printf("= PWG2 resonances =\n");
e4080179 158 if (iPWG2rsneff) printf("= PWG2 resonances efficiency =\n");
0d5d317c 159 if (iPWG2kink) {
160 printf("= PWG2 kink analysis tasks: =\n");
161 if (iPWG2kinkESDMC) printf("= PWG2 ESD-MC kinks =\n");
162 if (iPWG2kinkres) printf("= PWG2 kink resonances =\n");
163 if (iPWG2kinklikesign) printf("= PWG2 kink like-sign analysis =\n");
164 }
6e428ea7 165 if (iPWG2evchar) printf("= PWG2 event characteristics =\n");
166 if (iPWG2unicor) printf("= PWG2 Unicor analysis =\n");
167 if (iPWG2forward) printf("= PWG2 forward: sharing, density, bkg. correction, dNdEta =\n");
168 if (iPWG3vertexing) printf("= PWG3 vertexing =\n");
169 if (iPWG3hfe) printf("= PWG3 electrons =\n");
e4080179 170 if (iPWG3d2h) {
171 printf("= PWG3 D0->2 hadrons tasks =\n");
172 printf(" +++ configured by: %s\n", configPWG3d2h.Data());
173 }
6e428ea7 174 if (iPWG4partcorr) printf("= PWG4 gamma-hadron, pi0 and gamma-jet correlations =\n");
175 if (iPWG4gammaconv) printf("= PWG4 gamma conversion =\n");
176 if (iPWG4omega3pi) printf("= PWG4 omega to 3 pions =\n");
c6e7c68c 177 printf("==================================================================\n");
178 printf(":: use MC truth %d\n", (UInt_t)useMC);
099d8f33 179 printf(":: use KINE filter %d\n", (UInt_t)useKFILTER);
c6e7c68c 180 printf(":: use track refs %d\n", (UInt_t)useTR);
099d8f33 181 printf(":: use tags %d\n", (UInt_t)useTAGS);
182 printf(":: use AOD tags %d\n", (UInt_t)useAODTAGS);
c6e7c68c 183 printf(":: use debugging %d\n", (UInt_t)useDBG);
184 printf(":: use PAR files %d\n", (UInt_t)usePAR);
185 printf(":: use AliEn plugin %d\n", (UInt_t)usePLUGIN);
186
b160b576 187 //==========================================================================
c6e7c68c 188 // Connect to back-end system
189 if (!Connect(smode)) {
190 ::Error("AnalysisTrain", "Could not connect to %s back-end", analysis_mode);
191 return;
192 }
193
194 // Load common libraries and set include path
195 if (!LoadCommonLibraries(smode)) {
196 ::Error("AnalysisTrain", "Could not load common libraries");
197 return;
b160b576 198 }
c6e7c68c 199
b160b576 200 // Make the analysis manager and connect event handlers
201 AliAnalysisManager *mgr = new AliAnalysisManager("Analysis Train", "Production train");
202 if (saveProofToAlien) mgr->SetSpecialOutputLocation(proof_outdir);
6e428ea7 203 if (!strcmp(plugin_mode, "test")) mgr->SetNSysInfo(1);
c6e7c68c 204 // Load analysis specific libraries
205 if (!LoadAnalysisLibraries(smode)) {
206 ::Error("AnalysisTrain", "Could not load analysis libraries");
207 return;
208 }
209
c6e7c68c 210 // Create input handler (input container created automatically)
211 if (iAODanalysis) {
212 // AOD input handler
213 AliAODInputHandler *aodH = new AliAODInputHandler();
e4080179 214 if (iPWG3d2h) aodH->AddFriend("AliAOD.VertexingHF.root");
c6e7c68c 215 mgr->SetInputEventHandler(aodH);
216 } else {
217 // ESD input handler
218 AliESDInputHandler *esdHandler = new AliESDInputHandler();
099d8f33 219 if (useTAGS) esdHandler->SetReadTags();
c6e7c68c 220 mgr->SetInputEventHandler(esdHandler);
221 }
222 // Monte Carlo handler
223 if (useMC && !iAODanalysis) {
224 AliMCEventHandler* mcHandler = new AliMCEventHandler();
225 mgr->SetMCtruthEventHandler(mcHandler);
226 mcHandler->SetReadTR(useTR);
227 }
228 // AOD output container, created automatically when setting an AOD handler
229 if (iAODhandler) {
230 // AOD output handler
231 AliAODHandler* aodHandler = new AliAODHandler();
b160b576 232 aodHandler->SetOutputFileName("AliAOD.root");
c6e7c68c 233 mgr->SetOutputEventHandler(aodHandler);
b160b576 234 if (iAODanalysis) {
e4080179 235 aodHandler->SetFillAOD(kFALSE);
b160b576 236 aodHandler->SetCreateNonStandardAOD();
526b1502 237 if (iJETAN) aodHandler->SetOutputFileName("AliAOD.Jets.root");
e4080179 238// if (iPWG3vertexing) aodHandler->SetOutputFileName("AliAOD.VertexingHF.root");
b160b576 239 }
c6e7c68c 240 }
241 // Debugging if needed
242 if (useDBG) mgr->SetDebugLevel(3);
243
244 //==========================================================================
245 // Create the chain. In this example it is created only from ALIEN files but
246 // can be done to work in batch or grid mode as well.
247 TChain *chain = CreateChain(smode, plugin_mode);
248
249 //==========================================================================
250 // Load the tasks configuration macros for all wagons. These files are supposed now to be
251 // in the current workdir, but in AliEn they will be in the file catalog,
252 // mapped from AliRoot and pecified in the jdl input list.
253
254 // For now connection to top input container and common AOD output container
255 // is done in this macro, but in future these containers will be connected
256 // from each task configuration macro.
257
258 if (iESDfilter && !iAODanalysis) {
259 // ESD filter task configuration.
260 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskESDFilter.C");
099d8f33 261 AliAnalysisTaskESDfilter *taskesdfilter = AddTaskESDFilter(useKFILTER);
c6e7c68c 262 }
263
099d8f33 264 // AOD tags
265 if (useAODTAGS) {
266 AliAnalysisTaskTagCreator* tagTask = new AliAnalysisTaskTagCreator("AOD Tag Creator");
267 mgr->AddTask(tagTask);
268 AliAnalysisDataContainer *coutTags = mgr->CreateContainer("cTag", TTree::Class(),
269 AliAnalysisManager::kOutputContainer, "AOD.tag.root");
270 mgr->ConnectInput (tagTask, 0, mgr->GetCommonInputContainer());
271 mgr->ConnectOutput(tagTask, 1, coutTags);
c6e7c68c 272 }
273
e4080179 274// ********** PWG2 wagons ******************************************************
275 AliAnalysisManager::SetCommonFileName("PWG2histograms.root");
276
c6e7c68c 277 // Proton analysis
278 if (iPWG2spectra) {
f0e8e44e 279 // protons
0d5d317c 280 if (iPWG2protons) {
281 gROOT->LoadMacro("$ALICE_ROOT/PWG2/SPECTRA/macros/AddTaskProtons.C");
282 AliAnalysisTaskProtons *taskprotons = AddTaskProtons();
283 if (!taskprotons) ::Warning("AnalysisTrainNew", "AliAnalysisTaskProtons cannot run for this train conditions - EXCLUDED");
284 }
f0e8e44e 285 // cascades
0d5d317c 286 if (iPWG2checkcascade) {
287 gROOT->LoadMacro("$ALICE_ROOT/PWG2/SPECTRA/macros/AddTaskCheckCascade.C");
288 AliAnalysisTaskCheckCascade *taskcheckcascade = AddTaskCheckCascade();
289 if (!taskcheckcascade) ::Warning("AnalysisTrainNew", "AliAnalysisTaskCheckCascade cannot run for this train conditions - EXCLUDED");
290 }
6e7f8264 291 // v0's
0d5d317c 292 if (iPWG2checkv0) {
293 gROOT->LoadMacro("$ALICE_ROOT/PWG2/SPECTRA/macros/AddTaskCheckV0.C");
294 AliAnalysisTaskCheckV0 *taskcheckV0 = AddTaskCheckV0();
295 if (!taskcheckV0) ::Warning("AnalysisTrainNew", "AliAnalysisTaskCheckV0 cannot run for this train conditions - EXCLUDED");
296 }
6e7f8264 297 // strangeness
0d5d317c 298 if (iPWG2strange) {
299 gROOT->LoadMacro("$ALICE_ROOT/PWG2/SPECTRA/macros/AddTaskStrange.C");
300 AliAnalysisTaskStrange *taskstrange = AddTaskStrange();
301 if (!taskstrange) ::Warning("AnalysisTrainNew", "AliAnalysisTaskStrange cannot run for this train conditions - EXCLUDED");
302 }
c3a83447 303 // performance cascades
0d5d317c 304 if (iPWG2perfcascade) {
305 gROOT->LoadMacro("$ALICE_ROOT/PWG2/SPECTRA/macros/AddTaskCheckPerformanceCascade.C");
306 AliAnalysisTaskCheckPerformanceCascade *taskperfcascade = AddTaskCheckPerformanceCascade();
307 if (!taskperfcascade) ::Warning("AnalysisTrainNew", "AliAnalysisTaskCheckPerformanceCascade cannot run for this train conditions - EXCLUDED");
308 }
c6e7c68c 309 }
310
081194a7 311 // Femtoscopy analysis modules
312 if (iPWG2femto) {
313 gROOT->LoadMacro("$ALICE_ROOT/PWG2/FEMTOSCOPY/macros/AddTaskFemto.C");
6e428ea7 314 AliAnalysisTaskFemto *taskfemto = AddTaskFemto(configPWG2femto);
081194a7 315 if (!taskfemto) ::Warning("AnalysisTrainNew", "AliAnalysisTaskFemto cannot run for this train conditions - EXCLUDED");
316 }
317
318 // Kink analysis
319 if (iPWG2kink) {
0d5d317c 320 if (iPWG2kinkESDMC) {
321 gROOT->LoadMacro("$ALICE_ROOT/PWG2/KINK/macros/AddTaskKink.C");
322 AliAnalysisKinkESDMC *taskkink = AddTaskKink();
323 if (!taskkink) ::Warning("AnalysisTrainNew", "AliAnalysisKinkESDMC cannot run for this train conditions - EXCLUDED");
324 }
325 if (iPWG2kinkres) {
326 gROOT->LoadMacro("$ALICE_ROOT/PWG2/KINK/macros/AddTaskKinkResonance.C");
327 AliAnalysisTaskKinkResonance *taskkinkres = AddTaskKinkResonance();
328 if (!taskkinkres) ::Warning("AnalysisTrainNew", "AliAnalysisTaskKinkResonance cannot run for this train conditions - EXCLUDED");
329 }
330 if (iPWG2kinklikesign) {
331 gROOT->LoadMacro("$ALICE_ROOT/PWG2/KINK/macros/AddTaskKinkResonanceLikeSign.C");
332 AliResonanceKinkLikeSign *taskkinklikesign = AddTaskKinkResonanceLikeSign();
333 if (!taskkinklikesign) ::Warning("AnalysisTrainNew", "AliResonanceKinkLikeSign cannot run for this train conditions - EXCLUDED");
334 }
081194a7 335 }
e4d0b516 336
c0893d28 337 // Event characterization
338 if (iPWG2evchar) {
339 gROOT->LoadMacro("$ALICE_ROOT/PWG2/EVCHAR/macros/AddTaskSPDdNdEta.C");
340 AliAnalysisTaskSPDdNdEta *taskspddndeta = AddTaskSPDdNdEta();
341 if (!taskspddndeta) ::Warning("AnalysisTrainNew", "AliAnalysisTaskSPDdNdEta cannot run for this train conditions - EXCLUDED");
342 taskspddndeta->SetReadMC(useMC);
343 }
344
345 // Unicor
346 if (iPWG2unicor) {
347 gROOT->LoadMacro("$ALICE_ROOT/PWG2/UNICOR/AddTaskUnicor.C");
348 AliAnalysisTaskUnicor *taskunicor = AddTaskUnicor();
8e1cf110 349 if (!taskunicor) ::Warning("AnalysisTrainNew", "AliAnalysisTaskUnicor cannot run for this train conditions - EXCLUDED");
c0893d28 350 }
351
6e428ea7 352 // FMD
353 if (iPWG2forward) {
354 gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis/AddTaskFMD.C");
355 AliFMDAnalysisTaskSE *taskfmd = AddTaskFMD();
356 if (!taskfmd) ::Warning("AnalysisTrainNew", "AliFMDAnalysisTaskSE cannot run for this train conditions - EXCLUDED");
357 }
358
e4d0b516 359 // Flow analysis
360 if (iPWG2flow) {
361 gROOT->LoadMacro("$ALICE_ROOT/PWG2/FLOW/macros/AddTaskFlow.C");
1276f2f0 362 Bool_t SP = kTRUE;
363 Bool_t LYZ1SUM = kTRUE;
364 Bool_t LYZ1PROD = kTRUE;
365 Bool_t LYZ2SUM = kFALSE;
366 Bool_t LYZ2PROD = kFALSE;
367 Bool_t LYZEP = kFALSE;
368 Bool_t GFC = kTRUE;
369 Bool_t QC = kTRUE;
370 Bool_t FQD = kFALSE;
371 Bool_t MCEP = kFALSE; //does not work yet 24/12/08
e4d0b516 372 Bool_t kineFromESD = kTRUE;
1276f2f0 373 Bool_t METHODS[] = {SP,LYZ1SUM,LYZ1PROD,LYZ2SUM,LYZ2PROD,LYZEP,GFC,QC,FQD,MCEP};
e4d0b516 374 // Analysis type can be ESD, AOD, MC, ESDMC0, ESDMC1
375 TString type = "AOD";
376 if (!iAODanalysis) type = "ESD";
377 if (useMC) {
378 type += "MC";
379 if (!kineFromESD) type += "1";
380 else type += "0";
381 }
382 // Boolean to fill/not fill the QA histograms
383 Bool_t QA = kTRUE;
384 // Boolean to use/not use weights for the Q vector
385 Bool_t WEIGHTS[] = {kFALSE,kFALSE,kFALSE}; //Phi, v'(pt), v'(eta)
386 AliAnalysisTaskFlowEvent* taskFE = AddTaskFlow(type,METHODS,QA,WEIGHTS);
387 if (!taskFE) ::Warning("AnalysisTrainNew", "AliAnalysisTaskFlowEvent cannot run for this train conditions - EXCLUDED");
388 }
3b1610cf 389
390 // PWG2 resonances
391 if (iPWG2res) {
0d5d317c 392 gROOT->LoadMacro("$ALICE_ROOT/PWG2/RESONANCES/macros/train/AddAnalysisTaskRsn.C");
e4080179 393 gROOT->LoadMacro("$ALICE_ROOT/PWG2/RESONANCES/macros/train/AddAnalysisTaskRsnEff.C");
0d5d317c 394 TString path = gROOT->GetMacroPath();
395 path += ":$ALICE_ROOT/PWG2/RESONANCES/macros/train";
396 gROOT->SetMacroPath(path);
397 AddAnalysisTaskRsn(kTRUE);
e4080179 398 AddAnalysisTaskRsnEff();
3b1610cf 399 }
e4080179 400
401// ********** PWG3 wagons ******************************************************
402 AliAnalysisManager::SetCommonFileName("PWG3histograms.root");
e4d0b516 403
404 // PWG3 vertexing
15dac83a 405 if (iPWG3vertexing) {
406 gROOT->LoadMacro("$ALICE_ROOT/PWG3/vertexingHF/AddTaskVertexingHF.C");
407 AliAnalysisTaskSEVertexingHF *taskvertexingHF = AddTaskVertexingHF();
081194a7 408 if (!taskvertexingHF) ::Warning("AnalysisTrainNew", "AliAnalysisTaskSEVertexingHF cannot run for this train conditions - EXCLUDED");
15dac83a 409 }
410
2a47e7b4 411 // PWG3 electrons
412 if (iPWG3hfe) {
413 gROOT->LoadMacro("$ALICE_ROOT/PWG3/hfe/AddTaskHFE.C");
414 AliAnalysisTaskHFE *taskHFE = AddTaskHFE();
415 if (!taskHFE) ::Warning("AnalysisTrainNew", "AliAnalysisTaskHFE cannot run for this train conditions - EXCLUDED");
416 }
e4080179 417
418 // PWG3 D2h
419 if (iPWG3d2h) {
420 gROOT->LoadMacro("$ALICE_ROOT/PWG3/vertexingHF/AddD2HTrain.C");
421 TFile::Cp(gSystem->ExpandPathName(configPWG3d2h.Data()), Form("%s/ConfigVertexingHF.C", train_name.Data()));
422 AddD2HTrain();
423 }
2a47e7b4 424
e4080179 425// ********** PWG4 wagons ******************************************************
426 AliAnalysisManager::SetCommonFileName("PWG4histograms.root");
427
428 // Jet analysis
429 if (iJETAN) {
430 gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskJets.C");
431 if (!iAODanalysis) {
432 // Default jet reconstructor running on ESD's
433 AliAnalysisTaskJets * taskjets = AddTaskJets();
434 if (!taskjets) ::Warning("AnalysisTrainNew", "AliAnalysisTaskJets cannot run for this train conditions - EXCLUDED");
435 } else {
436 // AOD-based analysis. Add all reconstructors to write into delta AOD's
437// AddTaskJetsDelta();
438 AliAnalysisTaskJets * taskjets = AddTaskJets();
439 taskjets->SetNonStdBranch("jetsAOD_UA1_04");
440 }
441 }
c6e7c68c 442 // PWG4 hadron correlations
443 if (iPWG4partcorr) {
099d8f33 444 gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskPartCorr.C");
081194a7 445 AliAnalysisTaskParticleCorrelation *taskpartcorrPHOS = AddTaskPartCorr("AOD", "PHOS");
446 if (!taskpartcorrPHOS) ::Warning("AnalysisTrainNew", "AliAnalysisTaskParticleCorrelation PHOS cannot run for this train conditions - EXCLUDED");
274ff025 447 AliAnalysisTaskParticleCorrelation *taskpartcorrEMCAL = AddTaskPartCorr("AOD", "EMCAL");
081194a7 448 if (!taskpartcorrEMCAL) ::Warning("AnalysisTrainNew", "AliAnalysisTaskParticleCorrelation EMCAL cannot run for this train conditions - EXCLUDED");
15dac83a 449 }
c3a83447 450
451 // PWG4 gamma conversion analysis
452 if (iPWG4gammaconv) {
453 gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskGammaConversion.C");
526b1502 454 TString cdir = gSystem->WorkingDirectory();
455 gSystem->ChangeDirectory(gSystem->ExpandPathName("$ALICE_ROOT/PWG4/macros/"));
456 TString gcArguments = "-run-on-train -run-jet -run-chic -run-neutralmeson";
457 AliAnalysisTaskGammaConversion * taskGammaConversion = AddTaskGammaConversion(gcArguments,mgr->GetCommonInputContainer());
458 gSystem->ChangeDirectory(cdir);
c3a83447 459 if (!taskGammaConversion) ::Warning("AnalysisTrainNew", "AliAnalysisTaskGammaConversion cannot run for these train conditions - EXCLUDED");
460 }
5c4c538a 461
462 // PWG4 omega to 3 pions analysis
463 if (iPWG4omega3pi) {
464 gROOT->LoadMacro("$ALICE_ROOT/PWG4/macros/AddTaskomega3pi.C");
465 AliAnalysisTaskOmegaPi0PiPi *taskomega3pi = AddTaskomega3pi();
466 if (!taskomega3pi) ::Warning("AnalysisTrainNew", "AliAnalysisTaskomega3pi cannot run for these train conditions - EXCLUDED");
467 }
468
c6e7c68c 469 //==========================================================================
470 // FOR THE REST OF THE TASKS THE MACRO AddTaskXXX() is not yet implemented/
471 // Run the analysis
472 //
6e428ea7 473 if (usePLUGIN) {
474 AliAnalysisGrid *alienHandler = CreateAlienHandler(plugin_mode);
475 AliAnalysisManager::GetAnalysisManager()->SetGridHandler(alienHandler);
476 }
477
c6e7c68c 478 if (mgr->InitAnalysis()) {
479 mgr->PrintStatus();
371c967e 480 if (saveTrain || strlen(config_file)) gSystem->ChangeDirectory(train_name);
c6e7c68c 481 StartAnalysis(smode, chain);
c0893d28 482 if (saveTrain && smode=="GRID") {
5c4c538a 483 AliAnalysisAlien *gridhandler = (AliAnalysisAlien*)mgr->GetGridHandler();
0d5d317c 484 TString alien_workdir = gGrid->GetHomeDirectory();
485 if (iAODanalysis) alien_workdir += "analysisAOD";
486 else alien_workdir += "analysisESD";
5c4c538a 487 alien_outdir = gridhandler->GetGridOutputDir();
0d5d317c 488 printf("=== Registering ConfigTrain.C in the work directory <%s> ===\n",
489 alien_workdir.Data());
490 if (AliAnalysisAlien::FileExists(Form("%s/%sConfig.C", alien_workdir.Data(), train_name.Data())))
491 gGrid->Rm(Form("%s/%sConfig.C", alien_workdir.Data(), train_name.Data()));
2a47e7b4 492 if (strcmp(plugin_mode, "test"))
493 TFile::Cp(Form("file:%sConfig.C",train_name.Data()), Form("alien://%s/%sConfig.C", alien_workdir.Data(), train_name.Data()));
371c967e 494 }
495 }
c6e7c68c 496}
497
498//______________________________________________________________________________
499void StartAnalysis(const char *mode, TChain *chain) {
500// Start analysis.
501 Int_t imode = -1;
502 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
503 if (!strcmp(mode, "LOCAL")) imode = 0;
504 if (!strcmp(mode, "PROOF")) imode = 1;
505 if (!strcmp(mode, "GRID")) imode = 2;
506 switch (imode) {
507 case 0:
508 if (!chain) {
a42c0df6 509 ::Error("AnalysisTrainNew.C::StartAnalysis", "Cannot create the chain");
c6e7c68c 510 return;
511 }
081194a7 512 mgr->StartAnalysis(mode, chain);
c6e7c68c 513 return;
514 case 1:
a42c0df6 515 if (!proof_dataset.Length()) {
516 ::Error("AnalysisTrainNew.C::StartAnalysis", "proof_dataset is empty");
c6e7c68c 517 return;
518 }
b160b576 519 mgr->StartAnalysis(mode, proof_dataset, 1000);
c6e7c68c 520 return;
521 case 2:
522 if (usePLUGIN) {
523 if (!mgr->GetGridHandler()) {
a42c0df6 524 ::Error("AnalysisTrainNew.C::StartAnalysis", "Grid plugin not initialized");
c6e7c68c 525 return;
526 }
527 mgr->StartAnalysis("grid");
528 } else {
529 if (!chain) {
a42c0df6 530 ::Error("AnalysisTrainNew.C::StartAnalysis", "Cannot create the chain");
c6e7c68c 531 return;
532 }
533 mgr->StartAnalysis(mode, chain);
534 }
535 return;
536 }
537}
538
539//______________________________________________________________________________
540void CheckModuleFlags(const char *mode) {
541// Checks selected modules and insure compatibility
542 Int_t imode = -1;
543 if (!strcmp(mode, "LOCAL")) imode = 0;
544 if (!strcmp(mode, "PROOF")) imode = 1;
545 if (!strcmp(mode, "GRID")) imode = 2;
546 if (imode==1) {
081194a7 547 if (!usePAR) {
a42c0df6 548 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PAR files enabled due to PROOF analysis");
081194a7 549 usePAR = kTRUE;
550 }
274ff025 551 }
081194a7 552 if (imode != 2) {
a42c0df6 553 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "AliEn plugin disabled since not in GRID mode");
081194a7 554 usePLUGIN = kFALSE;
555 }
c6e7c68c 556 if (iAODanalysis) {
557 // AOD analysis
081194a7 558 if (useMC)
a42c0df6 559 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "MC usage disabled in analysis on AOD's");
526b1502 560 if (useAODTAGS)
561 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "AOD tags usage disabled in analysis on AOD's");
c6e7c68c 562 useMC = kFALSE;
563 useTR = kFALSE;
526b1502 564 useAODTAGS = kFALSE;
081194a7 565 if (iESDfilter)
a42c0df6 566 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "ESD filter disabled in analysis on AOD's");
c6e7c68c 567 iESDfilter = 0;
081194a7 568 if (!iAODhandler) {
569 if (iJETAN)
a42c0df6 570 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "JETAN disabled in analysis on AOD's without AOD handler");
081194a7 571 iJETAN = 0;
572 }
c6e7c68c 573 // Disable tasks that do not work yet on AOD data
e4080179 574 if (iPWG4gammaconv)
575 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG4gammaconv disabled on AOD's without AOD handler");
576 iPWG4gammaconv = 0;
0d5d317c 577 if (iPWG2flow)
578 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG2flow disabled on AOD's");
579 iPWG2flow = 0;
580 if (iPWG2femto)
581 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG2femto disabled on AOD's");
582 iPWG2femto = 0;
583 if (iPWG2res)
584 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG2res disabled on AOD's");
585 iPWG2res = 0;
e4080179 586 if (iPWG2rsneff)
587 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG2rsneff disabled on AOD's");
588 iPWG2rsneff = 0;
589 if (iPWG2kink)
a42c0df6 590 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG2kink disabled in analysis on AOD's");
7cbd7add 591 iPWG2kink = 0;
c0893d28 592 if (iPWG2unicor)
593 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG2unicor disabled in analysis on AOD's");
594 iPWG2unicor = 0;
0d5d317c 595 if (iPWG2evchar)
596 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG4evchar disabled on AOD's");
597 iPWG2evchar = 0;
6e428ea7 598 if (iPWG2forward)
599 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG2forward disabled in analysis on AOD's");
600 iPWG2forward = 0;
2a47e7b4 601 if (iPWG3hfe)
602 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG3hfe disabled on AOD's");
603 iPWG3hfe = 0;
e4080179 604 if (iPWG3vertexing)
605 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG3vertexing disabled on AOD's");
606// iPWG3vertexing = 0;
5c4c538a 607 if (iPWG4omega3pi)
0d5d317c 608 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG4omega3pi disabled on AOD's");
5c4c538a 609 iPWG4omega3pi = 0;
0d5d317c 610 if (iPWG4partcorr)
611 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG4partcorr disabled on AOD's");
612 iPWG4partcorr = 0;
c6e7c68c 613 } else {
614 // ESD analysis
615 iMUONcopyAOD = 0;
552f38dc 616 if (!useMC) useTR = kFALSE;
617 if (!useTR) {
618 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "iPWG2evchar disabled if not reading track references");
619 iPWG2evchar = 0;
620 }
0d5d317c 621 }
622 if (!useMC) {
623 if (iPWG2perfcascade)
624 ::Info("AnalysisTrainNew.C::CheckModuleFlags", "PWG2perfcascade disabled without MC info");
625 iPWG2perfcascade = 0;
626 }
526b1502 627 if (iJETAN && !iAODanalysis) iESDfilter=1;
628 if (iESDfilter) {iAODhandler=1; useCORRFW = kTRUE;}
e4080179 629 if (iPWG2spectra || iPWG2flow || iPWG3vertexing || iPWG3hfe || iPWG2res || iPWG2rsneff) useCORRFW = kTRUE;
099d8f33 630 if (useKFILTER && !useMC) useKFILTER = kFALSE;
631 if (useAODTAGS && !iAODhandler) useAODTAGS = kFALSE;
c6e7c68c 632}
633
634//______________________________________________________________________________
635Bool_t Connect(const char *mode) {
636// Connect <username> to the back-end system.
637 Int_t imode = -1;
638 if (!strcmp(mode, "LOCAL")) imode = 0;
639 if (!strcmp(mode, "PROOF")) imode = 1;
640 if (!strcmp(mode, "GRID")) imode = 2;
641 TString username = gSystem->Getenv("alien_API_USER");
642 switch (imode) {
643 case 0:
644 break;
645 case 1:
646 if (!username.Length()) {
a42c0df6 647 ::Error(Form("AnalysisTrainNew.C::Connect <%s>", mode), "Make sure you:\n \
c6e7c68c 648 1. Have called: alien-token-init <username>\n \
649 2. Have called: >source /tmp/gclient_env_$UID");
650 return kFALSE;
651 }
a42c0df6 652 ::Info("AnalysisTrainNew.C::Connect", "Connecting user <%s> to PROOF cluster <%s>",
653 username.Data(), proof_cluster.Data());
b160b576 654 gEnv->SetValue("XSec.GSI.DelegProxy", "2");
7cbd7add 655// TProof::Open(Form("%s@%s:31093", username.Data(), proof_cluster.Data()));
656 TProof::Open(Form("%s@%s", username.Data(), proof_cluster.Data()));
c6e7c68c 657 if (!gProof) {
658 if (strcmp(gSystem->Getenv("XrdSecGSISRVNAMES"), "lxfsrd0506.cern.ch"))
a42c0df6 659 ::Error(Form("AnalysisTrainNew.C::Connect <%s>", mode), "Environment XrdSecGSISRVNAMES different from lxfsrd0506.cern.ch");
c6e7c68c 660 return kFALSE;
661 }
b160b576 662 TGrid::Connect("alien://");
663 if (gGrid) {
664 TString homedir = gGrid->GetHomeDirectory();
665 TString workdir = homedir + train_name;
666 if (!gGrid->Cd(workdir)) {
667 gGrid->Cd(homedir);
668 if (gGrid->Mkdir(workdir)) {
669 gGrid->Cd(train_name);
670 ::Info("AnalysisTrainNew::Connect()", "Directory %s created", gGrid->Pwd());
671 }
672 }
673 gGrid->Mkdir("proof_output");
674 gGrid->Cd("proof_output");
675 proof_outdir = Form("alien://%s", gGrid->Pwd());
676 }
c6e7c68c 677 break;
678 case 2:
679 if (!username.Length()) {
a42c0df6 680 ::Error(Form("AnalysisTrainNew.C::Connect <%s>", mode), "Make sure you:\n \
c6e7c68c 681 1. Have called: alien-token-init <username>\n \
682 2. Have called: >source /tmp/gclient_env_$UID");
683 return kFALSE;
684 }
685 if (usePLUGIN && !gSystem->Getenv("alien_CLOSE_SE")) {
a42c0df6 686 ::Error(Form("AnalysisTrainNew.C::Connect <%s>", mode),
c6e7c68c 687 "When using the AliEn plugin it is preferable to define the \
688 variable alien_CLOSE_SE in your environment.");
689 return kFALSE;
690 }
a42c0df6 691 ::Info("AnalysisTrainNew.C::Connect", "Connecting user <%s> to AliEn ...",
c6e7c68c 692 username.Data());
693 TGrid::Connect("alien://");
694 if (!gGrid || !gGrid->IsConnected()) return kFALSE;
695 break;
696 default:
a42c0df6 697 ::Error("AnalysisTrainNew.C::Connect", "Unknown run mode: %s", mode);
c6e7c68c 698 return kFALSE;
699 }
a42c0df6 700 ::Info("AnalysisTrainNew.C::Connect","Connected in %s mode", mode);
c6e7c68c 701 return kTRUE;
702}
703
704//______________________________________________________________________________
705Bool_t LoadCommonLibraries(const char *mode)
706{
707// Load common analysis libraries.
708 Int_t imode = -1;
709 if (!strcmp(mode, "LOCAL")) imode = 0;
710 if (!strcmp(mode, "PROOF")) imode = 1;
711 if (!strcmp(mode, "GRID")) imode = 2;
712 if (!gSystem->Getenv("ALICE_ROOT")) {
a42c0df6 713 ::Error("AnalysisTrainNew.C::LoadCommonLibraries", "Analysis train requires that analysis libraries are compiled with a local AliRoot");
c6e7c68c 714 return kFALSE;
715 }
716 Bool_t success = kTRUE;
717 // ROOT libraries
718 gSystem->Load("libTree.so");
719 gSystem->Load("libGeom.so");
720 gSystem->Load("libVMC.so");
721 gSystem->Load("libPhysics.so");
722
723 // Load framework classes. Par option ignored here.
724 switch (imode) {
725 case 0:
726 case 2:
7581b1bc 727 if (useCPAR) {
728 success &= LoadLibrary("STEERBase", mode, kTRUE);
729 success &= LoadLibrary("ESD", mode, kTRUE);
730 success &= LoadLibrary("AOD", mode, kTRUE);
731 success &= LoadLibrary("ANALYSIS", mode, kTRUE);
732 success &= LoadLibrary("ANALYSISalice", mode, kTRUE);
733 if (useCORRFW) success &= LoadLibrary("CORRFW", mode, kTRUE);
734 } else {
735 success &= LoadLibrary("libSTEERBase.so", mode);
736 success &= LoadLibrary("libESD.so", mode);
737 success &= LoadLibrary("libAOD.so", mode);
738 success &= LoadLibrary("libANALYSIS.so", mode);
739 success &= LoadLibrary("libANALYSISalice.so", mode);
740 if (useCORRFW) success &= LoadLibrary("libCORRFW.so", mode);
741 gROOT->ProcessLine(".include $ALICE_ROOT/include");
742 }
c6e7c68c 743 break;
744 case 1:
745 Int_t ires = -1;
a42c0df6 746 if (useAFPAR && !gSystem->AccessPathName(AFversion)) ires = gProof->UploadPackage(AFversion);
c6e7c68c 747 if (ires < 0) {
748 success &= LoadLibrary("STEERBase", mode);
749 success &= LoadLibrary("ESD", mode);
750 success &= LoadLibrary("AOD", mode);
751 success &= LoadLibrary("ANALYSIS", mode);
752 success &= LoadLibrary("ANALYSISalice", mode);
753 if (useCORRFW) success &= LoadLibrary("CORRFW", mode);
754 } else {
755 ires = gProof->EnablePackage(AFversion);
2b142d4b 756 if (ires<0) success = kFALSE;
c6e7c68c 757 if (useCORRFW) success &= LoadLibrary("CORRFW", mode);
758 }
c6e7c68c 759 break;
760 default:
a42c0df6 761 ::Error("AnalysisTrainNew.C::LoadCommonLibraries", "Unknown run mode: %s", mode);
c6e7c68c 762 return kFALSE;
763 }
764 if (success) {
a42c0df6 765 ::Info("AnalysisTrainNew.C::LoadCommodLibraries", "Load common libraries: SUCCESS");
766 ::Info("AnalysisTrainNew.C::LoadCommodLibraries", "Include path for Aclic compilation:\n%s",
c6e7c68c 767 gSystem->GetIncludePath());
768 } else {
a42c0df6 769 ::Info("AnalysisTrainNew.C::LoadCommodLibraries", "Load common libraries: FAILED");
c6e7c68c 770 }
771
772 return success;
773}
774
775//______________________________________________________________________________
776Bool_t LoadAnalysisLibraries(const char *mode)
777{
778// Load common analysis libraries.
779 Bool_t success = kTRUE;
099d8f33 780 if (iESDfilter) {
c6e7c68c 781 if (!LoadLibrary("PWG3base", mode, kTRUE) ||
782 !LoadLibrary("PWG3muon", mode, kTRUE)) return kFALSE;
783 }
784 // JETAN
785 if (iJETAN) {
786 if (!LoadLibrary("JETAN", mode, kTRUE)) return kFALSE;
c3a83447 787 }
c6e7c68c 788 // PWG4 particle correlations
274ff025 789 if (iPWG4partcorr) {
b9748bfd 790 if (!LoadLibrary("EMCALUtils", mode, kTRUE) ||
e4080179 791 !LoadLibrary("PHOSUtils", mode, kTRUE) ||
b9748bfd 792 !LoadLibrary("PWG4PartCorrBase", mode, kTRUE) ||
c6e7c68c 793 !LoadLibrary("PWG4PartCorrDep", mode, kTRUE)) return kFALSE;
c6e7c68c 794 }
c3a83447 795 // PWG4 gamma conversion
796 if (iPWG4gammaconv) {
797 if (!LoadLibrary("PWG4GammaConv", mode, kTRUE)) return kFALSE;
798 }
5c4c538a 799 // PWG4 omega to 3 pions
800 if (iPWG4omega3pi) {
801 if (!LoadLibrary("PWG4omega3pi", mode, kTRUE)) return kFALSE;
802 }
c6e7c68c 803 // PWG2 task protons
804 if (iPWG2spectra) {
805 if (!LoadLibrary("PWG2spectra", mode, kTRUE)) return kFALSE;
806 }
807 // PWG2 flow
808 if (iPWG2flow) {
e4d0b516 809 if (!LoadLibrary("PWG2flowCommon", mode, kTRUE) ||
810 !LoadLibrary("PWG2flowTasks", mode, kTRUE)) return kFALSE;
c6e7c68c 811 }
812 // PWG2 resonances
e4080179 813 if (iPWG2res || iPWG2rsneff) {
c6e7c68c 814 if (!LoadLibrary("PWG2resonances", mode, kTRUE)) return kFALSE;
815 }
081194a7 816 // PWG2 kink
817 if (iPWG2kink) {
818 if (!LoadLibrary("PWG2kink", mode, kTRUE)) return kFALSE;
819 }
c0893d28 820 // PWG2 unicor
821 if (iPWG2unicor) {
822 if (!LoadLibrary("PWG2unicor", mode, kTRUE)) return kFALSE;
823 }
824 // PWG2 evchar
825 if (iPWG2evchar) {
826 if (!LoadLibrary("PWG2evchar", mode, kTRUE)) return kFALSE;
827 }
c6e7c68c 828 // PWG2 femtoscopy
829 if (iPWG2femto) {
830 if (!LoadLibrary("PWG2AOD", mode, kTRUE) ||
831 !LoadLibrary("PWG2femtoscopy", mode, kTRUE) ||
832 !LoadLibrary("PWG2femtoscopyUser", mode, kTRUE)) return kFALSE;
6e428ea7 833// TFile::Cp(gSystem->ExpandPathName("$(ALICE_ROOT)/PWG2/FEMTOSCOPY/macros/ConfigFemtoAnalysis.C"), Form("%s/ConfigFemtoAnalysis.C", train_name.Data()));
834// anaLibs += "ConfigFemtoAnalysis.C ";
835 }
836 // PWG2 FORWARD
837 if (iPWG2forward) {
838 if (!LoadLibrary("PWG2forward", mode, kTRUE)) return kFALSE;
c6e7c68c 839 }
2a47e7b4 840 // PWG3 Vertexing HF
e4080179 841 if (iPWG3vertexing || iPWG3d2h) {
15dac83a 842 if (!LoadLibrary("PWG3base", mode, kTRUE) ||
843 !LoadLibrary("PWG3vertexingHF", mode, kTRUE)) return kFALSE;
c6e7c68c 844 }
2a47e7b4 845 // PWG3 hfe
846 if (iPWG3hfe) {
847 if (!LoadLibrary("PWG3hfe", mode, kTRUE)) return kFALSE;
848 }
849
a42c0df6 850 ::Info("AnalysisTrainNew.C::LoadAnalysisLibraries", "Load other libraries: SUCCESS");
c6e7c68c 851 return kTRUE;
852}
853
854//______________________________________________________________________________
855Bool_t LoadLibrary(const char *module, const char *mode, Bool_t rec=kFALSE)
856{
857// Load a module library in a given mode. Reports success.
858 Int_t imode = -1;
859 Int_t result;
860 TString smodule(module);
861 if (!strcmp(mode, "LOCAL")) imode = 0;
862 if (!strcmp(mode, "PROOF")) imode = 1;
863 if (!strcmp(mode, "GRID")) imode = 2;
864 TString mod(module);
865 if (!mod.Length()) {
a42c0df6 866 ::Error("AnalysisTrainNew.C::LoadLibrary", "Empty module name");
c6e7c68c 867 return kFALSE;
868 }
869 // If a library is specified, just load it
870 if (smodule.EndsWith(".so")) {
871 mod.Remove(mod.Index(".so"));
872 result = gSystem->Load(mod);
873 if (result < 0) {
a42c0df6 874 ::Error("AnalysisTrainNew.C::LoadLibrary", "Could not load library %s", module);
c6e7c68c 875 return kFALSE;
876 }
877 if (rec) anaLibs += Form("%s.so ",mod.Data());
878 return kTRUE;
879 }
880 // Check if the library is already loaded
881 if (strlen(gSystem->GetLibraries(Form("%s.so", module), "", kFALSE)) > 0)
882 return kTRUE;
883 switch (imode) {
884 case 0:
885 case 2:
886 if (usePAR) {
887 result = SetupPar(module);
888 if (rec) anaPars += Form("%s.par ", module);
889 } else {
890 result = gSystem->Load(Form("lib%s.so", module));
891 if (rec) anaLibs += Form("lib%s.so ", module);
892 }
893 break;
894 case 1:
895 result = gProof->UploadPackage(module);
896 if (result<0) {
897 result = gProof->UploadPackage(gSystem->ExpandPathName(Form("$ALICE_ROOT/%s.par", module)));
898 if (result<0) {
a42c0df6 899 ::Error("AnalysisTrainNew.C::LoadLibrary", "Could not find module %s.par in current directory nor in $ALICE_ROOT", module);
c6e7c68c 900 return kFALSE;
901 }
902 }
903 result = gProof->EnablePackage(module);
904 break;
905 default:
906 return kFALSE;
907 }
908 if (result < 0) {
a42c0df6 909 ::Error("AnalysisTrainNew.C::LoadLibrary", "Could not load module %s", module);
c6e7c68c 910 return kFALSE;
911 }
912 return kTRUE;
913}
914
915
916//______________________________________________________________________________
917TChain *CreateChain(const char *mode, const char *plugin_mode)
918{
919// Create the input chain
920 Int_t imode = -1;
921 if (!strcmp(mode, "LOCAL")) imode = 0;
922 if (!strcmp(mode, "PROOF")) imode = 1;
923 if (!strcmp(mode, "GRID")) imode = 2;
924 TChain *chain = NULL;
925 // Local chain
926 switch (imode) {
927 case 0:
928 if (iAODanalysis) {
a42c0df6 929 if (!local_xmldataset.Length()) {
c6e7c68c 930 // Local AOD
931 chain = new TChain("aodTree");
274ff025 932 if (gSystem->AccessPathName("data/AliAOD.root"))
a42c0df6 933 ::Error("AnalysisTrainNew.C::CreateChain", "File: AliAOD.root not in ./data dir");
b160b576 934 else {
935 if (!saveTrain) chain->Add("data/AliAOD.root");
936 else chain->Add("../data/AliAOD.root");
937 }
c6e7c68c 938 } else {
939 // Interactive AOD
a42c0df6 940 chain = CreateChainSingle(local_xmldataset, "aodTree");
c6e7c68c 941 }
942 } else {
a42c0df6 943 if (!local_xmldataset.Length()) {
c6e7c68c 944 // Local ESD
945 chain = new TChain("esdTree");
099d8f33 946 if (gSystem->AccessPathName("data/AliESDs.root"))
a42c0df6 947 ::Error("AnalysisTrainNew.C::CreateChain", "File: AliESDs.root not in ./data dir");
b160b576 948 else {
949 if (!saveTrain) chain->Add("data/AliESDs.root");
950 else chain->Add("../data/AliESDs.root");
951 }
c6e7c68c 952 } else {
953 // Interactive ESD
a42c0df6 954 chain = CreateChainSingle(local_xmldataset, "esdTree");
c6e7c68c 955 }
956 }
957 break;
958 case 1:
959 break;
960 case 2:
961 if (usePLUGIN) {
6e428ea7 962// AliAnalysisGrid *alienHandler = CreateAlienHandler(plugin_mode);
963// AliAnalysisManager::GetAnalysisManager()->SetGridHandler(alienHandler);
c6e7c68c 964 } else {
965 TString treeName = "esdTree";
966 if (iAODanalysis) treeName = "aodTree";
967 chain = CreateChainSingle("wn.xml", treeName);
968 }
969 break;
970 default:
971 }
972 if (chain && chain->GetNtrees()) return chain;
973 return NULL;
974}
975
976//______________________________________________________________________________
977TChain* CreateChainSingle(const char* xmlfile, const char *treeName)
978{
979 printf("*******************************\n");
980 printf("*** Getting the ESD Chain ***\n");
981 printf("*******************************\n");
982 TAlienCollection * myCollection = TAlienCollection::Open(xmlfile);
983
984 if (!myCollection) {
a42c0df6 985 ::Error("AnalysisTrainNew.C::CreateChainSingle", "Cannot create an AliEn collection from %s", xmlfile) ;
c6e7c68c 986 return NULL ;
987 }
988
989 TChain* chain = new TChain(treeName);
990 myCollection->Reset() ;
991 while ( myCollection->Next() ) chain->Add(myCollection->GetTURL("")) ;
992 chain->ls();
993 return chain;
994}
995
996//______________________________________________________________________________
997Int_t SetupPar(char* pararchivename)
998{
999 if (!pararchivename || !strlen(pararchivename)) return -1;
1000 char processline[1024];
1001 if (gSystem->AccessPathName(Form("%s.par", pararchivename))) {
1002 if (!gSystem->AccessPathName(Form("%s/%s.par", gSystem->Getenv("ALICE_ROOT"),pararchivename))) {
a42c0df6 1003 ::Info("AnalysisTrainNew.C::SetupPar", "Getting %s.par from $ALICE_ROOT", pararchivename);
c6e7c68c 1004 TFile::Cp(gSystem->ExpandPathName(Form("$ALICE_ROOT/%s.par", pararchivename)),
1005 Form("%s.par",pararchivename));
1006 } else {
a42c0df6 1007 ::Error("AnalysisTrainNew.C::SetupPar", "Cannot find %s.par", pararchivename);
c6e7c68c 1008 return -1;
1009 }
1010 }
a42c0df6 1011 if (usePLUGIN && saveTrain) gSystem->Exec(Form("ln -s ../%s.par %s",pararchivename, train_name.Data()));
c6e7c68c 1012 gSystem->Exec(Form("tar xvzf %s.par", pararchivename));
1013
1014 TString ocwd = gSystem->WorkingDirectory();
1015 if (!gSystem->ChangeDirectory(pararchivename)) return -1;
1016
1017 // check for BUILD.sh and execute
1018 if (!gSystem->AccessPathName("PROOF-INF/BUILD.sh")) {
1019 printf("*******************************\n");
1020 printf("*** Building PAR archive ***\n");
1021 printf("*******************************\n");
1022 if (gSystem->Exec("PROOF-INF/BUILD.sh")) {
1023 Error("runProcess","Cannot Build the PAR Archive! - Abort!");
1024 return -1;
1025 }
1026 }
1027
1028 // check for SETUP.C and execute
1029 if (!gSystem->AccessPathName("PROOF-INF/SETUP.C")) {
1030 printf("*******************************\n");
1031 printf("*** Setup PAR archive ***\n");
1032 printf("*******************************\n");
1033 gROOT->Macro("PROOF-INF/SETUP.C");
1034 }
1035 if (!gSystem->ChangeDirectory(ocwd.Data())) return -1;
1036 return 0;
1037}
1038
1039//______________________________________________________________________________
5c4c538a 1040AliAnalysisAlien* CreateAlienHandler(const char *plugin_mode)
c6e7c68c 1041{
1042// Check if user has a valid token, otherwise make one. This has limitations.
1043// One can always follow the standard procedure of calling alien-token-init then
1044// source /tmp/gclient_env_$UID in the current shell.
1045 if (!AliAnalysisGrid::CreateToken()) return NULL;
1046 AliAnalysisAlien *plugin = new AliAnalysisAlien();
1047// Set the run mode (can be "full", "test", "offline", "submit" or "terminate")
1048 plugin->SetRunMode(plugin_mode);
5c4c538a 1049 if (useProductionMode) plugin->SetProductionMode();
0d5d317c 1050 plugin->SetJobTag(job_tag);
c6e7c68c 1051 plugin->SetNtestFiles(1);
6e428ea7 1052// plugin->SetPreferedSE("ALICE::NIHAM::File");
c6e7c68c 1053// Set versions of used packages
1054 plugin->SetAPIVersion("V2.4");
1055 plugin->SetROOTVersion(root_version);
1056 plugin->SetAliROOTVersion(aliroot_version);
1057// Declare input data to be processed.
1058// Method 1: Create automatically XML collections using alien 'find' command.
1059// Define production directory LFN
1060 plugin->SetGridDataDir(alien_datadir);
1061// Set data search pattern
274ff025 1062 if (iAODanalysis) plugin->SetDataPattern("*AliAOD.root");
275942e0 1063 else plugin->SetDataPattern("*ESD.tag.root");
c6e7c68c 1064// ...then add run numbers to be considered
e4080179 1065 if (!iAODanalysis) plugin->SetRunRange(run_range[0], run_range[1]);
3b1610cf 1066// for (Int_t i=0; i<10; i++) {
1067// if (run_numbers[i]==0) break;
1068// plugin->AddRunNumber(run_numbers[i]);
1069// }
c6e7c68c 1070// Method 2: Declare existing data files (raw collections, xml collections, root file)
1071// If no path mentioned data is supposed to be in the work directory (see SetGridWorkingDir())
1072// XML collections added via this method can be combined with the first method if
1073// the content is compatible (using or not tags)
1074// plugin->AddDataFile("tag.xml");
1075// plugin->AddDataFile("/alice/data/2008/LHC08c/000057657/raw/Run57657.Merged.RAW.tag.root");
1076// Define alien work directory where all files will be copied. Relative to alien $HOME.
274ff025 1077 if (iAODanalysis) plugin->SetGridWorkingDir("analysisAOD");
1078 else plugin->SetGridWorkingDir("analysisESD");
c6e7c68c 1079// Declare alien output directory. Relative to working directory.
371c967e 1080 if (!alien_outdir.Length()) alien_outdir = Form("output_%s",train_name.Data());
1081 plugin->SetGridOutputDir(alien_outdir);
c6e7c68c 1082
1083 TString ana_sources = "";
1084 TString ana_add = "";
1085 if (usePAR && anaPars.Length()) {
7581b1bc 1086 printf("%s\n", anaPars.Data());
c6e7c68c 1087 TObjArray *arr;
1088 TObjString *objstr;
1089 arr = anaPars.Tokenize(" ");
1090 TIter next(arr);
1091 while ((objstr=(TObjString*)next())) plugin->EnablePackage(objstr->GetString());
1092 delete arr;
1093 }
1094
1095// Declare the analysis source files names separated by blancs. To be compiled runtime
1096// using ACLiC on the worker nodes.
1097 ana_sources = ana_sources.Strip();
1098// Declare all libraries (other than the default ones for the framework. These will be
1099// loaded by the generated analysis macro. Add all extra files (task .cxx/.h) here.
1100 anaLibs = anaLibs.Strip();
1101 if (ana_sources.Length()) plugin->SetAnalysisSource(ana_sources);
1102 if (anaLibs.Length()) plugin->SetAdditionalLibs(anaLibs);
1103
1104// Declare the output file names separated by blancs.
1105// (can be like: file.root or file.root@ALICE::Niham::File)
1106 plugin->SetDefaultOutputs();
275942e0 1107 plugin->SetMergeExcludes(mergeExclude);
1108 plugin->SetMaxMergeFiles(maxMergeFiles);
1109 plugin->SetNrunsPerMaster(nRunsPerMaster);
c6e7c68c 1110// Optionally define the files to be archived.
526b1502 1111// plugin->SetOutputArchive("log_archive.zip:stdout,stderr@ALICE::NIHAM::File root_archive.zip:AliAOD.root,AOD.tag.root@ALICE::NIHAM::File");
6e428ea7 1112
1113
1114 // Put default output files to archive
1115 TString listhists = "";
1116 TString listaods = "";
1117 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
1118 TIter next(mgr->GetOutputs());
1119 AliAnalysisDataContainer *output;
1120 while ((output=(AliAnalysisDataContainer*)next())) {
1121 const char *filename = output->GetFileName();
1122 if (!(strcmp(filename, "default"))) {
1123 if (!mgr->GetOutputEventHandler()) continue;
1124 filename = mgr->GetOutputEventHandler()->GetOutputFileName();
1125 if (listaods.Length()) listaods += ",";
1126 listaods += filename;
1127 } else {
e4080179 1128 if (listhists.Contains(filename)) continue;
6e428ea7 1129 if (listhists.Length()) listhists += ",";
1130 listhists += filename;
1131 }
1132 }
1133 if (mgr->GetExtraFiles().Length()) {
1134 if (listaods.Length()) listaods += ",";
1135 listaods += mgr->GetExtraFiles();
1136 listaods.ReplaceAll(" ", ",");
1137 }
1138 if (listhists.Length()) listhists = Form("hist_archive.zip:%s@%s", listhists.Data(), outputStorages.Data());;
1139 if (listaods.Length()) listaods = Form("aod_archive.zip:%s@%s", listaods.Data(), outputStorages.Data());;
1140 if (!listhists.Length() && !listaods.Length()) {
1141 ::Fatal("AnalysisTrainNew", "No task output !");
1142 }
1143 TString outputArchive = "log_archive.zip:stdout,stderr@ALICE::CERN::SE";
1144 if (listaods.Length()) {
1145 outputArchive += " ";
1146 outputArchive += listaods;
1147 }
1148 if (listhists.Length()) {
1149 outputArchive += " ";
1150 outputArchive += listhists;
1151 }
e4080179 1152// Set friends
1153// if (iAODanalysis && iPWG3d2h)
1154// plugin->SetFriendChainName("AliAOD.VertexingHF.root");
6e428ea7 1155 plugin->SetOutputArchive(outputArchive);
c6e7c68c 1156// Optionally set a name for the generated analysis macro (default MyAnalysis.C)
a42c0df6 1157 plugin->SetAnalysisMacro(Form("%s.C", train_name.Data()));
c6e7c68c 1158// Optionally set maximum number of input files/subjob (default 100, put 0 to ignore)
275942e0 1159 plugin->SetSplitMaxInputFileNumber(nFilesPerJob);
c6e7c68c 1160// Optionally set number of failed jobs that will trigger killing waiting sub-jobs.
1161// plugin->SetMaxInitFailed(5);
1162// Optionally resubmit threshold.
1163// plugin->SetMasterResubmitThreshold(90);
1164// Optionally set time to live (default 30000 sec)
e4080179 1165 plugin->SetTTL(100000);
c6e7c68c 1166// Optionally set input format (default xml-single)
1167 plugin->SetInputFormat("xml-single");
1168// Optionally modify the name of the generated JDL (default analysis.jdl)
a42c0df6 1169 plugin->SetJDLName(Form("%s.jdl", train_name.Data()));
7ceeacc7 1170// Optionally modify the executable name (default analysis.sh)
a42c0df6 1171 plugin->SetExecutable(Form("%s.sh", train_name.Data()));
c6e7c68c 1172// Optionally modify job price (default 1)
1173 plugin->SetPrice(1);
1174// Optionally modify split mode (default 'se')
1175 plugin->SetSplitMode("se");
1176 return plugin;
1177}
a42c0df6 1178
1179//______________________________________________________________________________
1180void WriteConfig()
1181{
1182// Write train configuration in a file. The file name has the format:
1183// train_[trainName]_ddMonthyyyy_time.C
371c967e 1184 if (useDATE) {
0d5d317c 1185 gSystem->Exec("date +%d%b%Y_%Hh%M > date.tmp");
1186 ifstream fdate("date.tmp");
1187 if (!fdate.is_open()) {
1188 ::Error("AnalysisTrainNew.C::Export","Could not generate file name");
1189 return;
1190 }
371c967e 1191 const char date[64];
1192 fdate.getline(date,64);
1193 fdate.close();
1194 gSystem->Exec("rm date.tmp");
1195 train_name = Form("train_%s_%s", train_name.Data(), date);
1196 } else {
1197 train_name = Form("train_%s", train_name.Data());
1198 }
a42c0df6 1199 TString cdir = gSystem->WorkingDirectory();
1200 gSystem->MakeDirectory(train_name);
1201 gSystem->ChangeDirectory(train_name);
1202 ofstream out;
0d5d317c 1203 out.open(Form("%sConfig.C",train_name.Data()), ios::out);
a42c0df6 1204 if (out.bad()) {
1205 ::Error("AnalysisTrainNew.C::Export", "Cannot open ConfigTrain.C for writing");
1206 return;
1207 }
1208 out << "{" << endl;
1209 out << " train_name = " << "\"" << train_name.Data() << "\";" << endl;
1210 out << " proof_cluster = " << "\"" << proof_cluster.Data() << "\";" << endl;
1211 out << " useAFPAR = " << useAFPAR << ";" << endl;
1212 if (useAFPAR)
1213 out << " AFversion = " << AFversion.Data() << ";" << endl;
1214 out << " proof_dataset = " << "\"" << proof_dataset.Data() << "\";" << endl;
1215 out << " usePLUGIN = " << usePLUGIN << ";" << endl;
1216 out << " usePAR = " << usePAR << ";" << endl;
1217 out << " useCPAR = " << useCPAR << ";" << endl;
1218 out << " root_version = " << "\"" << root_version.Data() << "\";" << endl;
1219 out << " aliroot_version = " << "\"" << aliroot_version.Data() << "\";" << endl;
1220 out << " alien_datadir = " << "\"" << alien_datadir.Data() << "\";" << endl;
371c967e 1221 if (!alien_outdir.Length()) alien_outdir = Form("output_%s",train_name.Data());
1222 out << " alien_outdir = " << "\"" << alien_outdir.Data() << "\";" << endl;
275942e0 1223 out << " maxMergeFiles = " << maxMergeFiles << ";" << endl;
1224 out << " mergeExclude = " << "\"" << mergeExclude.Data() << "\";" << endl;
1225 out << " nRunsPerMaster = " << nRunsPerMaster << ";" << endl;
1226 out << " nFilesPerJob = " << nFilesPerJob << ";" << endl;
3b1610cf 1227// for (Int_t i=0; i<10; i++) {
1228// if (run_numbers[i])
1229// out << " run_numbers[" << i << "] = " << run_numbers[i] << ";" << endl;
1230// }
1231 out << " run_range[0] = " << run_range[0] << ";" << endl;
1232 out << " run_range[1] = " << run_range[1] << ";" << endl;
a42c0df6 1233 out << " useDBG = " << useDBG << ";" << endl;
1234 out << " useMC = " << useMC << ";" << endl;
1235 out << " useTAGS = " << useTAGS << ";" << endl;
1236 out << " useKFILTER = " << useKFILTER << ";" << endl;
1237 out << " useTR = " << useTR << ";" << endl;
1238 out << " useCORRFW = " << useCORRFW << ";" << endl;
1239 out << " useAODTAGS = " << useAODTAGS << ";" << endl;
1240 out << " saveTrain = " << "kFALSE;" << endl << endl;
1241 out << " // Analysis modules" << endl;
1242 out << " iAODanalysis = " << iAODanalysis << ";" << endl;
1243 out << " iAODhandler = " << iAODhandler << ";" << endl;
1244 out << " iESDfilter = " << iESDfilter << ";" << endl;
1245 out << " iMUONcopyAOD = " << iMUONcopyAOD << ";" << endl;
1246 out << " iJETAN = " << iJETAN << ";" << endl;
1247 out << " iPWG4partcorr = " << iPWG4partcorr << ";" << endl;
c3a83447 1248 out << " iPWG4gammaconv = " << iPWG4gammaconv << ";" << endl;
5c4c538a 1249 out << " iPWG4omega3pi = " << iPWG4omega3pi << ";" << endl;
2a47e7b4 1250 out << " iPWG3vertexing = " << iPWG3vertexing << ";" << endl;
1251 out << " iPWG3hfe = " << iPWG3hfe << ";" << endl;
e4080179 1252 out << " iPWG3d2h = " << iPWG3d2h << ";" << endl;
a42c0df6 1253 out << " iPWG2femto = " << iPWG2femto << ";" << endl;
1254 out << " iPWG2spectra = " << iPWG2spectra << ";" << endl;
0d5d317c 1255 out << " iPWG2protons = " << iPWG2protons << ";" << endl;
1256 out << " iPWG2checkcascade = " << iPWG2checkcascade << ";" << endl;
1257 out << " iPWG2perfcascade = " << iPWG2perfcascade << ";" << endl;
1258 out << " iPWG2checkv0 = " << iPWG2checkv0 << ";" << endl;
1259 out << " iPWG2strange = " << iPWG2strange << ";" << endl;
a42c0df6 1260 out << " iPWG2flow = " << iPWG2flow << ";" << endl;
1261 out << " iPWG2res = " << iPWG2res << ";" << endl;
e4080179 1262 out << " iPWG2rsneff = " << iPWG2rsneff << ";" << endl;
a42c0df6 1263 out << " iPWG2kink = " << iPWG2kink << ";" << endl;
0d5d317c 1264 out << " iPWG2kinkESDMC = " << iPWG2kinkESDMC << ";" << endl;
1265 out << " iPWG2kinkres = " << iPWG2kinkres << ";" << endl;
1266 out << " iPWG2kinklikesign = " << iPWG2kinklikesign << ";" << endl;
c0893d28 1267 out << " iPWG2unicor = " << iPWG2unicor << ";" << endl;
1268 out << " iPWG2evchar = " << iPWG2evchar << ";" << endl;
6e428ea7 1269 out << " iPWG2forward = " << iPWG2forward << ";" << endl << endl;
1270 out << "// Configuration fot the wagons" << endl;
1271 out << " configPWG2femto = \"" << configPWG2femto << "\";" << endl;
a42c0df6 1272 out << "}" << endl;
1273 ::Info("AnalysisTrainNew.C::WriteConfig", "Train configuration wrote to file %s", Form("config_%s.C", train_name.Data()));
1274 gSystem->ChangeDirectory(cdir);
1275}
1276
1277//______________________________________________________________________________
1278Bool_t LoadConfig(const char *filename)
1279{
1280// Read train configuration from file
1281 if (gSystem->AccessPathName(filename)) {
1282 ::Error("AnalysisTrainNew.C::LoadConfig", "Config file name not found");
1283 return kFALSE;
1284 }
1285 gROOT->ProcessLine(Form(".x %s", filename));
1286 ::Info("AnalysisTrainNew.C::LoadConfig", "Train configuration loaded from file %s", filename);
1287 return kTRUE;
1288}