variable normalization range of the event mixing histograms for correlation functions
authormiweber <m.weber@cern.ch>
Tue, 11 Mar 2014 13:37:55 +0000 (14:37 +0100)
committermiweber <m.weber@cern.ch>
Tue, 11 Mar 2014 13:40:09 +0000 (14:40 +0100)
before: fixed 1/2*pi < dphi < 3/2*pi
now: pi - dphirange < dphi < pi + dphirange (default: dphirange = 1/6*pi)

PWGCF/EBYE/BalanceFunctions/AliBalancePsi.cxx
PWGCF/EBYE/BalanceFunctions/AliBalancePsi.h
PWGCF/EBYE/macros/drawBalanceFunction2DPsi.C
PWGCF/EBYE/macros/drawCorrelationFunctionPsi.C

index 551c858..dea98f0 100644 (file)
@@ -1894,6 +1894,7 @@ TH2D *AliBalancePsi::GetCorrelationFunction(TString type,
                                            Double_t ptAssociatedMax,
                                            AliBalancePsi *bMixed,
                                            Bool_t normToTrig,
+                                           Double_t normalizationRangePhi,
                                            TH2D *hVertexCentrality) {
 
   // Returns the 2D correlation function for "type"(PN,NP,PP,NN) pairs,
@@ -1936,7 +1937,7 @@ TH2D *AliBalancePsi::GetCorrelationFunction(TString type,
   for(Int_t iBinPsi = binPsiMin; iBinPsi <= binPsiMax; iBinPsi++){
     for(Int_t iBinVertex = binVertexMin; iBinVertex <= binVertexMax; iBinVertex++){
 
-      cout<<"In the correlation function loop: "<<iBinPsi<<" (psiBin), "<<iBinVertex<<" (vertexBin)  "<<endl;
+      //cout<<"In the correlation function loop: "<<iBinPsi<<" (psiBin), "<<iBinVertex<<" (vertexBin)  "<<endl;
 
       // determine the bin edges for this bin
       binPsiLowEdge    = fHistPN->GetGrid(0)->GetGrid()->GetAxis(0)->GetBinLowEdge(iBinPsi) + 0.00001;
@@ -1971,13 +1972,12 @@ TH2D *AliBalancePsi::GetCorrelationFunction(TString type,
       if(fMixed && normToTrig && fMixed->Integral()>0){
        
        // normalization of Event mixing to 1 at (0,0) --> Jan Fietes method
-       // do it only on away-side (due to two-track cuts): pi +- pi/3.
-
+       // do it only on away-side (due to two-track cuts): pi +- pi/6.
        Int_t binXmin  = fMixed->GetXaxis()->FindBin(0-10e-5);
        Int_t binXmax  = fMixed->GetXaxis()->FindBin(0+10e-5);
        Double_t binsX = (Double_t)(binXmax - binXmin + 1);
-       Int_t binYmin  = fMixed->GetYaxis()->FindBin(2./3.*TMath::Pi());
-       Int_t binYmax  = fMixed->GetYaxis()->FindBin(4./3.*TMath::Pi());
+       Int_t binYmin  = fMixed->GetYaxis()->FindBin(TMath::Pi() - normalizationRangePhi);
+       Int_t binYmax  = fMixed->GetYaxis()->FindBin(TMath::Pi() + normalizationRangePhi - 0.00001);
        Double_t binsY = (Double_t)(binYmax - binYmin + 1);
        
        Double_t mixedNorm = fMixed->Integral(binXmin,binXmax,binYmin,binYmax);
@@ -2016,8 +2016,8 @@ TH2D *AliBalancePsi::GetCorrelationFunction(TString type,
 
        Double_t NEventsSubBin = (Double_t)hVertexCentrality->Integral(binStatsVertexLowEdge,binStatsVertexUpEdge,binStatsPsiLowEdge,binStatsPsiUpEdge);
 
-       Printf("Averaging from %d < z < %d and %d < cent < %d ",binStatsVertexLowEdge,binStatsVertexUpEdge,binStatsPsiLowEdge,binStatsPsiUpEdge);
-       Printf("Averaging from %.2f < z < %.2f and %.2f < cent < %.2f --> %.2f ",binVertexLowEdge,binVertexUpEdge,binPsiLowEdge,binPsiUpEdge,NEventsSubBin);
+       //Printf("Averaging from %d < z < %d and %d < cent < %d ",binStatsVertexLowEdge,binStatsVertexUpEdge,binStatsPsiLowEdge,binStatsPsiUpEdge);
+       //Printf("Averaging from %.2f < z < %.2f and %.2f < cent < %.2f --> %.2f ",binVertexLowEdge,binVertexUpEdge,binPsiLowEdge,binPsiUpEdge,NEventsSubBin);
        fSame->Scale(NEventsSubBin);
        
        // OLD and NEW averaging:
index da24f81..a8cc5f0 100644 (file)
@@ -83,6 +83,7 @@ class AliBalancePsi : public TObject {
                                 Double_t ptAssociatedMax=-1,
                                 AliBalancePsi *bMixed=NULL,
                                 Bool_t normToTrig = kFALSE,
+                                Double_t normalizationRangePhi = TMath::Pi()/6.,
                                 TH2D *hVertexCentrality = NULL);
   TH2D   *GetCorrelationFunctionPN(Double_t psiMin, Double_t psiMax,
                                   Double_t vertexZMin=-1,
index 56865ca..9917e59 100644 (file)
@@ -1413,7 +1413,7 @@ void drawBFPsi2DFromCorrelationFunctions(const char* lhcPeriod = "LHC10h",
   gHistNN->Sumw2();
   gHistNP->Add(gHistNN,-1);
   gHistPN->Add(gHistNP);
-  gHistPN->Scale(0.5);
+  //gHistPN->Scale(0.5);//not needed anymore, since pT,assoc < pT,trig in all pT bins
   TH2D *gHistBalanceFunction2D = dynamic_cast<TH2D *>(gHistPN->Clone());
   gHistBalanceFunction2D->SetStats(kFALSE);
   gHistBalanceFunction2D->GetXaxis()->SetTitle("#Delta#eta");
index f7698ed..981d825 100644 (file)
@@ -18,6 +18,7 @@ void drawCorrelationFunctionPsi(const char* filename = "AnalysisResultsPsi_train
                                Double_t ptAssociatedMin = -1.,
                                Double_t ptAssociatedMax = -1.,
                                Bool_t normToTrig = kTRUE,
+                               Double_t normalizationRangePhi = TMath::Pi()/6.,
                                Bool_t kUseVzBinning = kTRUE,
                                Int_t rebinEta = 1,
                                Int_t rebinPhi = 1,
@@ -94,7 +95,8 @@ void drawCorrelationFunctionPsi(const char* filename = "AnalysisResultsPsi_train
   else 
     draw(list,listShuffled,listMixed,listQA,
         gCentralityEstimator,gCentrality,psiMin,psiMax,vertexZMin,vertexZMax,
-        ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,normToTrig,kUseVzBinning,rebinEta,rebinPhi,eventClass);
+        ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,normToTrig, normalizationRangePhi,
+        kUseVzBinning,rebinEta,rebinPhi,eventClass);
 }
 
 //______________________________________________________//
@@ -276,7 +278,8 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed,
          Double_t vertexZMin,Double_t vertexZMax,
          Double_t ptTriggerMin, Double_t ptTriggerMax,
          Double_t ptAssociatedMin, Double_t ptAssociatedMax,
-         Bool_t normToTrig,                            
+         Bool_t normToTrig, 
+         Double_t normalizationRangePhi,                               
          Bool_t kUseVzBinning,
          Int_t rebinEta, Int_t rebinPhi,TString eventClass) {
   //Draws the correlation functions for every centrality bin
@@ -596,7 +599,7 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed,
     //cPN[2]->SaveAs(pngName.Data());
 
     //Correlation function (+-)
-    gHistPN[3] = b->GetCorrelationFunction("PN",psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed,normToTrig,hVertexCentrality);
+    gHistPN[3] = b->GetCorrelationFunction("PN",psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed,normToTrig,normalizationRangePhi,hVertexCentrality);
     gHistPN[3]->GetXaxis()->SetRangeUser(-1.5,1.5);
     if(normToTrig)
       gHistPN[3]->GetZaxis()->SetTitle("#frac{1}{N_{trig}}#frac{d^{2}N_{assoc}}{d#Delta#eta#Delta#varphi} (rad^{-1})");
@@ -810,7 +813,7 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed,
     //cNP[2]->SaveAs(pngName.Data());
 
     //Correlation function (-+)
-    gHistNP[3] = b->GetCorrelationFunction("NP",psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed,normToTrig,hVertexCentrality);
+    gHistNP[3] = b->GetCorrelationFunction("NP",psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed,normToTrig,normalizationRangePhi,hVertexCentrality);
     gHistNP[3]->GetXaxis()->SetRangeUser(-1.5,1.5);
     if(normToTrig)
       gHistNP[3]->GetZaxis()->SetTitle("#frac{1}{N_{trig}}#frac{d^{2}N_{assoc}}{d#Delta#eta#Delta#varphi} (rad^{-1})");
@@ -1025,7 +1028,7 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed,
     //cPP[2]->SaveAs(pngName.Data());
 
     //Correlation function (++)
-    gHistPP[3] = b->GetCorrelationFunction("PP",psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed,normToTrig,hVertexCentrality);
+    gHistPP[3] = b->GetCorrelationFunction("PP",psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed,normToTrig,normalizationRangePhi,hVertexCentrality);
     gHistPP[3]->GetXaxis()->SetRangeUser(-1.5,1.5);
     if(normToTrig)
       gHistPP[3]->GetZaxis()->SetTitle("#frac{1}{N_{trig}}#frac{d^{2}N_{assoc}}{d#Delta#eta#Delta#varphi} (rad^{-1})");
@@ -1238,7 +1241,7 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed,
     //cNN[2]->SaveAs(pngName.Data());
 
     //Correlation function (--)
-    gHistNN[3] = b->GetCorrelationFunction("NN",psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed,normToTrig,hVertexCentrality);
+    gHistNN[3] = b->GetCorrelationFunction("NN",psiMin,psiMax,vertexZMin,vertexZMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,bMixed,normToTrig,normalizationRangePhi,hVertexCentrality);
     gHistNN[3]->GetXaxis()->SetRangeUser(-1.5,1.5);
     if(normToTrig)
       gHistNN[3]->GetZaxis()->SetTitle("#frac{1}{N_{trig}}#frac{d^{2}N_{assoc}}{d#Delta#eta#Delta#varphi} (rad^{-1})");