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;
34 AliJetParticle::AliJetParticle(const TParticle* p, Int_t idx, Int_t l) :
37 SetMomentum(p->Px(),p->Py(),p->Pz(),p->Energy());
43 AliJetParticle::AliJetParticle(Float_t px, Float_t py, Float_t pz,
44 Float_t etot, Int_t idx, Int_t l) :
47 SetMomentum(px,py,pz,etot);
53 AliJetParticle::AliJetParticle(Float_t px, Float_t py, Float_t pz,
54 Float_t etot, Int_t idx, Int_t l,
55 Float_t pt, Float_t phi, Float_t eta) :
57 fPx(px),fPy(py),fPz(pz),
58 fE(etot),fIdxInEvent(idx),
60 fPt(pt),fEta(eta),fPhi(phi)
65 void AliJetParticle::Calculate()
67 //calculate values from px, py, pz
68 //which are frequently needed
70 fPt=TMath::Sqrt(fPx*fPx+fPy*fPy);
72 fEta=0.5*TMath::Log((kp+fPz+1e-30)/(kp-fPz+1e-30));
73 fPhi=TMath::Pi()+TMath::ATan2(-fPy,-fPx);
76 void AliJetParticle::Clear(Option_t* /*t*/)
90 void AliJetParticle::Print(Option_t* /*t*/) const
92 cout << fPt << " " << fEta << " " << fPhi << endl;
95 Int_t AliJetParticle::Compare(const TObject *obj) const
97 Double_t val=((AliJetParticle*)obj)->Pt();
100 else if (fPt<val) return -1;