- Added following dimensions to pT resolution output: centrality, charge
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Dec 2013 16:11:18 +0000 (16:11 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 2 Dec 2013 16:11:18 +0000 (16:11 +0000)
- Changed binning for pT resolution

PWGJE/UserTasks/AliAnalysisTaskIDFragmentationFunction.cxx
PWGJE/UserTasks/AliAnalysisTaskPID.cxx
PWGJE/UserTasks/AliAnalysisTaskPID.h

index e105bc4..60dd722 100644 (file)
@@ -2849,7 +2849,8 @@ void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *)
                                                                               gentrack->Charge() / 3., centPercent, -1, -1, 
                                                                               -1 };
                 
-                Double_t valuePtResolution[AliAnalysisTaskPID::kPtResNumAxes] = { -1, gentrack->Pt(), inclusiveaod->Pt() };
+                Double_t valuePtResolution[AliAnalysisTaskPID::kPtResNumAxes] = { -1, gentrack->Pt(), inclusiveaod->Pt(),
+                                                                                  gentrack->Charge() / 3., centPercent };
               
                 for (Int_t i = 0; i < fNumInclusivePIDtasks; i++) {
                   if (survivedTPCCutMIGeo || !fInclusivePIDtask[i]->GetUseTPCCutMIGeo()) {
@@ -3163,7 +3164,7 @@ void AliAnalysisTaskIDFragmentationFunction::UserExec(Option_t *)
                                                                           gentrack->Charge() / 3., centPercent, jetPt, genZ, 
                                                                           genXi };
             
-            Double_t valuePtResolution[AliAnalysisTaskPID::kPtResNumAxes] = { jetPt, genPt, pT };
+            Double_t valuePtResolution[AliAnalysisTaskPID::kPtResNumAxes] = { jetPt, genPt, pT, gentrack->Charge() / 3., centPercent };
             
             for (Int_t i = 0; i < fNumJetPIDtasks; i++) {
               if (survivedTPCCutMIGeo || !fJetPIDtask[i]->GetUseTPCCutMIGeo()) {
index a790db9..64b6f8b 100644 (file)
@@ -764,16 +764,31 @@ void AliAnalysisTaskPID::UserCreateOutputObjects()
     fPtResolutionContainer->SetName(Form("%s_PtResolution", GetName()));
     fPtResolutionContainer->SetOwner(kTRUE);
     
+    const Int_t nPtBinsRes = 100;
+    Double_t pTbinsRes[nPtBinsRes + 1];
+
+    const Double_t fromLowPtRes = 0.15;
+    const Double_t toHighPtRes = 50.;
+    const Double_t factorPtRes = TMath::Power(toHighPtRes/fromLowPtRes, 1./nPtBinsRes);
+    // Log binning for whole pT range
+    pTbinsRes[0] = fromLowPtRes;
+    for (Int_t i = 0 + 1; i <= nPtBinsRes; i++) {
+      pTbinsRes[i] = factorPtRes * pTbinsRes[i - 1];
+    }
+    
     const Int_t nBinsPtResolution = kPtResNumAxes;
-    Int_t ptResolutionBins[kPtResNumAxes]    = { nJetPtBins,                    nPtBins,         nPtBins };
-    Double_t ptResolutionXmin[kPtResNumAxes] = { binsJetPt[0],                binsPt[0],       binsPt[0] };
-    Double_t ptResolutionXmax[kPtResNumAxes] = { binsJetPt[nJetPtBins], binsPt[nPtBins], binsPt[nPtBins] };
+    Int_t ptResolutionBins[kPtResNumAxes]    = { nJetPtBins,                       nPtBinsRes,            nPtBinsRes,             
+                                                 nChargeBins,             nCentBins };
+    Double_t ptResolutionXmin[kPtResNumAxes] = { binsJetPt[0],                   pTbinsRes[0],          pTbinsRes[0],           
+                                                 binsCharge[0],           binsCent[0] };
+    Double_t ptResolutionXmax[kPtResNumAxes] = { binsJetPt[nJetPtBins], pTbinsRes[nPtBinsRes], pTbinsRes[nPtBinsRes], 
+                                                 binsCharge[nChargeBins], binsCent[nCentBins] };
 
     for (Int_t i = 0; i < AliPID::kSPECIES; i++) {
       fPtResolution[i] = new THnSparseD(Form("fPtResolution_%s", AliPID::ParticleShortName(i)), 
                                         Form("Pt resolution for primaries, %s", AliPID::ParticleLatexName(i)),
                                         nBinsPtResolution, ptResolutionBins, ptResolutionXmin, ptResolutionXmax);
-      SetUpPtResHist(fPtResolution[i], binsPt, binsJetPt);
+      SetUpPtResHist(fPtResolution[i], pTbinsRes, binsJetPt, binsCent);
       fPtResolutionContainer->Add(fPtResolution[i]);
     }
   }
@@ -956,7 +971,8 @@ void AliAnalysisTaskPID::UserExec(Option_t *)
     
     if (fDoPtResolution) {
       if (mcTrack && fMC->IsPhysicalPrimary(TMath::Abs(label))) {
-        Double_t valuePtRes[kPtResNumAxes] = { -1, mcTrack->Pt(), track->Pt() };
+        // AliMCParticle->Charge() calls TParticlePDG->Charge(), which returns the charge in units of e0 / 3
+        Double_t valuePtRes[kPtResNumAxes] = { -1, mcTrack->Pt(), track->Pt(), mcTrack->Charge() / 3., centralityPercentile };
         fPtResolution[mcID]->Fill(valuePtRes);
       }
     }
@@ -3053,16 +3069,20 @@ void AliAnalysisTaskPID::SetUpHist(THnSparse* hist, Double_t* binsPt, Double_t*
 
 
 //________________________________________________________________________
-void AliAnalysisTaskPID::SetUpPtResHist(THnSparse* hist, Double_t* binsPt, Double_t* binsJetPt) const
+void AliAnalysisTaskPID::SetUpPtResHist(THnSparse* hist, Double_t* binsPt, Double_t* binsJetPt, Double_t* binsCent) const
 {
   // Sets bin limits for axes which are not standard binned and the axes titles.
   
   hist->SetBinEdges(kPtResJetPt, binsJetPt);
   hist->SetBinEdges(kPtResGenPt, binsPt);
   hist->SetBinEdges(kPtResRecPt, binsPt);
+  hist->SetBinEdges(kPtResCentrality, binsCent);
   
   // Set axes titles
   hist->GetAxis(kPtResJetPt)->SetTitle("P_{T}^{jet, rec} (GeV/c)");
   hist->GetAxis(kPtResGenPt)->SetTitle("P_{T}^{gen} (GeV/c)");
   hist->GetAxis(kPtResRecPt)->SetTitle("P_{T}^{rec} (GeV/c)");  
+  
+  hist->GetAxis(kPtResCharge)->SetTitle("Charge (e_{0})");
+  hist->GetAxis(kPtResCentrality)->SetTitle(Form("Centrality Percentile (%s)", fCentralityEstimator.Data()));
 }
index 1addfb7..df9142a 100644 (file)
@@ -59,7 +59,7 @@ class AliAnalysisTaskPID : public AliAnalysisTaskPIDV0base {
   enum genYieldAxes { kGenYieldMCID = 0, kGenYieldPt = 1, kGenYieldCentrality = 2, kGenYieldJetPt = 3, kGenYieldZ = 4, kGenYieldXi = 5,\r
                       kGenYieldCharge = 6, kGenYieldNumAxes = 7 };\r
   \r
-  enum ptResolutionAxes { kPtResJetPt = 0, kPtResGenPt = 1, kPtResRecPt = 2, kPtResNumAxes = 3 };\r
+  enum ptResolutionAxes { kPtResJetPt = 0, kPtResGenPt = 1, kPtResRecPt = 2, kPtResCharge = 3, kPtResCentrality = 4, kPtResNumAxes = 5 };\r
   \r
   enum efficiencyAxes { kEffMCID = 0, kEffTrackPt = 1, kEffTrackEta = 2, kEffTrackCharge = 3, kEffCentrality = 4, kEffJetPt = 5,\r
                         kEffZ = 6, kEffXi = 7, kEffNumAxes = 8 };\r
@@ -219,7 +219,7 @@ class AliAnalysisTaskPID : public AliAnalysisTaskPIDV0base {
   virtual void SetUpGenHist(THnSparse* hist, Double_t* binsPt, Double_t* binsDeltaPrime, Double_t* binsCent, Double_t* binsJetPt) const;\r
   virtual void SetUpGenYieldHist(THnSparse* hist, Double_t* binsPt, Double_t* binsCent, Double_t* binsJetPt) const;\r
   virtual void SetUpHist(THnSparse* hist, Double_t* binsPt, Double_t* binsDeltaPrime, Double_t* binsCent, Double_t* binsJetPt) const;\r
-  void SetUpPtResHist(THnSparse* hist, Double_t* binsPt, Double_t* binsJetPt) const;\r
+  virtual void SetUpPtResHist(THnSparse* hist, Double_t* binsPt, Double_t* binsJetPt, Double_t* binsCent) const;\r
   virtual void SetUpPIDcombined();\r
   \r
   static const Int_t fgkNumJetAxes = 3; // Number of additional axes for jets\r