]>
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 | |
96919f91 | 11 | //__________________________________________________________________________________________________ |
12 | AliEmcalJet::AliEmcalJet() : | |
13 | AliVParticle(), | |
14 | fPt(0), | |
15 | fEta(0), | |
16 | fPhi(0), | |
17 | fM(0), | |
18 | fNEF(0), | |
19 | fArea(0), | |
20 | fAreaEmc(-1), | |
21 | fAxisInEmcal(0), | |
22 | fMaxCPt(0), | |
23 | fMaxNPt(0), | |
24 | fMCPt(0), | |
25 | fNn(0), | |
26 | fNch(0), | |
27 | fClusterIDs(), | |
28 | fTrackIDs(), | |
29 | fMatched(2) | |
30 | { | |
31 | // Constructor. | |
32 | ||
33 | fClosestJets[0] = 0; | |
34 | fClosestJets[1] = 0; | |
35 | fClosestJetsDist[0] = 999; | |
36 | fClosestJetsDist[1] = 999; | |
96919f91 | 37 | } |
38 | ||
7efbea04 | 39 | //__________________________________________________________________________________________________ |
101cefde | 40 | AliEmcalJet::AliEmcalJet(Double_t px, Double_t py, Double_t pz) : |
41 | AliVParticle(), | |
42 | fPt(TMath::Sqrt(px*px+py*py)), | |
43 | fEta(TMath::ASinH(pz/fPt)), | |
44 | fPhi(0), | |
45 | fM(0), | |
46 | fNEF(0), | |
47 | fArea(0), | |
48 | fAreaEmc(-1), | |
49 | fAxisInEmcal(0), | |
50 | fMaxCPt(0), | |
51 | fMaxNPt(0), | |
96919f91 | 52 | fMCPt(0), |
53 | fNn(0), | |
54 | fNch(0), | |
101cefde | 55 | fClusterIDs(), |
96919f91 | 56 | fTrackIDs(), |
57 | fMatched(2) | |
7efbea04 | 58 | { |
59 | // Constructor. | |
60 | ||
61 | if (fPt != 0) { | |
62 | fPhi = TMath::ATan2(py, px); | |
63 | if (fPhi<0.) | |
64 | fPhi += 2. * TMath::Pi(); | |
65 | } | |
96919f91 | 66 | |
67 | fClosestJets[0] = 0; | |
68 | fClosestJets[1] = 0; | |
69 | fClosestJetsDist[0] = 999; | |
70 | fClosestJetsDist[1] = 999; | |
7efbea04 | 71 | } |
72 | ||
9cffd2d0 | 73 | //_________________________________________________________________________________________________ |
914d486c | 74 | AliEmcalJet::AliEmcalJet(Double_t pt, Double_t eta, Double_t phi, Double_t m) : |
9cffd2d0 | 75 | AliVParticle(), |
f8087a81 | 76 | fPt(pt), |
77 | fEta(eta), | |
78 | fPhi(phi), | |
79 | fM(m), | |
80 | fNEF(0), | |
81 | fArea(0), | |
101cefde | 82 | fAreaEmc(-1), |
83 | fAxisInEmcal(0), | |
f8087a81 | 84 | fMaxCPt(0), |
96919f91 | 85 | fMaxNPt(0), |
86 | fMCPt(0), | |
87 | fNn(0), | |
88 | fNch(0), | |
f8087a81 | 89 | fClusterIDs(), |
96919f91 | 90 | fTrackIDs(), |
91 | fMatched(2) | |
9cffd2d0 | 92 | { |
93 | // Constructor. | |
94 | ||
4f149872 | 95 | if (fPhi<0.) |
96 | fPhi += TMath::TwoPi(); | |
96919f91 | 97 | |
98 | fClosestJets[0] = 0; | |
99 | fClosestJets[1] = 0; | |
100 | fClosestJetsDist[0] = 999; | |
101 | fClosestJetsDist[1] = 999; | |
9cffd2d0 | 102 | } |
103 | ||
7efbea04 | 104 | //_________________________________________________________________________________________________ |
914d486c | 105 | AliEmcalJet::AliEmcalJet(const AliEmcalJet &jet) : |
7efbea04 | 106 | AliVParticle(jet), |
f8087a81 | 107 | fPt(jet.fPt), |
108 | fEta(jet.fEta), | |
109 | fPhi(jet.fPhi), | |
110 | fM(jet.fM), | |
111 | fNEF(jet.fNEF), | |
112 | fArea(jet.fArea), | |
101cefde | 113 | fAreaEmc(jet.fAreaEmc), |
114 | fAxisInEmcal(jet.fAxisInEmcal), | |
f8087a81 | 115 | fMaxCPt(jet.fMaxCPt), |
116 | fMaxNPt(jet.fMaxNPt), | |
96919f91 | 117 | fMCPt(jet.fMCPt), |
118 | fNn(jet.fNn), | |
119 | fNch(jet.fNch), | |
f8087a81 | 120 | fClusterIDs(jet.fClusterIDs), |
4f149872 | 121 | fTrackIDs(jet.fTrackIDs), |
122 | fMatched(jet.fMatched) | |
7df864a3 | 123 | { |
101cefde | 124 | // Copy constructor. |
4f149872 | 125 | |
126 | fClosestJets[0] = jet.fClosestJets[0]; | |
127 | fClosestJets[1] = jet.fClosestJets[1]; | |
128 | fClosestJetsDist[0] = jet.fClosestJetsDist[0]; | |
129 | fClosestJetsDist[1] = jet.fClosestJetsDist[1]; | |
7efbea04 | 130 | } |
131 | ||
132 | //_________________________________________________________________________________________________ | |
914d486c | 133 | AliEmcalJet &AliEmcalJet::operator=(const AliEmcalJet &jet) |
7efbea04 | 134 | { |
135 | // Assignment operator. | |
136 | ||
137 | if (this!=&jet) { | |
138 | AliVParticle::operator=(jet); | |
4f149872 | 139 | fPt = jet.fPt; |
140 | fEta = jet.fEta; | |
141 | fPhi = jet.fPhi; | |
142 | fM = jet.fM; | |
143 | fNEF = jet.fNEF; | |
144 | fArea = jet.fArea; | |
145 | fAreaEmc = jet.fAreaEmc; | |
146 | fAxisInEmcal = jet.fAxisInEmcal; | |
147 | fMaxCPt = jet.fMaxCPt; | |
148 | fMaxNPt = jet.fMaxNPt; | |
149 | fMCPt = jet.fMCPt; | |
150 | fNn = jet.fNn; | |
151 | fNch = jet.fNch; | |
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; | |
7efbea04 | 159 | } |
160 | ||
161 | return *this; | |
7df864a3 | 162 | } |
7efbea04 | 163 | |
164 | //__________________________________________________________________________________________________ | |
914d486c | 165 | void AliEmcalJet::GetMom(TLorentzVector &vec) const |
7efbea04 | 166 | { |
167 | // Return momentum as four vector. | |
168 | ||
169 | Double_t p = fPt *TMath::CosH(fEta); | |
170 | vec.SetPtEtaPhiE(fPt,fEta,fPhi,TMath::Sqrt(p*p+fM*fM)); | |
171 | } | |
172 | ||
173 | //__________________________________________________________________________________________________ | |
914d486c | 174 | void AliEmcalJet::Print(Option_t* /*option*/) const |
7efbea04 | 175 | { |
176 | // Print jet information. | |
177 | ||
178 | printf("Jet pt=%.2f, eta=%.2f, phi=%.2f, area=%.2f, NEF=%.2f\n", fPt, fEta, fPhi, fArea, fNEF); | |
179 | } | |
629e03fc | 180 | |
181 | //__________________________________________________________________________________________________ | |
182 | void AliEmcalJet::SortConstituents() | |
183 | { | |
f8087a81 | 184 | // Sort constituent by index (increasing). |
185 | ||
186 | std::sort(fClusterIDs.GetArray(), fClusterIDs.GetArray() + fClusterIDs.GetSize()); | |
187 | std::sort(fTrackIDs.GetArray(), fTrackIDs.GetArray() + fTrackIDs.GetSize()); | |
629e03fc | 188 | } |