]>
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), | |
db8a0184 | 20 | fAreaEta(0), |
21 | fAreaPhi(0), | |
96919f91 | 22 | fAreaEmc(-1), |
23 | fAxisInEmcal(0), | |
24 | fMaxCPt(0), | |
25 | fMaxNPt(0), | |
26 | fMCPt(0), | |
27 | fNn(0), | |
28 | fNch(0), | |
8895e61b | 29 | fPtEmc(0), |
30 | fNEmc(0), | |
96919f91 | 31 | fClusterIDs(), |
32 | fTrackIDs(), | |
8895e61b | 33 | fMatched(2), |
cfc2ac24 | 34 | fMatchingType(0), |
db8a0184 | 35 | fPtSub(0), |
85d48773 | 36 | fPtVectSub(0), |
37 | fTriggers(0) | |
96919f91 | 38 | { |
39 | // Constructor. | |
40 | ||
41 | fClosestJets[0] = 0; | |
42 | fClosestJets[1] = 0; | |
43 | fClosestJetsDist[0] = 999; | |
44 | fClosestJetsDist[1] = 999; | |
96919f91 | 45 | } |
46 | ||
7efbea04 | 47 | //__________________________________________________________________________________________________ |
101cefde | 48 | AliEmcalJet::AliEmcalJet(Double_t px, Double_t py, Double_t pz) : |
49 | AliVParticle(), | |
50 | fPt(TMath::Sqrt(px*px+py*py)), | |
51 | fEta(TMath::ASinH(pz/fPt)), | |
52 | fPhi(0), | |
53 | fM(0), | |
54 | fNEF(0), | |
55 | fArea(0), | |
db8a0184 | 56 | fAreaEta(0), |
57 | fAreaPhi(0), | |
101cefde | 58 | fAreaEmc(-1), |
59 | fAxisInEmcal(0), | |
60 | fMaxCPt(0), | |
61 | fMaxNPt(0), | |
96919f91 | 62 | fMCPt(0), |
63 | fNn(0), | |
64 | fNch(0), | |
8895e61b | 65 | fPtEmc(0), |
66 | fNEmc(0), | |
101cefde | 67 | fClusterIDs(), |
96919f91 | 68 | fTrackIDs(), |
8895e61b | 69 | fMatched(2), |
cfc2ac24 | 70 | fMatchingType(0), |
db8a0184 | 71 | fPtSub(0), |
85d48773 | 72 | fPtVectSub(0), |
73 | fTriggers(0) | |
7efbea04 | 74 | { |
75 | // Constructor. | |
76 | ||
77 | if (fPt != 0) { | |
78 | fPhi = TMath::ATan2(py, px); | |
79 | if (fPhi<0.) | |
80 | fPhi += 2. * TMath::Pi(); | |
81 | } | |
96919f91 | 82 | |
83 | fClosestJets[0] = 0; | |
84 | fClosestJets[1] = 0; | |
85 | fClosestJetsDist[0] = 999; | |
86 | fClosestJetsDist[1] = 999; | |
7efbea04 | 87 | } |
88 | ||
9cffd2d0 | 89 | //_________________________________________________________________________________________________ |
914d486c | 90 | AliEmcalJet::AliEmcalJet(Double_t pt, Double_t eta, Double_t phi, Double_t m) : |
9cffd2d0 | 91 | AliVParticle(), |
f8087a81 | 92 | fPt(pt), |
93 | fEta(eta), | |
94 | fPhi(phi), | |
95 | fM(m), | |
96 | fNEF(0), | |
97 | fArea(0), | |
db8a0184 | 98 | fAreaEta(0), |
99 | fAreaPhi(0), | |
101cefde | 100 | fAreaEmc(-1), |
101 | fAxisInEmcal(0), | |
f8087a81 | 102 | fMaxCPt(0), |
96919f91 | 103 | fMaxNPt(0), |
104 | fMCPt(0), | |
105 | fNn(0), | |
106 | fNch(0), | |
8895e61b | 107 | fPtEmc(0), |
108 | fNEmc(0), | |
f8087a81 | 109 | fClusterIDs(), |
96919f91 | 110 | fTrackIDs(), |
8895e61b | 111 | fMatched(2), |
cfc2ac24 | 112 | fMatchingType(0), |
db8a0184 | 113 | fPtSub(0), |
85d48773 | 114 | fPtVectSub(0), |
115 | fTriggers(0) | |
9cffd2d0 | 116 | { |
117 | // Constructor. | |
118 | ||
4f149872 | 119 | if (fPhi<0.) |
120 | fPhi += TMath::TwoPi(); | |
96919f91 | 121 | |
122 | fClosestJets[0] = 0; | |
123 | fClosestJets[1] = 0; | |
124 | fClosestJetsDist[0] = 999; | |
125 | fClosestJetsDist[1] = 999; | |
9cffd2d0 | 126 | } |
127 | ||
7efbea04 | 128 | //_________________________________________________________________________________________________ |
914d486c | 129 | AliEmcalJet::AliEmcalJet(const AliEmcalJet &jet) : |
7efbea04 | 130 | AliVParticle(jet), |
f8087a81 | 131 | fPt(jet.fPt), |
132 | fEta(jet.fEta), | |
133 | fPhi(jet.fPhi), | |
134 | fM(jet.fM), | |
135 | fNEF(jet.fNEF), | |
136 | fArea(jet.fArea), | |
db8a0184 | 137 | fAreaEta(jet.fAreaEta), |
138 | fAreaPhi(jet.fAreaPhi), | |
101cefde | 139 | fAreaEmc(jet.fAreaEmc), |
140 | fAxisInEmcal(jet.fAxisInEmcal), | |
f8087a81 | 141 | fMaxCPt(jet.fMaxCPt), |
142 | fMaxNPt(jet.fMaxNPt), | |
96919f91 | 143 | fMCPt(jet.fMCPt), |
144 | fNn(jet.fNn), | |
145 | fNch(jet.fNch), | |
8895e61b | 146 | fPtEmc(jet.fPtEmc), |
147 | fNEmc(jet.fNEmc), | |
f8087a81 | 148 | fClusterIDs(jet.fClusterIDs), |
4f149872 | 149 | fTrackIDs(jet.fTrackIDs), |
8895e61b | 150 | fMatched(jet.fMatched), |
cfc2ac24 | 151 | fMatchingType(jet.fMatchingType), |
db8a0184 | 152 | fPtSub(jet.fPtSub), |
85d48773 | 153 | fPtVectSub(jet.fPtVectSub), |
154 | fTriggers(jet.fTriggers) | |
7df864a3 | 155 | { |
101cefde | 156 | // Copy constructor. |
4f149872 | 157 | |
158 | fClosestJets[0] = jet.fClosestJets[0]; | |
159 | fClosestJets[1] = jet.fClosestJets[1]; | |
160 | fClosestJetsDist[0] = jet.fClosestJetsDist[0]; | |
161 | fClosestJetsDist[1] = jet.fClosestJetsDist[1]; | |
7efbea04 | 162 | } |
163 | ||
164 | //_________________________________________________________________________________________________ | |
914d486c | 165 | AliEmcalJet &AliEmcalJet::operator=(const AliEmcalJet &jet) |
7efbea04 | 166 | { |
167 | // Assignment operator. | |
168 | ||
169 | if (this!=&jet) { | |
170 | AliVParticle::operator=(jet); | |
4f149872 | 171 | fPt = jet.fPt; |
172 | fEta = jet.fEta; | |
173 | fPhi = jet.fPhi; | |
174 | fM = jet.fM; | |
175 | fNEF = jet.fNEF; | |
176 | fArea = jet.fArea; | |
db8a0184 | 177 | fAreaEta = jet.fAreaEta; |
178 | fAreaPhi = jet.fAreaPhi; | |
4f149872 | 179 | fAreaEmc = jet.fAreaEmc; |
180 | fAxisInEmcal = jet.fAxisInEmcal; | |
181 | fMaxCPt = jet.fMaxCPt; | |
182 | fMaxNPt = jet.fMaxNPt; | |
183 | fMCPt = jet.fMCPt; | |
184 | fNn = jet.fNn; | |
185 | fNch = jet.fNch; | |
8895e61b | 186 | fPtEmc = jet.fPtEmc; |
187 | fNEmc = jet.fNEmc; | |
4f149872 | 188 | fClusterIDs = jet.fClusterIDs; |
189 | fTrackIDs = jet.fTrackIDs; | |
190 | fClosestJets[0] = jet.fClosestJets[0]; | |
191 | fClosestJets[1] = jet.fClosestJets[1]; | |
192 | fClosestJetsDist[0] = jet.fClosestJetsDist[0]; | |
193 | fClosestJetsDist[1] = jet.fClosestJetsDist[1]; | |
194 | fMatched = jet.fMatched; | |
8895e61b | 195 | fPtSub = jet.fPtSub; |
f660c2d6 | 196 | fPtVectSub = jet.fPtVectSub; |
85d48773 | 197 | fTriggers = jet.fTriggers; |
7efbea04 | 198 | } |
199 | ||
200 | return *this; | |
7df864a3 | 201 | } |
7efbea04 | 202 | |
2103dc6a | 203 | //_________________________________________________________________________________________________ |
db8a0184 | 204 | Int_t AliEmcalJet::Compare(const TObject* obj) const |
205 | { | |
206 | //Return -1 if this is smaller than obj, 0 if objects are equal and 1 if this is larger than obj. | |
207 | ||
208 | const AliEmcalJet *jet = static_cast<const AliEmcalJet *>(obj); | |
209 | if (!obj) | |
210 | return 0; | |
211 | if (Pt()>jet->Pt()) | |
212 | return -1; | |
213 | return 1; | |
214 | } | |
215 | ||
7efbea04 | 216 | //__________________________________________________________________________________________________ |
914d486c | 217 | void AliEmcalJet::GetMom(TLorentzVector &vec) const |
7efbea04 | 218 | { |
219 | // Return momentum as four vector. | |
220 | ||
221 | Double_t p = fPt *TMath::CosH(fEta); | |
222 | vec.SetPtEtaPhiE(fPt,fEta,fPhi,TMath::Sqrt(p*p+fM*fM)); | |
223 | } | |
224 | ||
225 | //__________________________________________________________________________________________________ | |
914d486c | 226 | void AliEmcalJet::Print(Option_t* /*option*/) const |
7efbea04 | 227 | { |
228 | // Print jet information. | |
229 | ||
230 | printf("Jet pt=%.2f, eta=%.2f, phi=%.2f, area=%.2f, NEF=%.2f\n", fPt, fEta, fPhi, fArea, fNEF); | |
231 | } | |
629e03fc | 232 | |
db8a0184 | 233 | //__________________________________________________________________________________________________ |
234 | Double_t AliEmcalJet::PtSubVect(Double_t rho) const | |
235 | { | |
236 | // Return vectorial subtracted transverse momentum. | |
237 | ||
238 | Double_t dx = Px() - rho * fArea * TMath::Cos(fAreaPhi); | |
239 | Double_t dy = Py() - rho * fArea * TMath::Sin(fAreaPhi); | |
240 | //Double_t dz = Pz() - rho * fArea * TMath::SinH(fAreaEta); | |
241 | return TMath::Sqrt(dx*dx+dy*dy); | |
242 | } | |
243 | ||
629e03fc | 244 | //__________________________________________________________________________________________________ |
245 | void AliEmcalJet::SortConstituents() | |
246 | { | |
f8087a81 | 247 | // Sort constituent by index (increasing). |
248 | ||
249 | std::sort(fClusterIDs.GetArray(), fClusterIDs.GetArray() + fClusterIDs.GetSize()); | |
250 | std::sort(fTrackIDs.GetArray(), fTrackIDs.GetArray() + fTrackIDs.GetSize()); | |
629e03fc | 251 | } |
f660c2d6 | 252 | |
253 | //__________________________________________________________________________________________________ | |
254 | AliVParticle* AliEmcalJet::GetLeadingTrack(TClonesArray *tracks) const | |
255 | { | |
256 | AliVParticle* maxTrack = 0; | |
257 | for (Int_t i = 0; i < GetNumberOfTracks(); i++) { | |
258 | AliVParticle *track = TrackAt(i, tracks); | |
259 | if (!maxTrack || track->Pt() > maxTrack->Pt()) | |
260 | maxTrack = track; | |
261 | } | |
262 | ||
263 | return maxTrack; | |
264 | } | |
265 | ||
266 | //__________________________________________________________________________________________________ | |
267 | AliVCluster* AliEmcalJet::GetLeadingCluster(TClonesArray *clusters) const | |
268 | { | |
269 | AliVCluster* maxCluster = 0; | |
270 | for (Int_t i = 0; i < GetNumberOfClusters(); i++) { | |
271 | AliVCluster *cluster = ClusterAt(i, clusters); | |
272 | if (!maxCluster || cluster->E() > maxCluster->E()) | |
273 | maxCluster = cluster; | |
274 | } | |
275 | ||
276 | return maxCluster; | |
277 | } | |
2103dc6a | 278 | |
279 | //__________________________________________________________________________________________________ | |
280 | void AliEmcalJet::ResetMatching() | |
281 | { | |
282 | fClosestJets[0] = 0; | |
283 | fClosestJets[1] = 0; | |
284 | fClosestJetsDist[0] = 999; | |
285 | fClosestJetsDist[1] = 999; | |
286 | fMatched = 2; | |
287 | } |