add header files
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / Nuclei / B2 / macros / PriorProbabilities.C
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  *                                                                        *
4  * Author: The ALICE Off-line Project.                                    *
5  * Contributors are mentioned in the code where appropriate.              *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          *
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 // macro for prior probabilities
17 // author: Eulogio Serradilla <eulogio.serradilla@cern.ch>
18
19 #if !defined(__CINT__) || defined(__MAKECINT__)
20 #include <Riostream.h>
21 #include <TString.h>
22 #endif
23
24 void SetParameters(Double_t* prob, Double_t c0, Double_t c1, Double_t c2, Double_t c3, Double_t c4, Double_t c5, Double_t c6, Double_t c7, Double_t c8)
25 {
26 //
27 // assign values to an array
28 //
29         prob[0] = c0;
30         prob[1] = c1;
31         prob[2] = c2;
32         prob[3] = c3;
33         prob[4] = c4;
34         prob[5] = c5;
35         prob[6] = c6;
36         prob[7] = c7;
37         prob[8] = c8;
38 }
39
40 Bool_t PriorProbabilities(Double_t* prob, const TString& periodname, const TString& tracksel, const TString& ztag="")
41 {
42 //
43 // Prior probabilities for the different samples and track selection criteria.
44 // Obtained from several iterations of the analysis program
45 //
46         TString period = periodname;
47         period.ToLower();
48         
49         TString trksel = tracksel;
50         trksel.ToLower();
51         
52         if(period == "lhc10c900") // pp 900 GeV
53         {
54                 if (trksel=="its_tpc_dca")
55                 {
56                         SetParameters(prob, 0.0229385, 2.13852e-06, 0.868889, 0.0596281, 0.0484369, 0.00010232, 2.54977e-06, 0, 0);
57                 }
58                 else if (trksel == "its_tpc_dca_spd")
59                 {
60                         SetParameters(prob, 0.00670787, 1.03214e-06, 0.887492, 0.0627365, 0.0429736, 8.72157e-05, 2.06428e-06, 0, 0);
61                 }
62                 else if(trksel=="its_tpc_nsigma_spd")
63                 {
64                         SetParameters(prob, 0.00598811, 0.000283397, 0.889894, 0.0655886, 0.0382077, 3.76161e-05, 8.51043e-08, 0, 0);
65                 }
66                 else if(trksel == "its_tpc_tof_nsigma")
67                 {
68                         SetParameters(prob, 0.00968656, 0.00230198, 0.844375, 0.084224, 0.059334, 7.8127e-05, 7.89161e-07, 0, 0);
69                 }
70                 else if(trksel.Contains("its_tpc_tof"))
71                 {
72                         SetParameters(prob, 0.0123784, 0.00368129, 0.830011, 0.0795686, 0.0742296, 0.000127461, 2.99204e-06, 1.19682e-07, 0);
73                 }
74                 else // its_tpc_nsigma
75                 {
76                         SetParameters(prob, 0.0181447, 1.09966e-06, 0.880063, 0.0635145, 0.0382359, 4.06874e-05, 1.83277e-07, 0, 0);
77                 }
78         }
79         
80         else if(   period.Contains("lhc10b")
81                 || period.Contains("lhc10c")
82                 || period.Contains("lhc10d")
83                 || period.Contains("lhc10e") ) // pp 7 TeV
84         {
85                 if(trksel=="its_tpc_dca")
86                 {
87                         SetParameters(prob, 0.0250199, 0.00330477, 0.856905, 0.0621491, 0.0524821, 0.000136071, 3.44981e-06, 6.86137e-08, 0);
88                 }
89                 else if(trksel.Contains("its_tpc_dca"))
90                 {
91                         if(ztag=="mult01")
92                         {
93                                 SetParameters(prob, 0.0113558, 0.00237114, 0.883563, 0.0593706, 0.0432792, 5.94295e-05, 1.01616e-06, 3.90829e-08, 0);
94                         }
95                         else if(ztag=="mult02")
96                         {
97                                 SetParameters(prob, 0.0118104, 0.00192862, 0.879984, 0.0604466, 0.0457553, 7.33307e-05, 1.51046e-06, 6.19674e-08, 0);
98                         }
99                         else if(ztag=="mult03")
100                         {
101                                 SetParameters(prob, 0.0125272, 0.00151814, 0.874759, 0.0626643, 0.048439, 9.01123e-05, 1.82651e-06, 6.4088e-08, 0);
102                         }
103                         else if(ztag=="mult04")
104                         {
105                                 SetParameters(prob, 0.0134015, 0.00120842, 0.871346, 0.0643917, 0.0495416, 0.000108142, 2.08731e-06, 9.07528e-08, 0);
106                         }
107                         else if(ztag=="mult05")
108                         {
109                                 SetParameters(prob, 0.0145402, 0.00104951, 0.869689, 0.065484, 0.0491031, 0.000130796, 3.04532e-06, 1.08096e-07, 0);
110                         }
111                         else // MB
112                         {
113                                 SetParameters(prob, 0.00883871, 0.00306025, 0.877528, 0.0646921, 0.0457766, 0.000102032, 2.23315e-06, 3.71013e-08, 0);
114                         }
115                 }
116                 else if(trksel.Contains("its_tpc_tof"))
117                 {
118                         if(ztag=="mult01")
119                         {
120                                 SetParameters(prob, 0.00613724, 0.0202731, 0.840896, 0.0715336, 0.061085, 7.40152e-05, 1.30516e-06, 8.42038e-08, 0);
121                         }
122                         else if(ztag=="mult02")
123                         {
124                                 SetParameters(prob, 0.00691975, 0.0150303, 0.834815, 0.0762426, 0.0668928, 9.73555e-05, 1.93863e-06, 8.07762e-08, 0);
125                         }
126                         else if(ztag=="mult03")
127                         {
128                                 SetParameters(prob, 0.00768321, 0.0104512, 0.830187, 0.0804241, 0.0711316, 0.0001206, 2.53256e-06, 1.14596e-07, 0);
129                         }
130                         else if(ztag=="mult04")
131                         {
132                                 SetParameters(prob, 0.00856806, 0.00699712, 0.827349, 0.0838745, 0.07306, 0.000148069, 2.99689e-06, 1.75462e-07, 0);
133                         }
134                         else if(ztag=="mult05")
135                         {
136                                 SetParameters(prob, 0.00970593, 0.00542593, 0.825378, 0.0866497, 0.0726518, 0.000183113, 4.96661e-06, 2.36908e-07, 0);
137                         }
138                         else // MB
139                         {
140                                 SetParameters(prob, 0.0155752, 0.0130319, 0.813626, 0.0808387, 0.0767456, 0.000177436, 4.32771e-06, 3.93428e-07, 0);
141                         }
142                 }
143                 else // its_tpc_nsigma
144                 {
145                         SetParameters(prob, 0.0207349, 0.000587565, 0.871052, 0.0673557, 0.0402021, 6.74649e-05, 0, 0, 0);
146                 }
147         }
148         
149         else if(period == "lhc10h") // heavy ions 2.76 TeV, 20% centrality
150         {
151                 if(trksel=="its_tpc_dca")
152                 {
153                         SetParameters(prob, 0.032994, 0.012492, 0.824044, 0.0809969, 0.0492257, 0.000242368, 5.01681e-06, 3.34454e-07, 0);
154                 }
155                 else if(trksel=="its_tpc_dca_spd")
156                 {
157                         SetParameters(prob, 0.0262206, 0.00398172, 0.845586, 0.081878, 0.0421142, 0.000215343, 3.92153e-06, 0, 0);
158                 }
159                 else if(trksel=="its_tpc_nsigma")
160                 {
161                         SetParameters(prob, 0.0279673, 0.00329778, 0.845802, 0.085995, 0.0367557, 0.000179264, 2.62155e-06, 2.49671e-07, 1.24836e-07);
162                 }
163                 else if(trksel=="its_tpc_tof_dca")
164                 {
165                         SetParameters(prob, 0.017615, 0.00752739, 0.784779, 0.109672, 0.080031, 0.000370991, 3.95272e-06, 8.47012e-07, 0);
166                 }
167                 else if(trksel.Contains("its_tpc_tof"))
168                 {
169                         SetParameters(prob, 0.0130896, 0.0079917, 0.797236, 0.112833, 0.0685078, 0.000338538, 3.07762e-06, 0, 0);
170                 }
171                 else if(trksel=="its_tpc_tof_nsigma")
172                 {
173                         SetParameters(prob, 0.0157654, 0.00721323, 0.79879, 0.117158, 0.0607624, 0.000308557, 1.26199e-06, 6.30996e-07, 0);
174                 }
175                 else
176                 {
177                         SetParameters(prob, 0.032994, 0.012492, 0.824044, 0.0809969, 0.0492257, 0.000242368, 5.01681e-06, 3.34454e-07, 3.34454e-07);
178                 }
179         }
180         
181         else if(period == "lhc11a_wosdd") // pp 2.76 TeV without SDD pass3
182         {
183                 if(trksel=="its_tpc_dca")
184                 {
185                         SetParameters(prob, 0.0172658, 0.0179012, 0.857385, 0.0590938, 0.0482499, 0.000104021, 8.05072e-07, 0, 0);
186                 }
187                 else if(trksel == "its_tpc_dca_spd")
188                 {
189                         SetParameters(prob, 0.00808143, 0.016243, 0.873576, 0.0593675, 0.0426588, 7.27021e-05, 6.45822e-07, 0, 0);
190                 }
191                 else if(trksel.Contains("its_tpc_tof"))
192                 {
193                         SetParameters(prob, 0.0113244, 0.0275349, 0.790324, 0.0899881, 0.0806648, 0.000161212, 2.45189e-06, 0, 0);
194                 }
195                 else
196                 {
197                         SetParameters(prob, 0.0132164, 0.0209664, 0.864317, 0.0624972, 0.0389603, 4.30391e-05, 0, 0, 0);
198                 }
199         }
200         
201         else if(period == "lhc11a_wsdd") // pp 2.76 TeV without SDD pass3
202         {
203                 if(trksel=="its_tpc_dca")
204                 {
205                         SetParameters(prob, 0.0198007, 0.0130987, 0.857079, 0.0604184, 0.0494965, 0.000104874, 1.5572e-06, 0, 0);
206                 }
207                 else if(trksel == "its_tpc_dca_spd")
208                 {
209                         SetParameters(prob, 0.00808143, 0.016243, 0.873576, 0.0593675, 0.0426588, 7.27021e-05, 6.45822e-07, 0, 0);
210                 }
211                 else if(trksel.Contains("its_tpc_tof"))
212                 {
213                         SetParameters(prob, 0.0206518, 0.00922775, 0.859646, 0.0595307, 0.0508038, 0.000137122, 3.02079e-06, 0, 0);
214                 }
215                 else
216                 {
217                         SetParameters(prob, 0.0150916, 0.0122592, 0.868485, 0.0649622, 0.0391601, 4.18627e-05, 0, 0, 0);
218                 }
219         }
220         
221         // --------- simulation ----------
222         
223         else if(period == "lhc12a5a")
224         {
225                 if(trksel == "its_tpc_dca")
226                 {
227                         SetParameters(prob, 0.00269435, 0.00142106, 0.0831012, 0.00522487, 0.371055, 0.332289, 0.0602906, 0.0830945, 0.0608297);
228                 }
229                 else if(trksel == "its_tpc_dca_spd")
230                 {
231                         SetParameters(prob, 0.000903954, 0.000740461, 0.0787924, 0.0052352, 0.377698, 0.331812, 0.0598412, 0.0834821, 0.0614951);
232                 }
233                 else if(trksel.Contains("its_tpc_tof"))
234                 {
235                         SetParameters(prob, 0.000699209, 0.000628928, 0.0488789, 0.00274458, 0.378142, 0.35414, 0.0643921, 0.0830996, 0.0672741);
236                 }
237                 else
238                 {
239                         SetParameters(prob, 0.00177397, 0.000490646, 0.0745835, 0.00552979, 0.383725, 0.331756, 0.0592882, 0.0827403, 0.0601128);
240                 }
241         }
242         
243         else if(period == "lhc12a5bb")
244         {
245                 if(trksel == "its_tpc_dca")
246                 {
247                         SetParameters(prob, 0.00370442, 0.00158498, 0.108206, 0.00792265, 0.375296, 0.33667, 0.0610851, 0.0715099, 0.034021);
248                 }
249                 else if(trksel == "its_tpc_tof_dca")
250                 {
251                         SetParameters(prob, 0.00112885, 0.000832592, 0.0672591, 0.00469105, 0.385956, 0.361319, 0.0655949, 0.0767322, 0.0364865);
252                 }
253         }
254         
255         else if(period == "lhc12a5bc")
256         {
257                 if(trksel == "its_tpc_dca")
258                 {
259                         SetParameters(prob, 0.00370442, 0.00158498, 0.108206, 0.00792265, 0.375296, 0.33667, 0.0610851, 0.0715099, 0.034021);
260                 }
261                 else if(trksel == "its_tpc_tof_dca")
262                 {
263                         SetParameters(prob, 0.00112885, 0.000832592, 0.0672591, 0.00469105, 0.385956, 0.361319, 0.0655949, 0.0767322, 0.0364865);
264                 }
265         }
266         
267         else if(period == "lhc12a5bd")
268         {
269                 if(trksel == "its_tpc_dca")
270                 {
271                         SetParameters(prob, 0.00389124, 0.00181114, 0.10725, 0.00753775, 0.361361, 0.322078, 0.0584554, 0.0785471, 0.0590672);
272                 }
273                 else if(trksel == "its_tpc_dca_spd")
274                 {
275                         SetParameters(prob, 0.00129393, 0.000963743, 0.102737, 0.00760901, 0.36841, 0.322256, 0.0581189, 0.0791033, 0.0595082);
276                 }
277                 else if(trksel.Contains("its_tpc_tof"))
278                 {
279                         SetParameters(prob, 0.00122986, 0.000908924, 0.0696766, 0.00462655, 0.385381, 0.360127, 0.0653381, 0.0762508, 0.0364611);
280                 }
281                 else
282                 {
283                         SetParameters(prob, 0.00265834, 0.000648637, 0.0985374, 0.00801093, 0.373786, 0.322076, 0.0576089, 0.0782477, 0.0584268);
284                 }
285         }
286         
287         else if(period == "lhc12a5be")
288         {
289                 if(trksel == "its_tpc_tof_dca")
290                 {
291                         SetParameters(prob, 0.00114523, 0.000795738, 0.0666132, 0.00465889, 0.386032, 0.36171, 0.0656093, 0.0767938, 0.0366419);
292                 }
293                 else
294                 {
295                         SetParameters(prob, 0.00114523, 0.000795738, 0.0666132, 0.00465889, 0.386032, 0.36171, 0.0656093, 0.0767938, 0.0366419);
296                 }
297         }
298         
299         else if(period == "lhc12a5c_wosdd" || period == "lhc12a5c_wsdd")
300         {
301                 if(trksel == "its_tpc_dca_spd")
302                 {
303                         SetParameters(prob, 0.00140969, 0.00100911, 0.0901532, 0.00627527, 0.375878, 0.333126, 0.0601881, 0.0752193, 0.0567413);
304                 }
305                 else if(trksel.Contains("its_tpc_tof"))
306                 {
307                         SetParameters(prob, 0.00254534, 0.00138188, 0.0920481, 0.00642957, 0.381436, 0.344603, 0.0627622, 0.0736729, 0.0351211);
308                 }
309                 else
310                 {
311                         SetParameters(prob, 0.00254534, 0.00138188, 0.0920481, 0.00642957, 0.381436, 0.344603, 0.0627622, 0.0736729, 0.0351211);
312                 }
313         }
314         
315         else if(period == "lhc10e12")
316         {
317                 if(trksel=="its_tpc_dca")
318                 {
319                         SetParameters(prob, 0.0274572, 0.0132276, 0.868083, 0.0579849, 0.0332055, 2.94442e-05, 1.1225e-05, 0, 8.63465e-07);
320                 }
321                 else if(trksel=="its_tpc_dca_spd")
322                 {
323                         SetParameters(prob, 0.00902306, 0.00879859, 0.891372, 0.0600273, 0.0307466, 2.43343e-05, 7.44928e-06, 0, 4.96619e-07);
324                 }
325                 else if(trksel.Contains("its_tpc_tof"))
326                 {
327                         SetParameters(prob, 0.0113533, 0.0104639, 0.877447, 0.0577014, 0.0429803, 3.77285e-05, 1.40853e-05, 0, 2.51523e-06);
328                 }
329                 else
330                 {
331                         SetParameters(prob, 0.0228473, 0.00644153, 0.881383, 0.061429, 0.0278978, 1.21828e-06, 2.81142e-07, 0, 0);
332                 }
333         }
334         
335         else if(period == "lhc10e13")
336         {
337                 if(trksel=="its_tpc_dca")
338                 {
339                         SetParameters(prob, 0.0275037, 0.0129471, 0.864088, 0.0566767, 0.03875, 2.46576e-05, 9.52441e-06, 0, 5.29134e-07);
340                 }
341                 else if(trksel=="its_tpc_dca_spd")
342                 {
343                         SetParameters(prob, 0.00881856, 0.00853512, 0.887761, 0.0587557, 0.03611, 1.46288e-05, 5.01096e-06, 0, 4.0411e-07);
344                 }
345                 else if(trksel.Contains("its_tpc_tof"))
346                 {
347                         SetParameters(prob, 0.0118565, 0.0102582, 0.869917, 0.0579405, 0.0499923, 2.71412e-05, 8.44393e-06, 0, 0);
348                 }
349                 else
350                 {
351                         SetParameters(prob, 0.0227488, 0.00644463, 0.877399, 0.0598542, 0.033552, 1.08815e-06, 3.43625e-07, 0, 0);
352                 }
353         }
354         
355         else if(period == "lhc10f6a")
356         {
357                 if(trksel=="its_tpc_dca")
358                 {
359                         SetParameters(prob, 0.0301784, 0.0130575, 0.849464, 0.0631854, 0.0440839, 1.65739e-05, 8.28697e-06, 0, 5.52465e-06);
360                 }
361                 else if(trksel=="its_tpc_dca_spd")
362                 {
363                         SetParameters(prob, 0.0101971, 0.00853634, 0.875408, 0.0657018, 0.0401396, 1.18943e-05, 4.23147e-06, 0, 8.53405e-07);
364                 }
365                 else if(trksel.Contains("its_tpc_tof"))
366                 {
367                         SetParameters(prob, 0.0149055, 0.0105359, 0.852053, 0.0663013, 0.0561727, 2.17209e-05, 9.18959e-06, 0, 8.35418e-07);
368                 }
369                 else
370                 {
371                         SetParameters(prob, 0.0248513, 0.00652446, 0.863878, 0.0670812, 0.0376654, 3.27516e-05, 2.45637e-05, 0, 5.4586e-06);
372                 }
373         }
374         
375         else if(period == "lhc11e3a_wsdd") // from the grid without SDD
376         {
377                 if(trksel=="its_tpc_dca")
378                 {
379                         SetParameters(prob, 0.0288269, 0.0143436, 0.85568, 0.0600814, 0.0410309, 2.04805e-05, 1.56616e-05, 0, 1.20474e-06);
380                 }
381                 else if(trksel == "its_tpc_dca_spd")
382                 {
383                         SetParameters(prob, 0.0104567, 0.00998477, 0.878832, 0.0622996, 0.0384064, 1.43839e-05, 5.60782e-06, 0, 7.60383e-07);
384                 }
385                 else if(trksel.Contains("its_tpc_tof"))
386                 {
387                         SetParameters(prob, 0.0129161, 0.0117642, 0.852733, 0.0671011, 0.0554566, 2.17717e-05, 5.44293e-06, 0, 1.36073e-06);
388                 }
389                 else
390                 {
391                         SetParameters(prob, 0.0249858, 0.00773001, 0.87308, 0.0601418, 0.0340623, 0, 0, 0, 0);
392                 }
393         }
394         
395         else if(period == "lhc11e3a_wosdd") // from the grid without SDD
396         {
397                 if(trksel=="its_tpc_dca")
398                 {
399                         SetParameters(prob, 0.0222021, 0.0131403, 0.862641, 0.0613467, 0.0406294, 2.3342e-05, 1.55613e-05, 0, 1.29678e-06);
400                 }
401                 else if(trksel == "its_tpc_dca_spd")
402                 {
403                         SetParameters(prob, 0.0104567, 0.00998477, 0.878832, 0.0622996, 0.0384064, 1.43839e-05, 5.60782e-06, 0, 7.60383e-07);
404                 }
405                 else if(trksel.Contains("its_tpc_tof"))
406                 {
407                         SetParameters(prob, 0.0118237, 0.0110965, 0.855035, 0.0672175, 0.0547956, 2.49547e-05, 6.23867e-06, 0, 6.93185e-07);
408                 }
409                 else
410                 {
411                         SetParameters(prob, 0.0186686, 0.00736997, 0.875823, 0.062905, 0.0352281, 4.98982e-06, 0, 0, 0);
412                 }
413         }
414         
415         else
416         {
417                 std::cout << "Setting equal probabilities to all particle species: " << periodname << ", " << trksel << std::endl;
418                 
419                 SetParameters(prob, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11, 0.11);
420                 
421                 return kFALSE;
422         }
423         
424         return kTRUE;
425 }