from Megan
authorloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 6 Dec 2012 13:28:01 +0000 (13:28 +0000)
committerloizides <loizides@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 6 Dec 2012 13:28:01 +0000 (13:28 +0000)
PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalJetHMEC.cxx

index 752def3..f7cf26e 100644 (file)
@@ -624,8 +624,9 @@ void AliAnalysisTaskEmcalJetHMEC::UserExec(Option_t *)
                  AliPicoTrack *part = static_cast<AliPicoTrack*>(bgTracks->At(ibg));         
                  if(!part) continue;
   
-                 Double_t DPhi = jetphi - part->Phi();
-                 Double_t DEta = jeteta - part->Eta();
+                 Double_t DEta = part->Eta()-jeteta;
+                 Double_t DPhi = RelativePhi(jetphi,part->Phi());
+
                  Double_t DR=TMath::Sqrt(DPhi*DPhi+DEta*DEta);
                  if(DPhi<-0.5*TMath::Pi()) DPhi+=2.*TMath::Pi();
                  if(DPhi>3./2.*TMath::Pi()) DPhi-=2.*TMath::Pi();