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