Added sort method.
[u/mrichter/AliRoot.git] / JETAN / AliJetParticle.h
CommitLineData
d7c6ab14 1#ifndef ALIJETPARTICLE_H
2#define ALIJETPARTICLE_H
3/* $Id$ */
4
5//___________________________________________________________
6/////////////////////////////////////////////////////////////
03747640 7// //
8// class AliJetParticle //
9// //
10// loizides@ikf.uni-frankfurt.de //
11// //
d7c6ab14 12/////////////////////////////////////////////////////////////
13
14#include <TObject.h>
15#include <TMath.h>
16class TParticle;
17
18class AliJetParticle : public TObject
19{
20 public:
21 AliJetParticle();
22 AliJetParticle(const AliJetParticle& in);
23 AliJetParticle(const TParticle* p, Int_t idx, Int_t l=0);
24 AliJetParticle(Float_t px, Float_t py, Float_t pz, Float_t etot, Int_t idx, Int_t l=0);
25 AliJetParticle(Float_t px, Float_t py, Float_t pz, Float_t etot, Int_t idx, Int_t l,
26 Float_t pt, Float_t eta, Float_t phi);
27 virtual ~AliJetParticle(){};
28
29 void SetMomentum(Float_t px, Float_t py, Float_t pz, Float_t e)
30 {fPx=px; fPy=py; fPz=pz; fE=e; Calculate();}
31 void SetMomentum(Float_t px, Float_t py, Float_t pz, Float_t e,
32 Float_t pt, Float_t phi, Float_t eta)
33 {fPx=px;fPy=py;fPz=pz;fE=e;fPt=pt;fEta=eta;fPhi=phi;}
34
35 void SetUID(Int_t id) {fIdxInEvent = id;}
36 void SetLabel(Int_t l){fLabel = l;}
37
38 Float_t P() const {return TMath::Sqrt(fPx*fPx+fPy*fPy+fPz*fPz);}
39 Float_t Y() const {if (fE != fPz) return 0.5*TMath::Log((fE+fPz)/(fE-fPz));
40 else return 1.e30;}
41 Float_t Theta () const {return (fPz==0)?TMath::PiOver2():TMath::ACos(fPz/P());}
42
43 Int_t GetUID() const {return fIdxInEvent;}
44 Int_t GetLabel() const {return fLabel;}
45
46 Float_t Px() const {return fPx;}
47 Float_t Py() const {return fPy;}
48 Float_t Pz() const {return fPz;}
49 Float_t Energy() const {return fE;}
50
51 Float_t Pt() const {return fPt;}
52 Float_t Eta() const {return fEta;}
53 Float_t Phi() const {return fPhi;}
54
55 void Clear(Option_t *t="");
56 void Print(Option_t *t="") const;
f83e88f6 57 ULong_t Hash() const {return fIdxInEvent;}
58 Bool_t IsEqual(const TObject *obj) const
59 {return fIdxInEvent == ((AliJetParticle*)obj)->GetUID();}
60 Bool_t IsSortable() const {return kTRUE;}
61 Int_t Compare(const TObject *obj) const;
d7c6ab14 62
63 protected:
64 void Calculate(); //calculate values
65
66 Float_t fPx; // x component of momentum at vertex
67 Float_t fPy; // y component of momentum at vertex
68 Float_t fPz; // z component of momentum at vertex
69 Float_t fE; // total energy
70 Int_t fIdxInEvent; // index of particle as appeared in complete event
71 Int_t fLabel;
72 Float_t fPt; // normally calculated
73 Float_t fEta; // normally calculated
74 Float_t fPhi; // normally calculated
75
76 ClassDef(AliJetParticle,1) // Basic Jet Particle class
77};
78#endif