]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Eta-y dependent ratios for each pT bin
authorpchrist <pchrist@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Feb 2010 13:38:25 +0000 (13:38 +0000)
committerpchrist <pchrist@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 8 Feb 2010 13:38:25 +0000 (13:38 +0000)
PWG2/SPECTRA/AliProtonAnalysis.cxx
PWG2/SPECTRA/AliProtonAnalysis.h
PWG2/SPECTRA/macros/drawProtonResults.C

index 9867a5c3605ed428995179cb43c3c215d5c5a779..9ae50bf04ece9ed12d39eaf1f55d2d604b1c03fa 100644 (file)
@@ -55,7 +55,7 @@ AliProtonAnalysis::AliProtonAnalysis() :
   fNBinsPt(0), fMinPt(0), fMaxPt(0),
   fProtonContainer(0), fAntiProtonContainer(0),
   fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0), 
-  fHistEventStats(0),
+  fHistEventStats(0), fYRatioInPtBinsList(0),
   fEffGridListProtons(0), fCorrectionListProtons2D(0), 
   fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
   fEffGridListAntiProtons(0), fCorrectionListAntiProtons2D(0), 
@@ -77,7 +77,8 @@ AliProtonAnalysis::AliProtonAnalysis(Int_t nbinsY,
   fNBinsY(nbinsY), fMinY(fLowY), fMaxY(fHighY),
   fNBinsPt(nbinsPt), fMinPt(fLowPt), fMaxPt(fHighPt),
   fProtonContainer(0), fAntiProtonContainer(0),
-  fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0), fHistEventStats(0),
+  fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0), 
+  fHistEventStats(0), fYRatioInPtBinsList(0),
   fEffGridListProtons(0), fCorrectionListProtons2D(0), 
   fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
   fEffGridListAntiProtons(0), fCorrectionListAntiProtons2D(0), 
@@ -148,7 +149,8 @@ AliProtonAnalysis::AliProtonAnalysis(Int_t nbinsY, Double_t *gY,
   fNBinsY(nbinsY), fMinY(gY[0]), fMaxY(gY[nbinsY]),
   fNBinsPt(nbinsPt), fMinPt(gPt[0]), fMaxPt(gPt[nbinsPt]),
   fProtonContainer(0), fAntiProtonContainer(0),
-  fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0), fHistEventStats(0),
+  fHistEvents(0), fHistYPtProtons(0), fHistYPtAntiProtons(0), 
+  fHistEventStats(0), fYRatioInPtBinsList(0),
   fEffGridListProtons(0), fCorrectionListProtons2D(0), 
   fEfficiencyListProtons1D(0), fCorrectionListProtons1D(0),
   fEffGridListAntiProtons(0), fCorrectionListAntiProtons2D(0), 
