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