]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/EMCALTasks/AliESDJet.cxx
update from rosi
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / AliESDJet.cxx
1 // $Id$
2
3 #include "AliESDJet.h"
4
5 ClassImp(AliESDJet)
6
7 //__________________________________________________________________________________________________
8 AliESDJet::AliESDJet(Double_t px, Double_t py, Double_t pz) 
9   : AliVParticle(), 
10     fPt(TMath::Sqrt(px*px+py*py)), 
11     fEta(TMath::ASinH(pz/fPt)),
12     fPhi(0), fM(0), fNEF(0), 
13     fArea(0), fNch(0), fNn(0),
14     fMaxCPt(0), fMaxNPt(0)
15 {    
16   // Constructor.
17
18   if (fPt != 0) {
19     fPhi = TMath::ATan2(py, px);
20     if (fPhi<0.) 
21       fPhi += 2. * TMath::Pi();
22   }
23 }
24
25 //_________________________________________________________________________________________________
26 AliESDJet::AliESDJet(Double_t pt, Double_t eta, Double_t phi, Double_t m) :
27   AliVParticle(), 
28   fPt(pt), fEta(eta), fPhi(phi), 
29   fM(m), fNEF(0), fArea(0), 
30   fNch(0), fNn(0), 
31   fMaxCPt(0), fMaxNPt(0) 
32 {
33   // Constructor.
34
35  if (fPhi<0.) 
36    fPhi += 2. * TMath::Pi();
37 }
38
39 //_________________________________________________________________________________________________
40 AliESDJet::AliESDJet(const AliESDJet &jet) :
41   AliVParticle(jet),
42   fPt(jet.fPt), fEta(jet.fEta), fPhi(jet.fPhi), 
43   fM(jet.fM), fNEF(jet.fNEF), fArea(jet.fArea), 
44   fNch(jet.fNch), fNn(jet.fNn),
45   fMaxCPt(jet.fMaxCPt), fMaxNPt(jet.fMaxNPt)
46 {
47   // Constructor.
48 }
49
50 //_________________________________________________________________________________________________
51 AliESDJet &AliESDJet::operator=(const AliESDJet &jet)
52 {
53   // Assignment operator.
54
55   if (this!=&jet) {
56     AliVParticle::operator=(jet);
57     fPt     = jet.fPt;
58     fEta    = jet.fEta;
59     fPhi    = jet.fPhi;
60     fM      = jet.fM; 
61     fNEF    = jet.fNEF;
62     fArea   = jet.fArea; 
63     fNch    = jet.fNch; 
64     fNn     = jet.fNn;
65     fMaxCPt = jet.fMaxCPt; 
66     fMaxNPt = jet.fMaxNPt;
67   }
68
69   return *this;
70 }
71
72 //__________________________________________________________________________________________________
73 void AliESDJet::GetMom(TLorentzVector &vec) const
74 {
75   // Return momentum as four vector.
76
77   Double_t p = fPt *TMath::CosH(fEta);
78   vec.SetPtEtaPhiE(fPt,fEta,fPhi,TMath::Sqrt(p*p+fM*fM));
79 }
80
81 //__________________________________________________________________________________________________
82 void AliESDJet::Print(Option_t* /*option*/) const
83 {
84   // Print jet information.
85
86   printf("Jet pt=%.2f, eta=%.2f, phi=%.2f, area=%.2f, NEF=%.2f\n", fPt, fEta, fPhi, fArea, fNEF);
87 }