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