5 #include "AliEmcalJet.h"
9 //__________________________________________________________________________________________________
10 AliEmcalJet::AliEmcalJet(Double_t px, Double_t py, Double_t pz)
12 fPt(TMath::Sqrt(px*px+py*py)),
13 fEta(TMath::ASinH(pz/fPt)),
14 fPhi(0), fM(0), fNEF(0),
15 fArea(0), fNch(0), fNn(0),
16 fMaxCPt(0), fMaxNPt(0), fClusterIDs(new TArrayI()), fTrackIDs(new TArrayI())
21 fPhi = TMath::ATan2(py, px);
23 fPhi += 2. * TMath::Pi();
27 //_________________________________________________________________________________________________
28 AliEmcalJet::AliEmcalJet(Double_t pt, Double_t eta, Double_t phi, Double_t m) :
30 fPt(pt), fEta(eta), fPhi(phi),
31 fM(m), fNEF(0), fArea(0),
33 fMaxCPt(0), fMaxNPt(0), fClusterIDs(new TArrayI()), fTrackIDs(new TArrayI())
38 fPhi += 2. * TMath::Pi();
41 //_________________________________________________________________________________________________
42 AliEmcalJet::AliEmcalJet(const AliEmcalJet &jet) :
44 fPt(jet.fPt), fEta(jet.fEta), fPhi(jet.fPhi),
45 fM(jet.fM), fNEF(jet.fNEF), fArea(jet.fArea),
46 fNch(jet.fNch), fNn(jet.fNn),
47 fMaxCPt(jet.fMaxCPt), fMaxNPt(jet.fMaxNPt), fClusterIDs(new TArrayI(*(jet.fClusterIDs))), fTrackIDs(new TArrayI(*(jet.fTrackIDs)))
52 //_________________________________________________________________________________________________
53 AliEmcalJet &AliEmcalJet::operator=(const AliEmcalJet &jet)
55 // Assignment operator.
58 AliVParticle::operator=(jet);
67 fMaxCPt = jet.fMaxCPt;
68 fMaxNPt = jet.fMaxNPt;
74 //__________________________________________________________________________________________________
75 void AliEmcalJet::GetMom(TLorentzVector &vec) const
77 // Return momentum as four vector.
79 Double_t p = fPt *TMath::CosH(fEta);
80 vec.SetPtEtaPhiE(fPt,fEta,fPhi,TMath::Sqrt(p*p+fM*fM));
83 //__________________________________________________________________________________________________
84 void AliEmcalJet::Print(Option_t* /*option*/) const
86 // Print jet information.
88 printf("Jet pt=%.2f, eta=%.2f, phi=%.2f, area=%.2f, NEF=%.2f\n", fPt, fEta, fPhi, fArea, fNEF);
91 //__________________________________________________________________________________________________
92 void AliEmcalJet::SortConstituents()
94 std::sort(fClusterIDs->GetArray(), fClusterIDs->GetArray() + fClusterIDs->GetSize());
95 std::sort(fTrackIDs->GetArray(), fTrackIDs->GetArray() + fTrackIDs->GetSize());