]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG3/vertexingHF/AliHFSystErr.cxx
Bug fixes.
[u/mrichter/AliRoot.git] / PWG3 / vertexingHF / AliHFSystErr.cxx
index 0118f2237e4f633dd742a8b3b5be5affc47ad96b..087b8fb225e844eb8e51d279125808aadff81cd2 100644 (file)
@@ -111,15 +111,15 @@ void AliHFSystErr::InitD0toKpi() {
   
   // Normalization
   fNorm = new TH1F("fNorm","fNorm",20,0,20);
-  for(Int_t i=4;i<=20;i++) fNorm->SetBinContent(i,0.10); // 10% error on sigmaV0and
+  for(Int_t i=1;i<=20;i++) fNorm->SetBinContent(i,0.10); // 10% error on sigmaV0and
 
   // Branching ratio 
   fBR = new TH1F("fBR","fBR",20,0,20);
-  for(Int_t i=4;i<=20;i++) fBR->SetBinContent(i,0.012); // 1.2% PDG2010
+  for(Int_t i=1;i<=20;i++) fBR->SetBinContent(i,0.012); // 1.2% PDG2010
 
   // Tracking efficiency
   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",20,0,20);
-  for(Int_t i=4;i<=20;i++) fTrackingEff->SetBinContent(i,0.02); // 2% (1% per track)
+  for(Int_t i=1;i<=20;i++) fTrackingEff->SetBinContent(i,0.02); // 2% (1% per track)
 
   // Raw yield extraction
   fRawYield = new TH1F("fRawYield","fRawYield",20,0,20);
@@ -135,7 +135,7 @@ void AliHFSystErr::InitD0toKpi() {
   // PID efficiency (from PID/noPID)
   fPIDEff = new TH1F("fPIDEff","fPIDEff",20,0,20);
   for(Int_t i=1;i<=20;i++) fPIDEff->SetBinContent(i,0.03); // 3%
-  fPIDEff->SetBinContent(4,0.15); // 15%
+  fPIDEff->SetBinContent(4,0.10); // 10%
 
   // MC dN/dpt
   fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",20,0,20);
@@ -145,8 +145,7 @@ void AliHFSystErr::InitD0toKpi() {
   fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",20,0,20);
   fPartAntipart->SetBinContent(1,1);
   fPartAntipart->SetBinContent(2,1);
-  fPartAntipart->SetBinContent(3,0.20);
-  for(Int_t i=4;i<=20;i++) fPartAntipart->SetBinContent(i,0.05);
+  for(Int_t i=3;i<=6;i++) fPartAntipart->SetBinContent(i,0.08);
   
   return;
 }
@@ -158,22 +157,22 @@ void AliHFSystErr::InitDplustoKpipi() {
 
  // Normalization
   fNorm = new TH1F("fNorm","fNorm",20,0,20);
-  for(Int_t i=4;i<=20;i++) fNorm->SetBinContent(i,0.10); // 10% error on sigmaV0and
+  for(Int_t i=1;i<=20;i++) fNorm->SetBinContent(i,0.10); // 10% error on sigmaV0and
 
   // Branching ratio 
   fBR = new TH1F("fBR","fBR",20,0,20);
-  for(Int_t i=4;i<=20;i++) fBR->SetBinContent(i,0.04); // 4% PDG2010
+  for(Int_t i=1;i<=20;i++) fBR->SetBinContent(i,0.04); // 4% PDG2010
 
   // Tracking efficiency
   fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",20,0,20);
-  for(Int_t i=4;i<=20;i++) fTrackingEff->SetBinContent(i,0.03); // 3% (1% per track)
+  for(Int_t i=1;i<=20;i++) fTrackingEff->SetBinContent(i,0.03); // 3% (1% per track)
 
 
   // Raw yield extraction
   fRawYield = new TH1F("fRawYield","fRawYield",20,0,20);
   fRawYield->SetBinContent(1,1);
   fRawYield->SetBinContent(2,1);
-  fRawYield->SetBinContent(3,0.10);
+  fRawYield->SetBinContent(3,0.20);
   for(Int_t i=4;i<=20;i++) fRawYield->SetBinContent(i,0.055);  //5 to 10%
 
   // Cuts efficiency (from cuts variation)
@@ -204,9 +203,52 @@ void AliHFSystErr::InitDplustoKpipi() {
 //--------------------------------------------------------------------------
 void AliHFSystErr::InitDstartoD0pi() {
   // 
-  // D*+->D0pi syst errors. Responsible: tbd
+  // D*+->D0pi syst errors. Responsible: A. Grelli, Y. Wang
   //
 
+ // Normalization
+  fNorm = new TH1F("fNorm","fNorm",20,0,20);
+  for(Int_t i=1;i<=20;i++) fNorm->SetBinContent(i,0.10); // 10% error on sigmaV0and
+
+  // Branching ratio 
+  fBR = new TH1F("fBR","fBR",20,0,20);
+  for(Int_t i=1;i<=20;i++) fBR->SetBinContent(i,0.015); // 1.5% PDG2010
+
+  // Tracking efficiency
+  fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",20,0,20);
+  fTrackingEff->SetBinContent(1,0.12);
+  fTrackingEff->SetBinContent(2,0.08);
+  fTrackingEff->SetBinContent(3,0.05);
+  for(Int_t i=4;i<=20;i++) fTrackingEff->SetBinContent(i,0.03); // 3% (1% per track)
+
+
+  // Raw yield extraction
+  fRawYield = new TH1F("fRawYield","fRawYield",20,0,20);
+  fRawYield->SetBinContent(1,1);
+  fRawYield->SetBinContent(2,0.12);
+  fRawYield->SetBinContent(3,0.09);
+  fRawYield->SetBinContent(4,0.08);
+  fRawYield->SetBinContent(5,0.06);
+  for(Int_t i=5;i<=20;i++) fRawYield->SetBinContent(i,0.04);  //4%
+
+  // Cuts efficiency (from cuts variation)
+  fCutsEff = new TH1F("fCutsEff","fCutsEff",20,0,20);
+  for(Int_t i=1;i<=20;i++) fCutsEff->SetBinContent(i,0.10); // 10%
+
+  // PID efficiency (from PID/noPID)
+  fPIDEff = new TH1F("fPIDEff","fPIDEff",20,0,20);
+  for(Int_t i=1;i<=20;i++) fPIDEff->SetBinContent(i,0.04); // 3%
+  fPIDEff->SetBinContent(1,1); // 100%
+  fPIDEff->SetBinContent(2,1); // 100%
+  fPIDEff->SetBinContent(3,0.05); // 5%
+  fPIDEff->SetBinContent(4,0.05); // 5%
+  fPIDEff->SetBinContent(5,0.05); // 5%
+
+  // MC dN/dpt  (copied from D0 : will update later)
+  fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",20,0,20);
+  for(Int_t i=1;i<=20;i++) fMCPtShape->SetBinContent(i,(Float_t)i*0.006);
+
   return;
 }
 //--------------------------------------------------------------------------
@@ -306,7 +348,9 @@ void AliHFSystErr::DrawErrors(TGraphAsymmErrors *grErrFeeddown) const {
   //
   gStyle->SetOptStat(0);
 
-  TCanvas *cSystErr = new TCanvas("cSystErr","Systematic Errors",0,0,500,500);
+  TCanvas *cSystErr = new TCanvas("cSystErr","Systematic Errors",300,80,640,500);
+  cSystErr->Range(0.20,-0.5,18.4,0.34);
+  cSystErr->SetRightMargin(0.318);
   cSystErr->SetFillColor(0);
 
   TH2F *hFrame = new TH2F("hFrame","Systematic errors; p_{t} [GeV/c]; Relative Error",20,0,20,100,-1,+1);
@@ -314,7 +358,8 @@ void AliHFSystErr::DrawErrors(TGraphAsymmErrors *grErrFeeddown) const {
   hFrame->SetAxisRange(-0.5,0.5,"Y");
   hFrame->Draw();
 
-  TLegend *leg=new TLegend(0.5,0.5,0.9,0.9);
+  TLegend *leg = new TLegend(0.69,0.44,0.98,0.86,NULL,"brNDC");
+  leg->SetTextSize(0.03601695);
   leg->SetFillStyle(0);
   leg->SetBorderSize(0);
   
@@ -332,7 +377,7 @@ void AliHFSystErr::DrawErrors(TGraphAsymmErrors *grErrFeeddown) const {
        grErrFeeddown->GetPoint(j,x,y);
        errxh = grErrFeeddown->GetErrorXhigh(j);
        errxl = grErrFeeddown->GetErrorXlow(j);
-       if ( ( (x-errxl) >= pt) && ( (x+errxl) <= pt) ) {
+       if ( ( (x-errxl) <= pt) && ( (x+errxl) >= pt) ) {
          erryh = grErrFeeddown->GetErrorYhigh(j);
          erryl = grErrFeeddown->GetErrorYlow(j);
        }
@@ -353,9 +398,9 @@ void AliHFSystErr::DrawErrors(TGraphAsymmErrors *grErrFeeddown) const {
     }
 
   }
-  gTotErr->SetLineColor(kYellow);
-  gTotErr->SetFillColor(kYellow-10);
-  gTotErr->SetFillStyle(1001);
+  gTotErr->SetLineColor(kBlack);
+  gTotErr->SetFillColor(kRed);
+  gTotErr->SetFillStyle(3002);
   gTotErr->Draw("2");
   leg->AddEntry(gTotErr,"Total (excl. norm.)","f");
 //   hTotErr->SetLineColor(1);
@@ -367,8 +412,10 @@ void AliHFSystErr::DrawErrors(TGraphAsymmErrors *grErrFeeddown) const {
   if(fNorm) {
     fNorm->SetFillColor(1);
     fNorm->SetFillStyle(3002);
-    fNorm->Draw("same");
-    leg->AddEntry(fNorm,"Normalization","f");
+    //fNorm->Draw("same");
+    //TH1F *hNormRefl = ReflectHisto(fNorm);
+    //hNormRefl->Draw("same");
+    leg->AddEntry(fNorm,"Normalization (10%)","");
   }
   if(grErrFeeddown) {
     grErrFeeddown->SetFillColor(kTeal-8);
@@ -380,6 +427,8 @@ void AliHFSystErr::DrawErrors(TGraphAsymmErrors *grErrFeeddown) const {
     fTrackingEff->SetFillColor(4);
     fTrackingEff->SetFillStyle(3006);
     fTrackingEff->Draw("same");
+    TH1F *hTrackingEffRefl = ReflectHisto(fTrackingEff);
+    hTrackingEffRefl->Draw("same");
     leg->AddEntry(fTrackingEff,"Tracking efficiency","f");
   }
   if(fBR) {
@@ -387,6 +436,8 @@ void AliHFSystErr::DrawErrors(TGraphAsymmErrors *grErrFeeddown) const {
     fBR->SetFillStyle(3005);
     //fBR->SetFillStyle(3020);
     fBR->Draw("same");
+    TH1F *hBRRefl = ReflectHisto(fBR);
+    hBRRefl->Draw("same");
     leg->AddEntry(fBR,"Branching ratio","f");
   }
   if(fRawYield) {
@@ -396,18 +447,24 @@ void AliHFSystErr::DrawErrors(TGraphAsymmErrors *grErrFeeddown) const {
     //    fRawYield->SetLineColor(3);
     fRawYield->SetLineWidth(3);
     fRawYield->Draw("same");
-    leg->AddEntry(fRawYield,"Inv. mass analysis","l");
+    TH1F *hRawYieldRefl = ReflectHisto(fRawYield);
+    hRawYieldRefl->Draw("same");
+    leg->AddEntry(fRawYield,"Yield extraction","l");
   }
   if(fCutsEff) {
     fCutsEff->SetLineColor(4);
     fCutsEff->SetLineWidth(3);
     fCutsEff->Draw("same");
+    TH1F *hCutsEffRefl = ReflectHisto(fCutsEff);
+    hCutsEffRefl->Draw("same");
     leg->AddEntry(fCutsEff,"Cuts efficiency","l");
   }
   if(fPIDEff) {
     fPIDEff->SetLineColor(7);
     fPIDEff->SetLineWidth(3);
     fPIDEff->Draw("same");
+    TH1F *hPIDEffRefl = ReflectHisto(fPIDEff);
+    hPIDEffRefl->Draw("same");
     leg->AddEntry(fPIDEff,"PID efficiency","l");
   }
   if(fMCPtShape) {
@@ -416,6 +473,8 @@ void AliHFSystErr::DrawErrors(TGraphAsymmErrors *grErrFeeddown) const {
     //    fMCPtShape->SetLineColor(8);
     fMCPtShape->SetLineWidth(3);
     fMCPtShape->Draw("same");
+    TH1F *hMCPtShapeRefl = ReflectHisto(fMCPtShape);
+    hMCPtShapeRefl->Draw("same");
     leg->AddEntry(fMCPtShape,"MC p_{t} shape","l");
   }
   if(fPartAntipart) {
@@ -424,6 +483,8 @@ void AliHFSystErr::DrawErrors(TGraphAsymmErrors *grErrFeeddown) const {
     //    fPartAntipart->SetLineColor(9);
     fPartAntipart->SetLineWidth(3);
     fPartAntipart->Draw("same");
+    TH1F *hPartAntipartRefl = ReflectHisto(fPartAntipart);
+    hPartAntipartRefl->Draw("same");
     leg->AddEntry(fPartAntipart,"D = #bar{D}","l");
   }
 
@@ -434,3 +495,13 @@ void AliHFSystErr::DrawErrors(TGraphAsymmErrors *grErrFeeddown) const {
 
   return;
 }
+//-------------------------------------------------------------------------
+TH1F* AliHFSystErr::ReflectHisto(TH1F *hin) const {
+  //
+  // Clones and reflects histogram 
+  // 
+  TH1F *hout=(TH1F*)hin->Clone("hout");
+  hout->Scale(-1.);
+
+  return hout;
+}