From: vkucera Date: Wed, 29 Oct 2014 22:49:33 +0000 (+0100) Subject: Some calculations simplified. X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=dbfb49e00296237b08ea09905c6cd5ade2526c94 Some calculations simplified. --- diff --git a/PWGJE/EMCALJetTasks/AliEmcalJet.cxx b/PWGJE/EMCALJetTasks/AliEmcalJet.cxx index b84160bfa8a..e68a91e0b74 100644 --- a/PWGJE/EMCALJetTasks/AliEmcalJet.cxx +++ b/PWGJE/EMCALJetTasks/AliEmcalJet.cxx @@ -396,8 +396,7 @@ void AliEmcalJet::GetMom(TLorentzVector& vec) const { // Return momentum as four vector. - Double_t p = fPt * TMath::CosH(fEta); - vec.SetPtEtaPhiE(fPt, fEta, fPhi, TMath::Sqrt(p * p + fM * fM)); + vec.SetPtEtaPhiE(fPt, fEta, fPhi, E()); } //__________________________________________________________________________________________________ @@ -478,10 +477,11 @@ Double_t AliEmcalJet::GetZ(const Double_t trkPx, const Double_t trkPy, const Dou { // Get the z of a constituent inside of a jet - Double_t pJetSq = this->Px() * this->Px() + this->Py() * this->Py() + this->Pz() * this->Pz(); + Double_t pJetSq = P(); + pJetSq *= pJetSq; if(pJetSq > 1e-6) - { return (trkPx * this->Px() + trkPy * this->Py() + trkPz * this->Pz()) / pJetSq ; } + { return (trkPx * Px() + trkPy * Py() + trkPz * Pz()) / pJetSq ; } else { AliWarning(Form("%s: strange, pjet*pjet seems to be zero pJetSq: %f", GetName(), pJetSq)); return -1; } } diff --git a/PWGJE/EMCALJetTasks/AliEmcalJet.h b/PWGJE/EMCALJetTasks/AliEmcalJet.h index c2d7d5e4ab3..d9136362017 100644 --- a/PWGJE/EMCALJetTasks/AliEmcalJet.h +++ b/PWGJE/EMCALJetTasks/AliEmcalJet.h @@ -47,10 +47,10 @@ class AliEmcalJet : public AliVParticle Double_t OneOverPt() const { return 1./fPt; } Double_t Phi() const { return fPhi; } Double_t Theta() const { return 2*TMath::ATan(TMath::Exp(-fEta)); } - Double_t E() const { Double_t p=P(); return TMath::Sqrt(M()*M()+p*p); } + Double_t E() const { Double_t p=P(); return TMath::Sqrt(fM*fM+p*p); } Double_t M() const { return fM; } Double_t Eta() const { return fEta; } - Double_t Y() const { return 0.5*TMath::Log((E()+Pz())/(E()-Pz())); } + Double_t Y() const { Double_t e = E(); Double_t pz = Pz(); return 0.5*TMath::Log((e+pz)/(e-pz)); } Short_t Charge() const { return 0; } Int_t GetLabel() const { return fLabel; } Int_t PdgCode() const { return 0; }