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