Changes for PbPb (Zaida)
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 10 Apr 2011 00:16:55 +0000 (00:16 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 10 Apr 2011 00:16:55 +0000 (00:16 +0000)
PWG3/vertexingHF/AliHFPtSpectrum.cxx
PWG3/vertexingHF/AliHFPtSpectrum.h
PWG3/vertexingHF/AliHFSystErr.cxx
PWG3/vertexingHF/AliHFSystErr.h
PWG3/vertexingHF/macros/HFPtSpectrum.C

index 3457303..24f2a55 100644 (file)
@@ -1300,15 +1300,13 @@ void AliHFPtSpectrum::CalculateFeedDownCorrectedSpectrumNb(Double_t deltaY, Doub
 
 
 //_________________________________________________________________________________________________________
-void AliHFPtSpectrum::ComputeSystUncertainties(Int_t decay, Bool_t combineFeedDown) {
+void AliHFPtSpectrum::ComputeSystUncertainties(AliHFSystErr *systematics, Bool_t combineFeedDown) {
   //
   // Function that re-calculates the global systematic uncertainties
   //   by calling the class AliHFSystErr and combining those
   //   (in quadrature) with the feed-down subtraction uncertainties
   //
 
-  // Call the systematics uncertainty class for a given decay
-  AliHFSystErr systematics(decay);
 
   // Estimate the feed-down uncertainty in percentage
   Int_t nentries = fgSigmaCorrConservative->GetN();
@@ -1324,7 +1322,7 @@ void AliHFPtSpectrum::ComputeSystUncertainties(Int_t decay, Bool_t combineFeedDo
   }
 
   // Draw all the systematics independently
-  systematics.DrawErrors(grErrFeeddown);
+  systematics->DrawErrors(grErrFeeddown);
 
   // Set the sigma systematic uncertainties
   // possibly combine with the feed-down uncertainties 
@@ -1335,11 +1333,11 @@ void AliHFPtSpectrum::ComputeSystUncertainties(Int_t decay, Bool_t combineFeedDo
     erryl = grErrFeeddown->GetErrorYlow(i);
     erryh = grErrFeeddown->GetErrorYhigh(i);
     if (combineFeedDown) {
-      errylcomb = systematics.GetTotalSystErr(x,erryl) * y ;
-      erryhcomb = systematics.GetTotalSystErr(x,erryh) * y ;
+      errylcomb = systematics->GetTotalSystErr(x,erryl) * y ;
+      erryhcomb = systematics->GetTotalSystErr(x,erryh) * y ;
     } else {
-      errylcomb = systematics.GetTotalSystErr(x) * y ;
-      erryhcomb = systematics.GetTotalSystErr(x) * y ;
+      errylcomb = systematics->GetTotalSystErr(x) * y ;
+      erryhcomb = systematics->GetTotalSystErr(x) * y ;
     }
     fgSigmaCorr->SetPointError(i,errx,errx,errylcomb,erryhcomb);
   }
index 0b9282d..18adcba 100644 (file)
@@ -26,6 +26,7 @@
 
 class TH1;
 class TGraphAsymmErrors;
+class AliHFSystErr;
 
 
 class AliHFPtSpectrum: public TNamed
@@ -143,7 +144,7 @@ class AliHFPtSpectrum: public TNamed
 
   // Compute the systematic uncertainties
   //   taking as input the AliHFSystErr uncertainties
-  void ComputeSystUncertainties(Int_t decay, Bool_t combineFeedDown);
+  void ComputeSystUncertainties(AliHFSystErr *systematics, Bool_t combineFeedDown);
   //
   // Drawing the corrected spectrum comparing to theoretical prediction
   void DrawSpectrum(TGraphAsymmErrors *gPrediction);
index 1124075..ac1de65 100644 (file)
 // Class to handle systematic errors for charm hadrons
 //
 // Usage:
-// AliHFSystEff syst(DECAY); // DECAY = 1 for D0, 2, for D+, 3 for D* 
+// AliHFSystEff syst;           // DECAY = 1 for D0, 2, for D+, 3 for D* 
+// syst.SetRunNumber(YEAR);     // YEAR = two last numbers of the year (is 10 for 2010)
+// syst.SetCollisionType(TYPE);  // TYPE =  0 is pp, 1 is PbPb
+// syst.SetCentrality(CENT);     // CENT is centrality, 0100 for MB, 020 (4080) for 0-20 (40-80) CC...
+// syst.Init(DECAY);             // DECAY = 1 for D0, 2, for D+, 3 for D* 
 // syst.DrawErrors(); // to see a plot of the error contributions
 // syst.GetTotalSystErr(pt); // to get the total err at pt 
 //
@@ -35,6 +39,7 @@
 #include <TLegend.h>
 #include <TColor.h>
 
+#include "AliLog.h"
 #include "AliHFSystErr.h"
 
 
@@ -50,67 +55,185 @@ fBR(0),
 fCutsEff(0),
 fPIDEff(0),
 fMCPtShape(0),
-fPartAntipart(0)
+fPartAntipart(0),
+fRunNumber(10),
+fCollisionType(0),
+fCentralityClass(0100)
 {
   //
   // Default Constructor
   //
 }
+
 //--------------------------------------------------------------------------
-AliHFSystErr::AliHFSystErr(Int_t decay,const Char_t* name, const Char_t* title) : 
-TNamed(name,title),
-fNorm(0),
-fRawYield(0),
-fTrackingEff(0),
-fBR(0),
-fCutsEff(0),
-fPIDEff(0),
-fMCPtShape(0),
-fPartAntipart(0)
-{
+AliHFSystErr::~AliHFSystErr() {
+  //  
+  // Default Destructor
+  //
+
+  if(fNorm)         { delete fNorm; fNorm=0; }
+  if(fRawYield)     { delete fRawYield; fRawYield=0; }
+  if(fTrackingEff)  { delete fTrackingEff; fTrackingEff=0; }
+  if(fBR)           { delete fBR; fBR=0; }
+  if(fCutsEff)      { delete fCutsEff; fCutsEff=0; }
+  if(fPIDEff)       { delete fPIDEff; fPIDEff=0; }
+  if(fMCPtShape)    { delete fMCPtShape; fMCPtShape=0; }
+  if(fPartAntipart) { delete fPartAntipart; fPartAntipart=0; }
+
+}
+
+//--------------------------------------------------------------------------
+void AliHFSystErr::Init(Int_t decay){
   //
-  // Standard Constructor
+  // Variables/histos initialization
   //
 
+  if (fRunNumber!=10) { 
+    AliError("Only settings for 2010 are implemented so far");
+  }
+  if (fCentralityClass!=020 && fCentralityClass!=4080 && fCentralityClass!=0100){
+    AliError("Only settings for MB2010 are implemented so far");
+  }
+
   switch(decay) {
   case 1: // D0->Kpi
-    InitD0toKpi();
+    if (fCollisionType==0) InitD0toKpi2010pp();
+    else if (fCollisionType==1) {
+      if (fCentralityClass==020) InitD0toKpi2010PbPb020();
+      else if (fCentralityClass==4080) InitD0toKpi2010PbPb4080();
+      else AliError("Not yet implemented");
+    }
     break;
   case 2: // D+->Kpipi
-    InitDplustoKpipi();
+    if (fCollisionType==0) InitDplustoKpipi2010pp();
+    else if (fCollisionType==1) {
+      if (fCentralityClass==020) InitDplustoKpipi2010PbPb020();
+      else if (fCentralityClass==4080) InitDplustoKpipi2010PbPb4080();
+      else AliError("Not yet implemented");
+    }
     break;
   case 3: // D*->D0pi
-    InitDstartoD0pi();
+    if (fCollisionType==0) InitDstartoD0pi2010pp();
+    else if (fCollisionType==1) {
+      if (fCentralityClass==020) InitDstartoD0pi2010PbPb020();
+      else if (fCentralityClass==4080) InitDstartoD0pi2010PbPb4080();
+      else AliError("Not yet implemented");
+    }
     break;
   default:
     printf("Invalid decay type: %d\n",decay);
     break;
   }
 
-
 }
+  
 //--------------------------------------------------------------------------
-AliHFSystErr::~AliHFSystErr() {
-  //  
-  // Default Destructor
+void AliHFSystErr::InitD0toKpi2010pp() {
+  // 
+  // D0->Kpi syst errors. Responsible: A. Rossi
+  //   2010 pp sample
   //
 
-  if(fNorm)         { delete fNorm; fNorm=0; }
-  if(fRawYield)     { delete fRawYield; fRawYield=0; }
-  if(fTrackingEff)  { delete fTrackingEff; fTrackingEff=0; }
-  if(fBR)           { delete fBR; fBR=0; }
-  if(fCutsEff)      { delete fCutsEff; fCutsEff=0; }
-  if(fPIDEff)       { delete fPIDEff; fPIDEff=0; }
-  if(fMCPtShape)    { delete fMCPtShape; fMCPtShape=0; }
-  if(fPartAntipart) { delete fPartAntipart; fPartAntipart=0; }
+  // 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.012); // 1.2% PDG2010
+
+  // Tracking efficiency
+  fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",20,0,20);
+  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);
+  fRawYield->SetBinContent(1,1);
+  fRawYield->SetBinContent(2,1);
+  fRawYield->SetBinContent(3,0.15);
+  for(Int_t i=4;i<=20;i++) fRawYield->SetBinContent(i,0.065);
+
+  // 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.03); // 3%
+  fPIDEff->SetBinContent(4,0.10); // 10%
+
+  // MC dN/dpt
+  fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",20,0,20);
+  for(Int_t i=1;i<=20;i++) fMCPtShape->SetBinContent(i,(Float_t)i*0.006);
 
+  // particle-antiparticle
+  fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",20,0,20);
+  fPartAntipart->SetBinContent(1,1);
+  fPartAntipart->SetBinContent(2,1);
+  for(Int_t i=3;i<=6;i++) fPartAntipart->SetBinContent(i,0.08);
+  
+  return;
 }
 //--------------------------------------------------------------------------
-void AliHFSystErr::InitD0toKpi() {
+void AliHFSystErr::InitD0toKpi2010PbPb020() {
   // 
-  // D0->Kpi syst errors. Responsible: A. Rossi
+  // D0->Kpi syst errors. Responsible: ??
+  //   2010 PbPb sample, 0-20 CC
   //
+
+  // 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.012); // 1.2% PDG2010
+
+  // Tracking efficiency
+  fTrackingEff = new TH1F("fTrackingEff","fTrackingEff",20,0,20);
+  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);
+  fRawYield->SetBinContent(1,0);
+  fRawYield->SetBinContent(2,0);
+  fRawYield->SetBinContent(3,0);
+  fRawYield->SetBinContent(4,0.27);
+  fRawYield->SetBinContent(5,0.27);
+  fRawYield->SetBinContent(6,0);
+  fRawYield->SetBinContent(7,0.07);
+  fRawYield->SetBinContent(8,0.07);
+  for(Int_t i=9;i<=12;i++) fRawYield->SetBinContent(i,0.09);
+  for(Int_t i=12;i<=20;i++) fRawYield->SetBinContent(i,0);
+
+  // 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.03); // 3%
+  fPIDEff->SetBinContent(4,0.10); // 10%
+
+  // MC dN/dpt
+  fMCPtShape = new TH1F("fMCPtShape","fMCPtShape",20,0,20);
+  for(Int_t i=1;i<=20;i++) fMCPtShape->SetBinContent(i,(Float_t)i*0.006);
+
+  // particle-antiparticle
+  fPartAntipart = new TH1F("fPartAntipart","fPartAntipart",20,0,20);
+  fPartAntipart->SetBinContent(1,1);
+  fPartAntipart->SetBinContent(2,1);
+  for(Int_t i=3;i<=6;i++) fPartAntipart->SetBinContent(i,0.08);
   
+  return;
+}
+//--------------------------------------------------------------------------
+void AliHFSystErr::InitD0toKpi2010PbPb4080() {
+  // 
+  // D0->Kpi syst errors. Responsible: ??
+  //   2010 PbPb sample, 40-80 CC
+  //
+
   // 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
@@ -125,10 +248,15 @@ void AliHFSystErr::InitD0toKpi() {
 
   // Raw yield extraction
   fRawYield = new TH1F("fRawYield","fRawYield",20,0,20);
-  fRawYield->SetBinContent(1,1);
-  fRawYield->SetBinContent(2,1);
-  fRawYield->SetBinContent(3,0.15);
-  for(Int_t i=4;i<=20;i++) fRawYield->SetBinContent(i,0.065);
+  fRawYield->SetBinContent(1,0);
+  fRawYield->SetBinContent(2,0);
+  fRawYield->SetBinContent(3,0);
+  fRawYield->SetBinContent(4,0);
+  fRawYield->SetBinContent(5,0.3);
+  fRawYield->SetBinContent(6,0);
+  fRawYield->SetBinContent(7,0.33);
+  fRawYield->SetBinContent(8,0.33);
+  for(Int_t i=9;i<=20;i++) fRawYield->SetBinContent(i,0);
 
   // Cuts efficiency (from cuts variation)
   fCutsEff = new TH1F("fCutsEff","fCutsEff",20,0,20);
@@ -152,9 +280,10 @@ void AliHFSystErr::InitD0toKpi() {
   return;
 }
 //--------------------------------------------------------------------------
-void AliHFSystErr::InitDplustoKpipi() {
+void AliHFSystErr::InitDplustoKpipi2010pp() {
   // 
   // D+->Kpipi syst errors. Responsible: R. Bala
+  //  2010 pp sample
   //
 
  // Normalization
@@ -203,9 +332,32 @@ void AliHFSystErr::InitDplustoKpipi() {
   return;
 }
 //--------------------------------------------------------------------------
-void AliHFSystErr::InitDstartoD0pi() {
+void AliHFSystErr::InitDplustoKpipi2010PbPb020() {
+  // 
+  // D+->Kpipi syst errors. Responsible: ??
+  //  2010 PbPb sample, 0-20 CC
+  //
+  
+  AliInfo("Not yet implemented");
+  return;
+}
+
+//--------------------------------------------------------------------------
+void AliHFSystErr::InitDplustoKpipi2010PbPb4080() {
+  // 
+  // D+->Kpipi syst errors. Responsible: ??
+  //  2010 PbPb sample, 40-80 CC
+  //
+  
+  AliInfo("Not yet implemented");
+  return;
+}
+
+//--------------------------------------------------------------------------
+void AliHFSystErr::InitDstartoD0pi2010pp() {
   // 
   // D*+->D0pi syst errors. Responsible: A. Grelli, Y. Wang
+  //  2010 pp sample
   //
 
  // Normalization
@@ -254,6 +406,26 @@ void AliHFSystErr::InitDstartoD0pi() {
   return;
 }
 //--------------------------------------------------------------------------
+void AliHFSystErr::InitDstartoD0pi2010PbPb020() {
+  // 
+  // D*+->D0pi syst errors. Responsible: ??
+  //  2010 PbPb sample, 0-20 CC
+  //
+
+  AliInfo("Not yet implemented");
+  return;
+}
+//--------------------------------------------------------------------------
+void AliHFSystErr::InitDstartoD0pi2010PbPb4080() {
+  // 
+  // D*+->D0pi syst errors. Responsible: ??
+  //  2010 PbPb sample, 40-80 CC
+  //
+
+  AliInfo("Not yet implemented");
+  return;
+}
+//--------------------------------------------------------------------------
 Double_t AliHFSystErr::GetCutsEffErr(Double_t pt) const {
   // 
   // Get error
index 4910f9f..fd8f5c9 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <TNamed.h>
 #include <TH1F.h>
+#include "AliLog.h"
 #include "TGraphAsymmErrors.h"
 
 
@@ -21,7 +22,6 @@ class AliHFSystErr : public TNamed
  public:
 
   AliHFSystErr(const Char_t* name="HFSystErr", const Char_t* title="");
-  AliHFSystErr(Int_t decay,const Char_t* name="HFSystErr", const Char_t* title="");
   
   virtual ~AliHFSystErr();
   
@@ -38,16 +38,46 @@ class AliHFSystErr : public TNamed
   Double_t GetTrackingEffErr(Double_t pt) const;
   Double_t GetTotalSystErr(Double_t pt,Double_t feeddownErr=0) const;
 
+  // Setting  the run number
+  //  set the two last numbers of the year (is 10 for 2010)
+  void SetRunNumber(Int_t number) { 
+    fRunNumber = number; 
+    AliInfo(Form(" Settings for run year 20%2d",fRunNumber));
+  }
+  // Setting the collision type
+  //  0 is pp, 1 is PbPb
+  void SetCollisionType(Int_t type) { 
+    fCollisionType = type; 
+    if (fCollisionType==0) { AliInfo(" Settings for p-p collisions"); }
+    else if(fCollisionType==1) { AliInfo(" Settings for Pb-Pb collisions"); }
+  }
+  // Setting for the centrality class
+  //  0100 for MB, 020 (4080) for 0-20 (40-80) CC and so on
+  void SetCentrality(Int_t centrality) { 
+    fCentralityClass = centrality; 
+    AliInfo(Form(" Settings for centrality class %d",fCentralityClass));
+  }
+
+  // Function to initialize the variables/histograms
+  void Init(Int_t decay);
 
  private:
 
   AliHFSystErr(const AliHFSystErr& source);
   AliHFSystErr& operator=(const AliHFSystErr& source); 
  
+  void InitD0toKpi2010pp();
+  void InitDplustoKpipi2010pp();
+  void InitDstartoD0pi2010pp();
+
+  void InitD0toKpi2010PbPb020();
+  void InitDplustoKpipi2010PbPb020();
+  void InitDstartoD0pi2010PbPb020();
+
+  void InitD0toKpi2010PbPb4080();
+  void InitDplustoKpipi2010PbPb4080();
+  void InitDstartoD0pi2010PbPb4080();
 
-  void InitD0toKpi();
-  void InitDplustoKpipi();
-  void InitDstartoD0pi();
 
   TH1F* ReflectHisto(TH1F *hin) const;
 
@@ -60,6 +90,11 @@ class AliHFSystErr : public TNamed
   TH1F *fMCPtShape;       // MC dNdpt
   TH1F *fPartAntipart;    // particle=antiparticle
 
+  Int_t fRunNumber;        // Run Number (year)
+  Int_t fCollisionType;    // Collision type: pp=0, PbPb=1
+  Int_t fCentralityClass;  // Centrality class
+                           // MB:0100, 0-10:010, 0-20:020 ...40-80:4080...
+
   ClassDef(AliHFSystErr,1);  // class for systematic errors of charm hadrons
 };
 
index e856b8e..f14b56d 100644 (file)
@@ -14,6 +14,7 @@
 #include "TCanvas.h"
 #include "TROOT.h"
 
+#include "AliHFSystErr.h"
 #include "AliHFPtSpectrum.h"
 
 //
@@ -238,8 +239,11 @@ void HFPtSpectrum ( const char *mcfilename="FeedDownCorrectionMC.root",
   cout << "   ended the calculation, getting the histograms back " << endl;
 
   // Set the systematics externally
+  AliHFSystErr *systematics = new AliHFSystErr();
+  systematics->Init(decay);
   bool combineFeedDown = true;
-  spectra->ComputeSystUncertainties(decay,combineFeedDown);
+  spectra->ComputeSystUncertainties(systematics,combineFeedDown);
+
 
   //
   // Get the output histograms