]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliAODJet.cxx
Initialization of fAmpThreshold is added to ctors.
[u/mrichter/AliRoot.git] / STEER / AliAODJet.cxx
index b18fe08c47f5b8f9acac1d0a8172c63a566356b1..7fea86783668de0fc86160dfb3f9af039ccc2738 100644 (file)
@@ -126,3 +126,30 @@ void AliAODJet::Print(Option_t* /*option*/) const
   printf("Charged:  %13.3f\n", EffectiveAreaCharged());
   printf("Neutral:  %13.3f\n", EffectiveAreaNeutral());
 }
+
+void  AliAODJet::SetPxPyPzE(Double_t px, Double_t py, Double_t pz, Double_t e){
+  // 
+  // Set the four Momentum from outside
+  // MomentumVector()->SetPxPyPzE() cannot be used since pointer can be 0x0
+  //
+
+  if(!fMomentum){
+    fMomentum = new TLorentzVector(px,py,pz,e);
+  }
+  else{
+    fMomentum->SetPxPyPzE(px,py,pz,e);
+  }
+}
+
+Double_t AliAODJet::DeltaR(const AliVParticle* part){
+
+  // Helper function to calculate the distance between two jets
+  // or a jet and particle
+
+  Double_t dPhi = Phi() - part->Phi(); 
+  if(dPhi>TMath::Pi())dPhi = dPhi - 2.*TMath::Pi();
+  if(dPhi<(-1.*TMath::Pi()))dPhi = dPhi + 2.*TMath::Pi();
+  Double_t dEta = Eta() - part->Eta(); 
+  Double_t dR = TMath::Sqrt(dPhi*dPhi+dEta*dEta);
+  return dR;
+}