From: kleinb Date: Fri, 19 Aug 2011 05:52:54 +0000 (+0000) Subject: Added wrapper function to SetPtPhiEtaM() X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=commitdiff_plain;h=6a845d4ec1e0458fc4f32950087f10c7529ae777 Added wrapper function to SetPtPhiEtaM() --- diff --git a/STEER/AOD/AliAODJet.cxx b/STEER/AOD/AliAODJet.cxx index 0e6feaa08e7..b32cdb405f1 100644 --- a/STEER/AOD/AliAODJet.cxx +++ b/STEER/AOD/AliAODJet.cxx @@ -171,6 +171,20 @@ void AliAODJet::SetPxPyPzE(Double_t px, Double_t py, Double_t pz, Double_t e){ } } +void AliAODJet::SetPtEtaPhiM(Double_t pt, Double_t eta, Double_t phi, Double_t m){ + // + // Set the four Momentum from outside with pt eta phi and M + // MomentumVector()->SetPtPhiEtaM() cannot be used since pointer can be 0x0 + // + + if(!fMomentum){ + fMomentum = new TLorentzVector(); + } + fMomentum->SetPtEtaPhiM(pt,eta,phi,m); +} + + + Double_t AliAODJet::DeltaR(const AliVParticle* part){ // Helper function to calculate the distance between two jets diff --git a/STEER/AOD/AliAODJet.h b/STEER/AOD/AliAODJet.h index c8dca1352a3..9f337d5951f 100644 --- a/STEER/AOD/AliAODJet.h +++ b/STEER/AOD/AliAODJet.h @@ -59,6 +59,7 @@ class AliAODJet : public AliVParticle { fEffectiveAreaError[1] = effAErrNe; } virtual void SetPxPyPzE(Double_t px, Double_t py, Double_t pz, Double_t e); + virtual void SetPtEtaPhiM(Double_t pt, Double_t eta, Double_t phi, Double_t m); virtual void SetTrigger(UChar_t f){fTrigger |= f;} virtual void ResetTrigger(UChar_t f){fTrigger &= ~f;} virtual void SetNEF(Double_t nef) {fNeutralFraction=nef;} @@ -112,7 +113,7 @@ class AliAODJet : public AliVParticle { TLorentzVector* fVectorAreaCharged; // jet area four momentum TRefArray* fRefTracks; // array of references to the tracks belonging to the jet - ClassDef(AliAODJet,8); + ClassDef(AliAODJet,9); };