7 #include "AliEmcalJet.h"
11 //__________________________________________________________________________________________________
12 AliEmcalJet::AliEmcalJet() :
41 fClosestJetsDist[0] = 999;
42 fClosestJetsDist[1] = 999;
45 //__________________________________________________________________________________________________
46 AliEmcalJet::AliEmcalJet(Double_t px, Double_t py, Double_t pz) :
48 fPt(TMath::Sqrt(px*px+py*py)),
49 fEta(TMath::ASinH(pz/fPt)),
74 fPhi = TMath::ATan2(py, px);
76 fPhi += 2. * TMath::Pi();
81 fClosestJetsDist[0] = 999;
82 fClosestJetsDist[1] = 999;
85 //_________________________________________________________________________________________________
86 AliEmcalJet::AliEmcalJet(Double_t pt, Double_t eta, Double_t phi, Double_t m) :
114 fPhi += TMath::TwoPi();
118 fClosestJetsDist[0] = 999;
119 fClosestJetsDist[1] = 999;
122 //_________________________________________________________________________________________________
123 AliEmcalJet::AliEmcalJet(const AliEmcalJet &jet) :
131 fAreaEta(jet.fAreaEta),
132 fAreaPhi(jet.fAreaPhi),
133 fAreaEmc(jet.fAreaEmc),
134 fAxisInEmcal(jet.fAxisInEmcal),
135 fMaxCPt(jet.fMaxCPt),
136 fMaxNPt(jet.fMaxNPt),
142 fClusterIDs(jet.fClusterIDs),
143 fTrackIDs(jet.fTrackIDs),
144 fMatched(jet.fMatched),
146 fPtVectSub(jet.fPtVectSub)
150 fClosestJets[0] = jet.fClosestJets[0];
151 fClosestJets[1] = jet.fClosestJets[1];
152 fClosestJetsDist[0] = jet.fClosestJetsDist[0];
153 fClosestJetsDist[1] = jet.fClosestJetsDist[1];
156 //_________________________________________________________________________________________________
157 AliEmcalJet &AliEmcalJet::operator=(const AliEmcalJet &jet)
159 // Assignment operator.
162 AliVParticle::operator=(jet);
169 fAreaEta = jet.fAreaEta;
170 fAreaPhi = jet.fAreaPhi;
171 fAreaEmc = jet.fAreaEmc;
172 fAxisInEmcal = jet.fAxisInEmcal;
173 fMaxCPt = jet.fMaxCPt;
174 fMaxNPt = jet.fMaxNPt;
180 fClusterIDs = jet.fClusterIDs;
181 fTrackIDs = jet.fTrackIDs;
182 fClosestJets[0] = jet.fClosestJets[0];
183 fClosestJets[1] = jet.fClosestJets[1];
184 fClosestJetsDist[0] = jet.fClosestJetsDist[0];
185 fClosestJetsDist[1] = jet.fClosestJetsDist[1];
186 fMatched = jet.fMatched;
188 fPtVectSub = jet.fPtVectSub;
194 Int_t AliEmcalJet::Compare(const TObject* obj) const
196 //Return -1 if this is smaller than obj, 0 if objects are equal and 1 if this is larger than obj.
198 const AliEmcalJet *jet = static_cast<const AliEmcalJet *>(obj);
206 //__________________________________________________________________________________________________
207 void AliEmcalJet::GetMom(TLorentzVector &vec) const
209 // Return momentum as four vector.
211 Double_t p = fPt *TMath::CosH(fEta);
212 vec.SetPtEtaPhiE(fPt,fEta,fPhi,TMath::Sqrt(p*p+fM*fM));
215 //__________________________________________________________________________________________________
216 void AliEmcalJet::Print(Option_t* /*option*/) const
218 // Print jet information.
220 printf("Jet pt=%.2f, eta=%.2f, phi=%.2f, area=%.2f, NEF=%.2f\n", fPt, fEta, fPhi, fArea, fNEF);
223 //__________________________________________________________________________________________________
224 Double_t AliEmcalJet::PtSubVect(Double_t rho) const
226 // Return vectorial subtracted transverse momentum.
228 Double_t dx = Px() - rho * fArea * TMath::Cos(fAreaPhi);
229 Double_t dy = Py() - rho * fArea * TMath::Sin(fAreaPhi);
230 //Double_t dz = Pz() - rho * fArea * TMath::SinH(fAreaEta);
231 return TMath::Sqrt(dx*dx+dy*dy);
234 //__________________________________________________________________________________________________
235 void AliEmcalJet::SortConstituents()
237 // Sort constituent by index (increasing).
239 std::sort(fClusterIDs.GetArray(), fClusterIDs.GetArray() + fClusterIDs.GetSize());
240 std::sort(fTrackIDs.GetArray(), fTrackIDs.GetArray() + fTrackIDs.GetSize());