Added type which is not used yet, but will be for mixed events.
[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;}
317552c8 37 void SetType(Int_t t) {fType = t;}
38
d7c6ab14 39 Float_t P() const {return TMath::Sqrt(fPx*fPx+fPy*fPy+fPz*fPz);}
40 Float_t Y() const {if (fE != fPz) return 0.5*TMath::Log((fE+fPz)/(fE-fPz));
41 else return 1.e30;}
42 Float_t Theta () const {return (fPz==0)?TMath::PiOver2():TMath::ACos(fPz/P());}
43
44 Int_t GetUID() const {return fIdxInEvent;}
45 Int_t GetLabel() const {return fLabel;}
46
47 Float_t Px() const {return fPx;}
48 Float_t Py() const {return fPy;}
49 Float_t Pz() const {return fPz;}
50 Float_t Energy() const {return fE;}
51
317552c8 52 Int_t GetType() const {return fType;}
d7c6ab14 53 Float_t Pt() const {return fPt;}
54 Float_t Eta() const {return fEta;}
55 Float_t Phi() const {return fPhi;}
56
57 void Clear(Option_t *t="");
58 void Print(Option_t *t="") const;
f83e88f6 59 ULong_t Hash() const {return fIdxInEvent;}
60 Bool_t IsEqual(const TObject *obj) const
61 {return fIdxInEvent == ((AliJetParticle*)obj)->GetUID();}
62 Bool_t IsSortable() const {return kTRUE;}
63 Int_t Compare(const TObject *obj) const;
d7c6ab14 64
65 protected:
66 void Calculate(); //calculate values
67
68 Float_t fPx; // x component of momentum at vertex
69 Float_t fPy; // y component of momentum at vertex
70 Float_t fPz; // z component of momentum at vertex
71 Float_t fE; // total energy
72 Int_t fIdxInEvent; // index of particle as appeared in complete event
317552c8 73 Int_t fType; // -123 if marked
74 Int_t fLabel; // assigned label
d7c6ab14 75 Float_t fPt; // normally calculated
76 Float_t fEta; // normally calculated
77 Float_t fPhi; // normally calculated
78
317552c8 79 ClassDef(AliJetParticle,2) // Basic Jet Particle class
d7c6ab14 80};
81#endif