4035b0b930b910866d0e4dcf864821f888008986
[u/mrichter/AliRoot.git] / PWG4 / macros / ConfigTrainGrid.C
1 {
2   /*
3
4     //  < 1 are private
5     // run >= 100 < 1000 are real data
6     // runs > 1000 are sim data
7     1 = LHC09a1 pt hard 15 - 50 GeV 
8     2 = LHC09a2 pt hard 50 -100 GeV
9     3 = LHC09a3 pt hard > 100
10     100 = LHC09d 0.9 GeV real with TPC
11     200 = LHC10b 7 TeV real with TPC  
12     202 = LHC10b 7 TeV real with TPC  (pass2) 
13     300 = LHC10c 900 GeV real with TPC
14     302 = LHC10c 900 GeV  pass2 real with TPC
15     400 = LHC10c 7000 GeV real with TPC
16     402 = LHC10c 7000 GeV pass2  real with TPC
17     500 = LHC10d 7000 GeV Real
18     502 = LHC10d 7000 GeV Real pass2
19     801 = LHC10h Pb+Pb real
20     802 = LHC10h Pb+Pb real pass2
21    1012 = LHC10a12 0.9 GeV MC Pythiy D6T  
22    1014 = LHC10a14 0.9 GeV MC ojet D6T  
23    2001 = LHC10b1 7 TeV Phojet with real OCDB
24    2002 = LHC10b2 7 TeV Pythia Pergiua-0
25    4001 = LHC10d1 pp, Pythia6 Perugia-0, 0.5T, 7000GeV, // misses some runs since i a different direcotory LHC10c9
26    4002 = LHC10d2 pp, Phojet, 0.5T, 7000GeV
27    4004 = LHC10d4 pp, Perugis, 0.5T, 7000GeV
28    5014 = LHC10e14 pp, Jet+Jet different p_T hard bins 0.5T, 7000GeV
29    6006 = LHC10f6 pp, Phojet Nachor Runs LHC10d
30    8012 = 50 80 GeV (LHC10h12)
31    8013 = 80-inf GeV (LHC10h13)
32    8102 = LHC11a2XX (where x = a - j)
33   */
34   Bool_t debugConfig =false;
35   Bool_t ckbConfig = false;
36   Bool_t productionConfig = false; // make this true for productions mode
37   Int_t  iVersion = 1; // this is the train version for one datapass
38
39   // bextra == 0 4 plus
40   // bextra == 1 large pass1 split..
41   // bextra == 2 3 plus
42   Int_t bRun = 802; Int_t bExtra = 0;  char* cDate = "110818a";
43   //  Int_t bRun = 8102; Int_t bExtra = 1;  char* cDate = "110725a";
44   iAODanalysis = 0; 
45   // 1 == Read Jets and tracks form the input AOD
46   // needs the jet branchnames set explicitly
47   // 2 == Read tracks from input and jets from output
48   
49   // 1 =  write the Full AOD for all events 
50   // 2 =  write the Full AOD for triggered events
51   // 3 =  write the deltaAOD for all events
52   //  iFilterAnalysis = 2;kJetTriggerPtCut = 40; 
53   iFilterAnalysis = 3;
54   // iFilterAnalysis = 2;
55   
56   if (kPluginMode.Contains("merge")){
57     // currently merging this one...
58     //       cDate = "110717a";
59     bRun = 802; Int_t bExtra = 0; cDate = "110812a";
60   }
61   kUseDebug = kFALSE;
62   // this is for testing just one run...
63   //  kGridMaxRunsFromList = 1;kUseDebug = kTRUE;
64
65   kUseSysInfo = 100;
66   
67   kFillAOD                = kTRUE; // fill the aod
68   kGridMergeExclude = ""; kSaveAOD = (1<<0)|(1<<1)|(1<<3); // 
69   if(!productionConfig){
70     kUsePAR              = kTRUE; // 
71     kUseCPAR            = kTRUE;
72     kGridFilesPerJob       = 20;
73   }
74
75   iPhysicsSelection = 1;
76
77   if(iAODanalysis){
78     // iAODAn
79     if(iAODanalysis == 1){
80       iJETAN = 0;
81       iPWG4Cluster = 0;
82       iJETSUBTRACT = 0;
83     }
84   }
85
86   iJETAN = 3;
87   iDIJETAN = 1; // only run on one JetFinder for the moment
88   iPWG1QASym = 0; // excluded since also on QA train         
89   iPWG4TmpSourceSara = 0; 
90   iPWG4JetServices = 1; 
91   iPWG4Fragmentation = 0; 
92   iPWG4JetSpectrum = 7; 
93   iPWG4UE = 0; // tmp off awating updates
94   iPWG4LeadingUE = 1; 
95   iPWG4CorrectionsUE = 0; // 19.07. OFF awaiting changes by Sara
96   iPWG4PtQAMC       = 1;
97   iPWG4PtSpectra    = 1;
98   iPWG4PtQATPC      = 3;
99   iPWG4PtTrackQA    = 1;
100   iPWG4Cosmics      = 0; 
101   iPWG4JetChem      = 1;
102   iPWG4QGSep  = 1;
103   iPWG4Minijet  = 1;
104   iPWG4ThreeJets    = 0; // tmp off mem leak
105   iPWG4KMeans       = 1; // Off no feedback 
106   iPWG4Cluster      = 5;
107   iPWG4Tagged       = 1; 
108   iPWG4PartCorr     = 1;
109   iPWG4CaloQA       = 1;
110   iPWG4JetCorr      = 0; 
111   iPWG4JCORRAN      = 0;  // TMP OFF: Writes a Tree
112   iPWG4GammaConv    = 1; // TMP OFF for merging
113   iPWG4CaloConv    = 0;  // 25.08. off: Output size 450MB in memory 03.09 crashes
114   iPWG4omega3pi     = 1; //
115   kDeltaAODJetName   = ""; // for OTF we do not need to write a delta/saves some extension gymnastics in the tasks       
116   kDeltaAODPartCorrName = "";
117   kPluginExecutableCommand = "cat wn.xml; root -b -q "; // dump the file list to stdout for debugging
118   kPluginAliRootVersion    = ""; 
119   kGridRunsPerMaster = 1; // To have the separate configs for eacj run in separate dirs
120
121   if(bRun<100){ // private MC
122     iPWG1QASym = 0;
123     iPWG4TmpSourceSara = 0;
124     iPWG4JetChem = 0;
125     iPWG4UE = 0;
126     iPWG4Cluster      = 0;
127     iPWG4PtQAMC       = 0;
128     iPWG4PtSpectra    = 0;
129     iPWG4PtQATPC      = 0;
130     iPWG4Cosmics      = 0; // tmp on
131     iPWG4ThreeJets    = 0; 
132     iPWG4KMeans       = 0;
133     iPWG4PartCorr     = 0;
134     iPWG4CaloQA       = 0; 
135     iPWG4CaloConv     = 0; 
136     iPWG4Tagged    = 0; 
137     iPWG4JetCorr      = 0;     
138     iPWG4GammaConv    = 0; 
139     iPWG4omega3pi      = 0;     
140     kUseKinefilter         = kTRUE;
141     kIsMC                  = kTRUE;  
142     kUseTR                 = kTRUE; 
143     kUseMC                 = kTRUE; 
144     kUseAODMC              = kTRUE; 
145     //   kErrorIgnoreLevel = 3001;
146     //    kPluginFastReadOption = kTRUE;
147   }
148
149   if(bRun>=1000){
150     kUseKinefilter         = kTRUE;
151     kIsMC                  = kTRUE; 
152     kUseMC                 = kTRUE; 
153     kUseAODMC              = kTRUE; 
154     kUseTR                 = kTRUE; 
155     iPhysicsSelection      = 1;
156   }
157
158
159   if (bRun == 1){
160     kGridRunRange[0]       =  0;  
161     kGridRunRange[1]       =  -1; 
162     kGridDatadir           = "/alice/sim/PDC_08b/LHC09a1/"; 
163     kGridDataSet           = "LHC09a1"; 
164     kGridRunPattern        = "%05d"; 
165     kGridLocalRunList      = "fp_lhc09a1.txt";
166     kTrainName             = Form("pwg4train_LHC09a1_%s",cDate);
167     iPhysicsSelection      = 0;
168     kHighPtFilterMask      = 32;     
169     kGridFilesPerJob       = 200;
170   }
171   else if (bRun == 2){
172     kGridRunRange[0]       =  0;  
173     kGridRunRange[1]       =  -1; 
174     kGridDatadir           = "/alice/sim/PDC_08b/LHC09a2/"; 
175     kGridDataSet           = "LHC09a2"; 
176     kGridRunPattern        = "%05d"; 
177     kGridLocalRunList      = "fp_lhc09a2.txt";
178     kTrainName             = Form("pwg4train_LHC09a2_%s",cDate);
179     iPhysicsSelection      = 0;
180     kHighPtFilterMask      = 32;     
181     kGridFilesPerJob       = 80;
182   }
183   else if (bRun == 3){
184     kGridRunRange[0]       =  0;  
185     kGridRunRange[1]       =  -1; // 
186     kGridDatadir           = "/alice/sim/PDC_08b/LHC09a3/"; 
187     kGridDataSet           = "LHC09a3"; 
188     kGridRunPattern        = "%05d"; 
189     kGridLocalRunList      = "fp_lhc09a3.txt";
190     kTrainName             = Form("pwg4train_LHC09a3_%s",cDate);
191     iPhysicsSelection      = 0;
192     kHighPtFilterMask      = 32;     
193     kGridFilesPerJob       = 80;
194   }
195   else if (bRun == 100){
196     kGridRunRange[0]       =  0; 
197     kGridRunRange[1]       =  -1; // 
198     kGridDatadir           = "/alice/data/2009/LHC09d/"; 
199     kGridDataSet           = "LHC09d"; 
200     kGridRunPattern        = "%09d"; 
201     kUseKinefilter         = kFALSE;
202     kIsMC                  = kFALSE;  // is real! 
203     kUseMC                 = kFALSE; 
204     kUseAODMC              = kFALSE; 
205     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
206     //    kGridPassPattern       = "pass1";    kGridLocalRunList      = "fp_runlist_pass1.txt";    kTrainName  = "pwg4train_LHC09d_pass1_100104";
207     kGridPassPattern       = "pass6";    kGridLocalRunList      = "fp_runlist_pass6.txt";    kTrainName  = Form("pwg4train_LHC09d_pass6_%s",cDate);
208     kGridRunsPerMaster = 1; // Physcicsselection does not support more than on run per job
209   }
210   else if (bRun == 200){
211     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
212     kGridRunRange[1]       =  -1; // 
213     kGridDatadir           = "/alice/data/2010/LHC10b/"; 
214     kGridDataSet           = "LHC10b"; 
215     kGridRunPattern        = "%09d"; 
216     kUseKinefilter         = kFALSE;
217     kIsMC                  = kFALSE;  // is real! 
218     kUseMC                 = kFALSE; 
219     kUseAODMC              = kFALSE; 
220     kGridPassPattern       = "pass1";    kGridLocalRunList      = "fp_lhc10b_runlist_pass1.txt";    kTrainName  = Form("pwg4train_LHC10b_pass1_%s",cDate);
221     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
222     kGridRunsPerMaster = 1; // Physcicsselection does not support more than on run per job
223     // stich of tasks not from PWG4JetTasks
224     gROOT->LoadMacro("cleanXML.C");
225     cleanXML();
226   }
227   else if (bRun == 202){
228     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
229     kGridRunRange[1]       =  -1; // 
230     kGridDatadir           = "/alice/data/2010/LHC10b/"; 
231     kGridDataSet           = "LHC10b"; 
232     kGridRunPattern        = "%09d"; 
233     kUseKinefilter         = kFALSE;
234     kIsMC                  = kFALSE;  // is real! 
235     kUseMC                 = kFALSE; 
236     kUseAODMC              = kFALSE; 
237     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
238     kGridPassPattern       = "pass2";    kGridLocalRunList      = "fp_lhc10b_runlist_pass2.txt";    kTrainName  = Form("pwg4train_LHC10b_pass2_%s",cDate);
239
240     kGridRunsPerMaster = 1; // Physcicsselection does not support more than on run per job
241     // stich of tasks not from PWG4JetTasks
242
243     // switch off tasks with no feedback...
244     iPWG4ThreeJets    = 0; // tmp off mem leak
245     iPWG4KMeans       = 0;  // OFF no FEEDBACK
246     iPWG4Tagged       = 0; // OFF crashes on MC 
247     iPWG4CaloQA       = 0; // OFF not needed on MC   
248     iPWG4JetCorr      = 0; 
249     iPWG4JCORRAN      = 0;  // TMP OFF: Writes a Tree
250     iPWG4omega3pi     = 0; // OFF no feedback
251
252     gROOT->LoadMacro("cleanXML.C");
253     cleanXML();
254   }
255   else if (bRun == 300){
256     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
257     kGridRunRange[1]       =  -1; // 
258     kGridDatadir           = "/alice/data/2010/LHC10c/"; 
259     kGridDataSet           = "LHC10c"; 
260     kGridRunPattern        = "%09d"; 
261     kUseKinefilter         = kFALSE;
262     kIsMC                  = kFALSE;  // is real! 
263     kUseMC                 = kFALSE; 
264     kUseAODMC              = kFALSE; 
265     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
266     kGridPassPattern       = "pass1";    kGridLocalRunList      = "fp_lhc10c_runlist_900_pass1.txt";    kTrainName  = Form("pwg4train_LHC10c_900_pass1_%s",cDate);
267     
268     kGridRunsPerMaster = 1; // Physcicsselection does not support more than on run per job
269     // stich of tasks not from PWG4JetTasks
270     gROOT->LoadMacro("cleanXML.C");
271     cleanXML();
272   }
273   else if (bRun == 302){
274     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
275     kGridRunRange[1]       =  -1; // 
276     kGridDatadir           = "/alice/data/2010/LHC10c/"; 
277     kGridDataSet           = "LHC10c"; 
278     kGridRunPattern        = "%09d"; 
279     kUseKinefilter         = kFALSE;
280     kIsMC                  = kFALSE;  // is real! 
281     kUseMC                 = kFALSE; 
282     kUseAODMC              = kFALSE; 
283     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
284     kGridPassPattern       = "pass2";    kGridLocalRunList      = "fp_lhc10c_runlist_900_pass2.txt";    kTrainName  = Form("pwg4train_LHC10c_900_pass2_%s",cDate);
285
286     // switch off tasks with no feedback...
287     iPWG4ThreeJets    = 0; // tmp off mem leak
288     iPWG4KMeans       = 0;  // OFF no FEEDBACK
289     iPWG4Tagged       = 0; // OFF crashes on MC 
290     iPWG4CaloQA       = 0; // OFF not needed on MC   
291     iPWG4JetCorr      = 0; 
292     iPWG4JCORRAN      = 0;  // TMP OFF: Writes a Tree
293     iPWG4omega3pi     = 0; // OFF no feedback
294
295     
296     kGridRunsPerMaster = 1; // Physcicsselection does not support more than on run per job
297     // stich of tasks not from PWG4JetTasks
298     gROOT->LoadMacro("cleanXML.C");
299     cleanXML();
300   }
301   else if (bRun == 400){
302     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
303     kGridRunRange[1]       =  -1; // 
304     kGridDatadir           = "/alice/data/2010/LHC10c/"; 
305     kGridDataSet           = "LHC10c"; 
306     kGridRunPattern        = "%09d"; 
307     kUseKinefilter         = kFALSE;
308     kIsMC                  = kFALSE;  // is real! 
309     kUseMC                 = kFALSE; 
310     kUseAODMC              = kFALSE; 
311     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
312     kGridPassPattern       = "pass1";    kGridLocalRunList      = "fp_lhc10c_runlist_7000_pass1.txt";    kTrainName  = Form("pwg4train_LHC10c_7000_pass1_%s",cDate);
313
314     kGridRunsPerMaster = 1; // Physcicsselection does not support more than on run per job
315     // stich of tasks not from PWG4JetTasks
316     gROOT->LoadMacro("cleanXML.C");
317     cleanXML();
318   }
319   else if (bRun == 402){
320     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
321     kGridRunRange[1]       =  -1; // 
322     kGridFilesPerJob       = 10;
323     kGridDatadir           = "/alice/data/2010/LHC10c/"; 
324     kGridDataSet           = "LHC10c"; 
325     kGridRunPattern        = "%09d"; 
326     kUseKinefilter         = kFALSE;
327     kIsMC                  = kFALSE;  // is real! 
328     kUseMC                 = kFALSE; 
329     kUseAODMC              = kFALSE; 
330     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
331     kGridPassPattern       = "pass2";    kGridLocalRunList      = "fp_lhc10c_runlist_7000_pass2.txt";    kTrainName  = Form("pwg4train_LHC10c_7000_pass2_%s",cDate);
332
333     // switch off tasks with no feedback...
334     iPWG4ThreeJets    = 0; // tmp off mem leak
335     iPWG4KMeans       = 0;  // OFF no FEEDBACK
336     iPWG4Tagged       = 0; // OFF crashes on MC 
337     iPWG4CaloQA       = 0; // OFF not needed on MC   
338     iPWG4JetCorr      = 0; 
339     iPWG4JCORRAN      = 0;  // TMP OFF: Writes a Tree
340     iPWG4omega3pi     = 0; // OFF no feedback
341
342     kGridRunsPerMaster = 1; // Physcicsselection does not support more than on run per job
343     // stich of tasks not from PWG4JetTasks
344     gROOT->LoadMacro("cleanXML.C");
345     cleanXML();
346   }
347   else if (bRun == 500){
348     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
349     kGridRunRange[1]       =  -1; // 
350     kGridDatadir           = "/alice/data/2010/LHC10d/"; 
351     kGridDataSet           = "LHC10d"; 
352     kGridRunPattern        = "%09d"; 
353     kUseKinefilter         = kFALSE;
354     kIsMC                  = kFALSE;  // is real! 
355     kUseMC                 = kFALSE; 
356     kUseAODMC              = kFALSE; 
357     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
358     kGridPassPattern       = "pass1";    kGridLocalRunList      = "fp_lhc10d_runlist_7000_pass1.txt";    kTrainName  = Form("pwg4train_LHC10d_7000_pass1_%s",cDate);
359
360     kGridRunsPerMaster = 1; // Physcicsselection does not support more than on run per job
361     // stich of tasks not from PWG4JetTasks
362     gROOT->LoadMacro("cleanXML.C");
363     cleanXML();
364   }
365   else if (bRun == 502){
366     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
367     kGridRunRange[1]       =  -1; // 
368     kGridDatadir           = "/alice/data/2010/LHC10d/"; 
369     kGridDataSet           = "LHC10d"; 
370     kGridRunPattern        = "%09d"; 
371     kUseKinefilter         = kFALSE;
372     kIsMC                  = kFALSE;  // is real! 
373     kUseMC                 = kFALSE; 
374     kUseAODMC              = kFALSE; 
375
376     // switch off tasks with no feedback...
377     iPWG4ThreeJets    = 0; // tmp off mem leak
378     iPWG4KMeans       = 0;  // OFF no FEEDBACK
379     iPWG4Tagged       = 0; // OFF crashes on MC 
380     iPWG4CaloQA       = 0; // OFF not needed on MC   
381     iPWG4JetCorr      = 0; 
382     iPWG4JCORRAN      = 0;  // TMP OFF: Writes a Tree
383     iPWG4omega3pi     = 0; // OFF no feedback
384
385
386     // swtich off most tasks for Pb+Pb
387     iDIJETAN = 0; // only run on one JetFinder for the moment
388     iPWG4Fragmentation = 0; 
389     iPWG4LeadingUE = 0; 
390     iPWG4JetChem      = 0;
391     iPWG4QGSep  = 0;
392     iPWG4Minijet  = 0;
393     iPWG4PartCorr     = 0;
394     iPWG4GammaConv    = 0; 
395
396     // running as light a possible 
397
398     iPWG4PtQAMC     = 1;
399     iPWG4PtSpectra   = 1;
400     iPWG4PtQATPC   = 1;
401     iPWG4JetSpectrum = 1;
402     iPWG4JetServices  = 1; // !!!!!!!!!!! 
403     iPWG4Cluster      = 1;// not 5....
404     kHighPtFilterMask = 1<<8; // 256 TPC related to SPD     
405
406     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
407     kGridPassPattern       = "pass2";    kGridLocalRunList      = "fp_lhc10d_runlist_7000_pass2.txt";    kTrainName  = Form("p4t_10d_7000_p2_%s",cDate);
408     //    kDeltaAODJetName   = "AliAOD.Jets.root"; 
409     kGridRunsPerMaster = 1; // Physcicsselection does not support more than on run per job
410     // stich of tasks not from PWG4JetTasks
411     gROOT->LoadMacro("cleanXML.C");
412     cleanXML();
413   }
414   else if (bRun == 801){
415     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
416     kGridRunRange[1]       =  -1; // 
417     kGridDatadir           = "/alice/data/2010/LHC10h/"; 
418     kGridDataSet           = "LHC10h"; 
419     kGridRunPattern        = "%09d"; 
420     kUseKinefilter         = kFALSE;
421     kIsMC                  = kFALSE;  // is real! 
422     kUseMC                 = kFALSE; 
423     kUseAODMC              = kFALSE; 
424
425     // switch off tasks with no feedback...
426     iPWG4ThreeJets    = 0; // tmp off mem leak
427     iPWG4KMeans       = 0;  // OFF no FEEDBACK
428     iPWG4Tagged       = 0; // OFF crashes on MC 
429     iPWG4CaloQA       = 0; // OFF not needed on MC   
430     iPWG4JetCorr      = 0; 
431     iPWG4JCORRAN      = 0;  // TMP OFF: Writes a Tree
432     iPWG4omega3pi     = 0; // OFF no feedback
433
434     // swtich off most tasks for Pb+Pb
435     iDIJETAN = 0; // only run on one JetFinder for the moment
436     iPWG4Fragmentation = 0; 
437     iPWG4LeadingUE = 0; 
438     iPWG4JetChem      = 0;
439     iPWG4QGSep  = 0;
440     iPWG4Minijet  = 0;
441     iPWG4PartCorr     = 0;
442     iPWG4GammaConv    = 0; 
443
444     // running as light a possible 
445
446     iPWG4PtQAMC     = 1;
447     iPWG4PtSpectra   = 1;
448     iPWG4PtQATPC   = 1;
449     iPWG4JetSpectrum = 1;
450     iPWG4JetServices  = 1; // !!!!!!!!!!! 
451     iPWG4Cluster      = 1;// not 5....
452     kHighPtFilterMask = 1<<8; // 256 TPC related to SPD     
453
454
455     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
456     kGridPassPattern       = "pass1_4plus";    kGridLocalRunList      = "fp_lhc10h_pass1_4plus.txt";    
457     kTrainName  = Form("t_10h_1_4p_%s",cDate);
458     if(bExtra==1){
459       kGridPassPattern       = "pass1";    kGridLocalRunList      = "fp_lhc10h_pass1.txt";   
460       //      kTrainName  = Form("train_pass1_%s",cDate);
461       kTrainName  = Form("t_10h_p1_%s",cDate);
462     }
463     else if(bExtra==2){
464       kGridPassPattern       = "pass1_plusplusplus";    kGridLocalRunList      = "fp_lhc10h_pass1_3plus.txt";
465       //      kTrainName  = Form("train_LHC10h_pass1_3p_%s",cDate);      
466       kTrainName  = Form("t_10h_p1_3p_%s",cDate);
467     }
468     kSaveAOD            = 1;  
469     kDeltaAODJetName   = "AliAOD.Jets.root";kSaveAOD = 2;
470
471     if (kPluginMode.Contains("merge")){
472       kSaveAOD = 0; // 
473     }
474     kGridRunsPerMaster = 1; // Physcicsselection does not support more than on run per job
475     // stich of tasks not from PWG4JetTasks
476     //    gROOT->LoadMacro("cleanXML.C");
477     // cleanXML();
478   }
479   else if (bRun == 802){
480     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
481     kGridRunRange[1]       =  -1; // 
482     kGridDatadir           = "/alice/data/2010/LHC10h/"; 
483     kGridDataSet           = "LHC10h"; 
484     kGridExtraAliendirLevel  = Form("/%s",cDate);kGridOutdir = "output";
485     kGridRunPattern        = "%09d"; 
486     kUseKinefilter         = kFALSE;
487     kIsMC                  = kFALSE;  // is real! 
488     kUseMC                 = kFALSE; 
489     kUseAODMC              = kFALSE; 
490
491     if(iVersion==1){
492     // switch off tasks with no feedback...
493       iPWG4ThreeJets    = 0; // tmp off mem leak
494       iPWG4KMeans       = 0;  // OFF no FEEDBACK
495       iPWG4Tagged       = 0; // OFF crashes on MC 
496       iPWG4CaloQA       = 0; // OFF not needed on MC   
497       iPWG4JetCorr      = 0; 
498       iPWG4JCORRAN      = 0;  // TMP OFF: Writes a Tree
499       iPWG4omega3pi     = 0; // OFF no feedback
500       
501       // swtich off most tasks for Pb+Pb
502       iDIJETAN = 0; // only run on one JetFinder for the moment
503       iPWG4LeadingUE = 0; 
504       iPWG4JetChem      = 0;
505       iPWG4QGSep  = 0;
506       iPWG4Minijet  = 0;
507       iPWG4PartCorr     = 0;
508       iPWG4GammaConv    = 0; 
509       
510       // running as light a possible 
511       
512       iPWG4PtQAMC     = 0;  // 
513       iPWG4PtQATPC   = 0;  // 
514       iPWG4PtSpectra   = 0;  //  
515       iPWG4PtTrackQA    = 1;
516       iPWG4JetSpectrum = 1; 
517       iPWG4JetServices  = 1; // !!!!!!!!!!! 
518       iPWG4Cluster      = 1;// not 5....
519       kHighPtFilterMask = 1<<4|1<<8; // Global tracks with SPD requirment global constraitn for the rest
520       iPWG4Fragmentation = 1;
521     //
522     }// version1
523
524
525     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
526     kGridPassPattern       = "pass2";    // reset for AODs below
527
528     kGridLocalRunList      = "fp_lhc10h_pass2c.txt";    
529     if(bExtra==1)kGridLocalRunList      = "fp_lhc10h_pass2.txt";    
530     kTrainName  = Form("p4t_10h_pass2_%s",cDate);
531     if (kPluginMode.Contains("merge")){
532       //      kGridLocalRunList      = "fp_lhc10h_pass2b.txt";    
533       kGridLocalRunList      = "out_merge_100_1.txt";    
534     }
535     if(iAODanalysis)kTrainName  = Form("tAOD_10h_pass2_%s",cDate);
536
537     if(iFilterAnalysis==1){
538       kSaveAOD            = 1;
539       kGridFilesPerJob       = 5;
540       kDeltaAODJetName   = "";
541       kFilterAOD = false;
542     }
543     else if(iFilterAnalysis==2){
544       kSaveAOD            = 1;
545       kGridFilesPerJob    = 20;
546       kDeltaAODJetName   = "";
547       kFilterAOD = true;
548     }
549     else if(iFilterAnalysis == 3){
550       kSaveAOD            = 2;
551       kGridFilesPerJob    = 20;
552       kDeltaAODJetName   = "AliAOD.Jets.root";
553       kFilterAOD = true;
554     }
555
556     if(iAODanalysis==0){
557       // select what is running in the spectrum task, list of jet names is filles automatically
558       kGridFilesPerJob       = 30;
559       /*
560       // Thnsparses... 
561
562       ############# Possible jet branches ###################
563       1: jetsAOD_UA104_B0_Filter00016_Cut01000
564       2: jetsAOD_UA104_B0_Filter00016_Cut02000
565       3: jetsAOD_UA104_B2_Filter00016_Cut01000
566       4: jetsAOD_UA104_B2_Filter00016_Cut02000
567       5: clustersAOD_KT04_B0_Filter00016_Cut00150_Skip00
568       6: clustersAOD_KT04_B0_Filter00016_Cut00150_Skip00RandomConeSkip00
569       7: clustersAOD_KT04_B0_Filter00016_Cut00150_Skip00RandomCone_random
570       8: clustersAOD_KT04_B0_Filter00016_Cut02000_Skip00
571       9: clustersAOD_KT04_B0_Filter00016_Cut02000_Skip00RandomConeSkip00
572       10: clustersAOD_KT04_B0_Filter00016_Cut02000_Skip00RandomCone_random
573       11: clustersAOD_KT02_B0_Filter00016_Cut00150_Skip00
574       12: clustersAOD_ANTIKT04_B0_Filter00016_Cut00150_Skip02
575       13: clustersAOD_ANTIKT04_B0_Filter00016_Cut00150_Skip02RandomConeSkip02
576       14: clustersAOD_ANTIKT04_B0_Filter00016_Cut00150_Skip02RandomCone_random
577       15: clustersAOD_ANTIKT04_B0_Filter00016_Cut02000_Skip02
578       16: clustersAOD_ANTIKT02_B0_Filter00016_Cut00150_Skip00
579       17: clustersAOD_KT04_B1_Filter00016_Cut00150_Skip00RandomConeSkip00
580       18: clustersAOD_KT04_B1_Filter00016_Cut00150_Skip00RandomCone_random
581       19: clustersAOD_ANTIKT04_B1_Filter00016_Cut00150_Skip02
582       20: clustersAOD_ANTIKT04_B1_Filter00016_Cut00150_Skip02RandomConeSkip02
583       21: clustersAOD_ANTIKT04_B1_Filter00016_Cut00150_Skip02RandomCone_random
584       22: clustersAOD_ANTIKT02_B1_Filter00016_Cut00150_Skip00
585       23: clustersAOD_KT04_B2_Filter00016_Cut00150_Skip00RandomConeSkip00
586       24: clustersAOD_KT04_B2_Filter00016_Cut00150_Skip00RandomCone_random
587       25: clustersAOD_ANTIKT04_B2_Filter00016_Cut00150_Skip02
588       26: clustersAOD_ANTIKT04_B2_Filter00016_Cut00150_Skip02RandomConeSkip02
589       27: clustersAOD_ANTIKT04_B2_Filter00016_Cut00150_Skip02RandomCone_random
590       28: clustersAOD_ANTIKT02_B2_Filter00016_Cut00150_Skip00
591       29: clustersAOD_KT04_B2_Filter00016_Cut02000_Skip00RandomConeSkip00
592       30: clustersAOD_KT04_B2_Filter00016_Cut02000_Skip00RandomCone_random
593       31: clustersAOD_ANTIKT04_B2_Filter00016_Cut02000_Skip02
594             */
595       /*
596         ############# Possible jet branches ###################
597         1: jetsAOD_UA104_B0_Filter00272_Cut01000
598         2: jetsAOD_UA104_B0_Filter00272_Cut02000
599         3: jetsAOD_UA104_B2_Filter00272_Cut01000
600         4: jetsAOD_UA104_B2_Filter00272_Cut02000
601         5: clustersAOD_KT04_B0_Filter00272_Cut00150_Skip00
602         6: clustersAOD_KT04_B0_Filter00272_Cut00150_Skip00RandomConeSkip00
603         7: clustersAOD_KT04_B0_Filter00272_Cut00150_Skip00RandomCone_random
604         8: clustersAOD_KT04_B0_Filter00272_Cut01000_Skip00
605         9: clustersAOD_KT04_B0_Filter00272_Cut01000_Skip00RandomConeSkip00
606         10: clustersAOD_KT04_B0_Filter00272_Cut01000_Skip00RandomCone_random
607         11: clustersAOD_KT04_B0_Filter00272_Cut02000_Skip00
608         12: clustersAOD_KT04_B0_Filter00272_Cut02000_Skip00RandomConeSkip00
609         13: clustersAOD_KT04_B0_Filter00272_Cut02000_Skip00RandomCone_random
610         14: clustersAOD_KT02_B0_Filter00272_Cut00150_Skip00
611         15: clustersAOD_ANTIKT04_B0_Filter00272_Cut00150_Skip02
612         16: clustersAOD_ANTIKT04_B0_Filter00272_Cut00150_Skip02RandomConeSkip02
613         17: clustersAOD_ANTIKT04_B0_Filter00272_Cut00150_Skip02RandomCone_random
614         18: clustersAOD_ANTIKT04_B0_Filter00272_Cut01000_Skip02
615         19: clustersAOD_ANTIKT04_B0_Filter00272_Cut02000_Skip02
616         20: clustersAOD_ANTIKT02_B0_Filter00272_Cut00150_Skip00
617         21: clustersAOD_KT04_B1_Filter00272_Cut00150_Skip00RandomConeSkip00
618         22: clustersAOD_KT04_B1_Filter00272_Cut00150_Skip00RandomCone_random
619         23: clustersAOD_ANTIKT04_B1_Filter00272_Cut00150_Skip02
620         24: clustersAOD_ANTIKT04_B1_Filter00272_Cut00150_Skip02RandomConeSkip02
621         25: clustersAOD_ANTIKT04_B1_Filter00272_Cut00150_Skip02RandomCone_random
622         26: clustersAOD_ANTIKT02_B1_Filter00272_Cut00150_Skip00
623         27: clustersAOD_KT04_B2_Filter00272_Cut00150_Skip00RandomConeSkip00
624         28: clustersAOD_KT04_B2_Filter00272_Cut00150_Skip00RandomCone_random
625         29: clustersAOD_ANTIKT04_B2_Filter00272_Cut00150_Skip02
626         30: clustersAOD_ANTIKT04_B2_Filter00272_Cut00150_Skip02RandomConeSkip02
627         31: clustersAOD_ANTIKT04_B2_Filter00272_Cut00150_Skip02RandomCone_random
628         32: clustersAOD_ANTIKT02_B2_Filter00272_Cut00150_Skip00
629         33: clustersAOD_KT04_B2_Filter00272_Cut01000_Skip00RandomConeSkip00
630         34: clustersAOD_KT04_B2_Filter00272_Cut01000_Skip00RandomCone_random
631         35: clustersAOD_ANTIKT04_B2_Filter00272_Cut01000_Skip02
632         36: clustersAOD_KT04_B2_Filter00272_Cut02000_Skip00RandomConeSkip00
633         37: clustersAOD_KT04_B2_Filter00272_Cut02000_Skip00RandomCone_random
634         38: clustersAOD_ANTIKT04_B2_Filter00272_Cut02000_Skip02
635       */
636       
637       // in the first map we fill the correlations we want to plot
638       // in the jet back map we associated the branche used for background calculation
639       // to fetch the multiplicity
640
641       // UA1 
642       kJetMapSpectrum.Add(4,2);
643       kJetBackMapSpectrum.Add(4,8);
644
645       // anti kT 150 MeV
646       kJetMapSpectrum.Add(29,15);
647       kJetBackMapSpectrum.Add(29,5);
648       kJetBackMapSpectrum.Add(15,5);
649
650       // anti kT 1000 MeV
651       kJetMapSpectrum.Add(35,18);
652       kJetBackMapSpectrum.Add(35,8);      
653       kJetBackMapSpectrum.Add(35,8);
654
655       // anti kT 2000 MeV
656       kJetMapSpectrum.Add(38,19);
657       kJetBackMapSpectrum.Add(35,11);      
658       kJetBackMapSpectrum.Add(19,11);
659
660
661       // anti kT 0.2
662       kJetMapSpectrum.Add(32,14);
663       kJetBackMapSpectrum.Add(32,5);      
664       kJetBackMapSpectrum.Add(14,5);
665
666       // random cones
667       kJetMapSpectrum.Add(6,7);
668       kJetBackMapSpectrum.Add(6,5);
669       kJetBackMapSpectrum.Add(7,5);
670
671       kJetMapSpectrum.Add(9,10);
672       kJetBackMapSpectrum.Add(9,8);
673       kJetBackMapSpectrum.Add(10,8);
674       
675     }
676     else if (iAODanalysis){
677       kGridFilesPerJob       = 20;
678       if(iAODanalysis==1){
679         kGridPassPattern = "pass2/AOD049";
680         iJETAN = 0;
681         iPWG4Cluster = 0;
682         iJETSUBTRACT = 0;
683
684
685         /* 
686            reading from AOD043 input
687            1 jetsAOD_UA104_B0_Filter00128_Cut01000 1 0x102c068d0
688            2 jetsAOD_UA104_B2_Filter00128_Cut01000 1 0x102c068d0
689            3 jetsAOD_SISCONE04_B0_Filter00128_Cut00150 1 0x102c068d0
690            4 clustersAOD_KT04_B0_Filter00128_Cut00150_Skip00 1 0x102c068d0
691            5 clustersAOD_KT04_B0_Filter00128_Cut00150_Skip00_random 1 0x102c068d0
692            6 clustersAOD_KT04_B0_Filter00128_Cut00150_Skip00RandomConeSkip00 1 0x102c068d0
693            7 clustersAOD_KT04_B0_Filter00128_Cut00150_Skip00RandomCone_random 1 0x102c068d0
694            8 clustersAOD_ANTIKT04_B0_Filter00128_Cut00150_Skip02 1 0x102c068d0
695            9 clustersAOD_ANTIKT04_B0_Filter00128_Cut00150_Skip02_random 1 0x102c068d0
696            10 clustersAOD_ANTIKT04_B0_Filter00128_Cut00150_Skip02RandomConeSkip02 1 0x102c068d0
697            11 clustersAOD_ANTIKT04_B0_Filter00128_Cut00150_Skip02RandomCone_random 1 0x102c068d0
698            12 clustersAOD_ANTIKT02_B0_Filter00128_Cut00150_Skip00 1 0x102c068d0
699            13 clustersAOD_ANTIKT02_B0_Filter00128_Cut00150_Skip00_random 1 0x102c068d0
700            14 jetsAOD_SISCONE04_B1_Filter00128_Cut00150 1 0x102c068d0
701            15 clustersAOD_ANTIKT04_B1_Filter00128_Cut00150_Skip02 1 0x102c068d0
702            16 clustersAOD_ANTIKT02_B1_Filter00128_Cut00150_Skip00 1 0x102c068d0
703         */
704
705         kJetListSpectrum.Add(new TObjString("jetsAOD_UA104_B0_Filter00128_Cut01000"));
706         kJetListSpectrum.Add(new TObjString("jetsAOD_UA104_B2_Filter00128_Cut01000"));
707         kJetListSpectrum.Add(new TObjString("jetsAOD_SISCONE04_B0_Filter00128_Cut00150"));
708         kJetListSpectrum.Add(new TObjString("clustersAOD_KT04_B0_Filter00128_Cut00150_Skip00"));
709         kJetListSpectrum.Add(new TObjString("clustersAOD_KT04_B0_Filter00128_Cut00150_Skip00_random"));
710         kJetListSpectrum.Add(new TObjString("clustersAOD_KT04_B0_Filter00128_Cut00150_Skip00RandomConeSkip00"));
711         kJetListSpectrum.Add(new TObjString("clustersAOD_KT04_B0_Filter00128_Cut00150_Skip00RandomCone_random"));
712         kJetListSpectrum.Add(new TObjString("clustersAOD_ANTIKT04_B0_Filter00128_Cut00150_Skip02"));
713         kJetListSpectrum.Add(new TObjString("clustersAOD_ANTIKT04_B0_Filter00128_Cut00150_Skip02_random"));
714         kJetListSpectrum.Add(new TObjString("clustersAOD_ANTIKT04_B0_Filter00128_Cut00150_Skip02RandomConeSkip02"));
715         kJetListSpectrum.Add(new TObjString("clustersAOD_ANTIKT04_B0_Filter00128_Cut00150_Skip02RandomCone_random"));
716         kJetListSpectrum.Add(new TObjString("clustersAOD_ANTIKT02_B0_Filter00128_Cut00150_Skip00"));
717         kJetListSpectrum.Add(new TObjString("clustersAOD_ANTIKT02_B0_Filter00128_Cut00150_Skip00_random"));
718         kJetListSpectrum.Add(new TObjString("jetsAOD_SISCONE04_B1_Filter00128_Cut00150"));
719         kJetListSpectrum.Add(new TObjString("clustersAOD_ANTIKT04_B1_Filter00128_Cut00150_Skip02"));    
720         kJetListSpectrum.Add(new TObjString("clustersAOD_ANTIKT02_B1_Filter00128_Cut00150_Skip00"));
721
722         // anti kT 150 MeV
723         kJetMapSpectrum.Add(15,8);
724         kJetBackMapSpectrum.Add(8,4);
725         kJetBackMapSpectrum.Add(15,4);
726
727         // anti kT R  = 0.2
728         kJetMapSpectrum.Add(17,12);
729         kJetBackMapSpectrum.Add(17,4);      
730         kJetBackMapSpectrum.Add(12,4);
731         
732         // random cones
733         kJetMapSpectrum.Add(6,7);
734         kJetBackMapSpectrum.Add(6,4);
735         kJetBackMapSpectrum.Add(7,4);
736         
737         kJetMapSpectrum.Add(10,11);
738         kJetBackMapSpectrum.Add(10,4);
739         kJetBackMapSpectrum.Add(11,4);
740         kDeltaAODJetNameInput = "AliAOD.Jets.root";
741         kDeltaAODJetName = "";
742         kHighPtFilterMask      = 128; // centrally produced AOD     
743       }
744       else if(iAODanalysis==2){
745         /*
746           ############# Possible jet branches ###################
747           1: jetsAOD_UA104_B0_Filter00128_Cut01000
748           2: jetsAOD_UA104_B0_Filter00128_Cut02000
749           3: jetsAOD_UA104_B2_Filter00128_Cut01000
750           4: jetsAOD_UA104_B2_Filter00128_Cut02000
751           5: clustersAOD_KT04_B0_Filter00128_Cut00150_Skip00
752           6: clustersAOD_KT04_B0_Filter00128_Cut00150_Skip00RandomConeSkip00
753           7: clustersAOD_KT04_B0_Filter00128_Cut00150_Skip00RandomCone_random
754           8: clustersAOD_KT04_B0_Filter00128_Cut02000_Skip00
755           9: clustersAOD_KT04_B0_Filter00128_Cut02000_Skip00RandomConeSkip00
756           10: clustersAOD_KT04_B0_Filter00128_Cut02000_Skip00RandomCone_random
757           11: clustersAOD_KT02_B0_Filter00128_Cut00150_Skip00
758           12: clustersAOD_ANTIKT04_B0_Filter00128_Cut00150_Skip02
759           13: clustersAOD_ANTIKT04_B0_Filter00128_Cut00150_Skip02RandomConeSkip02
760           14: clustersAOD_ANTIKT04_B0_Filter00128_Cut00150_Skip02RandomCone_random
761           15: clustersAOD_ANTIKT04_B0_Filter00128_Cut02000_Skip02
762           16: clustersAOD_ANTIKT02_B0_Filter00128_Cut00150_Skip00
763           17: clustersAOD_KT04_B1_Filter00128_Cut00150_Skip00Skip00RandomConeSkip00
764           18: clustersAOD_KT04_B1_Filter00128_Cut00150_Skip00Skip00RandomCone_random
765           19: clustersAOD_ANTIKT04_B1_Filter00128_Cut00150_Skip02
766           20: clustersAOD_ANTIKT04_B1_Filter00128_Cut00150_Skip02Skip02RandomConeSkip02
767           21: clustersAOD_ANTIKT04_B1_Filter00128_Cut00150_Skip02Skip02RandomCone_random
768           22: clustersAOD_ANTIKT02_B1_Filter00128_Cut00150_Skip00
769           23: clustersAOD_KT04_B2_Filter00128_Cut00150_Skip00Skip00RandomConeSkip00
770           24: clustersAOD_KT04_B2_Filter00128_Cut00150_Skip00Skip00RandomCone_random
771           25: clustersAOD_ANTIKT04_B2_Filter00128_Cut00150_Skip02
772           26: clustersAOD_ANTIKT04_B2_Filter00128_Cut00150_Skip02Skip02RandomConeSkip02
773           27: clustersAOD_ANTIKT04_B2_Filter00128_Cut00150_Skip02Skip02RandomCone_random
774           28: clustersAOD_ANTIKT02_B2_Filter00128_Cut00150_Skip00
775           29: clustersAOD_KT04_B2_Filter00128_Cut02000_Skip00Skip00RandomConeSkip00
776           30: clustersAOD_KT04_B2_Filter00128_Cut02000_Skip00Skip00RandomCone_random
777           31: clustersAOD_ANTIKT04_B2_Filter00128_Cut02000_Skip02
778          */
779         
780         // anti kT 150 MeV
781         kJetMapSpectrum.Add(25,12);
782         kJetBackMapSpectrum.Add(25,5);
783         kJetBackMapSpectrum.Add(12,5);
784
785         // anti kT R  = 0.2
786         kJetMapSpectrum.Add(28,16);
787         kJetBackMapSpectrum.Add(28,5);      
788         kJetBackMapSpectrum.Add(16,5);
789
790         // anti kT 2 GeV
791         kJetMapSpectrum.Add(31,15);
792         kJetBackMapSpectrum.Add(31,8);      
793         kJetBackMapSpectrum.Add(15,8);
794
795         
796         // random cones
797         kJetMapSpectrum.Add(9,10);
798         kJetBackMapSpectrum.Add(10,5);
799         kJetBackMapSpectrum.Add(9,5);
800         
801         kJetMapSpectrum.Add(13,14);
802         kJetBackMapSpectrum.Add(14,5);
803         kJetBackMapSpectrum.Add(13,5);
804         kDeltaAODJetNameInput = "";
805
806
807         kDeltaAODJetName   = "AliAOD.Jets.root";kSaveAOD = 2;
808         kHighPtFilterMask      = 128; // centrally produced AOD     
809         iPWG4Fragmentation = 0; // off for a pass 
810
811         
812       }
813     }
814     if (kPluginMode.Contains("merge")){
815       kSaveAOD = 0; // 
816     }
817     kGridRunsPerMaster = 1; // Physcicsselection does not support more than on run per job
818     // stich of tasks not from PWG4JetTasks
819     //    gROOT->LoadMacro("cleanXML.C");
820     // cleanXML();
821   }
822   else if (bRun == 1012){
823     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
824     kGridRunRange[1]       =  -1; // 
825     kGridDatadir           = "/alice/sim/LHC10a12/"; 
826     kGridDataSet           = "LHC10a12"; 
827     kGridRunPattern        = "%06d"; 
828     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
829     kGridPassPattern       = "";    kGridLocalRunList      = "fp_lhc10a12.txt";    kTrainName  = Form("pwg4train_LHC10a12_%s",cDate);
830     kGridRunsPerMaster     = 1; // Physcicsselection does not support more than on run per job
831     kGridFilesPerJob       = 250; // only few events in a sim file
832     // stich of tasks not from PWG4JetTasks
833     gROOT->LoadMacro("cleanXML.C");
834     cleanXML();
835   }
836   else if (bRun == 1014){
837     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
838     kGridRunRange[1]       =  -1; // 
839     kGridDatadir           = "/alice/sim/LHC10a14/"; 
840     kGridDataSet           = "LHC10a14"; 
841     kGridRunPattern        = "%06d"; 
842     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
843     kGridPassPattern       = "";    kGridLocalRunList      = "fp_lhc10a14.txt";    kTrainName  = Form("pwg4train_LHC10a14_%s",cDate);
844     kGridRunsPerMaster     = 1; // Physcicsselection does not support more than on run per job
845     kGridFilesPerJob       = 250; // only few events in a sim file
846     // stich of tasks not from PWG4JetTasks
847     gROOT->LoadMacro("cleanXML.C");
848     cleanXML();
849   }
850   else if (bRun == 2001){
851     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
852     kGridRunRange[1]       =  -1; // 
853     kGridDatadir           = "/alice/sim/LHC10b1/"; 
854     kGridDataSet           = "LHC10b1"; 
855     kGridRunPattern        = "%06d"; 
856     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
857     kGridPassPattern       = "";    kGridLocalRunList      = "fp_lhc10b1.txt";    kTrainName  = Form("pwg4train_LHC10b1_%s",cDate);
858     kGridRunsPerMaster     = 1; // Physcicsselection does not support more than on run per job
859     kGridFilesPerJob       = 250; // only few events in a sim file
860     // stich of tasks not from PWG4JetTasks
861     gROOT->LoadMacro("cleanXML.C");
862     cleanXML();
863   }
864   else if (bRun == 2002){
865     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
866     kGridRunRange[1]       =  -1; // 
867     kGridDatadir           = "/alice/sim/LHC10b2/"; 
868     kGridDataSet           = "LHC10b2"; 
869     kGridRunPattern        = "%06d"; 
870     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
871     kGridPassPattern       = "";    kGridLocalRunList      = "fp_lhc10b2.txt";    kTrainName  = Form("pwg4train_LHC10b2_%s",cDate);
872     kGridRunsPerMaster     = 1; // Physcicsselection does not support more than on run per job
873     kGridFilesPerJob       = 250; // only few events in a sim file
874     // stich of tasks not from PWG4JetTasks
875     gROOT->LoadMacro("cleanXML.C");
876     cleanXML();
877   }
878   else if (bRun == 4001){
879     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
880     kGridRunRange[1]       =  -1; // 
881     kGridDatadir           = "/alice/sim/LHC10d1/"; 
882     kGridDataSet           = "LHC10d1"; 
883     kGridRunPattern        = "%06d"; 
884     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
885     kGridPassPattern       = "";    kGridLocalRunList      = "fp_lhc10d1.txt";    kTrainName  = Form("pwg4train_LHC10d1_%s",cDate);
886     kGridRunsPerMaster     = 1; // Physcicsselection does not support more than on run per job
887     kGridFilesPerJob       = 50; // only few events in a sim file
888     // stich of tasks not from PWG4JetTasks
889     gROOT->LoadMacro("cleanXML.C");
890     cleanXML();
891   }
892   else if (bRun == 4002){
893     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
894     kGridRunRange[1]       =  -1; // 
895     kGridDatadir           = "/alice/sim/LHC10d2/"; 
896     kGridDataSet           = "LHC10d2"; 
897     kGridRunPattern        = "%06d"; 
898     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
899     kGridPassPattern       = "";    kGridLocalRunList      = "fp_lhc10d2.txt";    kTrainName  = Form("pwg4train_LHC10d2_%s",cDate);
900     kGridRunsPerMaster     = 1; // Physcicsselection does not support more than on run per job
901     kGridFilesPerJob       = 100; // only few events in a sim file
902     // stich of tasks not from PWG4JetTasks
903     gROOT->LoadMacro("cleanXML.C");
904     cleanXML();
905   }
906   else if (bRun == 4004){
907     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
908     kGridRunRange[1]       =  -1; // 
909     kGridDatadir           = "/alice/sim/LHC10d4/"; 
910     kGridDataSet           = "LHC10d4"; 
911     kGridRunPattern        = "%06d"; 
912     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
913     kGridPassPattern       = "";    kGridLocalRunList      = "fp_lhc10d4.txt";    kTrainName  = Form("pwg4train_LHC10d4_%s",cDate);
914     kGridRunsPerMaster     = 1; // Physcicsselection does not support more than on run per job
915     kGridFilesPerJob       = 100; // only few events in a sim file
916     // stich of tasks not from PWG4JetTasks
917     iPWG4TmpSourceSara = 0; 
918     iPWG4UE = 0; //
919     iPWG4ThreeJets    = 0; // tmp off mem leak
920     iPWG4KMeans       = 0;  // OFF no FEEDBACK
921     iPWG4Tagged       = 0; // OFF crashes on MC 
922     iPWG4CaloQA       = 0; // OFF not needed on MC   
923     iPWG4JetCorr      = 0; 
924     iPWG4JCORRAN      = 0;  // TMP OFF: Writes a Tree
925     iPWG4CaloConv    = 0;  // 25.08. off: Output size 03.09 crashes 
926     iPWG4omega3pi     = 0; // OFF no feedback
927     gROOT->LoadMacro("cleanXML.C");
928     cleanXML();
929   }
930   else if(bRun==5014){
931     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
932     kGridRunRange[1]       =  -1; // 
933     kGridDatadir           = "/alice/sim/LHC10e14/120823/"; 
934     kGridRunPattern        = "%d"; 
935     kGridDataSet           = "LHC10e14"; 
936     kGridLocalRunList      = "fp_lhc10e14.txt";   kTrainName  = Form("pwg4train_LHC10e14_%s",cDate);
937     kGridPassPattern       = "";
938
939     iPWG4TmpSourceSara = 0; 
940     iPWG4UE = 0; // off not needed on Jet+Jet
941     iPWG4LeadingUE = 0; // off not needed on Jet +Jet
942     iPWG4CorrectionsUE = 0; // off not needed on Jet +Jet
943     iPWG4Cosmics      = 0; // off not needed on Jet +Jet MC
944     iPWG4JetChem      = 0; // OFF no FEEDBACK
945     iPWG4ThreeJets    = 0; // tmp off mem leak
946     iPWG4KMeans       = 0;  // OFF no FEEDBACK
947     iPWG4Tagged       = 0; // OFF crashes on MC 
948     iPWG4CaloQA       = 0; // OFF not needed on MC   
949     iPWG4JetCorr      = 0; 
950     iPWG4GammaConv    = 0; // TMP OFF cuts not updated not so important for jet+jet
951     iPWG4JCORRAN      = 0;  // TMP OFF: Writes a Tree
952     iPWG4CaloConv    = 0;  // 25.08. off: Output size 03.09 crashes 
953     iPWG4omega3pi     = 0; // OFF no feedback
954     iPWG1QASym = 0; // excluded since also on QA train         
955
956     kDeltaAODJetName   = ""; // for OTF we do not need to write a delta/saves some extension gymnastics in the tasks       
957
958     kUseKinefilter         = kTRUE;
959     kIsMC                  = kTRUE;  
960     kUseTR                 = kTRUE; 
961     kUseMC                 = kTRUE; 
962     kUseAODMC              = kTRUE; 
963     //    gSystem->Exec("cp wn_lhc10b.xml wn.xml");
964     kGridFilesPerJob       = 50; // only few events in a sim file
965     gROOT->LoadMacro("cleanXML.C");
966     cleanXML();
967   }
968   else if (bRun == 6006){
969     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
970     kGridRunRange[1]       =  -1; // 
971     kGridDatadir           = "/alice/sim/LHC10f6/"; 
972     kGridDataSet           = "LHC10f6"; 
973     kGridRunPattern        = "%06d"; 
974     kUseKinefilter         = kTRUE;
975     kIsMC                  = kTRUE;  
976     kUseMC                 = kTRUE; 
977     kUseAODMC              = kTRUE; 
978     kGridFilesPerJob       = 100;
979     // switch off tasks with no feedback...
980     iPWG4ThreeJets    = 0; // tmp off mem leak
981     iPWG4KMeans       = 0;  // OFF no FEEDBACK
982     iPWG4Tagged       = 0; // OFF crashes on MC 
983     iPWG4CaloQA       = 0; // OFF not needed on MC   
984     iPWG4JetCorr      = 0; 
985     iPWG4JCORRAN      = 0;  // TMP OFF: Writes a Tree
986     iPWG4omega3pi     = 0; // OFF no feedback
987     iPWG4TmpSourceSara = 0; 
988     iPWG4UE = 0; //
989     iPWG4ThreeJets    = 0; // tmp off mem leak
990     iPWG4KMeans       = 0;  // OFF no FEEDBACK
991     iPWG4Tagged       = 0; // OFF crashes on MC 
992     iPWG4CaloQA       = 0; // OFF not needed on MC   
993     iPWG4JetCorr      = 0; 
994     iPWG4JCORRAN      = 0;  // TMP OFF: Writes a Tree
995     iPWG4CaloConv    = 0;  // 25.08. off: Output size 03.09 crashes 
996     iPWG4PartCorr    = 0;  // OFF cjecked back with Gustavo
997     iPWG4omega3pi     = 0; // OFF no feedback
998     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
999     kGridPassPattern       = "";    kGridLocalRunList      = "fp_lhc10f6.txt";    kTrainName  = Form("pwg4train_LHC10f6_%s",cDate);
1000     kGridRunsPerMaster = 1; // Physcicsselection does not support more than on run per job
1001     // stich of tasks not from PWG4JetTasks
1002     //    gROOT->LoadMacro("cleanXML.C");
1003     //    cleanXML();
1004   }
1005   else if (bRun == 8012){
1006     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
1007     kGridRunRange[1]       =  -1; // 
1008     kGridDatadir           = "/alice/sim/LHC10h12/"; 
1009     kGridDataSet           = "LHC10h12"; 
1010     kGridRunPattern        = "%06d"; 
1011     kUseKinefilter         = kTRUE;
1012     kIsMC                  = kTRUE;  
1013     kUseMC                 = kTRUE; 
1014     kUseAODMC              = kTRUE; 
1015     kGridFilesPerJob       = 50;
1016     // switch off tasks with no feedback...
1017
1018
1019     // switch off tasks with no feedback...
1020     iPWG4ThreeJets    = 0; // tmp off mem leak
1021     iPWG4KMeans       = 0;  // OFF no FEEDBACK
1022     iPWG4Tagged       = 0; // OFF crashes on MC 
1023     iPWG4CaloQA       = 0; // OFF not needed on MC   
1024     iPWG4JetCorr      = 0; 
1025     iPWG4JCORRAN      = 0;  // TMP OFF: Writes a Tree
1026     iPWG4omega3pi     = 0; // OFF no feedback
1027
1028
1029     // swtich off most tasks for Pb+Pb
1030     iDIJETAN = 0; // only run on one JetFinder for the moment
1031     iPWG4Fragmentation = 0; 
1032     iPWG4LeadingUE = 0; 
1033     iPWG4JetChem      = 0;
1034     iPWG4QGSep  = 0;
1035     iPWG4Minijet  = 0;
1036     iPWG4PartCorr     = 0;
1037     iPWG4GammaConv    = 0; 
1038
1039     // running as light a possible 
1040
1041     iPWG4PtQAMC     = 0;
1042     iPWG4PtSpectra   = 0;
1043     iPWG4PtQATPC   = 0;
1044     iPWG4JetSpectrum = 0;
1045     iPWG4JetServices  = 0; // !!!!!!!!!!! 
1046     iPWG4Cluster      = 1;// not 5....
1047     kHighPtFilterMask = 256;     
1048
1049     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
1050     kGridPassPattern       = "";    kGridLocalRunList      = "fp_lhc10h12.txt";    kTrainName  = Form("pwg4train_LHC10h12_%s",cDate);
1051     kGridRunsPerMaster = 1; // Physcicsselection does not support more than on run per job
1052     // stich of tasks not from PWG4JetTasks
1053     gROOT->LoadMacro("cleanXML.C");
1054     cleanXML();
1055   }
1056   else if (bRun == 8102){
1057     kGridRunRange[0]       =  0;  // 0 is a bad number :(, needs a manual commit in alien...
1058     kGridRunRange[1]       =  -1; // 
1059
1060
1061     char a;
1062     if(bExtra<10)a = bExtra+97;
1063
1064     kGridDatadir           = Form("/alice/sim/LHC11a2%c/",a); 
1065     kGridDataSet           = Form("LHC11a2%c/",a); 
1066     kGridRunPattern        = "%06d"; 
1067     kUseKinefilter         = kTRUE;
1068     kIsMC                  = kTRUE;  
1069     kUseMC                 = kTRUE; 
1070     kUseAODMC              = kTRUE; 
1071     kGridFilesPerJob       = 50;
1072     // switch off tasks with no feedback...
1073
1074
1075     // switch off tasks with no feedback...
1076     iPWG4ThreeJets    = 0; // tmp off mem leak
1077     iPWG4KMeans       = 0;  // OFF no FEEDBACK
1078     iPWG4Tagged       = 0; // OFF crashes on MC 
1079     iPWG4CaloQA       = 0; // OFF not needed on MC   
1080     iPWG4JetCorr      = 0; 
1081     iPWG4JCORRAN      = 0;  // TMP OFF: Writes a Tree
1082     iPWG4omega3pi     = 0; // OFF no feedback
1083
1084
1085     // swtich off most tasks for Pb+Pb
1086     iDIJETAN = 0; // only run on one JetFinder for the moment
1087     iPWG4Fragmentation = 0; 
1088     iPWG4LeadingUE = 0; 
1089     iPWG4JetChem      = 0;
1090     iPWG4QGSep  = 0;
1091     iPWG4Minijet  = 0;
1092     iPWG4PartCorr     = 0;
1093     iPWG4GammaConv    = 0; 
1094
1095     // running as light a possible 
1096     iJETSUBTRACT = 0; // no subtraction
1097
1098
1099     iPWG4PtQAMC     = 1;
1100     iPWG4PtSpectra   = 1;
1101     iPWG4PtQATPC   = 1;
1102     iPWG4JetSpectrum = 1;
1103     iPWG4JetServices  = 1; // !!!!!!!!!!! 
1104     iPWG4Cluster      = 1;// not 5....
1105     kHighPtFilterMask = 1<<4|1<<8;     
1106
1107
1108
1109     if(iFilterAnalysis==1){
1110       kSaveAOD            = 1;
1111       kDeltaAODJetName   = "";
1112       kFilterAOD = false;
1113     }
1114     else if(iFilterAnalysis==2){
1115       kJetTriggerPtCut = 20; //pt 
1116       kSaveAOD            = 1;
1117       kDeltaAODJetName   = "";
1118       kFilterAOD = true;
1119     }
1120     else if(iFilterAnalysis == 3){
1121       kSaveAOD            = 2;
1122       kDeltaAODJetName   = "AliAOD.Jets.root";
1123       kFilterAOD = true;
1124     }
1125     kGridFilesPerJob       = 100;
1126     /*
1127 ############# Possible jet branches ###################
1128   1: jetsAOD_UA104_B0_Filter00272_Cut01000
1129       2: jetsAOD_UA104_B0_Filter00272_Cut02000
1130       3: jetsAODMC_UA104_B0_Filter00272_Cut01000
1131       4: jetsAODMC2_UA104_B0_Filter00272_Cut01000
1132       5: clustersAOD_KT06_B0_Filter00272_Cut00150_Skip00
1133       6: clustersAOD_KT04_B0_Filter00272_Cut00150_Skip00
1134       7: clustersAOD_ANTIKT04_B0_Filter00272_Cut00150_Skip02
1135       8: clustersAOD_ANTIKT04_B0_Filter00272_Cut00150_Skip02RandomConeSkip02
1136       9: clustersAOD_ANTIKT04_B0_Filter00272_Cut00150_Skip02RandomCone_random
1137       10: clustersAOD_ANTIKT04_B0_Filter00272_Cut02000_Skip02
1138       11: clustersAOD_ANTIKT02_B0_Filter00272_Cut00150_Skip00
1139       12: clustersAODMC_KT06_B0_Filter00272_Cut00150_Skip00
1140       13: clustersAODMC2_KT06_B0_Filter00272_Cut00150_Skip00
1141       14: clustersAODMC_ANTIKT04_B0_Filter00272_Cut00150_Skip00
1142       15: clustersAODMC2_ANTIKT04_B0_Filter00272_Cut00150_Skip00
1143 */
1144     // CLEAN XML FILES LOCALLY AND ON ALIEN WHEN STARTING A NEW PASS!
1145     kGridPassPattern       = "";    kGridLocalRunList      = "fp_runlist_lhc11a2.txt";    kTrainName  = Form("pwg4train_LHC11a2%c_%s",a,cDate);
1146     kGridRunsPerMaster = 1; // Physcicsselection does not support more than on run per job
1147     kGridFilesPerJob       = 100;
1148     // stich of tasks not from PWG4JetTasks
1149     gROOT->LoadMacro("cleanXML.C");
1150     cleanXML();
1151   }
1152
1153
1154
1155   if(ckbConfig){
1156     // switch off all but my analyses
1157     iPWG4KMeans     = 0;
1158     iPWG1QASym = 0;
1159     iPWG4TmpSourceSara = 0;
1160     iPWG4UE = 0;
1161     iPWG4PtQAMC        = 0;
1162     iPWG4PtSpectra     = 0;
1163     iPWG4PtQATPC        = 0;
1164     iPWG4ThreeJets        = 0;
1165     iPWG4KMeans     = 0;
1166     iPWG4Tagged    = 0; 
1167     iPWG4PartCorr     = 0;
1168     iPWG4CaloQA     = 0;
1169     iPWG4CaloConv     = 0; 
1170     iPWG4JetCorr      = 0;     
1171     iPWG4GammaConv    = 0; 
1172     iPWG4JetChem = 0; // tmp on
1173     iPWG4omega3pi      = 0;     
1174     kDeltaAODJetName   = ""; // for OTF we do not need to write a delta/saves some extension gymnastics in the tasks       
1175     kDeltaAODPartCorrName = "";
1176     kUseDebug = kFALSE;
1177     kPluginAliRootVersion    = ""; 
1178     kGridFilesPerJob       = 60;
1179     kTrainName             = Form("%s_ckb",kTrainName.Data());
1180   }
1181
1182   if(debugConfig){
1183     // debug mode 
1184     //    kUsePAR                = kFALSE; // cannot patch the macro for local test, need to laod FASTjet libs before loading FASTJETA.so
1185     //    kUseCPAR               = kFALSE;
1186     kUseSysInfo = 100;
1187     kUseDebug = kTRUE;
1188     kGridLocalRunList      = "fp_runlist_pass4_debug.txt";
1189     kTrainName             = Form("pwg4train_LHC09d_debug",cDate);
1190     
1191     // kPluginExecutableCommand = "root -b -q ";
1192     kPluginExecutableCommand = "cat wn.xml; echo \"Root.Stacktrace:         yes\" > .rootrc; root -b -q ";
1193     //    kPluginExecutableCommand = "echo \"run -b -q  pwg4train_LHC09d_debug.C\" > gdb.cmd; echo where >> gdb.cmd; echo quit >> gdb.cmd; echo y >> gdb.cmd; gdb -x gdb.cmd -batch root.exe";
1194   }
1195
1196   if (kPluginMode.Contains("test")){
1197     kJetTriggerPtCut = 0.01; 
1198     if(kAnalysisMode.Contains("grid")){
1199       //      kPluginExecutableCommand = "source ~/setup_root.txt; alienroot -b -q";      
1200       kPluginExecutableCommand = "root -b -q";      
1201       //      kPluginExecutableCommand = "valgrind --tool=memcheck --error-limit=no --max-stackframe=3060888 --suppressions=$ROOTSYS/etc/valgrind-root.supp --leak-check=full --num-callers=15 --log-file=valgrind_memcheck.log root.exe -b -q";
1202       kPluginExecutableCommand = "export ALICE_ROOT=./ROOTFILES/;" + kPluginExecutableCommand; 
1203       kUseSysInfo = 1;
1204       kUseDebug = kTRUE;
1205       if(bRun==802){
1206         kGridLocalRunList      = "fp_lhc10h_anchor.txt";
1207       }
1208       kTrainName             = Form("pwg4train_test");
1209       if(iAODanalysis)kNumberOfEvents     = 500;
1210     }
1211     else{
1212       // local
1213       if(iAODanalysis)kNumberOfEvents     = 2000;
1214       kUseSysInfo = 1;
1215         kUseDebug = kTRUE;
1216         kTrainName             = Form("pwg4train_test_local");
1217         kLocalDataList = "local_esd_lhc10d_pass2.txt";
1218         kUsePAR              = kFALSE; // cannot patch the macro for local test, need to laod FASTjet libs before loading FASTJETA.so
1219         kUseCPAR            = kFALSE;
1220         if(bRun==802){
1221           kLocalDataList = "local_esd_lhc10h.txt";
1222           if(iAODanalysis)        kLocalDataList = "local_aod_lhc10h.txt";
1223         }
1224         //      iPWG4PtTrackQA    = 0;
1225         //      iPWG4PtQAMC       = 0;
1226         //      iPWG4PtSpectra    = 0;
1227         //      iPWG4PtQATPC      = 0;
1228         //      iPWG4PtTrackQA    = 0;
1229         //      iPWG4Cluster      = 0;
1230         kUseCPAR            = kFALSE;
1231         kUsePAR            = kFALSE;
1232         //      kNumberOfEvents     = 200;
1233         // all OFF
1234     }
1235   }
1236   if(kPluginAliRootVersion.Length()==0){
1237     kPluginExecutableCommand = "export ALICE_ROOT=./ROOTFILES/;" + kPluginExecutableCommand; 
1238   } 
1239
1240   if (kPluginMode.Contains("merge")){
1241     // swtich of task where macros changed in the meantime
1242   }
1243
1244
1245 }