7 #include "AliEmcalJet.h"
11 //__________________________________________________________________________________________________
12 AliEmcalJet::AliEmcalJet() :
35 fClosestJetsDist[0] = 999;
36 fClosestJetsDist[1] = 999;
39 //__________________________________________________________________________________________________
40 AliEmcalJet::AliEmcalJet(Double_t px, Double_t py, Double_t pz) :
42 fPt(TMath::Sqrt(px*px+py*py)),
43 fEta(TMath::ASinH(pz/fPt)),
62 fPhi = TMath::ATan2(py, px);
64 fPhi += 2. * TMath::Pi();
69 fClosestJetsDist[0] = 999;
70 fClosestJetsDist[1] = 999;
73 //_________________________________________________________________________________________________
74 AliEmcalJet::AliEmcalJet(Double_t pt, Double_t eta, Double_t phi, Double_t m) :
96 fPhi += TMath::TwoPi();
100 fClosestJetsDist[0] = 999;
101 fClosestJetsDist[1] = 999;
104 //_________________________________________________________________________________________________
105 AliEmcalJet::AliEmcalJet(const AliEmcalJet &jet) :
113 fAreaEmc(jet.fAreaEmc),
114 fAxisInEmcal(jet.fAxisInEmcal),
115 fMaxCPt(jet.fMaxCPt),
116 fMaxNPt(jet.fMaxNPt),
120 fClusterIDs(jet.fClusterIDs),
121 fTrackIDs(jet.fTrackIDs),
122 fMatched(jet.fMatched)
126 fClosestJets[0] = jet.fClosestJets[0];
127 fClosestJets[1] = jet.fClosestJets[1];
128 fClosestJetsDist[0] = jet.fClosestJetsDist[0];
129 fClosestJetsDist[1] = jet.fClosestJetsDist[1];
132 //_________________________________________________________________________________________________
133 AliEmcalJet &AliEmcalJet::operator=(const AliEmcalJet &jet)
135 // Assignment operator.
138 AliVParticle::operator=(jet);
145 fAreaEmc = jet.fAreaEmc;
146 fAxisInEmcal = jet.fAxisInEmcal;
147 fMaxCPt = jet.fMaxCPt;
148 fMaxNPt = jet.fMaxNPt;
152 fClusterIDs = jet.fClusterIDs;
153 fTrackIDs = jet.fTrackIDs;
154 fClosestJets[0] = jet.fClosestJets[0];
155 fClosestJets[1] = jet.fClosestJets[1];
156 fClosestJetsDist[0] = jet.fClosestJetsDist[0];
157 fClosestJetsDist[1] = jet.fClosestJetsDist[1];
158 fMatched = jet.fMatched;
164 //__________________________________________________________________________________________________
165 void AliEmcalJet::GetMom(TLorentzVector &vec) const
167 // Return momentum as four vector.
169 Double_t p = fPt *TMath::CosH(fEta);
170 vec.SetPtEtaPhiE(fPt,fEta,fPhi,TMath::Sqrt(p*p+fM*fM));
173 //__________________________________________________________________________________________________
174 void AliEmcalJet::Print(Option_t* /*option*/) const
176 // Print jet information.
178 printf("Jet pt=%.2f, eta=%.2f, phi=%.2f, area=%.2f, NEF=%.2f\n", fPt, fEta, fPhi, fArea, fNEF);
181 //__________________________________________________________________________________________________
182 void AliEmcalJet::SortConstituents()
184 // Sort constituent by index (increasing).
186 std::sort(fClusterIDs.GetArray(), fClusterIDs.GetArray() + fClusterIDs.GetSize());
187 std::sort(fTrackIDs.GetArray(), fTrackIDs.GetArray() + fTrackIDs.GetSize());