]>
Commit | Line | Data |
---|---|---|
7df864a3 | 1 | // $Id$ |
04f6e9de | 2 | // |
3 | // Emcal jet class. | |
4 | // | |
cd231d42 | 5 | // Author: C.Loizides |
7efbea04 | 6 | |
914d486c | 7 | #include "AliEmcalJet.h" |
7df864a3 | 8 | |
914d486c | 9 | ClassImp(AliEmcalJet) |
7efbea04 | 10 | |
11 | //__________________________________________________________________________________________________ | |
914d486c | 12 | AliEmcalJet::AliEmcalJet(Double_t px, Double_t py, Double_t pz) |
7efbea04 | 13 | : AliVParticle(), |
14 | fPt(TMath::Sqrt(px*px+py*py)), | |
15 | fEta(TMath::ASinH(pz/fPt)), | |
f8087a81 | 16 | fPhi(0), |
17 | fM(0), | |
18 | fNEF(0), | |
19 | fArea(0), | |
20 | fMaxCPt(0), | |
21 | fMaxNPt(0), | |
22 | fClusterIDs(), | |
23 | fTrackIDs() | |
7efbea04 | 24 | { |
25 | // Constructor. | |
26 | ||
27 | if (fPt != 0) { | |
28 | fPhi = TMath::ATan2(py, px); | |
29 | if (fPhi<0.) | |
30 | fPhi += 2. * TMath::Pi(); | |
31 | } | |
32 | } | |
33 | ||
9cffd2d0 | 34 | //_________________________________________________________________________________________________ |
914d486c | 35 | AliEmcalJet::AliEmcalJet(Double_t pt, Double_t eta, Double_t phi, Double_t m) : |
9cffd2d0 | 36 | AliVParticle(), |
f8087a81 | 37 | fPt(pt), |
38 | fEta(eta), | |
39 | fPhi(phi), | |
40 | fM(m), | |
41 | fNEF(0), | |
42 | fArea(0), | |
43 | fMaxCPt(0), | |
44 | fMaxNPt(0), | |
45 | fClusterIDs(), | |
46 | fTrackIDs() | |
9cffd2d0 | 47 | { |
48 | // Constructor. | |
49 | ||
50 | if (fPhi<0.) | |
51 | fPhi += 2. * TMath::Pi(); | |
52 | } | |
53 | ||
7efbea04 | 54 | //_________________________________________________________________________________________________ |
914d486c | 55 | AliEmcalJet::AliEmcalJet(const AliEmcalJet &jet) : |
7efbea04 | 56 | AliVParticle(jet), |
f8087a81 | 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 | fMaxCPt(jet.fMaxCPt), | |
64 | fMaxNPt(jet.fMaxNPt), | |
65 | fClusterIDs(jet.fClusterIDs), | |
66 | fTrackIDs(jet.fTrackIDs) | |
7df864a3 | 67 | { |
7efbea04 | 68 | // Constructor. |
69 | } | |
70 | ||
71 | //_________________________________________________________________________________________________ | |
914d486c | 72 | AliEmcalJet &AliEmcalJet::operator=(const AliEmcalJet &jet) |
7efbea04 | 73 | { |
74 | // Assignment operator. | |
75 | ||
76 | if (this!=&jet) { | |
77 | AliVParticle::operator=(jet); | |
f8087a81 | 78 | fPt = jet.fPt; |
79 | fEta = jet.fEta; | |
80 | fPhi = jet.fPhi; | |
81 | fM = jet.fM; | |
82 | fNEF = jet.fNEF; | |
83 | fArea = jet.fArea; | |
84 | fMaxCPt = jet.fMaxCPt; | |
85 | fMaxNPt = jet.fMaxNPt; | |
86 | fClusterIDs = jet.fClusterIDs; | |
87 | fTrackIDs = jet.fTrackIDs; | |
7efbea04 | 88 | } |
89 | ||
90 | return *this; | |
7df864a3 | 91 | } |
7efbea04 | 92 | |
93 | //__________________________________________________________________________________________________ | |
914d486c | 94 | void AliEmcalJet::GetMom(TLorentzVector &vec) const |
7efbea04 | 95 | { |
96 | // Return momentum as four vector. | |
97 | ||
98 | Double_t p = fPt *TMath::CosH(fEta); | |
99 | vec.SetPtEtaPhiE(fPt,fEta,fPhi,TMath::Sqrt(p*p+fM*fM)); | |
100 | } | |
101 | ||
102 | //__________________________________________________________________________________________________ | |
914d486c | 103 | void AliEmcalJet::Print(Option_t* /*option*/) const |
7efbea04 | 104 | { |
105 | // Print jet information. | |
106 | ||
107 | printf("Jet pt=%.2f, eta=%.2f, phi=%.2f, area=%.2f, NEF=%.2f\n", fPt, fEta, fPhi, fArea, fNEF); | |
108 | } | |
629e03fc | 109 | |
110 | //__________________________________________________________________________________________________ | |
111 | void AliEmcalJet::SortConstituents() | |
112 | { | |
f8087a81 | 113 | // Sort constituent by index (increasing). |
114 | ||
115 | std::sort(fClusterIDs.GetArray(), fClusterIDs.GetArray() + fClusterIDs.GetSize()); | |
116 | std::sort(fTrackIDs.GetArray(), fTrackIDs.GetArray() + fTrackIDs.GetSize()); | |
629e03fc | 117 | } |