D+ pPb systematics (R.Russo)
[u/mrichter/AliRoot.git] / PWGHF / vertexingHF / AliHFSystErr.cxx
1
2 /**************************************************************************
3  * Copyright(c) 1998-2010, ALICE Experiment at CERN, All rights reserved. *
4  *                                                                        *
5  * Author: The ALICE Off-line Project.                                    *
6  * Contributors are mentioned in the code where appropriate.              *
7  *                                                                        *
8  * Permission to use, copy, modify and distribute this software and its   *
9  * documentation strictly for non-commercial purposes is hereby granted   *
10  * without fee, provided that the above copyright notice appears in all   *
11  * copies and that both the copyright notice and this permission notice   *
12  * appear in the supporting documentation. The authors make no claims     *
13  * about the suitability of this software for any purpose. It is          *
14  * provided "as is" without express or implied warranty.                  *
15  **************************************************************************/
16
17 /* $Id$ */
18
19 /////////////////////////////////////////////////////////////
20 //
21 // Class to handle systematic errors for charm hadrons
22 //
23 // Usage:
24 // AliHFSystEff syst;           // DECAY = 1 for D0, 2, for D+, 3 for D* 
25 // syst.SetRunNumber(YEAR);     // YEAR = two last numbers of the year (is 10 for 2010)
26 // syst.SetCollisionType(TYPE);  // TYPE =  0 is pp, 1 is PbPb
27 // syst.SetCentrality(CENT);     // CENT is centrality, 0100 for MB, 020 (4080) for 0-20 (40-80) CC...
28 // syst.Init(DECAY);             // DECAY = 1 for D0, 2, for D+, 3 for D* 
29 // syst.DrawErrors(); // to see a plot of the error contributions
30 // syst.GetTotalSystErr(pt); // to get the total err at pt 
31 //
32 // Author: A.Dainese, andrea.dainese@pd.infn.it
33 /////////////////////////////////////////////////////////////
34
35 #include <TStyle.h>
36 #include <TGraphAsymmErrors.h>
37 #include <TMath.h>
38 #include <TCanvas.h>
39 #include <TH2F.h>
40 #include <TLegend.h>
41 #include <TColor.h>
42
43 #include "AliLog.h"
44 #include "AliHFSystErr.h"
45
46
47 ClassImp(AliHFSystErr)
48
49 //--------------------------------------------------------------------------
50 AliHFSystErr::AliHFSystErr(const Char_t* name, const Char_t* title) : 
51 TNamed(name,title),
52 fNorm(0),
53 fRawYield(0),
54 fTrackingEff(0),
55 fBR(0),
56 fCutsEff(0),
57 fPIDEff(0),
58 fMCPtShape(0),
59 fPartAntipart(0),
60 fRunNumber(10),
61 fCollisionType(0),
62 fCentralityClass("0100"),
63 fIsLowEnergy(false),
64 fIsCentScan(false)
65 {
66   //
67   // Default Constructor
68   //
69 }
70
71 //--------------------------------------------------------------------------
72 AliHFSystErr::~AliHFSystErr() {
73   //  
74   // Default Destructor
75   //
76   /*
77
78   if(fNorm)         { delete fNorm; fNorm=0; }
79   if(fRawYield)     { delete fRawYield; fRawYield=0; }
80   if(fTrackingEff)  { delete fTrackingEff; fTrackingEff=0; }
81   if(fBR)           { delete fBR; fBR=0; }
82   if(fCutsEff)      { delete fCutsEff; fCutsEff=0; }
83   if(fPIDEff)       { delete fPIDEff; fPIDEff=0; }
84   if(fMCPtShape)    { delete fMCPtShape; fMCPtShape=0; }
85   if(fPartAntipart) { delete fPartAntipart; fPartAntipart=0; }
86   */
87 }
88
89 //--------------------------------------------------------------------------
90 void AliHFSystErr::Init(Int_t decay){
91   //
92   // Variables/histos initialization
93   //
94
95   if ((fRunNumber>11) && fIsLowEnergy==false) { 
96     AliFatal("Only settings for 2010 and the low energy runs are implemented so far");
97   }
98
99   switch(decay) {
100   case 1: // D0->Kpi
101     if (fCollisionType==0) {
102       if (fIsLowEnergy) InitD0toKpi2010ppLowEn();
103       else InitD0toKpi2010pp();
104     } 
105     else if (fCollisionType==1) {
106       if (fRunNumber == 10){
107         if (fCentralityClass=="010") InitD0toKpi2010PbPb010CentScan();
108         else if (fCentralityClass=="1020") InitD0toKpi2010PbPb1020CentScan();
109         else if (fCentralityClass=="020")  InitD0toKpi2010PbPb020();
110         else if (fCentralityClass=="2040") InitD0toKpi2010PbPb2040CentScan();
111         else if (fCentralityClass=="4060") InitD0toKpi2010PbPb4060CentScan();
112         else if (fCentralityClass=="6080") InitD0toKpi2010PbPb6080CentScan();
113         else if (fCentralityClass=="4080") InitD0toKpi2010PbPb4080();
114         else AliFatal("Not yet implemented");
115       }
116       else if (fRunNumber == 11){
117         if (fCentralityClass=="07half") InitD0toKpi2011PbPb07half();
118         else if (fCentralityClass=="3050InPlane") InitD0toKpi2011PbPb3050InPlane();
119         else if (fCentralityClass=="3050OutOfPlane") InitD0toKpi2011PbPb3050OutOfPlane();
120         else if (fCentralityClass=="010") InitD0toKpi2011PbPb010CentScan();
121         else if (fCentralityClass=="1020") InitD0toKpi2011PbPb1020CentScan();
122         else if (fCentralityClass=="2030") InitD0toKpi2011PbPb2030CentScan();
123         else if (fCentralityClass=="3040") InitD0toKpi2011PbPb3040CentScan();
124         else if (fCentralityClass=="4050") InitD0toKpi2011PbPb4050CentScan();
125         else if (fCentralityClass=="5080") InitD0toKpi2010PbPb5080CentScan();
126         else AliFatal("Not yet implemented");
127       }
128     } 
129     else if (fCollisionType==2) { 
130       if (fCentralityClass=="0100") InitD0toKpi2013pPb0100();
131     }
132     else AliFatal("Not yet implemented");
133     break;
134     
135   case 2: // D+->Kpipi
136     if (fCollisionType==0) {
137       if (fIsLowEnergy) InitDplustoKpipi2010ppLowEn();
138       else InitDplustoKpipi2010pp();
139     } 
140     else if (fCollisionType==1) {
141       if (fRunNumber == 10){
142         if (fCentralityClass=="010") InitDplustoKpipi2010PbPb010CentScan();
143         else if (fCentralityClass=="1020") InitDplustoKpipi2010PbPb1020CentScan();
144         else if (fCentralityClass=="020") InitDplustoKpipi2010PbPb020();
145         else if (fCentralityClass=="2040") InitDplustoKpipi2010PbPb2040CentScan();
146         else if (fCentralityClass=="4060") InitDplustoKpipi2010PbPb4060CentScan();
147         else if (fCentralityClass=="6080") InitDplustoKpipi2010PbPb6080CentScan();
148         else if (fCentralityClass=="4080") InitDplustoKpipi2010PbPb4080();
149         else AliFatal("Not yet implemented");
150       }
151       if(fRunNumber == 11){
152         if (fCentralityClass=="07half") InitDplustoKpipi2011PbPb07half();
153         else if (fCentralityClass=="010") InitDplustoKpipi2011PbPb010CentScan();
154         else if (fCentralityClass=="1020") InitDplustoKpipi2011PbPb1020CentScan();
155         else if (fCentralityClass=="2030") InitDplustoKpipi2011PbPb2030CentScan();
156         else if (fCentralityClass=="3040") InitDplustoKpipi2011PbPb3040CentScan();
157         else if (fCentralityClass=="4050") InitDplustoKpipi2011PbPb4050CentScan();
158         else if (fCentralityClass=="5080") InitDplustoKpipi2010PbPb5080CentScan();
159         else AliFatal("Not yet implemented");
160       }
161     } 
162     else if (fCollisionType==2) { 
163       if (fCentralityClass=="0100") InitDplustoKpipi2013pPb0100();
164     } 
165     else AliFatal("Not yet implemented");
166     break;
167   case 3: // D*->D0pi
168     if (fCollisionType==0) {
169       if(fIsLowEnergy)  InitDstartoD0pi2010ppLowEn();
170       else InitDstartoD0pi2010pp();
171     }
172     else if (fCollisionType==1) {
173       if (fRunNumber == 10){
174         if (fCentralityClass=="010") InitDstartoD0pi2010PbPb010CentScan();
175         else if (fCentralityClass=="1020") InitDstartoD0pi2010PbPb1020CentScan();
176         else if (fCentralityClass=="020") InitDstartoD0pi2010PbPb020();
177         else if (fCentralityClass=="2040" && fIsCentScan) InitDstartoD0pi2010PbPb2040CentScan();
178         else if (fCentralityClass=="2040") InitDstartoD0pi2010PbPb2040();
179         else if (fCentralityClass=="4060") InitDstartoD0pi2010PbPb4060CentScan();
180         else if (fCentralityClass=="6080") InitDstartoD0pi2010PbPb6080CentScan();
181         else if (fCentralityClass=="4080") InitDstartoD0pi2010PbPb4080();
182         else AliFatal("Not yet implemented");
183       }
184       if (fRunNumber == 11){
185         if (fCentralityClass=="07half") InitDstartoD0pi2011PbPb07half();
186         else if (fCentralityClass=="010") InitDstartoD0pi2011PbPb010CentScan();
187         else if (fCentralityClass=="1020") InitDstartoD0pi2011PbPb1020CentScan();
188         else if (fCentralityClass=="2030") InitDstartoD0pi2011PbPb2030CentScan();
189         else if (fCentralityClass=="3040") InitDstartoD0pi2011PbPb3040CentScan();
190         else if (fCentralityClass=="4050") InitDstartoD0pi2011PbPb4050CentScan();
191         else if (fCentralityClass=="5080") InitDstartoD0pi2010PbPb5080CentScan();
192         else AliFatal("Not yet implemented");
193       }
194     }
195     else if (fCollisionType==2) { 
196       if (fCentralityClass=="0100") InitDstartoD0pi2013pPb0100();
197     }
198     else AliFatal("Not yet implemented");
199     break;
200   case 4: // D+s->KKpi
201     if (fCollisionType==0) InitDstoKKpi2010pp();
202     else if (fCollisionType==1) {
203       if (fCentralityClass=="07half") InitDstoKKpi2011PbPb07half();
204       else AliFatal("Not yet implemented");
205     }
206     else if (fCollisionType==2) { 
207       if (fCentralityClass=="0100") InitDstoKKpi2013pPb0100();
208     }
209     else AliFatal("Not yet implemented");
210     break;
211   case 5: // Lc->pKpi
212     if (fCollisionType==0) InitLctopKpi2010pp();
213     else AliFatal("Not yet implemented");
214     break;
215     
216   default:
217     printf("Invalid decay type: %d\n",decay);
218     break;
219   }
220
221 }
222   
223 //--------------------------------------------------------------------------
224 void AliHFSystErr::InitD0toKpi2010pp() {
225   // 
226   // D0->Kpi syst errors. Responsible: A. Rossi
227   //   2010 pp sample
228   //
229
230   // Normalization
231   fNorm = new TH1F("fNorm","fNorm",24,0,24);
232   for(Int_t i=1;i<=24;i++) fNorm->SetBinContent(i,0.035); // 4% error on sigmaV0and
233
234   // Branching ratio 
235   fBR = new TH1F("fBR","fBR",24,0,24);
236   for(Int_t i=1;i<=24;i++) fBR->SetBinContent(i,0.012); // 1.2% PDG2010
237
238   // Tracking efficiency
239   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",24,0,24);
240   for(Int_t i=1;i<=24;i++) fTrackingEff->SetBinContent(i,0.08); // 8% (4% per track)
241
242   // Raw yield extraction
243   fRawYield = new TH1F("fRawYield","fRawYield",24,0,24);
244   fRawYield->SetBinContent(1,1);
245   fRawYield->SetBinContent(2,0.22);
246   fRawYield->SetBinContent(3,0.1);
247   for(Int_t i=4;i<=7;i++) fRawYield->SetBinContent(i,0.04);
248   for(Int_t i=8;i<=12;i++) fRawYield->SetBinContent(i,0.07);
249   for(Int_t i=13;i<=16;i++) fRawYield->SetBinContent(i,0.10);
250   for(Int_t i=17;i<=24;i++) fRawYield->SetBinContent(i,1);
251
252   // Cuts efficiency (from cuts variation)
253   fCutsEff = new TH1F("fCutsEff","fCutsEff",24,0,24);
254   for(Int_t i=1;i<=24;i++) fCutsEff->SetBinContent(i,0.10); // 10%
255
256   // PID efficiency (from PID/noPID)
257   fPIDEff = new TH1F("fPIDEff","fPIDEff",24,0,24);
258   for(Int_t i=1;i<=24;i++) fPIDEff->SetBinContent(i,0.03); // 3%
259   fPIDEff->SetBinContent(2,0.05); // 5%
260
261   // MC dN/dpt
262   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",24,0,24);
263   for(Int_t i=1;i<=24;i++) fMCPtShape->SetBinContent(i,0);
264   fMCPtShape->SetBinContent(1,0.03);
265   fMCPtShape->SetBinContent(2,0.03);
266
267   // particle-antiparticle
268   //  fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",24,0,24);
269   //  fPartAntipart->SetBinContent(1,1); 
270   //  for(Int_t i=2;i<=24;i++) fPartAntipart->SetBinContent(i,0.05);
271   
272   return;
273 }
274 //--------------------------------------------------------------------------
275 void AliHFSystErr::InitD0toKpi2010PbPb020() {
276   // 
277   // D0->Kpi syst errors. Responsible: A. Rossi
278   //   2010 PbPb sample, 0-20 CC
279   //
280
281   // Normalization
282   fNorm = new TH1F("fNorm","fNorm",20,0,20);
283   for(Int_t i=1;i<=20;i++) fNorm->SetBinContent(i,0.05); // TAA and pp norm
284
285   // Branching ratio 
286   fBR = new TH1F("fBR","fBR",20,0,20);
287   for(Int_t i=1;i<=20;i++) fBR->SetBinContent(i,0.012); // 1.2% PDG2010
288
289   // Tracking efficiency
290   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",20,0,20);
291   for(Int_t i=1;i<=20;i++) fTrackingEff->SetBinContent(i,0.10);// Jacek, 5% per track
292
293   // Raw yield extraction
294   fRawYield = new TH1F("fRawYield","fRawYield",20,0,20);
295   fRawYield->SetBinContent(1,0);
296   fRawYield->SetBinContent(2,0);
297   fRawYield->SetBinContent(3,0.08);
298   for(Int_t i=4;i<=12;i++) fRawYield->SetBinContent(i,0.06);
299   for(Int_t i=13;i<=16;i++) fRawYield->SetBinContent(i,0.10);
300
301   // Cuts efficiency (from cuts variation)
302   fCutsEff = new TH1F("fCutsEff","fCutsEff",20,0,20);
303   fCutsEff->SetBinContent(1,0.);
304   fCutsEff->SetBinContent(2,0.);
305   fCutsEff->SetBinContent(3,0.13);
306   fCutsEff->SetBinContent(4,0.11);  
307   for(Int_t i=5;i<=16;i++) fCutsEff->SetBinContent(i,0.10);
308   for(Int_t i=17;i<=20;i++) fCutsEff->SetBinContent(i,0.);
309
310   // PID efficiency (from PID/noPID)
311   fPIDEff = new TH1F("fPIDEff","fPIDEff",20,0,20);
312   for(Int_t i=3;i<=16;i++) fPIDEff->SetBinContent(i,0.05);
313
314   // MC dN/dpt
315   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",20,0,20);
316   for(Int_t i=1;i<=20;i++) fMCPtShape->SetBinContent(i,0.01);
317   fMCPtShape->SetBinContent(3,0.04);
318   fMCPtShape->SetBinContent(4,0.02);
319   for(Int_t i=13;i<=16;i++) fMCPtShape->SetBinContent(i,0.03); 
320
321 //   // particle-antiparticle
322 //   fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",20,0,20);
323 //   for(Int_t i=3;i<=12;i++) fPartAntipart->SetBinContent(i,0.05);
324 //   fPartAntipart->SetBinContent(3,0.10);
325 //   fPartAntipart->SetBinContent(4,0.10);
326 //   fPartAntipart->SetBinContent(7,0.10);
327 //   fPartAntipart->SetBinContent(8,0.10);
328   
329   return;
330 }
331 //--------------------------------------------------------------------------
332 //--------------------------------------------------------------------------
333 void AliHFSystErr::InitD0toKpi2011PbPb07half() {
334   // 
335   // D0->Kpi syst errors. Responsible: A. Rossi
336   //   2011 PbPb sample, 0-7.5 CC
337   //
338
339   // Normalization
340   fNorm = new TH1F("fNorm","fNorm",36,0,36);
341   for(Int_t i=1;i<36;i++) fNorm->SetBinContent(i,0.048); // TAA and pp norm
342
343   // Branching ratio 
344   fBR = new TH1F("fBR","fBR",36,0,36);
345   for(Int_t i=1;i<=36;i++) fBR->SetBinContent(i,0.012); // 1.2% PDG2010
346
347   // Tracking efficiency
348   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",36,0,36);
349   for(Int_t i=1;i<=24;i++) fTrackingEff->SetBinContent(i,0.10);// Jacek, 5% per track
350   for(Int_t i=25;i<=36;i++) fTrackingEff->SetBinContent(i,0.);// OUT OF MEASUREMENT RANGE
351
352   // Raw yield extraction
353   fRawYield = new TH1F("fRawYield","fRawYield",36,0,36);
354   fRawYield->SetBinContent(1,0);
355   fRawYield->SetBinContent(2,0.1);
356   fRawYield->SetBinContent(3,0.05);
357   for(Int_t i=4;i<=12;i++) fRawYield->SetBinContent(i,0.05);
358   for(Int_t i=13;i<=16;i++) fRawYield->SetBinContent(i,0.10);
359   for(Int_t i=17;i<=24;i++) fRawYield->SetBinContent(i,0.30);
360   for(Int_t i=25;i<=36;i++) fRawYield->SetBinContent(i,0.);// OUT OF MEASUREMENT RANGE
361
362   // Cuts efficiency (from cuts variation)
363   fCutsEff = new TH1F("fCutsEff","fCutsEff",36,0,36);
364   fCutsEff->SetBinContent(1,0.);
365   fCutsEff->SetBinContent(2,0.15);
366   fCutsEff->SetBinContent(3,0.13);
367   fCutsEff->SetBinContent(4,0.11);  
368   fCutsEff->SetBinContent(5,0.08); 
369   for(Int_t i=6;i<=24;i++) fCutsEff->SetBinContent(i,0.06);
370   for(Int_t i=25;i<=36;i++) fCutsEff->SetBinContent(i,0.0);// OUT OF MEASUREMENT RANGE
371
372   // PID efficiency (from PID/noPID)
373   fPIDEff = new TH1F("fPIDEff","fPIDEff",36,0,36);
374   for(Int_t i=1;i<=24;i++) fPIDEff->SetBinContent(i,0.05);
375   for(Int_t i=25;i<=36;i++) fPIDEff->SetBinContent(i,0.0);// OUT OF MEASUREMENT RANGE
376
377   // MC dN/dpt
378   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",36,0,36);
379   for(Int_t i=1;i<=24;i++) fMCPtShape->SetBinContent(i,0.01);
380   fMCPtShape->SetBinContent(2,0.06);
381   fMCPtShape->SetBinContent(3,0.04);
382   fMCPtShape->SetBinContent(4,0.02);
383   for(Int_t i=13;i<=16;i++) fMCPtShape->SetBinContent(i,0.03); 
384   for(Int_t i=17;i<=24;i++) fMCPtShape->SetBinContent(i,0.05);
385   for(Int_t i=25;i<=36;i++) fMCPtShape->SetBinContent(i,0.0);// OUT OF MEASUREMENT RANGE
386
387 //   // particle-antiparticle
388 //   fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",36,0,36);
389 //   for(Int_t i=3;i<=12;i++) fPartAntipart->SetBinContent(i,0.05);
390 //   fPartAntipart->SetBinContent(3,0.10);
391 //   fPartAntipart->SetBinContent(4,0.10);
392 //   fPartAntipart->SetBinContent(7,0.10);
393 //   fPartAntipart->SetBinContent(8,0.10);
394   
395   return;
396 }
397
398 //--------------------------------------------------------------------------
399 void AliHFSystErr::InitD0toKpi2011PbPb3050InPlane() {
400   //
401   // D0->Kpi syst errors. Responsible: D. Caffarri
402   //   2011 PbPb sample, 30-50 CC InPlane
403   //
404   InitD0toKpi2011PbPb07half();
405   // Raw yield extraction
406   // fRawYield = new TH1F("fRawYield","fRawYield",36,0,36);
407   fRawYield->SetBinContent(1,0);
408   fRawYield->SetBinContent(2,0);
409   fRawYield->SetBinContent(3,0.05);
410   fRawYield->SetBinContent(4,0.08);
411   for(Int_t i=5;i<=8;i++) fRawYield->SetBinContent(i,0.05);
412   for(Int_t i=9;i<=12;i++) fRawYield->SetBinContent(i,0.05);
413   for(Int_t i=13;i<=16;i++) fRawYield->SetBinContent(i,0.15);
414   for(Int_t i=17;i<=36;i++) fRawYield->SetBinContent(i,0.);// OUT OF MEASUREMENT RANGE
415
416   // Cuts efficiency (from cuts variation)
417   //fCutsEff = new TH1F("fCutsEff","fCutsEff",36,0,36);
418   fCutsEff->SetBinContent(1,0.);
419   fCutsEff->SetBinContent(2,0.0);
420   fCutsEff->SetBinContent(3,0.10);
421   fCutsEff->SetBinContent(4,0.10);
422   fCutsEff->SetBinContent(5,0.10);
423   fCutsEff->SetBinContent(6,0.10);
424   for(Int_t i=7;i<=8;i++) fCutsEff->SetBinContent(i,0.15);
425   for(Int_t i=9;i<=16;i++) fCutsEff->SetBinContent(i,0.15);
426   for(Int_t i=25;i<=36;i++) fCutsEff->SetBinContent(i,0.0);// OUT OF MEASUREMENT RANGE
427 }
428
429 //--------------------------------------------------------------------------
430 void AliHFSystErr::InitD0toKpi2011PbPb3050OutOfPlane() {
431   //
432   // D0->Kpi syst errors. Responsible: D. Caffarri
433   //   2011 PbPb sample, 30-50 CC OutOfPlane
434   //
435   InitD0toKpi2011PbPb07half();
436   // Raw yield extraction
437   //fRawYield = new TH1F("fRawYield","fRawYield",36,0,36);
438   fRawYield->SetBinContent(1,0);
439   fRawYield->SetBinContent(2,0.);
440   fRawYield->SetBinContent(3,0.05);
441   for(Int_t i=4;i<=6;i++) fRawYield->SetBinContent(i,0.07);
442   for(Int_t i=7;i<=8;i++) fRawYield->SetBinContent(i,0.05);
443   for(Int_t i=9;i<=12;i++) fRawYield->SetBinContent(i,0.10);
444   for(Int_t i=13;i<=16;i++) fRawYield->SetBinContent(i,0.15);
445   for(Int_t i=17;i<=36;i++) fRawYield->SetBinContent(i,0.);// OUT OF MEASUREMENT RANGE
446
447   // Cuts efficiency (from cuts variation)
448   // fCutsEff = new TH1F("fCutsEff","fCutsEff",36,0,36);
449   fCutsEff->SetBinContent(1,0.);
450   fCutsEff->SetBinContent(2,0.);
451   fCutsEff->SetBinContent(3,0.10);
452   fCutsEff->SetBinContent(4,0.10);
453   fCutsEff->SetBinContent(5,0.10);
454   fCutsEff->SetBinContent(6,0.10);
455   for(Int_t i=7;i<=8;i++) fCutsEff->SetBinContent(i,0.15);
456   for(Int_t i=9;i<=16;i++) fCutsEff->SetBinContent(i,0.15);
457   for(Int_t i=17;i<=36;i++) fCutsEff->SetBinContent(i,0.0);// OUT OF MEASUREMENT RANGE
458 }
459
460 //--------------------------------------------------------------------------
461 void AliHFSystErr::InitD0toKpi2010PbPb4080() {
462   //
463   // D0->Kpi syst errors. Responsible: A. Rossi
464   //   2010 PbPb sample, 40-80 CC
465   //
466
467   // Normalization
468   fNorm = new TH1F("fNorm","fNorm",20,0,20);
469   for(Int_t i=1;i<=24;i++) fNorm->SetBinContent(i,0.07); // TAA and pp norm
470
471   // Branching ratio 
472   fBR = new TH1F("fBR","fBR",20,0,20);
473   for(Int_t i=1;i<=20;i++) fBR->SetBinContent(i,0.012); // 1.2% PDG2010
474
475   // Tracking efficiency
476   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",20,0,20);
477   for(Int_t i=1;i<=20;i++) fTrackingEff->SetBinContent(i,0.10); // Jacek, 5% per track
478
479
480   // Raw yield extraction
481   fRawYield = new TH1F("fRawYield","fRawYield",20,0,20);
482   fRawYield->SetBinContent(1,0);
483   fRawYield->SetBinContent(2,0);
484   for(Int_t i=3;i<=16;i++) fRawYield->SetBinContent(i,0.05);
485   //for(Int_t i=13;i<=20;i++) fRawYield->SetBinContent(i,0);
486
487   // Cuts efficiency (from cuts variation)
488   fCutsEff = new TH1F("fCutsEff","fCutsEff",20,0,20);
489   fCutsEff->SetBinContent(1,0.);
490   fCutsEff->SetBinContent(2,0.);
491   fCutsEff->SetBinContent(3,0.13);
492   fCutsEff->SetBinContent(4,0.11);  
493   for(Int_t i=5;i<=16;i++) fCutsEff->SetBinContent(i,0.10);
494   for(Int_t i=17;i<=20;i++) fCutsEff->SetBinContent(i,0.);
495
496   // PID efficiency (from PID/noPID)
497   fPIDEff = new TH1F("fPIDEff","fPIDEff",20,0,20);
498 //   for(Int_t i=3;i<=6;i++) fPIDEff->SetBinContent(i,0.10);
499 //   for(Int_t i=7;i<=16;i++) fPIDEff->SetBinContent(i,0.05);
500   for(Int_t i=3;i<=16;i++) fPIDEff->SetBinContent(i,0.05);
501
502   // MC dN/dpt
503   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",20,0,20);
504   for(Int_t i=1;i<=20;i++) fMCPtShape->SetBinContent(i,0.01);
505   //  fMCPtShape->SetBinContent(3,0.04); Not set for peripherals (Raa Vs pt is flat)
506   //  fMCPtShape->SetBinContent(4,0.02);
507   for(Int_t i=13;i<=16;i++) fMCPtShape->SetBinContent(i,0.03); 
508   
509   //   // particle-antiparticle
510   //   fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",20,0,20);
511   //   for(Int_t i=3;i<=12;i++) fPartAntipart->SetBinContent(i,0.05);
512   
513   return;
514 }
515
516 //--------------------------------------------------------------------------
517 void AliHFSystErr::InitD0toKpi2010ppLowEn() {
518   // 
519   // D0->Kpi syst errors. Low energy run
520   //   2011 2.76 TeV pp sample
521   //
522   AliInfo(" Settings for D0 --> K pi, p-p collisions at 2.76 TeV"); 
523
524   // Normalization
525   fNorm = new TH1F("fNorm","fNorm",20,0,20);
526   for(Int_t i=1;i<=20;i++) fNorm->SetBinContent(i,0.031); // 4% error on sigmaV0and
527
528   // Branching ratio 
529   fBR = new TH1F("fBR","fBR",20,0,20);
530   for(Int_t i=1;i<=20;i++) fBR->SetBinContent(i,0.012); // 1.2% PDG2010
531
532   // Tracking efficiency
533   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",20,0,20);
534   for(Int_t i=1;i<=20;i++) fTrackingEff->SetBinContent(i,0.10); //10% (5% per track)
535
536   // Raw yield extraction
537   fRawYield = new TH1F("fRawYield","fRawYield",20,0,20);
538   fRawYield->SetBinContent(1,1);
539   for(Int_t i=1;i<=20;i++) fRawYield->SetBinContent(i,0.15);
540
541   // Cuts efficiency (from cuts variation)
542   fCutsEff = new TH1F("fCutsEff","fCutsEff",20,0,20);
543   for(Int_t i=1;i<=20;i++) fCutsEff->SetBinContent(i,0.10); // 10% 
544   fCutsEff->SetBinContent(2,0.20);
545   for(Int_t i=7;i<=20;i++) fCutsEff->SetBinContent(i,0.15); // 10% 
546
547
548   // PID efficiency (from PID/noPID)
549   fPIDEff = new TH1F("fPIDEff","fPIDEff",20,0,20);
550   for(Int_t i=1;i<=20;i++) fPIDEff->SetBinContent(i,0.15); // 10%
551   //  fPIDEff->SetBinContent(2,0.20);
552   for(Int_t i=7;i<=20;i++) fPIDEff->SetBinContent(i,0.05); // 10%
553
554   // MC dN/dpt
555   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",20,0,20);
556   for(Int_t i=1;i<=20;i++) fMCPtShape->SetBinContent(i,0.01);
557   fMCPtShape->SetBinContent(1,0.03);
558   fMCPtShape->SetBinContent(2,0.03);
559
560 //   // particle-antiparticle
561 //   fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",20,0,20);
562 //   fPartAntipart->SetBinContent(1,1);
563 //   fPartAntipart->SetBinContent(2,1);
564 //   for(Int_t i=3;i<=6;i++) fPartAntipart->SetBinContent(i,0.08);
565 //   for(Int_t i=1;i<=20;i++) fPartAntipart->SetBinContent(i,0.);
566   
567   return;
568 }
569 //_________________________________________________________________________
570 void AliHFSystErr::InitD0toKpi2013pPb0100(){
571   //
572   // D0->Kpi syst errors. p-Pb data sample
573   //
574   AliInfo(" Settings for D0 --> K pi, p-Pb collisions at 5.023 TeV"); 
575
576   fNorm = new TH1F("fNorm","fNorm",24,0,24);
577   for(Int_t i=1;i<=24;i++) fNorm->SetBinContent(i,0.02); // 
578   
579   // Branching ratio 
580   fBR = new TH1F("fBR","fBR",24,0,24);
581   for(Int_t i=1;i<=24;i++) fBR->SetBinContent(i,0.013); // 1.2% PDG2010
582
583   // Tracking efficiency
584   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",24,0,24);
585   for(Int_t i=1;i<=24;i++) fTrackingEff->SetBinContent(i,0.06); // 3% per track
586
587   // Raw yield extraction
588   fRawYield = new TH1F("fRawYield","fRawYield",24,0,24);
589   fRawYield->SetBinContent(1,0.0);
590   fRawYield->SetBinContent(2,0.05);
591   for(Int_t i=3;i<=6;i++) fRawYield->SetBinContent(i,0.02);
592   for(Int_t i=7;i<=24;i++) fRawYield->SetBinContent(i,0.05);
593   
594   // Cuts efficiency (from cuts variation)
595   fCutsEff = new TH1F("fCutsEff","fCutsEff",24,0,24);
596   fCutsEff->SetBinContent(1,0.0);
597   fCutsEff->SetBinContent(2,0.10);
598   for(Int_t i=3;i<=24;i++) fCutsEff->SetBinContent(i,0.05);
599
600   // PID efficiency (from PID/noPID)
601   fPIDEff = new TH1F("fPIDEff","fPIDEff",24,0,24);
602   fPIDEff->SetBinContent(1,0.0);
603   fPIDEff->SetBinContent(2,0.05);
604   for(Int_t i=3;i<=12;i++) fPIDEff->SetBinContent(i,0.00);
605   for(Int_t i=12;i<=24;i++) fPIDEff->SetBinContent(i,0.05);
606
607   // MC dN/dpt  
608   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",24,0,24);
609   fMCPtShape->SetBinContent(1,0.0);
610   fMCPtShape->SetBinContent(2,0.02);
611   fMCPtShape->SetBinContent(3,0.02);
612   for(Int_t i=4;i<=8;i++) fMCPtShape->SetBinContent(i,0.0);
613   for(Int_t i=9;i<=24;i++) fMCPtShape->SetBinContent(i,0.02);
614
615   // particle-antiparticle
616   /*
617   fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",20,0,20);
618   for(Int_t i=1;i<=20;i++) fPartAntipart->SetBinContent(i,0.05);   //5 to 12%
619   */
620   return;
621
622
623 }
624
625 //--------------------------------------------------------------------------
626 void AliHFSystErr::InitDplustoKpipi2010pp() {
627   // 
628   // D+->Kpipi syst errors. Responsible: R. Bala
629   //  2010 pp sample
630   //
631
632
633 // Normalization
634   fNorm = new TH1F("fNorm","fNorm",24,0,24);
635   for(Int_t i=1;i<=24;i++) fNorm->SetBinContent(i,0.035); // 4% error on sigmaV0and
636
637   // Branching ratio 
638   fBR = new TH1F("fBR","fBR",24,0,24);
639   for(Int_t i=1;i<=24;i++) fBR->SetBinContent(i,0.021); // 2.1% PDG2010
640
641   // Tracking efficiency
642   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",24,0,24);
643   for(Int_t i=1;i<=24;i++) fTrackingEff->SetBinContent(i,0.12); // 12% (4% per track)
644
645
646   // Raw yield extraction
647   fRawYield = new TH1F("fRawYield","fRawYield",24,0,24);
648   fRawYield->SetBinContent(1,1);
649   fRawYield->SetBinContent(2,0.25);
650   fRawYield->SetBinContent(3,0.25);
651   fRawYield->SetBinContent(4,0.20);
652   fRawYield->SetBinContent(5,0.09);
653   fRawYield->SetBinContent(6,0.09);
654   for(Int_t i=7;i<=12;i++) fRawYield->SetBinContent(i,0.05);  
655   for(Int_t i=12;i<=24;i++) fRawYield->SetBinContent(i,0.10);  
656   
657   // Cuts efficiency (from cuts variation)
658   fCutsEff = new TH1F("fCutsEff","fCutsEff",24,0,24);
659   for(Int_t i=1;i<=24;i++) fCutsEff->SetBinContent(i,0.10); // 10%
660
661   // PID efficiency (from PID/noPID)
662   fPIDEff = new TH1F("fPIDEff","fPIDEff",24,0,24);
663   for(Int_t i=1;i<=24;i++) fPIDEff->SetBinContent(i,0.05); // 5%
664   fPIDEff->SetBinContent(1,0.15); // 15%
665   fPIDEff->SetBinContent(2,0.15); // 15%
666   fPIDEff->SetBinContent(3,0.15); // 15%
667   fPIDEff->SetBinContent(4,0.15); // 15%
668   for(Int_t i=12;i<=16;i++) fPIDEff->SetBinContent(i,0.10); // 5%
669
670   // MC dN/dpt  
671   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",24,0,24);
672   for(Int_t i=1;i<=24;i++) fMCPtShape->SetBinContent(i,0);
673   fMCPtShape->SetBinContent(1,0.03);
674   fMCPtShape->SetBinContent(2,0.03);
675
676
677   // particle-antiparticle
678   /*
679   fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",20,0,20);
680   fPartAntipart->SetBinContent(1,1);
681   fPartAntipart->SetBinContent(2,1);
682   fPartAntipart->SetBinContent(3,0.12);
683   for(Int_t i=4;i<=20;i++) fPartAntipart->SetBinContent(i,0.05);   //5 to 12%
684   */
685   return;
686 }
687  
688 //--------------------------------------------------------------------------
689 void AliHFSystErr::InitDstoKKpi2010pp() {
690   // 
691   // D+s->KKpi syst errors. Responsible: G.M. Innocenti
692   //  2010 pp sample
693   //
694
695
696 // Normalization
697   fNorm = new TH1F("fNorm","fNorm",12,0,12);
698   for(Int_t i=1;i<=12;i++) fNorm->SetBinContent(i,0.035); // 3.5% error on sigmaV0and
699
700   // Branching ratio 
701   fBR = new TH1F("fBR","fBR",12,0,12);
702   for(Int_t i=1;i<=12;i++) fBR->SetBinContent(i,0.06); // 0.14/2.32 PDG2010
703
704   // Tracking efficiency
705   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",12,0,12);
706   for(Int_t i=1;i<=12;i++) fTrackingEff->SetBinContent(i,0.12); // 12% (4% per track)
707
708
709   // Raw yield extraction
710   fRawYield = new TH1F("fRawYield","fRawYield",12,0,12);
711   fRawYield->SetBinContent(1,1);
712   fRawYield->SetBinContent(2,1);
713   fRawYield->SetBinContent(3,0.20);
714   fRawYield->SetBinContent(4,0.20);
715   fRawYield->SetBinContent(5,0.15);
716   fRawYield->SetBinContent(6,0.15);
717   fRawYield->SetBinContent(7,0.15);
718   fRawYield->SetBinContent(8,0.15);
719   fRawYield->SetBinContent(9,0.20);
720   fRawYield->SetBinContent(10,0.20);
721   fRawYield->SetBinContent(11,0.20);
722   fRawYield->SetBinContent(12,0.20);
723   
724   // Cuts efficiency (from cuts variation)
725   fCutsEff = new TH1F("fCutsEff","fCutsEff",12,0,12);
726   for(Int_t i=1;i<=12;i++) fCutsEff->SetBinContent(i,0.15); // 15%
727
728   // PID efficiency (from PID/noPID)
729   fPIDEff = new TH1F("fPIDEff","fPIDEff",12,0,12);
730   for(Int_t i=1;i<=12;i++) fPIDEff->SetBinContent(i,0.07); // 7%
731
732   // MC dN/dpt 
733   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",12,0,12);
734   for(Int_t i=1; i<=2; i++) fMCPtShape->SetBinContent(i,1.);
735   for(Int_t i=3; i<=4; i++) fMCPtShape->SetBinContent(i,0.03);
736   for(Int_t i=5; i<=6; i++) fMCPtShape->SetBinContent(i,0.03);
737   for(Int_t i=7; i<=8; i++) fMCPtShape->SetBinContent(i,0.02);
738   for(Int_t i=9; i<=12; i++) fMCPtShape->SetBinContent(i,0.02);
739
740
741   // particle-antiparticle
742   /*
743   fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",12,0,12);
744   fPartAntipart->SetBinContent(1,1);
745   fPartAntipart->SetBinContent(2,1);
746   fPartAntipart->SetBinContent(3,0.12);
747   for(Int_t i=4;i<=12;i++) fPartAntipart->SetBinContent(i,0.05);   //5 to 12%
748   */
749   return;
750 }
751    
752  
753 //--------------------------------------------------------------------------
754 void AliHFSystErr::InitDplustoKpipi2011PbPb07half() {
755   // 
756   // D+->Kpipi syst errors. Responsible: E. Bruna
757   //  2011 PbPb sample, 0-7.5% CC
758   //
759
760  // Normalization
761   fNorm = new TH1F("fNorm","fNorm",36,0,36);
762   for(Int_t i=1;i<=36;i++) fNorm->SetBinContent(i,0.048); // TAA and pp norm
763
764   // Branching ratio 
765   fBR = new TH1F("fBR","fBR",36,0,36);
766   for(Int_t i=1;i<=36;i++) fBR->SetBinContent(i,0.021); // 2.1% PDG2010
767
768   // Tracking efficiency
769   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",36,0,36);
770   for(Int_t i=1;i<=36;i++) fTrackingEff->SetBinContent(i,0.15); // Jacek, 5% per track
771
772   // Raw yield extraction
773   fRawYield = new TH1F("fRawYield","fRawYield",36,0,36);
774   for(Int_t i=1;i<=36;i++) fRawYield->SetBinContent(i,.10);  //5 to 10%
775   fRawYield->SetBinContent(4,0.30);
776   fRawYield->SetBinContent(5,0.20);
777   fRawYield->SetBinContent(6,0.20);
778   for(Int_t i=7; i<=8; i++) fRawYield->SetBinContent(i,0.10);
779   for(Int_t i=9; i<=12; i++) fRawYield->SetBinContent(i,0.08);
780   for(Int_t i=13; i<=16; i++) fRawYield->SetBinContent(i,0.05);
781   for(Int_t i=17; i<=24; i++) fRawYield->SetBinContent(i,0.08);
782   for(Int_t i=25; i<=36; i++) fRawYield->SetBinContent(i,0.20);
783
784
785   // Cuts efficiency (from cuts variation)
786   fCutsEff = new TH1F("fCutsEff","fCutsEff",36,0,36);
787   for(Int_t i=1; i<=12; i++) fCutsEff->SetBinContent(i,0.10);
788   for(Int_t i=13; i<=36; i++) fCutsEff->SetBinContent(i,0.08);
789
790
791   // PID efficiency (from PID/noPID)
792   fPIDEff = new TH1F("fPIDEff","fPIDEff",36,0,36);
793   for(Int_t i=1;i<=36;i++) fPIDEff->SetBinContent(i,0.05); // 5%
794
795   // MC dN/dpt  (24/7/2012)
796   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",36,0,36);
797   for(Int_t iBin=1; iBin<=5; iBin++) fMCPtShape->SetBinContent(iBin,0.05);
798   for(Int_t iBin=6; iBin<=36; iBin++) fMCPtShape->SetBinContent(iBin,0.03);
799   //  for(Int_t iBin=13; iBin<=36; iBin++) fMCPtShape->SetBinContent(iBin,0.05);
800
801
802   // particle-antiparticle
803   /*
804   fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",20,0,20);
805   fPartAntipart->SetBinContent(1,1);
806   fPartAntipart->SetBinContent(2,1);
807   fPartAntipart->SetBinContent(3,0.12);
808   for(Int_t i=4;i<=20;i++) fPartAntipart->SetBinContent(i,0.05);   //5 to 12%
809   */
810
811   return;
812 }
813
814 //--------------------------------------------------------------------------
815 void AliHFSystErr::InitDstoKKpi2011PbPb07half() {
816   // 
817   // D+s->Kpipi syst errors. Responsible: G.M. Innocenti
818   //  2011 PbPb sample, 0-7.5% CC
819   //
820
821  // Normalization
822   fNorm = new TH1F("fNorm","fNorm",12,0,12);
823   for(Int_t i=1;i<=12;i++) fNorm->SetBinContent(i,0.048); // TAA and pp norm
824
825   // Branching ratio 
826   fBR = new TH1F("fBR","fBR",12,0,12);
827   for(Int_t i=1;i<=12;i++) fBR->SetBinContent(i,0.053); // 0.12/2.28 PDG2012
828
829   // Tracking efficiency
830   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",12,0,12);
831   for(Int_t i=1;i<=12;i++) fTrackingEff->SetBinContent(i,0.15); // Jacek, 5% per track
832
833   // Raw yield extraction
834   fRawYield = new TH1F("fRawYield","fRawYield",12,0,12);
835   for(Int_t i=1;i<=6;i++) fRawYield->SetBinContent(i,.30); 
836   for(Int_t i=7; i<=12; i++) fRawYield->SetBinContent(i,0.20);
837  
838
839
840   // Cuts efficiency (from cuts variation)
841   fCutsEff = new TH1F("fCutsEff","fCutsEff",12,0,12);
842   for(Int_t i=1;i<=12;i++) fCutsEff->SetBinContent(i,0.20); // 20%
843
844   // PID efficiency (from PID/noPID)
845   fPIDEff = new TH1F("fPIDEff","fPIDEff",12,0,12);
846   for(Int_t i=1;i<=12;i++) fPIDEff->SetBinContent(i,0.1); // 10%
847
848    // MC dN/dpt 
849   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",12,0,12);
850   for(Int_t i=1; i<=2; i++) fMCPtShape->SetBinContent(i,1.);
851   for(Int_t i=3; i<=4; i++) fMCPtShape->SetBinContent(i,0.03);
852   for(Int_t i=5; i<=6; i++) fMCPtShape->SetBinContent(i,0.03);
853   for(Int_t i=7; i<=8; i++) fMCPtShape->SetBinContent(i,0.02);
854   for(Int_t i=9; i<=12; i++) fMCPtShape->SetBinContent(i,0.02);
855
856   // particle-antiparticle
857   /*
858   fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",12,0,12);
859   fPartAntipart->SetBinContent(1,1);
860   fPartAntipart->SetBinContent(2,1);
861   fPartAntipart->SetBinContent(3,0.12);
862   for(Int_t i=4;i<=12;i++) fPartAntipart->SetBinContent(i,0.05);   //5 to 12%
863   */
864
865   return;
866 }
867
868 //_________________________________________________________________________
869 void AliHFSystErr::InitDstoKKpi2013pPb0100(){
870   //
871   // Dstar syst
872   AliInfo(" Settings for Ds --> K K pi, p-Pb collisions at 5.023 TeV"); 
873   
874   //Normalization
875   fNorm = new TH1F("fNorm","fNorm",24,0,24);
876   for(Int_t i=3;i<=12;i++) fNorm->SetBinContent(i,0.00); // 
877   
878  // Branching ratio 
879   fBR = new TH1F("fBR","fBR",12,0,12);
880   for(Int_t i=3;i<=12;i++) fBR->SetBinContent(i,0.053); // 0.12/2.28 PDG2012
881
882   // Tracking efficiency
883   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",24,0,24);
884   for(Int_t i=3;i<=12;i++) fTrackingEff->SetBinContent(i,0.09); // 3% per track
885
886   // Raw yield extraction
887   fRawYield = new TH1F("fRawYield","fRawYield",24,0,24);
888   for(Int_t i=3; i<=4; i++) fRawYield->SetBinContent(i,0.10);
889   for(Int_t i=5; i<=6; i++) fRawYield->SetBinContent(i,0.08);
890   for(Int_t i=7; i<=8; i++) fRawYield->SetBinContent(i,0.05);
891   for(Int_t i=9; i<=12; i++) fRawYield->SetBinContent(i,0.08);
892
893   // Cuts efficiency (from cuts variation)
894   fCutsEff = new TH1F("fCutsEff","fCutsEff",24,0,24);
895   for(Int_t i=3;i<=12;i++) fCutsEff->SetBinContent(i,0.15); //
896
897   // PID efficiency (from PID/noPID)
898   fPIDEff = new TH1F("fPIDEff","fPIDEff",24,0,24);
899   for(Int_t i=3;i<=4;i++) fPIDEff->SetBinContent(i,0.10); 
900   for(Int_t i=5;i<=12;i++) fPIDEff->SetBinContent(i,0.05); 
901
902   // MC dN/dpt  
903   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",24,0,24);
904   for(Int_t i=3;i<=12;i++) fMCPtShape->SetBinContent(i,0.04);
905
906   // particle-antiparticle
907   /*
908   fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",20,0,20);
909   fPartAntipart->SetBinContent(1,1);
910   fPartAntipart->SetBinContent(2,1);
911   fPartAntipart->SetBinContent(3,0.12);
912   for(Int_t i=4;i<=20;i++) fPartAntipart->SetBinContent(i,0.05);   //5 to 12%
913   */
914   return;
915 }
916
917
918 //--------------------------------------------------------------------------
919 void AliHFSystErr::InitDplustoKpipi2010PbPb020() {
920   // 
921   // D+->Kpipi syst errors. Responsible: ??
922   //  2010 PbPb sample, 0-20 CC
923   //
924
925  // Normalization
926   fNorm = new TH1F("fNorm","fNorm",20,0,20);
927   for(Int_t i=1;i<=20;i++) fNorm->SetBinContent(i,0.05); // TAA and pp norm
928
929   // Branching ratio 
930   fBR = new TH1F("fBR","fBR",20,0,20);
931   for(Int_t i=1;i<=20;i++) fBR->SetBinContent(i,0.021); // 2.1% PDG2010
932
933   // Tracking efficiency
934   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",20,0,20);
935   for(Int_t i=1;i<=20;i++) fTrackingEff->SetBinContent(i,0.15); // Jacek, 5% per track
936
937   // Raw yield extraction
938   fRawYield = new TH1F("fRawYield","fRawYield",20,0,20);
939   for(Int_t i=1;i<=20;i++) fRawYield->SetBinContent(i,.10);  //5 to 10%
940   // fRawYield->SetBinContent(5,0.23);
941   //fRawYield->SetBinContent(6,0.23);
942   fRawYield->SetBinContent(7,0.20);
943   fRawYield->SetBinContent(8,0.20);
944   fRawYield->SetBinContent(9,0.15);
945   fRawYield->SetBinContent(10,0.15);
946   fRawYield->SetBinContent(11,0.15);
947   fRawYield->SetBinContent(12,0.15);
948
949   // Cuts efficiency (from cuts variation)
950   fCutsEff = new TH1F("fCutsEff","fCutsEff",20,0,20);
951   for(Int_t i=1;i<=20;i++) fCutsEff->SetBinContent(i,0.15); // 10%
952
953   // PID efficiency (from PID/noPID)
954   fPIDEff = new TH1F("fPIDEff","fPIDEff",20,0,20);
955   for(Int_t i=1;i<=20;i++) fPIDEff->SetBinContent(i,0.05); // 5%
956
957   // MC dN/dpt  (2/2/2012)
958   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",20,0,20);
959   for(Int_t i=1;i<=20;i++) fMCPtShape->SetBinContent(i,0.);
960   for(Int_t iBin=7; iBin<=8; iBin++) fMCPtShape->SetBinContent(iBin,0.01);
961   for(Int_t iBin=9; iBin<=12; iBin++) fMCPtShape->SetBinContent(iBin,0.05);
962   for(Int_t iBin=13; iBin<=16; iBin++) fMCPtShape->SetBinContent(iBin,0.05);
963
964
965   // particle-antiparticle
966   /*
967   fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",20,0,20);
968   fPartAntipart->SetBinContent(1,1);
969   fPartAntipart->SetBinContent(2,1);
970   fPartAntipart->SetBinContent(3,0.12);
971   for(Int_t i=4;i<=20;i++) fPartAntipart->SetBinContent(i,0.05);   //5 to 12%
972   */
973
974   return;
975 }
976
977 //--------------------------------------------------------------------------
978 void AliHFSystErr::InitDplustoKpipi2010PbPb4080() {
979   // 
980   // D+->Kpipi syst errors. Responsible: ??
981   //  2010 PbPb sample, 40-80 CC
982   //
983   
984
985  // Normalization
986   fNorm = new TH1F("fNorm","fNorm",20,0,20);
987   for(Int_t i=1;i<=24;i++) fNorm->SetBinContent(i,0.07); // TAA and pp norm
988
989   // Branching ratio 
990   fBR = new TH1F("fBR","fBR",20,0,20);
991   for(Int_t i=1;i<=20;i++) fBR->SetBinContent(i,0.021); // 2.1% 
992
993   // Tracking efficiency
994   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",20,0,20);
995   for(Int_t i=1;i<=20;i++) fTrackingEff->SetBinContent(i,0.15); // Jacek, 5% per track
996
997
998   // Raw yield extraction
999   fRawYield = new TH1F("fRawYield","fRawYield",20,0,20);
1000   fRawYield->SetBinContent(1,1);
1001   fRawYield->SetBinContent(2,1);
1002   fRawYield->SetBinContent(3,1);
1003   fRawYield->SetBinContent(4,0.15);
1004   fRawYield->SetBinContent(5,0.05);
1005   fRawYield->SetBinContent(6,0.05);
1006   fRawYield->SetBinContent(7,0.15);
1007   fRawYield->SetBinContent(8,0.15);
1008   for(Int_t i=9;i<=12;i++) fRawYield->SetBinContent(i,0.15);
1009   for(Int_t i=13;i<=20;i++) fRawYield->SetBinContent(i,1);  //5 to 10%
1010
1011   // Cuts efficiency (from cuts variation)
1012   fCutsEff = new TH1F("fCutsEff","fCutsEff",20,0,20);
1013   for(Int_t i=1;i<=20;i++) fCutsEff->SetBinContent(i,0.10); // 10%
1014
1015   // PID efficiency (from PID/noPID)
1016   fPIDEff = new TH1F("fPIDEff","fPIDEff",20,0,20);
1017   for(Int_t i=1;i<=20;i++) fPIDEff->SetBinContent(i,0.05); // 5%
1018   fPIDEff->SetBinContent(3,0.13); // 13%
1019  
1020
1021   // MC dN/dpt  (2/2/2012)
1022   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",20,0,20);
1023   for(Int_t i=1;i<=20;i++) fMCPtShape->SetBinContent(i,0);
1024   for(Int_t iBin=4; iBin<=8; iBin++) fMCPtShape->SetBinContent(iBin,0.01);
1025   for(Int_t iBin=9; iBin<=12; iBin++) fMCPtShape->SetBinContent(iBin,0.03);
1026   for(Int_t iBin=13; iBin<=16; iBin++) fMCPtShape->SetBinContent(iBin,0.03);
1027
1028
1029   // particle-antiparticle
1030   /*
1031   fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",20,0,20);
1032   fPartAntipart->SetBinContent(1,1);
1033   fPartAntipart->SetBinContent(2,1);
1034   fPartAntipart->SetBinContent(3,0.12);
1035   for(Int_t i=4;i<=20;i++) fPartAntipart->SetBinContent(i,0.05);   //5 to 12%
1036   */
1037   return;
1038 }
1039
1040 //--------------------------------------------------------------------------
1041 void AliHFSystErr::InitDplustoKpipi2010ppLowEn() {
1042
1043   // 
1044   // D+->Kpipi syst errors. Responsible: R. Bala
1045   //  2011 2.76 TeV pp sample
1046   //
1047   AliInfo(" Settings for D+ --> K pi pi p-p collisions at 2.76 TeV"); 
1048
1049   // Normalization
1050   fNorm = new TH1F("fNorm","fNorm",20,0,20);
1051   for(Int_t i=1;i<=20;i++) fNorm->SetBinContent(i,0.031); // 10% error on sigmaV0and
1052
1053   // Branching ratio 
1054   fBR = new TH1F("fBR","fBR",20,0,20);
1055   for(Int_t i=1;i<=20;i++) fBR->SetBinContent(i,0.021); // 2.1% PDG2010
1056
1057   // Tracking efficiency
1058   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",20,0,20);
1059   for(Int_t i=1;i<=20;i++) fTrackingEff->SetBinContent(i,0.15); // 3% (1% per track)
1060
1061   // Raw yield extraction
1062   fRawYield = new TH1F("fRawYield","fRawYield",20,0,20);
1063   fRawYield->SetBinContent(1,1);
1064   fRawYield->SetBinContent(2,1);
1065   for(Int_t i=3;i<=6;i++) fRawYield->SetBinContent(i,0.10);  //5 to 10%
1066   fRawYield->SetBinContent(7,0.15);
1067   fRawYield->SetBinContent(8,0.15); 
1068   for(Int_t i=9;i<=20;i++) fRawYield->SetBinContent(i,0.055);  //5 to 10%
1069
1070   // Cuts efficiency (from cuts variation)
1071   fCutsEff = new TH1F("fCutsEff","fCutsEff",20,0,20);
1072   for(Int_t i=1;i<=20;i++) fCutsEff->SetBinContent(i,0.15); // 10%
1073
1074   // PID efficiency (from PID/noPID)
1075   fPIDEff = new TH1F("fPIDEff","fPIDEff",20,0,20);
1076   for(Int_t i=1;i<=20;i++) fPIDEff->SetBinContent(i,0.05); // 5%
1077   fPIDEff->SetBinContent(3,0.10); // 13%
1078   fPIDEff->SetBinContent(4,0.10); // 13%
1079  
1080   // MC dN/dpt  (copied from D0 : will update later)
1081   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",20,0,20);
1082   for(Int_t i=1;i<=20;i++) fMCPtShape->SetBinContent(i,0.01);
1083   fMCPtShape->SetBinContent(1,0.03);
1084   fMCPtShape->SetBinContent(2,0.03);
1085
1086   return;
1087 }
1088
1089 //_________________________________________________________________________
1090 void AliHFSystErr::InitDplustoKpipi2013pPb0100(){
1091   //
1092   // Dplus syst 
1093   AliInfo(" Settings for D+ --> K pi pi, p-Pb collisions at 5.023 TeV"); 
1094
1095   fNorm = new TH1F("fNorm","fNorm",24,0,24);
1096   for(Int_t i=1;i<=24;i++) fNorm->SetBinContent(i,0.00); // 
1097   
1098   fBR = new TH1F("fBR","fBR",20,0,20);
1099   for(Int_t i=1;i<=20;i++) fBR->SetBinContent(i,0.021); // 2.1% PDG2010
1100
1101   // Tracking efficiency
1102   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",24,0,24);
1103   for(Int_t i=1;i<=24;i++) fTrackingEff->SetBinContent(i,0.09); // 3% per track
1104   
1105   // Raw yield extraction
1106   fRawYield = new TH1F("fRawYield","fRawYield",24,0,24);
1107   fRawYield->SetBinContent(1,1);
1108   fRawYield->SetBinContent(2,1);
1109   fRawYield->SetBinContent(3,0.06);
1110   fRawYield->SetBinContent(4,0.12);
1111   fRawYield->SetBinContent(5,0.05);
1112   fRawYield->SetBinContent(6,0.04);
1113   fRawYield->SetBinContent(7,0.04);
1114   fRawYield->SetBinContent(8,0.04);
1115   for(Int_t i=9;i<=12;i++) fRawYield->SetBinContent(i,0.07);
1116   for(Int_t i=13;i<=16;i++) fRawYield->SetBinContent(i,0.17);
1117   for(Int_t i=17;i<=24;i++) fRawYield->SetBinContent(i,0.14);
1118
1119   // Cuts efficiency (from cuts variation)
1120   fCutsEff = new TH1F("fCutsEff","fCutsEff",24,0,24);
1121   fCutsEff->SetBinContent(1,1);
1122   fCutsEff->SetBinContent(2,1);
1123   fCutsEff->SetBinContent(3,0.07);
1124   fCutsEff->SetBinContent(4,0.04);
1125   fCutsEff->SetBinContent(5,0.04);
1126   fCutsEff->SetBinContent(6,0.08);
1127   fCutsEff->SetBinContent(7,0.08);
1128   fCutsEff->SetBinContent(8,0.08);
1129   for(Int_t i=9;i<=12;i++) fCutsEff->SetBinContent(i,0.08);
1130   for(Int_t i=13;i<=16;i++) fCutsEff->SetBinContent(i,0.08);
1131   for(Int_t i=17;i<=24;i++) fCutsEff->SetBinContent(i,0.1); 
1132
1133   // PID efficiency (from PID/noPID)
1134   fPIDEff = new TH1F("fPIDEff","fPIDEff",24,0,24);
1135   fPIDEff->SetBinContent(1,1);
1136   fPIDEff->SetBinContent(2,1);
1137   for(Int_t i=3;i<=12;i++) fPIDEff->SetBinContent(i,0.0); //
1138   for(Int_t i=12;i<=24;i++) fPIDEff->SetBinContent(i,0.05); // 5%
1139
1140   // MC dN/dpt
1141   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",24,0,24);
1142   for(Int_t i=1;i<=12;i++) fMCPtShape->SetBinContent(i,0.02);
1143   for(Int_t i=13;i<=24;i++) fMCPtShape->SetBinContent(i,0.04);
1144
1145   // particle-antiparticle
1146   /*
1147   fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",20,0,20);
1148   fPartAntipart->SetBinContent(1,1);
1149   fPartAntipart->SetBinContent(2,1);
1150   fPartAntipart->SetBinContent(3,0.12);
1151   for(Int_t i=4;i<=20;i++) fPartAntipart->SetBinContent(i,0.05);   //5 to 12%
1152   */
1153   return;
1154
1155
1156 }
1157
1158 //--------------------------------------------------------------------------
1159 void AliHFSystErr::InitDstartoD0pi2010pp() {
1160   // 
1161   // D*+->D0pi syst errors. Responsible: A. Grelli, Y. Wang
1162   //  2010 pp sample
1163   //
1164
1165  // Normalization
1166   fNorm = new TH1F("fNorm","fNorm",24,0,24);
1167   for(Int_t i=1;i<=24;i++) fNorm->SetBinContent(i,0.035); // 4% error on sigmaV0and
1168
1169   // Branching ratio 
1170   fBR = new TH1F("fBR","fBR",24,0,24);
1171   for(Int_t i=1;i<=24;i++) fBR->SetBinContent(i,0.015); // 1.5% PDG2010
1172
1173   // Tracking efficiency
1174   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",24,0,24);
1175   fTrackingEff->SetBinContent(1,1.0);
1176   fTrackingEff->SetBinContent(2,0.13); // 10% (ITSsa) \oplus 8% (4% per ITSTPC track)
1177   fTrackingEff->SetBinContent(3,0.12);
1178   fTrackingEff->SetBinContent(3,0.12);
1179   for(Int_t i=4;i<=24;i++) fTrackingEff->SetBinContent(i,0.12); // 12% (4% per track)
1180
1181
1182   // Raw yield extraction
1183   fRawYield = new TH1F("fRawYield","fRawYield",24,0,24);
1184   fRawYield->SetBinContent(1,1.0);
1185   fRawYield->SetBinContent(2,0.10);
1186   fRawYield->SetBinContent(3,0.04);
1187   fRawYield->SetBinContent(4,0.03);
1188   fRawYield->SetBinContent(5,0.03);
1189   fRawYield->SetBinContent(6,0.05);
1190   fRawYield->SetBinContent(7,0.05);
1191   fRawYield->SetBinContent(8,0.05);
1192   for(Int_t i=9;i<=12;i++) fRawYield->SetBinContent(i,0.04);  //4%
1193   for(Int_t i=13;i<=16;i++) fRawYield->SetBinContent(i,0.09);  //4%
1194   for(Int_t i=17;i<=24;i++) fRawYield->SetBinContent(i,0.2);  //4%
1195
1196   // Cuts efficiency (from cuts variation)
1197   fCutsEff = new TH1F("fCutsEff","fCutsEff",24,0,24);
1198   fCutsEff->SetBinContent(2,0.22);
1199   for(Int_t i=3;i<=24;i++) fCutsEff->SetBinContent(i,0.10); // 10%
1200
1201   // PID efficiency (from PID/noPID)
1202   fPIDEff = new TH1F("fPIDEff","fPIDEff",24,0,24);
1203   for(Int_t i=1;i<=24;i++) fPIDEff->SetBinContent(i,0.04); // 3%
1204  
1205
1206   // MC dN/dpt  (copied from D0 : will update later)
1207   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",24,0,24);
1208   for(Int_t i=1;i<=24;i++) fMCPtShape->SetBinContent(i,0);
1209   fMCPtShape->SetBinContent(1,0.03);
1210   fMCPtShape->SetBinContent(2,0.03);
1211
1212   return;
1213
1214
1215 }
1216 //--------------------------------------------------------------------------
1217 void AliHFSystErr::InitDstartoD0pi2010ppLowEn() {
1218
1219   // 
1220   // D+->Kpipi syst errors. Responsible: A. Grelli
1221   //  2011 2.76 TeV pp sample
1222   //
1223   AliInfo(" Settings for D*+ --> D0 pi p-p collisions at 2.76 TeV"); 
1224
1225 // Normalization
1226   fNorm = new TH1F("fNorm","fNorm",20,0,20);
1227   for(Int_t i=1;i<=20;i++) fNorm->SetBinContent(i,0.031); // 10% error on sigmaV0and
1228
1229   // Branching ratio 
1230   fBR = new TH1F("fBR","fBR",20,0,20);
1231   for(Int_t i=1;i<=20;i++) fBR->SetBinContent(i,0.015); // 1.5% PDG2010
1232
1233   // Tracking efficiency
1234   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",20,0,20);
1235   for(Int_t i=1;i<=20;i++) fTrackingEff->SetBinContent(i,0.15); //10% (to be checked!!)
1236
1237   // Raw yield extraction
1238   fRawYield = new TH1F("fRawYield","fRawYield",20,0,20);
1239   fRawYield->SetBinContent(1,1);
1240   fRawYield->SetBinContent(2,1);
1241   fRawYield->SetBinContent(3,0.14);
1242   fRawYield->SetBinContent(4,0.14);
1243   fRawYield->SetBinContent(5,0.12);
1244   fRawYield->SetBinContent(6,0.12);
1245   fRawYield->SetBinContent(7,0.06);
1246   fRawYield->SetBinContent(8,0.06);
1247   fRawYield->SetBinContent(9,0.08);
1248   fRawYield->SetBinContent(10,0.08);
1249   fRawYield->SetBinContent(11,0.08);
1250   fRawYield->SetBinContent(12,0.08);
1251   for(Int_t i=9;i<=20;i++) fRawYield->SetBinContent(i,0.065);
1252
1253   // Cuts efficiency (from cuts variation)
1254   fCutsEff = new TH1F("fCutsEff","fCutsEff",20,0,20);
1255   for(Int_t i=1;i<=20;i++) fCutsEff->SetBinContent(i,0.10);  
1256   fCutsEff->SetBinContent(3,0.15);
1257   fCutsEff->SetBinContent(4,0.15);
1258   fCutsEff->SetBinContent(5,0.15);
1259   fCutsEff->SetBinContent(6,0.15);
1260   fCutsEff->SetBinContent(7,0.10);
1261   fCutsEff->SetBinContent(8,0.10);
1262   fCutsEff->SetBinContent(9,0.10);
1263   fCutsEff->SetBinContent(10,0.10);
1264   fCutsEff->SetBinContent(11,0.10);
1265   fCutsEff->SetBinContent(12,0.10);
1266
1267   // PID efficiency (from PID/noPID)
1268   fPIDEff = new TH1F("fPIDEff","fPIDEff",20,0,20);
1269   for(Int_t i=1;i<=20;i++) fPIDEff->SetBinContent(i,0.05); // 10%
1270
1271   // MC dN/dpt
1272   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",20,0,20);
1273   for(Int_t i=1;i<=20;i++) fMCPtShape->SetBinContent(i,0.01);
1274   fMCPtShape->SetBinContent(1,0.03);
1275   fMCPtShape->SetBinContent(2,0.03);
1276
1277   return;
1278 }
1279
1280 //------------------------------------------------------------------------
1281 void AliHFSystErr::InitDstartoD0pi2010PbPb020() {
1282   // 
1283   // D*+->D0pi syst errors. Responsible: A. Grelli
1284   //  2010 PbPb sample, 0-20 CC
1285   //
1286
1287   AliInfo(" Settings for D*+ --> D0pi Pb-Pb collisions at 2.76 TeV - 0-20 centrality - DUMMY"); 
1288
1289  // Normalization
1290   fNorm = new TH1F("fNorm","fNorm",24,0,24);
1291   for(Int_t i=1;i<=20;i++) fNorm->SetBinContent(i,0.05); // TAA and pp norm
1292
1293   // Branching ratio 
1294   fBR = new TH1F("fBR","fBR",24,0,24);
1295   for(Int_t i=1;i<=24;i++) fBR->SetBinContent(i,0.015); // 1.5% PDG2010
1296
1297   // Tracking efficiency
1298   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",24,0,24);;
1299   for(Int_t i=1;i<=24;i++) fTrackingEff->SetBinContent(i,0.15); // Jacek, 5% per track
1300
1301
1302   // Raw yield extraction
1303   fRawYield = new TH1F("fRawYield","fRawYield",24,0,24);
1304   for(Int_t i=1;i<=24;i++) fRawYield->SetBinContent(i,0.1);  //4%
1305   fRawYield->SetBinContent(3,0.2);
1306   fRawYield->SetBinContent(4,0.2);
1307   fRawYield->SetBinContent(5,0.2);
1308   fRawYield->SetBinContent(6,0.2);
1309  
1310   // Cuts efficiency (from cuts variation)
1311   fCutsEff = new TH1F("fCutsEff","fCutsEff",24,0,24);
1312   for(Int_t i=1;i<=24;i++) fCutsEff->SetBinContent(i,0.10); // 10%
1313   fCutsEff->SetBinContent(4,0.15);
1314   fCutsEff->SetBinContent(5,0.15);
1315   fCutsEff->SetBinContent(6,0.15);
1316
1317   // PID efficiency (from PID/noPID)
1318   fPIDEff = new TH1F("fPIDEff","fPIDEff",24,0,24);
1319   for(Int_t i=1;i<=24;i++) fPIDEff->SetBinContent(i,0.05); // 3%
1320  
1321
1322   // MC dN/dpt  (from study on D* pt shape)
1323   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",24,0,24);
1324   for(Int_t i=1;i<=24;i++) fMCPtShape->SetBinContent(i,0.045);
1325   fMCPtShape->SetBinContent(4,0.025);
1326   fMCPtShape->SetBinContent(5,0.025);
1327   fMCPtShape->SetBinContent(6,0.025);
1328   fMCPtShape->SetBinContent(7,0.04);
1329   fMCPtShape->SetBinContent(8,0.04);
1330   fMCPtShape->SetBinContent(9,0.03);
1331   fMCPtShape->SetBinContent(10,0.03);
1332   fMCPtShape->SetBinContent(11,0.03);
1333   fMCPtShape->SetBinContent(12,0.03);
1334   
1335   return;
1336
1337 }
1338 // ----------------------------- 2011 ----------------------------------
1339 void AliHFSystErr::InitDstartoD0pi2011PbPb07half() {
1340   // 
1341   // D*+->D0pi syst errors. Responsible: A. Grelli
1342   //  2011 PbPb sample, 0-7.5 CC
1343   //
1344
1345   AliInfo(" Settings for D*+ --> D0pi Pb-Pb collisions at 2.76 TeV - 0-7.5 centrality - DUMMY"); 
1346
1347
1348  // Normalization
1349   fNorm = new TH1F("fNorm","fNorm",36,0,36);
1350   for(Int_t i=1;i<=36;i++) fNorm->SetBinContent(i,0.048); // TAA and pp norm
1351
1352   // Branching ratio 
1353   fBR = new TH1F("fBR","fBR",36,0,36);
1354   for(Int_t i=1;i<=36;i++) fBR->SetBinContent(i,0.015); // 1.5% PDG2010
1355
1356   // Tracking efficiency
1357   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",36,0,36);;
1358   for(Int_t i=1;i<=36;i++) fTrackingEff->SetBinContent(i,0.15); // Jacek, 5% per track
1359
1360
1361   // Raw yield extraction
1362   fRawYield = new TH1F("fRawYield","fRawYield",36,0,36);
1363   for(Int_t i=1;i<=36;i++) fRawYield->SetBinContent(i,0.05);  //4%
1364   fRawYield->SetBinContent(4,0.2);
1365   fRawYield->SetBinContent(5,0.10);
1366   fRawYield->SetBinContent(6,0.10);
1367   fRawYield->SetBinContent(7,0.08);
1368   for(Int_t i=25;i<=36;i++) fRawYield->SetBinContent(i,0.15);  //4%
1369
1370   // Cuts efficiency (from cuts variation)
1371   fCutsEff = new TH1F("fCutsEff","fCutsEff",36,0,36);
1372   for(Int_t i=1;i<=36;i++) fCutsEff->SetBinContent(i,0.10); // 10%
1373
1374   // PID efficiency (from PID/noPID)
1375   fPIDEff = new TH1F("fPIDEff","fPIDEff",36,0,36);
1376   for(Int_t i=1;i<=36;i++) fPIDEff->SetBinContent(i,0.05); // 3%
1377   fPIDEff->SetBinContent(4,0.09);
1378
1379   // MC dN/dpt  (from study on D* pt shape)
1380   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",36,0,36);
1381   for(Int_t i=1;i<=36;i++) fMCPtShape->SetBinContent(i,0.035);
1382   fMCPtShape->SetBinContent(4,0.015);
1383   fMCPtShape->SetBinContent(5,0.015);
1384   fMCPtShape->SetBinContent(6,0.015);
1385   fMCPtShape->SetBinContent(7,0.02);
1386   fMCPtShape->SetBinContent(8,0.02);
1387   fMCPtShape->SetBinContent(9,0.03);
1388   fMCPtShape->SetBinContent(10,0.03);
1389   fMCPtShape->SetBinContent(11,0.03);
1390   fMCPtShape->SetBinContent(12,0.03);
1391   
1392   
1393
1394   return;
1395
1396 }
1397 //-------------------------------------------------------------------------
1398 void AliHFSystErr::InitDstartoD0pi2010PbPb2040() {
1399   // 
1400   // D*+->D0pi syst errors. Responsible: A. Grelli
1401   //  2010 PbPb sample, 20-40 CC
1402   //
1403
1404   AliInfo(" Settings for D*+ --> D0pi Pb-Pb collisions at 2.76 TeV - 20-40 centrality - DUMMY"); 
1405
1406  // Normalization
1407   fNorm = new TH1F("fNorm","fNorm",24,0,24);
1408   for(Int_t i=1;i<=24;i++) fNorm->SetBinContent(i,0.10); // 10% error on sigmaV0and
1409
1410   // Branching ratio 
1411   fBR = new TH1F("fBR","fBR",24,0,24);
1412   for(Int_t i=1;i<=24;i++) fBR->SetBinContent(i,0.015); // 1.5% PDG2010
1413
1414   // Tracking efficiency
1415   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",24,0,24);;
1416   for(Int_t i=1;i<=24;i++) fTrackingEff->SetBinContent(i,0.15); // Jacek, 5% per track
1417
1418
1419   // Raw yield extraction
1420   fRawYield = new TH1F("fRawYield","fRawYield",24,0,24);
1421   for(Int_t i=1;i<=24;i++) fRawYield->SetBinContent(i,0.15);  //4%
1422  
1423   // Cuts efficiency (from cuts variation)
1424   fCutsEff = new TH1F("fCutsEff","fCutsEff",24,0,24);
1425   for(Int_t i=1;i<=24;i++) fCutsEff->SetBinContent(i,0.10); // 10%
1426
1427   // PID efficiency (from PID/noPID)
1428   fPIDEff = new TH1F("fPIDEff","fPIDEff",24,0,24);
1429   for(Int_t i=1;i<=24;i++) fPIDEff->SetBinContent(i,0.04); // 3%
1430  
1431
1432   // MC dN/dpt  (copied from D0 : will update later)
1433   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",24,0,24);
1434   for(Int_t i=1;i<=24;i++) fMCPtShape->SetBinContent(i,0.);
1435   fMCPtShape->SetBinContent(1,0.03);
1436   fMCPtShape->SetBinContent(2,0.03);
1437
1438   return;
1439
1440 }
1441
1442 //--------------------------------------------------------------------------
1443 void AliHFSystErr::InitDstartoD0pi2010PbPb4080() {
1444   // 
1445   // D*+->D0pi syst errors. Responsible: A. Grelli
1446   //  2010 PbPb sample, 40-80 CC
1447   //
1448
1449   AliInfo(" Settings for D*+ --> D0pi Pb-Pb collisions at 2.76 TeV - 40-80 centrality - DUMMY"); 
1450
1451  // Normalization
1452   fNorm = new TH1F("fNorm","fNorm",24,0,24);
1453   for(Int_t i=1;i<=24;i++) fNorm->SetBinContent(i,0.07); // TAA and pp norm
1454
1455   // Branching ratio 
1456   fBR = new TH1F("fBR","fBR",24,0,24);
1457   for(Int_t i=1;i<=24;i++) fBR->SetBinContent(i,0.015); // 1.5% PDG2010
1458
1459   // Tracking efficiency
1460   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",24,0,24);;
1461   for(Int_t i=1;i<=24;i++) fTrackingEff->SetBinContent(i,0.15); // Jacek, 5% per track
1462
1463
1464   // Raw yield extraction
1465   fRawYield = new TH1F("fRawYield","fRawYield",24,0,24);
1466   for(Int_t i=1;i<=24;i++) fRawYield->SetBinContent(i,0.2);  //4%
1467   fRawYield->SetBinContent(1,1);
1468   fRawYield->SetBinContent(2,0.15);
1469   fRawYield->SetBinContent(3,0.15);
1470   fRawYield->SetBinContent(4,0.15);
1471   fRawYield->SetBinContent(5,0.15);
1472   fRawYield->SetBinContent(6,0.10);
1473   fRawYield->SetBinContent(7,0.10);
1474   fRawYield->SetBinContent(8,0.10);
1475   fRawYield->SetBinContent(9,0.11);
1476   fRawYield->SetBinContent(10,0.11);
1477   fRawYield->SetBinContent(11,0.11);
1478   fRawYield->SetBinContent(12,0.11);
1479   fRawYield->SetBinContent(13,0.08);
1480   fRawYield->SetBinContent(14,0.08);
1481   fRawYield->SetBinContent(15,0.08);
1482   fRawYield->SetBinContent(16,0.08);
1483
1484
1485   // Cuts efficiency (from cuts variation)
1486   fCutsEff = new TH1F("fCutsEff","fCutsEff",24,0,24);
1487   for(Int_t i=1;i<=24;i++) fCutsEff->SetBinContent(i,0.10); // 10%
1488
1489   // PID efficiency (from PID/noPID)
1490   fPIDEff = new TH1F("fPIDEff","fPIDEff",24,0,24);
1491   for(Int_t i=1;i<=24;i++) fPIDEff->SetBinContent(i,0.05); // 3%
1492  
1493
1494   // MC dN/dpt  (copied from D0 : will update later)
1495   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",24,0,24);
1496   for(Int_t i=1;i<=24;i++) fMCPtShape->SetBinContent(i,0.01);
1497   fMCPtShape->SetBinContent(2,0.05);
1498   fMCPtShape->SetBinContent(3,0.05);
1499   fMCPtShape->SetBinContent(4,0.05);
1500   fMCPtShape->SetBinContent(5,0.04);
1501   fMCPtShape->SetBinContent(6,0.02);
1502   fMCPtShape->SetBinContent(7,0.04);
1503   fMCPtShape->SetBinContent(8,0.04);
1504  
1505   return;
1506
1507 }
1508
1509 //_________________________________________________________________________
1510 void AliHFSystErr::InitDstartoD0pi2013pPb0100(){
1511   // Dstar syst in pPb 2013 MB
1512   //
1513   AliInfo(" Settings for D* --> D0 pi, p-Pb collisions at 5.023 TeV"); 
1514
1515   //Normalization
1516   fNorm = new TH1F("fNorm","fNorm",24,0,24);
1517   for(Int_t i=1;i<=24;i++) fNorm->SetBinContent(i,0.00); // 
1518   
1519   // Branching ratio
1520   fBR = new TH1F("fBR","fBR",24,0,24);
1521   for(Int_t i=1;i<=24;i++) fBR->SetBinContent(i,0.015); // 1.5% PDG2010
1522
1523   // Tracking efficiency
1524   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",24,0,24);
1525   for(Int_t i=1;i<=24;i++) fTrackingEff->SetBinContent(i,0.09); // 3% per track
1526
1527   // Raw yield extraction
1528   fRawYield = new TH1F("fRawYield","fRawYield",24,0,24);
1529   fRawYield->SetBinContent(1,1.0);
1530   fRawYield->SetBinContent(2,0.10);
1531   fRawYield->SetBinContent(3,0.05);
1532   fRawYield->SetBinContent(4,0.02);
1533   fRawYield->SetBinContent(5,0.02);
1534   fRawYield->SetBinContent(6,0.04);
1535   fRawYield->SetBinContent(7,0.04);
1536   fRawYield->SetBinContent(8,0.04);
1537   for(Int_t i=9;i<=12;i++) fRawYield->SetBinContent(i,0.04); 
1538   for(Int_t i=13;i<=16;i++) fRawYield->SetBinContent(i,0.06);
1539   for(Int_t i=17;i<=24;i++) fRawYield->SetBinContent(i,0.06);
1540
1541   // Cuts efficiency (from cuts variation)
1542   fCutsEff = new TH1F("fCutsEff","fCutsEff",24,0,24);
1543   fCutsEff->SetBinContent(1,0.);
1544   fCutsEff->SetBinContent(2,0.10);
1545   for(Int_t i=3;i<=24;i++) fCutsEff->SetBinContent(i,0.05);
1546
1547   // PID efficiency (from PID/noPID)
1548   fPIDEff = new TH1F("fPIDEff","fPIDEff",24,0,24);
1549   fPIDEff->SetBinContent(1,0.0);
1550   fPIDEff->SetBinContent(2,0.05);
1551   for(Int_t i=3;i<=12;i++) fPIDEff->SetBinContent(i,0.00);
1552   for(Int_t i=12;i<=24;i++) fPIDEff->SetBinContent(i,0.05);
1553
1554   // MC dN/dpt  
1555   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",24,0,24);
1556   for(Int_t i=1;i<=3;i++) fMCPtShape->SetBinContent(i,0.02);
1557   for(Int_t i=4;i<=8;i++) fMCPtShape->SetBinContent(i,0.);
1558   for(Int_t i=9;i<=24;i++) fMCPtShape->SetBinContent(i,0.01);
1559
1560   // particle-antiparticle
1561   /*
1562   fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",20,0,20);
1563   fPartAntipart->SetBinContent(1,1);
1564   fPartAntipart->SetBinContent(2,1);
1565   fPartAntipart->SetBinContent(3,0.12);
1566   for(Int_t i=4;i<=20;i++) fPartAntipart->SetBinContent(i,0.05);   //5 to 12%
1567   */
1568   return;
1569
1570
1571 }
1572
1573 //--------------------------------------------------------------------------
1574 void AliHFSystErr::InitD0toKpi2010PbPb010CentScan(){
1575   // define errors for RAA vs. centrality
1576   InitD0toKpi2010PbPb020();
1577   for(Int_t i=7;i<=12;i++) fRawYield->SetBinContent(i,0.05);
1578   for(Int_t i=3;i<=5;i++) fMCPtShape->SetBinContent(i,0.17);      
1579   for(Int_t i=7;i<=12;i++) fMCPtShape->SetBinContent(i,0.08); 
1580 }
1581 //--------------------------------------------------------------------------
1582 void AliHFSystErr::InitD0toKpi2010PbPb1020CentScan(){
1583   // define errors for RAA vs. centrality
1584   InitD0toKpi2010PbPb020();
1585   for(Int_t i=7;i<=12;i++) fRawYield->SetBinContent(i,0.05);
1586   for(Int_t i=3;i<=5;i++)  fMCPtShape->SetBinContent(i,0.17);    
1587   for(Int_t i=7;i<=12;i++) fMCPtShape->SetBinContent(i,0.08); 
1588 }
1589 //--------------------------------------------------------------------------
1590 void AliHFSystErr::InitD0toKpi2010PbPb2040CentScan(){
1591   // define errors for RAA vs. centrality
1592   InitD0toKpi2010PbPb4080();
1593   for(Int_t i=7;i<=12;i++) fRawYield->SetBinContent(i,0.05);
1594   for(Int_t i=3;i<=5;i++)  fMCPtShape->SetBinContent(i,0.14);
1595   for(Int_t i=7;i<=12;i++) fMCPtShape->SetBinContent(i,0.08); 
1596 }
1597 //--------------------------------------------------------------------------
1598 void AliHFSystErr::InitD0toKpi2010PbPb4060CentScan(){
1599    // define errors for RAA vs. centrality
1600   InitD0toKpi2010PbPb4080();
1601   for(Int_t i=7;i<=12;i++) fRawYield->SetBinContent(i,0.06);
1602   for(Int_t i=3;i<=5;i++)  fMCPtShape->SetBinContent(i,0.11);  
1603   for(Int_t i=7;i<=12;i++) fMCPtShape->SetBinContent(i,0.08); 
1604 }
1605 //--------------------------------------------------------------------------
1606 void AliHFSystErr::InitD0toKpi2010PbPb6080CentScan(){
1607    // define errors for RAA vs. centrality
1608   InitD0toKpi2010PbPb4080();
1609   for(Int_t i=7;i<=12;i++) fRawYield->SetBinContent(i,0.08);
1610   for(Int_t i=3;i<=5;i++) fMCPtShape->SetBinContent(i,0.08);
1611   for(Int_t i=7;i<=12;i++) fMCPtShape->SetBinContent(i,0.08); 
1612 }
1613 //--------------------------------------------------------------------------
1614 void AliHFSystErr::InitDplustoKpipi2010PbPb010CentScan(){
1615   // define errors for RAA vs. centrality
1616   InitDplustoKpipi2010PbPb020();
1617   for(Int_t i=7;i<=12;i++) fRawYield->SetBinContent(i,0.18);
1618   for(Int_t i=7;i<=12;i++) fMCPtShape->SetBinContent(i,0.09);
1619
1620 }
1621 //--------------------------------------------------------------------------
1622 void AliHFSystErr::InitDplustoKpipi2010PbPb1020CentScan(){
1623   // define errors for RAA vs. centrality
1624   InitDplustoKpipi2010PbPb020();
1625   for(Int_t i=7;i<=12;i++) fRawYield->SetBinContent(i,0.23);
1626   for(Int_t i=7;i<=12;i++) fMCPtShape->SetBinContent(i,0.08);
1627 }
1628 //--------------------------------------------------------------------------
1629 void AliHFSystErr::InitDplustoKpipi2010PbPb2040CentScan(){
1630   // define errors for RAA vs. centrality
1631   InitDplustoKpipi2010PbPb020();
1632   for(Int_t i=7;i<=12;i++) fRawYield->SetBinContent(i,0.08);
1633   for(Int_t i=7;i<=12;i++) fMCPtShape->SetBinContent(i,0.095);
1634 }
1635 //--------------------------------------------------------------------------
1636 void AliHFSystErr::InitDplustoKpipi2010PbPb4060CentScan(){
1637   // define errors for RAA vs. centrality
1638   InitDplustoKpipi2010PbPb4080();
1639   for(Int_t i=7;i<=12;i++) fRawYield->SetBinContent(i,0.08);
1640   for(Int_t i=7;i<=12;i++) fMCPtShape->SetBinContent(i,0.08);
1641 }
1642 //--------------------------------------------------------------------------
1643 void AliHFSystErr::InitDplustoKpipi2010PbPb6080CentScan(){
1644   // define errors for RAA vs. centrality
1645   InitDplustoKpipi2010PbPb4080();
1646   for(Int_t i=7;i<=12;i++) fRawYield->SetBinContent(i,0.15);
1647   for(Int_t i=7;i<=12;i++) fMCPtShape->SetBinContent(i,0.07);
1648 }
1649
1650 //--------------------------------------------------------------------------
1651 void AliHFSystErr::InitDstartoD0pi2010PbPb010CentScan(){
1652   // define errors for RAA vs. centrality
1653   InitDstartoD0pi2010PbPb020();
1654   for(Int_t i=7;i<=12;i++) fRawYield->SetBinContent(i,0.16); 
1655   for(Int_t i=7;i<=12;i++) fMCPtShape->SetBinContent(i,0.15);
1656 }
1657 //--------------------------------------------------------------------------
1658 void AliHFSystErr::InitDstartoD0pi2010PbPb1020CentScan(){
1659   // define errors for RAA vs. centrality
1660   InitDstartoD0pi2010PbPb020();
1661   for(Int_t i=7;i<=12;i++) fRawYield->SetBinContent(i,0.05); 
1662   for(Int_t i=7;i<=12;i++) fMCPtShape->SetBinContent(i,0.15);
1663 }
1664 //--------------------------------------------------------------------------
1665 void AliHFSystErr::InitDstartoD0pi2010PbPb2040CentScan(){
1666   // define errors for RAA vs. centrality
1667   InitDstartoD0pi2010PbPb2040();
1668   for(Int_t i=7;i<=12;i++) fRawYield->SetBinContent(i,0.10); 
1669   for(Int_t i=7;i<=12;i++) fMCPtShape->SetBinContent(i,0.08);
1670 }
1671 //--------------------------------------------------------------------------
1672 void AliHFSystErr::InitDstartoD0pi2010PbPb4060CentScan(){
1673   // define errors for RAA vs. centrality
1674   InitDstartoD0pi2010PbPb4080();
1675   for(Int_t i=7;i<=12;i++) fRawYield->SetBinContent(i,0.10); 
1676   for(Int_t i=7;i<=12;i++) fMCPtShape->SetBinContent(i,0.045);
1677 }
1678 //--------------------------------------------------------------------------
1679 void AliHFSystErr::InitDstartoD0pi2010PbPb6080CentScan(){
1680   // define errors for RAA vs. centrality
1681   InitDstartoD0pi2010PbPb4080();
1682   for(Int_t i=7;i<=12;i++) fRawYield->SetBinContent(i,0.10); 
1683   for(Int_t i=7;i<=12;i++) fMCPtShape->SetBinContent(i,0.045);
1684 }
1685
1686 //--------------------------------------------------------------------------
1687 void AliHFSystErr::InitD0toKpi2011PbPb010CentScan(){
1688   // define errors for RAA vs. centrality 2011
1689   InitD0toKpi2011PbPb07half();
1690   
1691 }
1692 //--------------------------------------------------------------------------
1693 void AliHFSystErr::InitD0toKpi2011PbPb1020CentScan(){
1694   // define errors for RAA vs. centrality 2011
1695   InitD0toKpi2011PbPb07half();
1696   
1697 }
1698 //--------------------------------------------------------------------------
1699 void AliHFSystErr::InitD0toKpi2011PbPb2030CentScan(){
1700   // define errors for RAA vs. centrality 2011
1701   InitD0toKpi2011PbPb07half();
1702   
1703 }
1704 //--------------------------------------------------------------------------
1705 void AliHFSystErr::InitD0toKpi2011PbPb3040CentScan(){
1706   // define errors for RAA vs. centrality 2011
1707   InitD0toKpi2011PbPb07half();
1708   
1709 }
1710 //--------------------------------------------------------------------------
1711 void AliHFSystErr::InitD0toKpi2011PbPb4050CentScan(){
1712   // define errors for RAA vs. centrality 2011
1713   InitD0toKpi2011PbPb07half();
1714   
1715 }
1716 //--------------------------------------------------------------------------
1717 void AliHFSystErr::InitD0toKpi2010PbPb5080CentScan(){
1718   // define errors for RAA vs. centrality 2011
1719   InitD0toKpi2011PbPb07half();
1720   
1721 }
1722
1723 //--------------------------------------------------------------------------
1724 void AliHFSystErr::InitDplustoKpipi2011PbPb010CentScan(){
1725   // define errors for RAA vs. centrality 2011
1726   InitDplustoKpipi2011PbPb07half();
1727
1728   for(Int_t i=2;i<=5;i++) fRawYield->SetBinContent(i,0.15);
1729   for(Int_t i=5;i<=8;i++) fRawYield->SetBinContent(i,0.05);
1730   for(Int_t i=9;i<=17;i++) fRawYield->SetBinContent(i,0.15);
1731
1732   for(Int_t i=2;i<=5;i++) fMCPtShape->SetBinContent(i,0.10);
1733   for(Int_t i=5;i<=8;i++) fMCPtShape->SetBinContent(i,0.05);
1734   for(Int_t i=9;i<=17;i++) fMCPtShape->SetBinContent(i,0.05);
1735
1736   for(Int_t i=2;i<=5;i++) fCutsEff->SetBinContent(i,0.15);
1737   for(Int_t i=5;i<=8;i++) fCutsEff->SetBinContent(i,0.20);
1738   for(Int_t i=9;i<=17;i++) fCutsEff->SetBinContent(i,0.10);
1739 }
1740
1741 //--------------------------------------------------------------------------
1742 void AliHFSystErr::InitDplustoKpipi2011PbPb1020CentScan(){
1743   // define errors for RAA vs. centrality 2011
1744   InitDplustoKpipi2011PbPb07half();
1745
1746   for(Int_t i=2;i<=5;i++) fRawYield->SetBinContent(i,0.10);
1747   for(Int_t i=5;i<=8;i++) fRawYield->SetBinContent(i,0.10);
1748   for(Int_t i=9;i<=17;i++)fRawYield->SetBinContent(i,0.15);
1749
1750   for(Int_t i=2;i<=5;i++) fMCPtShape->SetBinContent(i,0.10);
1751   for(Int_t i=5;i<=8;i++) fMCPtShape->SetBinContent(i,0.05);
1752   for(Int_t i=9;i<=17;i++) fMCPtShape->SetBinContent(i,0.05);
1753   
1754   for(Int_t i=2;i<=5;i++) fCutsEff->SetBinContent(i,0.15);
1755   for(Int_t i=5;i<=8;i++) fCutsEff->SetBinContent(i,0.20);
1756   for(Int_t i=9;i<=17;i++) fCutsEff->SetBinContent(i,0.15);
1757 }
1758
1759 //--------------------------------------------------------------------------
1760 void AliHFSystErr::InitDplustoKpipi2011PbPb2030CentScan(){
1761   // define errors for RAA vs. centrality 2011
1762   InitDplustoKpipi2011PbPb07half();
1763   
1764   for(Int_t i=2;i<=5;i++) fRawYield->SetBinContent(i,0.10);
1765   for(Int_t i=5;i<=8;i++) fRawYield->SetBinContent(i,0.10);
1766   for(Int_t i=9;i<=17;i++) fRawYield->SetBinContent(i,0.08);
1767
1768   for(Int_t i=2;i<=5;i++) fMCPtShape->SetBinContent(i,0.10);
1769   for(Int_t i=5;i<=8;i++) fMCPtShape->SetBinContent(i,0.05);
1770   for(Int_t i=9;i<=17;i++) fMCPtShape->SetBinContent(i,0.05);
1771   
1772   for(Int_t i=2;i<=5;i++) fCutsEff->SetBinContent(i,0.20);
1773   for(Int_t i=5;i<=8;i++) fCutsEff->SetBinContent(i,0.15);
1774   for(Int_t i=9;i<=17;i++) fCutsEff->SetBinContent(i,0.20);
1775 }
1776
1777 //--------------------------------------------------------------------------
1778 void AliHFSystErr::InitDplustoKpipi2011PbPb3040CentScan(){
1779   // define errors for RAA vs. centrality 2011
1780   InitDplustoKpipi2011PbPb07half();
1781
1782   for(Int_t i=2;i<=5;i++) fRawYield->SetBinContent(i,0.20);
1783   for(Int_t i=5;i<=8;i++) fRawYield->SetBinContent(i,0.10);
1784   for(Int_t i=9;i<=17;i++) fRawYield->SetBinContent(i,0.20);
1785
1786   for(Int_t i=2;i<=5;i++) fMCPtShape->SetBinContent(i,0.10);
1787   for(Int_t i=5;i<=8;i++) fMCPtShape->SetBinContent(i,0.05);
1788   for(Int_t i=9;i<=17;i++) fMCPtShape->SetBinContent(i,0.05);
1789
1790   for(Int_t i=2;i<=5;i++) fCutsEff->SetBinContent(i,0.20);
1791   for(Int_t i=5;i<=8;i++) fCutsEff->SetBinContent(i,0.20);
1792   for(Int_t i=9;i<=17;i++) fCutsEff->SetBinContent(i,0.20);
1793 }
1794
1795 //--------------------------------------------------------------------------
1796 void AliHFSystErr::InitDplustoKpipi2011PbPb4050CentScan(){
1797   // define errors for RAA vs. centrality 2011
1798   InitDplustoKpipi2011PbPb07half();
1799
1800   for(Int_t i=2;i<=5;i++) fRawYield->SetBinContent(i,0.10);
1801   for(Int_t i=5;i<=8;i++) fRawYield->SetBinContent(i,0.10);
1802   for(Int_t i=9;i<=17;i++) fRawYield->SetBinContent(i,0.05);
1803
1804   for(Int_t i=2;i<=5;i++) fMCPtShape->SetBinContent(i,0.10);
1805   for(Int_t i=5;i<=8;i++) fMCPtShape->SetBinContent(i,0.05);
1806   for(Int_t i=9;i<=17;i++) fMCPtShape->SetBinContent(i,0.05);
1807
1808   for(Int_t i=2;i<=5;i++) fCutsEff->SetBinContent(i,0.20);
1809   for(Int_t i=5;i<=8;i++) fCutsEff->SetBinContent(i,0.15);
1810   for(Int_t i=9;i<=17;i++) fCutsEff->SetBinContent(i,0.20);
1811 }
1812
1813 //--------------------------------------------------------------------------
1814 void AliHFSystErr::InitDplustoKpipi2010PbPb5080CentScan(){
1815   // define errors for RAA vs. centrality 2011
1816   InitDplustoKpipi2010PbPb4080();
1817
1818   for(Int_t i=2;i<=5;i++) fRawYield->SetBinContent(i,0.05);
1819   for(Int_t i=5;i<=8;i++) fRawYield->SetBinContent(i,0.05);
1820   for(Int_t i=9;i<=17;i++) fRawYield->SetBinContent(i,0.10);
1821
1822   for(Int_t i=1;i<=17;i++) fMCPtShape->SetBinContent(i,0.05);
1823   for(Int_t i=2;i<=5;i++) fCutsEff->SetBinContent(i,0.20); // 10%
1824   for(Int_t i=5;i<=8;i++) fCutsEff->SetBinContent(i,0.10); // 10%
1825   for(Int_t i=9;i<=17;i++) fCutsEff->SetBinContent(i,0.20); // 10%
1826 }
1827
1828 //--------------------------------------------------------------------------
1829 void AliHFSystErr::InitDstartoD0pi2011PbPb010CentScan(){
1830   // define errors for RAA vs. centrality 2011
1831   InitDstartoD0pi2011PbPb07half();
1832   
1833 }
1834 //--------------------------------------------------------------------------
1835 void AliHFSystErr::InitDstartoD0pi2011PbPb1020CentScan(){
1836   // define errors for RAA vs. centrality 2011
1837   InitDstartoD0pi2011PbPb07half();
1838   
1839 }
1840 //--------------------------------------------------------------------------
1841 void AliHFSystErr::InitDstartoD0pi2011PbPb2030CentScan(){
1842   // define errors for RAA vs. centrality 2011
1843   InitDstartoD0pi2011PbPb07half();
1844   
1845 }
1846 //--------------------------------------------------------------------------
1847 void AliHFSystErr::InitDstartoD0pi2011PbPb3040CentScan(){
1848   // define errors for RAA vs. centrality 2011
1849   InitDstartoD0pi2011PbPb07half();
1850   
1851 }
1852 //--------------------------------------------------------------------------
1853 void AliHFSystErr::InitDstartoD0pi2011PbPb4050CentScan(){
1854   // define errors for RAA vs. centrality 2011
1855   InitDstartoD0pi2011PbPb07half();
1856   
1857 }
1858 //--------------------------------------------------------------------------
1859 void AliHFSystErr::InitDstartoD0pi2010PbPb5080CentScan(){
1860   // define errors for RAA vs. centrality 2011
1861   InitDstartoD0pi2011PbPb07half();
1862   
1863 }
1864
1865
1866
1867 //--------------------------------------------------------------------------
1868 void AliHFSystErr::InitLctopKpi2010pp() {
1869   //
1870   // Lc->pKpi syst errors. Responsible: R. Romita
1871   //  2010 pp sample
1872   //
1873
1874   // Normalization
1875   fNorm = new TH1F("fNorm","fNorm",4,2,6);
1876   for(Int_t i=1;i<=4;i++) fNorm->SetBinContent(i,0.035); // 4% error on sigmaV0and
1877
1878   // Tracking efficiency
1879   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",4,2,6);
1880   for(Int_t i=1;i<=4;i++) fTrackingEff->SetBinContent(i,0.12); // 12% (4% per track)
1881
1882   // Raw yield extraction
1883   fRawYield = new TH1F("fRawYield","fRawYield",24,0,24);
1884   fRawYield->SetBinContent(1,0.20);
1885   fRawYield->SetBinContent(2,0.15);
1886   fRawYield->SetBinContent(3,0.10);
1887   fRawYield->SetBinContent(4,0.15);
1888
1889   fCutsEff = new TH1F("fCutsEff","fCutsEff",4,2,6);
1890   fCutsEff->SetBinContent(1,0.50);
1891   fCutsEff->SetBinContent(2,0.07);
1892   fCutsEff->SetBinContent(3,0.30);
1893   fCutsEff->SetBinContent(4,0.40);
1894
1895   // PID efficiency (from PID/noPID)
1896   fPIDEff = new TH1F("fPIDEff","fPIDEff",4,2,4);
1897   fPIDEff->SetBinContent(1,0.13); // 15%
1898   fPIDEff->SetBinContent(2,0.30); // 15%
1899   fPIDEff->SetBinContent(3,0.5); // 15%
1900   fPIDEff->SetBinContent(4,0.30); // 15%
1901
1902   // MC dN/dpt 
1903   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",12,0,12);
1904   for(Int_t i=1; i<=2; i++) fMCPtShape->SetBinContent(i,1.);
1905   for(Int_t i=3; i<=4; i++) fMCPtShape->SetBinContent(i,0.03);
1906   for(Int_t i=5; i<=6; i++) fMCPtShape->SetBinContent(i,0.03);
1907   for(Int_t i=7; i<=8; i++) fMCPtShape->SetBinContent(i,0.02);
1908   for(Int_t i=9; i<=12; i++) fMCPtShape->SetBinContent(i,0.02);
1909 }
1910
1911 //--------------------------------------------------------------------------
1912 Double_t AliHFSystErr::GetCutsEffErr(Double_t pt) const {
1913   // 
1914   // Get error
1915   //
1916
1917   Int_t bin=fCutsEff->FindBin(pt);
1918
1919   return fCutsEff->GetBinContent(bin);
1920 }
1921 //--------------------------------------------------------------------------
1922 Double_t AliHFSystErr::GetMCPtShapeErr(Double_t pt) const {
1923   // 
1924   // Get error
1925   //
1926
1927   Int_t bin=fMCPtShape->FindBin(pt);
1928
1929   return fMCPtShape->GetBinContent(bin);
1930 }
1931 //--------------------------------------------------------------------------
1932 Double_t AliHFSystErr::GetSeleEffErr(Double_t pt) const {
1933   // 
1934   // Get error
1935   //
1936
1937   Double_t err=GetCutsEffErr(pt)*GetCutsEffErr(pt)+GetMCPtShapeErr(pt)*GetMCPtShapeErr(pt);
1938
1939   return TMath::Sqrt(err);
1940 }
1941 //--------------------------------------------------------------------------
1942 Double_t AliHFSystErr::GetPIDEffErr(Double_t pt) const {
1943   // 
1944   // Get error
1945   //
1946
1947   Int_t bin=fPIDEff->FindBin(pt);
1948
1949   return fPIDEff->GetBinContent(bin);
1950 }
1951 //--------------------------------------------------------------------------
1952 Double_t AliHFSystErr::GetTrackingEffErr(Double_t pt) const {
1953   // 
1954   // Get error
1955   //
1956
1957   Int_t bin=fTrackingEff->FindBin(pt);
1958
1959   return fTrackingEff->GetBinContent(bin);
1960 }
1961 //--------------------------------------------------------------------------
1962 Double_t AliHFSystErr::GetRawYieldErr(Double_t pt) const {
1963   // 
1964   // Get error
1965   //
1966
1967   Int_t bin=fRawYield->FindBin(pt);
1968
1969   return fRawYield->GetBinContent(bin);
1970 }
1971 //--------------------------------------------------------------------------
1972 Double_t AliHFSystErr::GetPartAntipartErr(Double_t pt) const {
1973   // 
1974   // Get error
1975   //
1976
1977   Int_t bin=fPartAntipart->FindBin(pt);
1978
1979   return fPartAntipart->GetBinContent(bin);
1980 }
1981 //--------------------------------------------------------------------------
1982 Double_t AliHFSystErr::GetTotalSystErr(Double_t pt,Double_t feeddownErr) const {
1983   // 
1984   // Get total syst error (except norm. error)
1985   //
1986
1987   Double_t err=0.;
1988
1989   if(fRawYield) err += GetRawYieldErr(pt)*GetRawYieldErr(pt);
1990   if(fTrackingEff) err += GetTrackingEffErr(pt)*GetTrackingEffErr(pt);
1991   //  if(fBR) err += GetBRErr()*GetBRErr();
1992   if(fCutsEff) err += GetCutsEffErr(pt)*GetCutsEffErr(pt);
1993   if(fPIDEff) err += GetPIDEffErr(pt)*GetPIDEffErr(pt);
1994   if(fMCPtShape) err += GetMCPtShapeErr(pt)*GetMCPtShapeErr(pt);
1995   if(fPartAntipart) err += GetPartAntipartErr(pt)*GetPartAntipartErr(pt);
1996
1997   err += feeddownErr*feeddownErr;
1998
1999   return TMath::Sqrt(err);
2000 }
2001 //---------------------------------------------------------------------------
2002 void AliHFSystErr::DrawErrors(TGraphAsymmErrors *grErrFeeddown) const {
2003   //
2004   // Draw errors
2005   //
2006   gStyle->SetOptStat(0);
2007
2008   TCanvas *cSystErr = new TCanvas("cSystErr","Systematic Errors",300,80,640,500);
2009   cSystErr->Range(0.20,-0.5,18.4,0.34);
2010   cSystErr->SetRightMargin(0.318);
2011   cSystErr->SetFillColor(0);
2012
2013   TH2F *hFrame = new TH2F("hFrame","Systematic errors; p_{t} (GeV/c); Relative Error",40,0,40,100,-1,+1);
2014   hFrame->SetAxisRange(1.,35.9,"X");
2015   hFrame->SetAxisRange(-0.5,0.5,"Y");
2016   hFrame->Draw();
2017
2018   TLegend *leg = new TLegend(0.69,0.44,0.98,0.86,NULL,"brNDC");
2019   leg->SetTextSize(0.03601695);
2020   leg->SetFillStyle(0);
2021   leg->SetBorderSize(0);
2022   
2023   TH1F *hTotErr=new TH1F("hTotErr","",36,0,36);
2024   Int_t nbins = fNorm->GetNbinsX();
2025   TGraphAsymmErrors *gTotErr = new TGraphAsymmErrors(nbins);
2026   for(Int_t i=1;i<=36;i++) {
2027     Double_t pt = hTotErr->GetBinCenter(i);
2028     Double_t ptwidth = hTotErr->GetBinWidth(i);
2029
2030     if(grErrFeeddown) {
2031       Double_t x=0., y=0., errxl=0., errxh=0., erryl=0., erryh=0.;
2032       Double_t toterryl=0., toterryh=0.;
2033       for(Int_t j=0; j<grErrFeeddown->GetN(); j++) {
2034         grErrFeeddown->GetPoint(j,x,y);
2035         errxh = grErrFeeddown->GetErrorXhigh(j);
2036         errxl = grErrFeeddown->GetErrorXlow(j);
2037         if ( ( (x-errxl) <= pt) && ( (x+errxl) >= pt) ) {
2038           erryh = grErrFeeddown->GetErrorYhigh(j);
2039           erryl = grErrFeeddown->GetErrorYlow(j);
2040         }
2041       }
2042       if (erryl>=1e-3) toterryl = GetTotalSystErr(pt,erryl);
2043       else toterryl = GetTotalSystErr(pt);
2044       if (erryh>=1e-3) toterryh = GetTotalSystErr(pt,erryh);
2045       else toterryh = GetTotalSystErr(pt);
2046
2047       hTotErr->SetBinContent(i,toterryh);
2048       gTotErr->SetPoint(i,pt,0.);
2049       gTotErr->SetPointError(i,ptwidth/2.,ptwidth/2.,toterryl,toterryh); // i, exl, exh, eyl, eyh
2050     }
2051     else {
2052       hTotErr->SetBinContent(i,GetTotalSystErr(pt));
2053       gTotErr->SetPoint(i,pt,0.);
2054       gTotErr->SetPointError(i,ptwidth/2.,ptwidth/2.,GetTotalSystErr(pt),GetTotalSystErr(pt)); // i, exl, exh, eyl, eyh
2055     }
2056
2057   }
2058   gTotErr->SetLineColor(kBlack);
2059   gTotErr->SetFillColor(kRed);
2060   gTotErr->SetFillStyle(3002);
2061   gTotErr->Draw("2");
2062   leg->AddEntry(gTotErr,"Total (excl. norm.)","f");
2063 //   hTotErr->SetLineColor(1);
2064 //   hTotErr->SetLineWidth(3);
2065 //   hTotErr->Draw("same");
2066 //   leg->AddEntry(hTotErr,"Total (excl. norm.)","l");
2067   
2068
2069   fNorm->SetFillColor(1);
2070   fNorm->SetFillStyle(3002);
2071   //fNorm->Draw("same");
2072   //TH1F *hNormRefl = ReflectHisto(fNorm);
2073   //hNormRefl->Draw("same");
2074   Double_t norm = fNorm->GetBinContent(1)*100;
2075   leg->AddEntry(fNorm,Form("Normalization (%.1f%s)",norm,"%"),"");
2076
2077   if(grErrFeeddown) {
2078     grErrFeeddown->SetFillColor(kTeal-8);
2079     grErrFeeddown->SetFillStyle(3001);
2080     grErrFeeddown->Draw("2");
2081     leg->AddEntry(grErrFeeddown,"Feed-down from B","f");
2082   }
2083   if(fTrackingEff) {
2084     fTrackingEff->SetFillColor(4);
2085     fTrackingEff->SetFillStyle(3006);
2086     fTrackingEff->Draw("same");
2087     TH1F *hTrackingEffRefl = ReflectHisto(fTrackingEff);
2088     hTrackingEffRefl->Draw("same");
2089     leg->AddEntry(fTrackingEff,"Tracking efficiency","f");
2090   }
2091   if(fBR) {
2092     fBR->SetFillColor(6);
2093     fBR->SetFillStyle(3005);
2094     //fBR->SetFillStyle(3020);
2095     fBR->Draw("same");
2096     TH1F *hBRRefl = ReflectHisto(fBR);
2097     hBRRefl->Draw("same");
2098     leg->AddEntry(fBR,"Branching ratio","f");
2099   }
2100   if(fRawYield) {
2101     Int_t ci;   // for color index setting
2102     ci = TColor::GetColor("#00cc00");
2103     fRawYield->SetLineColor(ci);
2104     //    fRawYield->SetLineColor(3);
2105     fRawYield->SetLineWidth(3);
2106     fRawYield->Draw("same");
2107     TH1F *hRawYieldRefl = ReflectHisto(fRawYield);
2108     hRawYieldRefl->Draw("same");
2109     leg->AddEntry(fRawYield,"Yield extraction","l");
2110   }
2111   if(fCutsEff) {
2112     fCutsEff->SetLineColor(4);
2113     fCutsEff->SetLineWidth(3);
2114     fCutsEff->Draw("same");
2115     TH1F *hCutsEffRefl = ReflectHisto(fCutsEff);
2116     hCutsEffRefl->Draw("same");
2117     leg->AddEntry(fCutsEff,"Cuts efficiency","l");
2118   }
2119   if(fPIDEff) {
2120     fPIDEff->SetLineColor(7);
2121     fPIDEff->SetLineWidth(3);
2122     fPIDEff->Draw("same");
2123     TH1F *hPIDEffRefl = ReflectHisto(fPIDEff);
2124     hPIDEffRefl->Draw("same");
2125     leg->AddEntry(fPIDEff,"PID efficiency","l");
2126   }
2127   if(fMCPtShape) {
2128     Int_t ci = TColor::GetColor("#9933ff");
2129     fMCPtShape->SetLineColor(ci);
2130     //    fMCPtShape->SetLineColor(8);
2131     fMCPtShape->SetLineWidth(3);
2132     fMCPtShape->Draw("same");
2133     TH1F *hMCPtShapeRefl = ReflectHisto(fMCPtShape);
2134     hMCPtShapeRefl->Draw("same");
2135     leg->AddEntry(fMCPtShape,"MC p_{t} shape","l");
2136   }
2137   if(fPartAntipart) {
2138     Int_t ci = TColor::GetColor("#ff6600");
2139     fPartAntipart->SetLineColor(ci);
2140     //    fPartAntipart->SetLineColor(9);
2141     fPartAntipart->SetLineWidth(3);
2142     fPartAntipart->Draw("same");
2143     TH1F *hPartAntipartRefl = ReflectHisto(fPartAntipart);
2144     hPartAntipartRefl->Draw("same");
2145     leg->AddEntry(fPartAntipart,"D = #bar{D}","l");
2146   }
2147
2148
2149   leg->Draw();
2150
2151   cSystErr->SaveAs("RelativeSystematics.eps");
2152
2153   return;
2154 }
2155 //-------------------------------------------------------------------------
2156 TH1F* AliHFSystErr::ReflectHisto(TH1F *hin) const {
2157   //
2158   // Clones and reflects histogram 
2159   // 
2160   TH1F *hout=(TH1F*)hin->Clone("hout");
2161   hout->Scale(-1.);
2162
2163   return hout;
2164 }
2165
2166
2167