@@ -211,6 +213,8 @@ AliProtonAnalysis::~AliProtonAnalysis() {
   if(fHistYPtProtons) delete fHistYPtProtons;
   if(fHistYPtAntiProtons) delete fHistYPtAntiProtons;
   if(fHistEventStats) delete fHistEventStats;
+  if(fYRatioInPtBinsList) delete fYRatioInPtBinsList;
+
   if(fProtonContainer) delete fProtonContainer;
   if(fAntiProtonContainer) delete fAntiProtonContainer;
 
@@ -400,6 +404,58 @@ Bool_t AliProtonAnalysis::ReadFromFile(const char* filename) {
   return status;
 }
 
+//____________________________________________________________________//
+TList *AliProtonAnalysis::GetYRatioHistogramsInPtBins() {
+  //Returns a TList obkect with the eta (or y) dependent ratios for each 
+  //pT bin taken from the 2D histograms (not from the containers)
+  fYRatioInPtBinsList = new TList();
+  
+  //Protons
+  TH1D *gHistYProtons[100];
+  TString title;
+  for(Int_t iBin = 1; iBin <= fHistYPtProtons->GetNbinsY(); iBin++) {
+    title = "gHistYProtons_PtBin"; title += iBin;
+    gHistYProtons[iBin] = (TH1D *)fHistYPtProtons->ProjectionX(title.Data(),
+                                                              iBin,
+                                                              iBin,"e");
+    gHistYProtons[iBin]->Sumw2();
+  }
+
+  //Antiprotons
+  TH1D *gHistYAntiProtons[100];
+  for(Int_t iBin = 1; iBin <= fHistYPtAntiProtons->GetNbinsY(); iBin++) {
+    title = "gHistYAntiProtons_PtBin"; title += iBin;
+    gHistYAntiProtons[iBin] = (TH1D *)fHistYPtAntiProtons->ProjectionX(title.Data(),
+                                                                      iBin,
+                                                                      iBin,"e");
+    gHistYAntiProtons[iBin]->Sumw2();
+  }
+
+  Double_t pTmin = fHistYPtProtons->GetYaxis()->GetXmin();
+  Double_t pTStep = (fHistYPtProtons->GetYaxis()->GetXmax() - fHistYPtProtons->GetYaxis()->GetXmin())/fHistYPtProtons->GetNbinsY();
+  Double_t pTmax = pTmin + pTStep;
+  //Ratio
+  TH1D *gHistYRatio[100];
+  for(Int_t iBin = 1; iBin <= fHistYPtProtons->GetNbinsY(); iBin++) {
+    title = "gHistYRatio_PtBin"; title += iBin;
+    gHistYRatio[iBin] = new TH1D(title.Data(),"",
+                                fHistYPtProtons->GetNbinsX(),
+                                fHistYPtProtons->GetXaxis()->GetXmin(),
+                                fHistYPtProtons->GetXaxis()->GetXmax());
+    title = "Pt: "; title += pTmin; title += " - "; title += pTmax;
+    gHistYRatio[iBin]->SetTitle(title.Data());
+    gHistYRatio[iBin]->GetYaxis()->SetTitle("#bar{p}/p");
+    gHistYRatio[iBin]->GetXaxis()->SetTitle(fHistYPtProtons->GetXaxis()->GetTitle());
+    gHistYRatio[iBin]->Divide(gHistYAntiProtons[iBin],
+                             gHistYProtons[iBin],1.0,1.0);
+    fYRatioInPtBinsList->Add(gHistYRatio[iBin]);
+    pTmin += pTStep;
+    pTmax += pTStep;
+  }
+  
+  return fYRatioInPtBinsList;
+}
+
 //____________________________________________________________________//
 TH1D *AliProtonAnalysis::GetProtonYHistogram() {
   //Get the y histogram for protons
index 45bc75851428525b2a9c049dcc3cb2e638537221..8c99e07aed198d7f99fc712eb30e258d09553ba2 100644 (file)
@@ -88,6 +88,7 @@ class AliProtonAnalysis : public TObject {
   
   TH1F *GetEventStatistics() {return fHistEventStats;}
 
+  TList *GetYRatioHistogramsInPtBins();
   TH1D *GetYRatioHistogram();
   TH1D *GetYRatioCorrectedHistogram(TH2D *gCorrectionMapProtons,
                                    TH2D *gCorrectionMapAntiProtons);
@@ -137,6 +138,7 @@ class AliProtonAnalysis : public TObject {
   TH2D *fHistYPtProtons; //Y-Pt of Protons
   TH2D *fHistYPtAntiProtons; // Y-Pt of Antiprotons
   TH1F *fHistEventStats;//Event statistics
+  TList *fYRatioInPtBinsList;//TList of the eta dependent ratios for each pT bin
 
   //Corrections
   TList *fEffGridListProtons; //list for the efficiency grid - protons 
index 563bbeab40144a21e78b7f4330ba00d260386d79..652ff794cd630aacb09b5aa5afac2eff9c178c57 100644 (file)
@@ -31,6 +31,8 @@ void drawResults(const char* analysisOutput) {
   TH1D *gHistPtAntiProtons = dynamic_cast<TH1D *>(analysis->GetAntiProtonPtHistogram());
   TH1D *gHistYRatio = dynamic_cast<TH1D *>(analysis->GetYRatioHistogram());
   TH1D *gHistPtRatio = dynamic_cast<TH1D *>(analysis->GetPtRatioHistogram());
+  TList *gYRatioInPtBinsList = dynamic_cast<TList *>(analysis->GetYRatioHistogramsInPtBins());
+  drawRatioInPtBins(gYRatioInPtBinsList);
 
   //==================================================================//
   TH2F *hEmptyRatio = new TH2F("hEmptyRatio",";;#bar{p}/p",100,-1.1,1.1,100,0.1,1.1);
@@ -67,7 +69,7 @@ void drawResults(const char* analysisOutput) {
 
   TCanvas *cRatio = new TCanvas("cRatio","Ratio",300,0,600,400);
   cRatio->SetFillColor(10); cRatio->SetHighLightColor(10); cRatio->Divide(2,1);
-  cRatio->cd(1); hEmptyRatio->GetXaxis()->SetTitle("eta"); 
+  cRatio->cd(1); hEmptyRatio->GetXaxis()->SetTitle("#eta"); 
   hEmptyRatio->GetXaxis()->SetRangeUser(-1.0,1.0); 
   hEmptyRatio->DrawCopy(); gHistYRatio->Draw("ESAME");
   gHistYRatio->Fit("fFitFunction","N");
@@ -93,6 +95,29 @@ void drawResults(const char* analysisOutput) {
   Printf("==========================================");
 }
 
+//___________________________________________________//
+void drawRatioInPtBins(TList *gYRatioInPtBinsList) {
+  Printf("drawRatioInPtBins:: %d entries",gYRatioInPtBinsList->GetEntries());
+  static const Int_t nEntries = gYRatioInPtBinsList->GetEntries();
+  TCanvas *cRatioInPtBins[100];
+  TH1D *gHistRatioInPtBins[100];
+  TString title;
+  for(Int_t iEntry = 0; iEntry < gYRatioInPtBinsList->GetEntries(); iEntry++) {
+    title = "ratioPtBin"; title += iEntry+1;
+    cRatioInPtBins[iEntry] = new TCanvas(title.Data(),
+                                        title.Data(),
+                                        0,0,400,400);
+    cRatioInPtBins[iEntry]->SetFillColor(10);
+    cRatioInPtBins[iEntry]->SetHighLightColor(10);
+    gHistRatioInPtBins[iEntry] = dynamic_cast<TH1D *>(gYRatioInPtBinsList->At(iEntry));
+    gHistRatioInPtBins[iEntry]->SetStats(kFALSE);
+    gHistRatioInPtBins[iEntry]->SetMarkerStyle(20);
+    gHistRatioInPtBins[iEntry]->SetMarkerColor(4);
+    gHistRatioInPtBins[iEntry]->GetYaxis()->SetRangeUser(0.0,1.4);
+    gHistRatioInPtBins[iEntry]->DrawCopy("E");
+  }
+}
+
 //___________________________________________________//
 void drawQAPlots(const char* analysisOutput,
                 Bool_t kMC) {
@@ -927,67 +952,67 @@ void drawMCvsData(const char* analysisOutputMC,
   gDataProtonsITSClustersPass->Add(gDataProtonsITSClustersReject);
   gDataProtonsITSClustersPass->Sumw2();
   gDataProtonsITSClustersPass->Scale(1./gDataProtonsITSClustersPass->Integral(1,gDataProtonsITSClustersPass->GetNbinsX()));
-  gDataProtonsITSClustersPass->SetMarkerStyle(24);
+  gDataProtonsITSClustersPass->SetMarkerStyle(1);
   TH1F *gDataProtonsTPCClustersPass = dynamic_cast<TH1F *>(fQADataProtonsAcceptedList->At(2));
   gDataProtonsTPCClustersPass->SetStats(kFALSE);
   gDataProtonsTPCClustersPass->Add(gDataProtonsTPCClustersReject);
   gDataProtonsTPCClustersPass->Sumw2();
   gDataProtonsTPCClustersPass->Scale(1./gDataProtonsTPCClustersPass->Integral(1,gDataProtonsTPCClustersPass->GetNbinsX()));
-  gDataProtonsTPCClustersPass->SetMarkerStyle(24);
+  gDataProtonsTPCClustersPass->SetMarkerStyle(1);
   TH1F *gDataProtonsChi2PerClusterTPCPass = dynamic_cast<TH1F *>(fQADataProtonsAcceptedList->At(3));
   gDataProtonsChi2PerClusterTPCPass->SetStats(kFALSE);
   gDataProtonsChi2PerClusterTPCPass->Add(gDataProtonsChi2PerClusterTPCReject);
   gDataProtonsChi2PerClusterTPCPass->Sumw2();
   gDataProtonsChi2PerClusterTPCPass->Scale(1./gDataProtonsChi2PerClusterTPCPass->Integral(1,gDataProtonsChi2PerClusterTPCPass->GetNbinsX()));
-  gDataProtonsChi2PerClusterTPCPass->SetMarkerStyle(24);
+  gDataProtonsChi2PerClusterTPCPass->SetMarkerStyle(1);
   TH1F *gDataProtonsExtCov11Pass = dynamic_cast<TH1F *>(fQADataProtonsAcceptedList->At(4));
   gDataProtonsExtCov11Pass->SetStats(kFALSE);
   gDataProtonsExtCov11Pass->Add(gDataProtonsExtCov11Reject);
   gDataProtonsExtCov11Pass->Sumw2();
   gDataProtonsExtCov11Pass->Scale(1./gDataProtonsExtCov11Pass->Integral(1,gDataProtonsExtCov11Pass->GetNbinsX()));
-  gDataProtonsExtCov11Pass->SetMarkerStyle(24);
+  gDataProtonsExtCov11Pass->SetMarkerStyle(1);
   TH1F *gDataProtonsExtCov22Pass = dynamic_cast<TH1F *>(fQADataProtonsAcceptedList->At(5));
   gDataProtonsExtCov22Pass->SetStats(kFALSE);
   gDataProtonsExtCov22Pass->Add(gDataProtonsExtCov22Reject);
   gDataProtonsExtCov22Pass->Sumw2();
   gDataProtonsExtCov22Pass->Scale(1./gDataProtonsExtCov22Pass->Integral(1,gDataProtonsExtCov22Pass->GetNbinsX()));
-  gDataProtonsExtCov22Pass->SetMarkerStyle(24);
+  gDataProtonsExtCov22Pass->SetMarkerStyle(1);
   TH1F *gDataProtonsExtCov33Pass = dynamic_cast<TH1F *>(fQADataProtonsAcceptedList->At(6));
   gDataProtonsExtCov33Pass->SetStats(kFALSE);
   gDataProtonsExtCov33Pass->Add(gDataProtonsExtCov33Reject);
   gDataProtonsExtCov33Pass->Sumw2();
   gDataProtonsExtCov33Pass->Scale(1./gDataProtonsExtCov33Pass->Integral(1,gDataProtonsExtCov33Pass->GetNbinsX()));
-  gDataProtonsExtCov33Pass->SetMarkerStyle(24);
+  gDataProtonsExtCov33Pass->SetMarkerStyle(1);
   TH1F *gDataProtonsExtCov44Pass = dynamic_cast<TH1F *>(fQADataProtonsAcceptedList->At(7));
   gDataProtonsExtCov44Pass->SetStats(kFALSE);
   gDataProtonsExtCov44Pass->Add(gDataProtonsExtCov44Reject);
   gDataProtonsExtCov44Pass->Sumw2();
   gDataProtonsExtCov44Pass->Scale(1./gDataProtonsExtCov44Pass->Integral(1,gDataProtonsExtCov44Pass->GetNbinsX()));
-  gDataProtonsExtCov44Pass->SetMarkerStyle(24);
+  gDataProtonsExtCov44Pass->SetMarkerStyle(1);
   TH1F *gDataProtonsExtCov55Pass = dynamic_cast<TH1F *>(fQADataProtonsAcceptedList->At(8));
   gDataProtonsExtCov55Pass->SetStats(kFALSE);
   gDataProtonsExtCov55Pass->Add(gDataProtonsExtCov55Reject);
   gDataProtonsExtCov55Pass->Sumw2();
   gDataProtonsExtCov55Pass->Scale(1./gDataProtonsExtCov55Pass->Integral(1,gDataProtonsExtCov55Pass->GetNbinsX()));
-  gDataProtonsExtCov55Pass->SetMarkerStyle(24);
+  gDataProtonsExtCov55Pass->SetMarkerStyle(1);
   TH1F *gDataProtonsDCAXYPass = dynamic_cast<TH1F *>(fQADataProtonsAcceptedList->At(11));
   gDataProtonsDCAXYPass->SetStats(kFALSE);  
   gDataProtonsDCAXYPass->Add(gDataProtonsDCAXYReject);
   gDataProtonsDCAXYPass->Sumw2();
   gDataProtonsDCAXYPass->Scale(1./gDataProtonsDCAXYPass->Integral(1,gDataProtonsDCAXYPass->GetNbinsX()));
-  gDataProtonsDCAXYPass->SetMarkerStyle(24);
+  gDataProtonsDCAXYPass->SetMarkerStyle(1);
   TH1F *gDataProtonsDCAZPass = dynamic_cast<TH1F *>(fQADataProtonsAcceptedList->At(13));
   gDataProtonsDCAZPass->SetStats(kFALSE);  
   gDataProtonsDCAZPass->Add(gDataProtonsDCAZReject);
   gDataProtonsDCAZPass->Sumw2();
   gDataProtonsDCAZPass->Scale(1./gDataProtonsDCAZPass->Integral(1,gDataProtonsDCAZPass->GetNbinsX()));
-  gDataProtonsDCAZPass->SetMarkerStyle(24);
+  gDataProtonsDCAZPass->SetMarkerStyle(1);
   TH1F *gDataProtonsNumberOfTPCdEdxPointsPass = dynamic_cast<TH1F *>(fQADataProtonsAcceptedList->At(26));
   gDataProtonsNumberOfTPCdEdxPointsPass->SetStats(kFALSE);  
   gDataProtonsNumberOfTPCdEdxPointsPass->Add(gDataProtonsNumberOfTPCdEdxPointsReject);
   gDataProtonsNumberOfTPCdEdxPointsPass->Sumw2();
   gDataProtonsNumberOfTPCdEdxPointsPass->Scale(1./gDataProtonsNumberOfTPCdEdxPointsPass->Integral(1,gDataProtonsNumberOfTPCdEdxPointsPass->GetNbinsX()));
-  gDataProtonsNumberOfTPCdEdxPointsPass->SetMarkerStyle(24);
+  gDataProtonsNumberOfTPCdEdxPointsPass->SetMarkerStyle(1);
 
   //Rejected antiprotons
   TList *fQADataAntiProtonsRejectedList = dynamic_cast<TList *>(gListGlobalQAData->At(4));