Fix in dPhi calculation
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Nov 2012 14:25:32 +0000 (14:25 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 15 Nov 2012 14:25:32 +0000 (14:25 +0000)
PWGJE/AliAnalysisTaskJetCore.cxx

index cc5d220..f4b9cd6 100644 (file)
@@ -919,9 +919,12 @@ void AliAnalysisTaskJetCore::UserExec(Option_t *)
                  if((jetEta<fJetEtaMin)||(jetEta>fJetEtaMax)) continue;
                  Double_t jetArea = jet->EffectiveAreaCharged();
                  Double_t jetPtCorr=jetPt-rho*jetArea;
-                 Double_t dPhi=TMath::Abs(jetPhi-partback->Phi());
+                 Double_t dPhi=jetPhi-partback->Phi();
                  if(dPhi>2*TMath::Pi()) dPhi -= 2*TMath::Pi();
-                 if(dPhi>1.5*TMath::Pi()) dPhi = dPhi-2*TMath::Pi();
+                 if(dPhi<-2*TMath::Pi()) dPhi += 2*TMath::Pi();
+                 if(dPhi<-0.5*TMath::Pi()) dPhi += 2*TMath::Pi();
+                 if(dPhi>1.5*TMath::Pi()) dPhi -= 2*TMath::Pi();
+
                  Double_t fill[] = {partback->Pt(),jetPtCorr,dPhi,jetArea,centValue};
                  fHJetPhiCorr->Fill(fill);
                }