3 //___________________________________________________________
4 /////////////////////////////////////////////////////////////
6 // class AliJetParticle
8 // loizides@ikf.uni-frankfurt.de
10 /////////////////////////////////////////////////////////////
12 #include <Riostream.h>
14 #include <TParticle.h>
15 #include "AliJetParticle.h"
17 ClassImp(AliJetParticle)
19 AliJetParticle::AliJetParticle() :
25 AliJetParticle::AliJetParticle(const AliJetParticle& in) :
28 SetMomentum(in.fPx,in.fPy,in.fPz,in.fE);
29 fIdxInEvent=in.fIdxInEvent;
33 AliJetParticle::AliJetParticle(const TParticle* p, Int_t idx, Int_t l) :
36 SetMomentum(p->Px(),p->Py(),p->Pz(),p->Energy());
41 AliJetParticle::AliJetParticle(Float_t px, Float_t py, Float_t pz,
42 Float_t etot, Int_t idx, Int_t l) :
45 SetMomentum(px,py,pz,etot);
50 AliJetParticle::AliJetParticle(Float_t px, Float_t py, Float_t pz,
51 Float_t etot, Int_t idx, Int_t l,
52 Float_t pt, Float_t phi, Float_t eta) :
54 fPx(px),fPy(py),fPz(pz),
55 fE(etot),fIdxInEvent(idx),fLabel(l),
56 fPt(pt),fEta(eta),fPhi(phi)
61 void AliJetParticle::Calculate()
63 //calculate values from px, py, pz
64 //which are frequently needed
66 fPt=TMath::Sqrt(fPx*fPx+fPy*fPy);
68 fEta=0.5*TMath::Log((kp+fPz+1e-30)/(kp-fPz+1e-30));
69 fPhi=TMath::Pi()+TMath::ATan2(-fPy,-fPx);
72 void AliJetParticle::Clear(Option_t* /*t*/)
85 void AliJetParticle::Print(Option_t* /*t*/) const
87 cout << fPt << " " << fEta << " " << fPhi << endl;
90 Int_t AliJetParticle::Compare(const TObject *obj) const
92 Double_t val=((AliJetParticle*)obj)->Pt();
95 else if (fPt<val) return -1;