Return type corrected (Gustavo)
[u/mrichter/AliRoot.git] / STEER / AliAODJet.h
CommitLineData
df9db588 1#ifndef AliAODJet_H
2#define AliAODJet_H
3/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8//-------------------------------------------------------------------------
87102d3c 9// AOD jet class
10// Author: Andreas Morsch, CERN
df9db588 11//-------------------------------------------------------------------------
12
87102d3c 13#include <TLorentzVector.h>
ff7c57dd 14#include "AliVParticle.h"
2e7293a2 15#include <TArrayI.h>
df9db588 16#include "AliAODVertex.h"
17
87102d3c 18
ff7c57dd 19class AliAODJet : public AliVParticle {
df9db588 20
21 public:
87102d3c 22 AliAODJet();
23 AliAODJet(Double_t px, Double_t py, Double_t pz, Double_t e);
a1708071 24 AliAODJet(TLorentzVector & p);
87102d3c 25 virtual ~AliAODJet();
26 AliAODJet(const AliAODJet& jet);
27 AliAODJet& operator=(const AliAODJet& jet);
ff7c57dd 28// AliVParticle methods
87102d3c 29 virtual Double_t Px() const { return fMomentum->Px(); }
30 virtual Double_t Py() const { return fMomentum->Py(); }
31 virtual Double_t Pz() const { return fMomentum->Pz(); }
32 virtual Double_t Pt() const { return fMomentum->Pt(); }
33 virtual Double_t P() const { return fMomentum->P(); }
34 virtual Double_t OneOverPt() const { return 1. / fMomentum->Pt(); }
c683ddc2 35 virtual Bool_t PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; }
4124c6c5 36 virtual Double_t Phi() const;
87102d3c 37 virtual Double_t Theta() const { return fMomentum->Theta(); }
38 virtual Double_t E() const { return fMomentum->E(); }
39 virtual Double_t M() const { return fMomentum->M(); }
40 virtual Double_t Eta() const { return fMomentum->Eta(); }
41 virtual Double_t Y() const { return fMomentum->Rapidity();}
c683ddc2 42 virtual Double_t Xv() const {return -999.;} // put reasonable values here
43 virtual Double_t Yv() const {return -999.;} //
44 virtual Double_t Zv() const {return -999.;} //
45 virtual Bool_t XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; }
4124c6c5 46
87102d3c 47//
2e7293a2 48 virtual void AddTrack(TObject *tr) {fRefTracks->Add(tr);}
49 TObject* GetTrack(Int_t i) {return fRefTracks->At(i);}
87102d3c 50 virtual void SetBgEnergy(Double_t bgEnCh, Double_t bgEnNe)
51 {fBackgEnergy[0] = bgEnCh; fBackgEnergy[1] = bgEnNe;}
52 virtual void SetEffArea(Double_t effACh, Double_t effANe)
53 {fEffectiveArea[0] = effACh; fEffectiveArea[1] = effANe;}
944efc80 54 virtual void SetPxPyPzE(Double_t px, Double_t py, Double_t pz, Double_t e);
55
2e7293a2 56 virtual TRefArray* GetRefTracks() const { return fRefTracks;}
57 virtual Double_t ChargedBgEnergy() const { return fBackgEnergy[0];}
58 virtual Double_t NeutralBgEnergy() const { return fBackgEnergy[1];}
59 virtual Double_t TotalBgEnergy() const { return (fBackgEnergy[0] + fBackgEnergy[1]);}
87102d3c 60
2e7293a2 61 virtual Double_t EffectiveAreaCharged() const { return fEffectiveArea[0];}
62 virtual Double_t EffectiveAreaNeutral() const { return fEffectiveArea[1];}
a19f293d 63 virtual Double_t DeltaR(const AliVParticle* part);
87102d3c 64
a19f293d 65
66ac9c97 66 TLorentzVector* MomentumVector() const {return fMomentum;}
a19f293d 67 virtual void Print(Option_t* /*option*/) const;
87102d3c 68
69// Dummy
70 virtual Short_t Charge() const { return 0;}
71 virtual const Double_t* PID() const { return NULL;}
3c43fb2b 72 virtual Int_t GetLabel() const { return -1;}
87102d3c 73//
3a4dcedf 74
75 /** Compare this class with an other instance of this class
76 * used in a TClonesArray::Sort()
77 * @param obj ptr to other instance
78 * @return Returns 0 when equal, 1 when this is smaller
79 * and -1 when bigger -- sorts descending
80 */
81 Int_t Compare( const TObject* obj) const;
87102d3c 82
83
3a4dcedf 84 /** Defines this class as being sortable in a TClonesArray
85 * @return always kTRUE;
86 */
87 Bool_t IsSortable() const { return kTRUE; }
88
87102d3c 89 private:
9333290e 90 Double32_t fBackgEnergy[2]; // Subtracted background energy
91 Double32_t fEffectiveArea[2]; // Effective jet area used for background subtraction
92
87102d3c 93 TLorentzVector* fMomentum; // Jet 4-momentum vector
2e7293a2 94 TRefArray* fRefTracks; // array of references to the tracks belonging to the jet
9333290e 95
66ac9c97 96 ClassDef(AliAODJet,4);
4124c6c5 97
df9db588 98};
99
4124c6c5 100inline Double_t AliAODJet::Phi() const
101{
102 // Return phi
103 Double_t phi = fMomentum->Phi();
104 if (phi < 0.) phi += 2. * TMath::Pi();
105 return phi;
106}
107
df9db588 108#endif