]>
Commit | Line | Data |
---|---|---|
00514d01 | 1 | // $Id$ |
91f4b7c5 | 2 | // |
297edd60 | 3 | // Jet analysis task. |
91f4b7c5 | 4 | // |
297edd60 | 5 | // Author: S.Aiola |
25283b37 | 6 | |
b5ee47fb | 7 | #include <TObject.h> |
25283b37 | 8 | #include <TChain.h> |
9 | #include <TClonesArray.h> | |
10 | #include <TH1F.h> | |
11 | #include <TH2F.h> | |
12 | #include <TList.h> | |
13 | #include <TLorentzVector.h> | |
a55e4f1d | 14 | #include <TRandom3.h> |
226f511d | 15 | #include <TParameter.h> |
25283b37 | 16 | |
17 | #include "AliAnalysisManager.h" | |
18 | #include "AliCentrality.h" | |
f0a0fd33 | 19 | #include "AliVCluster.h" |
df43b607 | 20 | #include "AliVParticle.h" |
6fd5039f | 21 | #include "AliVTrack.h" |
25283b37 | 22 | #include "AliEmcalJet.h" |
23 | #include "AliVEventHandler.h" | |
e44e8726 | 24 | #include "AliRhoParameter.h" |
55264f20 | 25 | #include "AliLog.h" |
25283b37 | 26 | |
00514d01 | 27 | #include "AliAnalysisTaskSAJF.h" |
25283b37 | 28 | |
00514d01 | 29 | ClassImp(AliAnalysisTaskSAJF) |
25283b37 | 30 | |
31 | //________________________________________________________________________ | |
00514d01 | 32 | AliAnalysisTaskSAJF::AliAnalysisTaskSAJF() : |
1f03e093 | 33 | AliAnalysisTaskEmcalJet("AliAnalysisTaskSAJF", kTRUE), |
121eb688 | 34 | fMCAna(kFALSE), |
b0e00dc4 | 35 | fMinRC2LJ(-1), |
2bee31e9 | 36 | fEmbJetsName("EmbJets"), |
e44e8726 | 37 | fEmbTracksName(""), |
38 | fEmbCaloName(""), | |
b12a85c3 | 39 | fRandTracksName("TracksRandomized"), |
40 | fRandCaloName("CaloClustersRandomized"), | |
226f511d | 41 | fRhoName("Rho"), |
2bee31e9 | 42 | fEmbJets(0), |
e44e8726 | 43 | fEmbTracks(0), |
44 | fEmbCaloClusters(0), | |
b12a85c3 | 45 | fRandTracks(0), |
46 | fRandCaloClusters(0), | |
b12a85c3 | 47 | fRho(0), |
a5621834 | 48 | fRhoVal(0), |
a825589f | 49 | fEmbeddedClusterId(-1), |
50 | fEmbeddedTrackId(-1), | |
f0a0fd33 | 51 | fHistCentrality(0), |
a825589f | 52 | fHistDeltaVectorPt(0), |
b12a85c3 | 53 | fHistRhoVSleadJetPt(0), |
54 | fHistRCPhiEta(0), | |
55 | fHistRCPtExLJVSDPhiLJ(0), | |
56 | fHistRhoVSRCPt(0), | |
b5ee47fb | 57 | fHistEmbJetPhiEta(0), |
58 | fHistEmbPartPhiEta(0), | |
b12a85c3 | 59 | fHistRhoVSEmbBkg(0) |
226f511d | 60 | |
25283b37 | 61 | { |
62 | // Default constructor. | |
f0a0fd33 | 63 | |
64 | for (Int_t i = 0; i < 4; i++) { | |
e44e8726 | 65 | fHistEvents[i] = 0; |
66 | fHistTracksPt[i] = 0; | |
67 | fHistClustersPt[i] = 0; | |
df43b607 | 68 | fHistJetPhiEta[i] = 0; |
55264f20 | 69 | fHistJetsPt[i] = 0; |
df43b607 | 70 | fHistJetsPtArea[i] = 0; |
55264f20 | 71 | fHistLeadingJetPt[i] = 0; |
72 | fHist2LeadingJetPt[i] = 0; | |
b12a85c3 | 73 | fHistJetsNEFvsPt[i] = 0; |
74 | fHistJetsZvsPt[i] = 0; | |
e44e8726 | 75 | fHistMaxTrackPtvsJetPt[i] = 0; |
76 | fHistMaxClusPtvsJetPt[i] = 0; | |
77 | fHistMaxPartPtvsJetPt[i] = 0; | |
78 | fHistMaxTrackPtvsJetCorrPt[i] = 0; | |
79 | fHistMaxClusPtvsJetCorrPt[i] = 0; | |
80 | fHistMaxPartPtvsJetCorrPt[i] = 0; | |
58285fc6 | 81 | fHistConstituents[i] = 0; |
b12a85c3 | 82 | fHistRho[i] = 0; |
c92284d5 | 83 | fHistJetsCorrPt[i] = 0; |
84 | fHistJetsCorrPtArea[i] = 0; | |
85 | fHistLeadingJetCorrPt[i] = 0; | |
9b265496 | 86 | fHistRCPtRigid[i] = 0; |
a55e4f1d | 87 | fHistRCPt[i] = 0; |
88 | fHistRCPtExLJ[i] = 0; | |
b12a85c3 | 89 | fHistRCPtRand[i] = 0; |
9b265496 | 90 | fHistDeltaPtRCRigid[i] = 0; |
b12a85c3 | 91 | fHistDeltaPtRC[i] = 0; |
92 | fHistDeltaPtRCExLJ[i] = 0; | |
93 | fHistDeltaPtRCRand[i] = 0; | |
b0e00dc4 | 94 | fHistEmbNotFoundPhiEta[i] = 0; |
e44e8726 | 95 | fHistEmbJetsPt[i] = 0; |
96 | fHistEmbJetsCorrPt[i] = 0; | |
c92284d5 | 97 | fHistEmbPartPt[i] = 0; |
98 | fHistDistEmbPartJetAxis[i] = 0; | |
b12a85c3 | 99 | fHistDeltaPtEmb[i] = 0; |
f0a0fd33 | 100 | } |
25283b37 | 101 | } |
102 | ||
103 | //________________________________________________________________________ | |
00514d01 | 104 | AliAnalysisTaskSAJF::AliAnalysisTaskSAJF(const char *name) : |
1f03e093 | 105 | AliAnalysisTaskEmcalJet(name, kTRUE), |
121eb688 | 106 | fMCAna(kFALSE), |
b0e00dc4 | 107 | fMinRC2LJ(-1), |
2bee31e9 | 108 | fEmbJetsName("EmbJets"), |
e44e8726 | 109 | fEmbTracksName(""), |
110 | fEmbCaloName(""), | |
b12a85c3 | 111 | fRandTracksName("TracksRandomized"), |
112 | fRandCaloName("CaloClustersRandomized"), | |
226f511d | 113 | fRhoName("Rho"), |
2bee31e9 | 114 | fEmbJets(0), |
e44e8726 | 115 | fEmbTracks(0), |
116 | fEmbCaloClusters(0), | |
b12a85c3 | 117 | fRandTracks(0), |
118 | fRandCaloClusters(0), | |
b12a85c3 | 119 | fRho(0), |
a5621834 | 120 | fRhoVal(0), |
a825589f | 121 | fEmbeddedClusterId(-1), |
122 | fEmbeddedTrackId(-1), | |
f0a0fd33 | 123 | fHistCentrality(0), |
a825589f | 124 | fHistDeltaVectorPt(0), |
b12a85c3 | 125 | fHistRhoVSleadJetPt(0), |
126 | fHistRCPhiEta(0), | |
127 | fHistRCPtExLJVSDPhiLJ(0), | |
128 | fHistRhoVSRCPt(0), | |
b5ee47fb | 129 | fHistEmbJetPhiEta(0), |
130 | fHistEmbPartPhiEta(0), | |
b12a85c3 | 131 | fHistRhoVSEmbBkg(0) |
25283b37 | 132 | { |
133 | // Standard constructor. | |
134 | ||
f0a0fd33 | 135 | for (Int_t i = 0; i < 4; i++) { |
e44e8726 | 136 | fHistEvents[i] = 0; |
137 | fHistTracksPt[i] = 0; | |
138 | fHistClustersPt[i] = 0; | |
df43b607 | 139 | fHistJetPhiEta[i] = 0; |
55264f20 | 140 | fHistJetsPt[i] = 0; |
df43b607 | 141 | fHistJetsPtArea[i] = 0; |
55264f20 | 142 | fHistLeadingJetPt[i] = 0; |
143 | fHist2LeadingJetPt[i] = 0; | |
b12a85c3 | 144 | fHistJetsNEFvsPt[i] = 0; |
145 | fHistJetsZvsPt[i] = 0; | |
e44e8726 | 146 | fHistMaxTrackPtvsJetPt[i] = 0; |
147 | fHistMaxClusPtvsJetPt[i] = 0; | |
148 | fHistMaxPartPtvsJetPt[i] = 0; | |
149 | fHistMaxTrackPtvsJetCorrPt[i] = 0; | |
150 | fHistMaxClusPtvsJetCorrPt[i] = 0; | |
151 | fHistMaxPartPtvsJetCorrPt[i] = 0; | |
58285fc6 | 152 | fHistConstituents[i] = 0; |
b12a85c3 | 153 | fHistRho[i] = 0; |
c92284d5 | 154 | fHistJetsCorrPt[i] = 0; |
155 | fHistJetsCorrPtArea[i] = 0; | |
156 | fHistLeadingJetCorrPt[i] = 0; | |
9b265496 | 157 | fHistRCPtRigid[i] = 0; |
a55e4f1d | 158 | fHistRCPt[i] = 0; |
159 | fHistRCPtExLJ[i] = 0; | |
9b265496 | 160 | fHistRCPtRand[i] = 0; |
161 | fHistDeltaPtRCRigid[i] = 0; | |
b12a85c3 | 162 | fHistDeltaPtRC[i] = 0; |
163 | fHistDeltaPtRCExLJ[i] = 0; | |
164 | fHistDeltaPtRCRand[i] = 0; | |
b0e00dc4 | 165 | fHistEmbNotFoundPhiEta[i] = 0; |
e44e8726 | 166 | fHistEmbJetsPt[i] = 0; |
167 | fHistEmbJetsCorrPt[i] = 0; | |
c92284d5 | 168 | fHistEmbPartPt[i] = 0; |
169 | fHistDistEmbPartJetAxis[i] = 0; | |
b12a85c3 | 170 | fHistDeltaPtEmb[i] = 0; |
f0a0fd33 | 171 | } |
25283b37 | 172 | } |
173 | ||
174 | //________________________________________________________________________ | |
00514d01 | 175 | AliAnalysisTaskSAJF::~AliAnalysisTaskSAJF() |
25283b37 | 176 | { |
16d143bd | 177 | // Destructor. |
25283b37 | 178 | } |
179 | ||
180 | //________________________________________________________________________ | |
00514d01 | 181 | void AliAnalysisTaskSAJF::UserCreateOutputObjects() |
25283b37 | 182 | { |
16d143bd | 183 | // Create user output. |
df43b607 | 184 | |
16d143bd | 185 | AliAnalysisTaskEmcalJet::UserCreateOutputObjects(); |
25283b37 | 186 | |
226f511d | 187 | OpenFile(1); |
25283b37 | 188 | fOutput = new TList(); |
226f511d | 189 | fOutput->SetOwner(); |
25283b37 | 190 | |
fb9ac42f | 191 | fHistCentrality = new TH1F("fHistCentrality","fHistCentrality", fNbins, 0, 100); |
f0a0fd33 | 192 | fHistCentrality->GetXaxis()->SetTitle("Centrality (%)"); |
193 | fHistCentrality->GetYaxis()->SetTitle("counts"); | |
194 | fOutput->Add(fHistCentrality); | |
25283b37 | 195 | |
a825589f | 196 | fHistDeltaVectorPt = new TH1F("fHistDeltaVectorPt", "fHistDeltaVectorPt", fNbins, -50, 50); |
197 | fHistDeltaVectorPt->GetXaxis()->SetTitle("#deltap_{T} [GeV/c]"); | |
198 | fHistDeltaVectorPt->GetYaxis()->SetTitle("counts"); | |
199 | fOutput->Add(fHistDeltaVectorPt); | |
200 | ||
6fd5039f | 201 | fHistRhoVSleadJetPt = new TH2F("fHistRhoVSleadJetPt","fHistRhoVSleadJetPt", fNbins, fMinBinPt, fMaxBinPt, fNbins, fMinBinPt, fMaxBinPt); |
b12a85c3 | 202 | fHistRhoVSleadJetPt->GetXaxis()->SetTitle("#rho * area [GeV/c]"); |
203 | fHistRhoVSleadJetPt->GetYaxis()->SetTitle("Leading jet p_{T} [GeV/c]"); | |
204 | fOutput->Add(fHistRhoVSleadJetPt); | |
b5ee47fb | 205 | |
6fd5039f | 206 | fHistRCPhiEta = new TH2F("fHistRCPhiEta","Phi-Eta distribution of rigid cones", 40, -2, 2, 64, 0, 6.4); |
b12a85c3 | 207 | fHistRCPhiEta->GetXaxis()->SetTitle("#eta"); |
208 | fHistRCPhiEta->GetYaxis()->SetTitle("#phi"); | |
209 | fOutput->Add(fHistRCPhiEta); | |
b5ee47fb | 210 | |
6fd5039f | 211 | fHistRCPtExLJVSDPhiLJ = new TH2F("fHistRCPtExLJVSDPhiLJ","fHistRCPtExLJVSDPhiLJ", fNbins, fMinBinPt, fMaxBinPt, 128, -1.6, 4.8); |
b12a85c3 | 212 | fHistRCPtExLJVSDPhiLJ->GetXaxis()->SetTitle("rigid cone p_{T} [GeV/c]"); |
b5ee47fb | 213 | fHistRCPtExLJVSDPhiLJ->GetYaxis()->SetTitle("#Delta#phi"); |
214 | fOutput->Add(fHistRCPtExLJVSDPhiLJ); | |
215 | ||
6fd5039f | 216 | fHistRhoVSRCPt = new TH2F("fHistRhoVSRCPt","fHistRhoVSRCPt", fNbins, fMinBinPt, fMaxBinPt, fNbins, fMinBinPt, fMaxBinPt); |
c92284d5 | 217 | fHistRhoVSRCPt->GetXaxis()->SetTitle("A#rho [GeV/c]"); |
b12a85c3 | 218 | fHistRhoVSRCPt->GetYaxis()->SetTitle("rigid cone p_{T} [GeV/c]"); |
219 | fOutput->Add(fHistRhoVSRCPt); | |
220 | ||
e44e8726 | 221 | if (!fEmbJetsName.IsNull()) { |
222 | fHistEmbJetPhiEta = new TH2F("fHistEmbJetPhiEta","Phi-Eta distribution of embedded jets", 40, -2, 2, 64, 0, 6.4); | |
223 | fHistEmbJetPhiEta->GetXaxis()->SetTitle("#eta"); | |
224 | fHistEmbJetPhiEta->GetYaxis()->SetTitle("#phi"); | |
225 | fOutput->Add(fHistEmbJetPhiEta); | |
226 | ||
227 | fHistEmbPartPhiEta = new TH2F("fHistEmbPartPhiEta","Phi-Eta distribution of embedded particles", 40, -2, 2, 64, 0, 6.4); | |
228 | fHistEmbPartPhiEta->GetXaxis()->SetTitle("#eta"); | |
229 | fHistEmbPartPhiEta->GetYaxis()->SetTitle("#phi"); | |
230 | fOutput->Add(fHistEmbPartPhiEta); | |
231 | ||
232 | fHistRhoVSEmbBkg = new TH2F("fHistRhoVSEmbBkg","fHistRhoVSEmbBkg", fNbins, fMinBinPt, fMaxBinPt, fNbins, fMinBinPt, fMaxBinPt); | |
c92284d5 | 233 | fHistRhoVSEmbBkg->GetXaxis()->SetTitle("A#rho [GeV/c]"); |
e44e8726 | 234 | fHistRhoVSEmbBkg->GetYaxis()->SetTitle("background of embedded track [GeV/c]"); |
235 | fOutput->Add(fHistRhoVSEmbBkg); | |
236 | } | |
b5ee47fb | 237 | |
f0a0fd33 | 238 | TString histname; |
239 | ||
240 | for (Int_t i = 0; i < 4; i++) { | |
e44e8726 | 241 | histname = "fHistEvents_"; |
242 | histname += i; | |
243 | fHistEvents[i] = new TH1F(histname,histname, 6, 0, 6); | |
244 | fHistEvents[i]->GetXaxis()->SetTitle("Event state"); | |
245 | fHistEvents[i]->GetYaxis()->SetTitle("counts"); | |
a5621834 | 246 | fHistEvents[i]->GetXaxis()->SetBinLabel(1, "No jets"); |
e22bc1b8 | 247 | fHistEvents[i]->GetXaxis()->SetBinLabel(2, "Max jet not found"); |
a5621834 | 248 | fHistEvents[i]->GetXaxis()->SetBinLabel(3, "Rho == 0"); |
e22bc1b8 | 249 | fHistEvents[i]->GetXaxis()->SetBinLabel(4, "Max jet <= 0"); |
a5621834 | 250 | fHistEvents[i]->GetXaxis()->SetBinLabel(5, "OK"); |
e44e8726 | 251 | fOutput->Add(fHistEvents[i]); |
252 | ||
a5621834 | 253 | if (fAnaType != kEMCALOnly) { |
254 | histname = "fHistTracksPt_"; | |
255 | histname += i; | |
be7b6e63 | 256 | fHistTracksPt[i] = new TH1F(histname.Data(), histname.Data(), (Int_t)(fNbins / 2.5), fMinBinPt, fMaxBinPt / 2.5); |
a5621834 | 257 | fHistTracksPt[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); |
258 | fHistTracksPt[i]->GetYaxis()->SetTitle("counts"); | |
259 | fOutput->Add(fHistTracksPt[i]); | |
260 | } | |
e44e8726 | 261 | |
a5621834 | 262 | if (fAnaType == kEMCAL || fAnaType == kEMCALOnly) { |
e44e8726 | 263 | histname = "fHistClustersPt_"; |
264 | histname += i; | |
be7b6e63 | 265 | fHistClustersPt[i] = new TH1F(histname.Data(), histname.Data(), (Int_t)(fNbins / 2.5), fMinBinPt, fMaxBinPt / 2.5); |
e44e8726 | 266 | fHistClustersPt[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); |
267 | fHistClustersPt[i]->GetYaxis()->SetTitle("counts"); | |
268 | fOutput->Add(fHistClustersPt[i]); | |
269 | } | |
270 | ||
df43b607 | 271 | histname = "fHistJetPhiEta_"; |
272 | histname += i; | |
6fd5039f | 273 | fHistJetPhiEta[i] = new TH2F(histname.Data(), histname.Data(), 40, -2, 2, 64, 0, 6.4); |
df43b607 | 274 | fHistJetPhiEta[i]->GetXaxis()->SetTitle("#eta"); |
275 | fHistJetPhiEta[i]->GetYaxis()->SetTitle("#phi"); | |
276 | fOutput->Add(fHistJetPhiEta[i]); | |
277 | ||
55264f20 | 278 | histname = "fHistJetsPt_"; |
f0a0fd33 | 279 | histname += i; |
6fd5039f | 280 | fHistJetsPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt); |
e44e8726 | 281 | fHistJetsPt[i]->GetXaxis()->SetTitle("p_{T}^{raw} [GeV/c]"); |
55264f20 | 282 | fHistJetsPt[i]->GetYaxis()->SetTitle("counts"); |
283 | fOutput->Add(fHistJetsPt[i]); | |
226f511d | 284 | |
df43b607 | 285 | histname = "fHistJetsPtArea_"; |
286 | histname += i; | |
5d950148 | 287 | fHistJetsPtArea[i] = new TH2F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt, 40, 0, fJetRadius * fJetRadius * TMath::Pi() * 3); |
e44e8726 | 288 | fHistJetsPtArea[i]->GetXaxis()->SetTitle("p_{T}^{raw} [GeV/c]"); |
df43b607 | 289 | fHistJetsPtArea[i]->GetYaxis()->SetTitle("area"); |
290 | fOutput->Add(fHistJetsPtArea[i]); | |
291 | ||
55264f20 | 292 | histname = "fHistLeadingJetPt_"; |
f0a0fd33 | 293 | histname += i; |
6fd5039f | 294 | fHistLeadingJetPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt); |
e44e8726 | 295 | fHistLeadingJetPt[i]->GetXaxis()->SetTitle("p_{T}^{raw} [GeV]"); |
55264f20 | 296 | fHistLeadingJetPt[i]->GetYaxis()->SetTitle("counts"); |
297 | fOutput->Add(fHistLeadingJetPt[i]); | |
b5ee47fb | 298 | |
299 | histname = "fHist2LeadingJetPt_"; | |
300 | histname += i; | |
6fd5039f | 301 | fHist2LeadingJetPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt); |
e44e8726 | 302 | fHist2LeadingJetPt[i]->GetXaxis()->SetTitle("p_{T}^{raw} [GeV]"); |
b5ee47fb | 303 | fHist2LeadingJetPt[i]->GetYaxis()->SetTitle("counts"); |
304 | fOutput->Add(fHist2LeadingJetPt[i]); | |
305 | ||
b12a85c3 | 306 | histname = "fHistJetsZvsPt_"; |
b5ee47fb | 307 | histname += i; |
6fd5039f | 308 | fHistJetsZvsPt[i] = new TH2F(histname.Data(), histname.Data(), fNbins, 0, 1.2, fNbins, fMinBinPt, fMaxBinPt); |
b12a85c3 | 309 | fHistJetsZvsPt[i]->GetXaxis()->SetTitle("Z"); |
e44e8726 | 310 | fHistJetsZvsPt[i]->GetYaxis()->SetTitle("p_{T}^{raw} [GeV/c]"); |
b12a85c3 | 311 | fOutput->Add(fHistJetsZvsPt[i]); |
312 | ||
a5621834 | 313 | if (fAnaType == kEMCAL || fAnaType == kEMCALOnly) { |
b12a85c3 | 314 | histname = "fHistJetsNEFvsPt_"; |
315 | histname += i; | |
6fd5039f | 316 | fHistJetsNEFvsPt[i] = new TH2F(histname.Data(), histname.Data(), fNbins, 0, 1.2, fNbins, fMinBinPt, fMaxBinPt); |
b12a85c3 | 317 | fHistJetsNEFvsPt[i]->GetXaxis()->SetTitle("NEF"); |
e44e8726 | 318 | fHistJetsNEFvsPt[i]->GetYaxis()->SetTitle("p_{T}^{raw} [GeV/c]"); |
b12a85c3 | 319 | fOutput->Add(fHistJetsNEFvsPt[i]); |
b12a85c3 | 320 | } |
321 | ||
a5621834 | 322 | if (fAnaType != kEMCALOnly) { |
323 | histname = "fHistMaxTrackPtvsJetPt_"; | |
324 | histname += i; | |
be7b6e63 | 325 | fHistMaxTrackPtvsJetPt[i] = new TH2F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt, (Int_t)(fNbins / 2.5), fMinBinPt, fMaxBinPt / 2.5); |
a5621834 | 326 | fHistMaxTrackPtvsJetPt[i]->GetXaxis()->SetTitle("p_{T}^{jet} [GeV/c]"); |
327 | fHistMaxTrackPtvsJetPt[i]->GetYaxis()->SetTitle("p_{T}^{track} [GeV/c]"); | |
328 | fOutput->Add(fHistMaxTrackPtvsJetPt[i]); | |
329 | } | |
e44e8726 | 330 | |
a5621834 | 331 | if (fAnaType == kEMCAL || fAnaType == kEMCALOnly) { |
e44e8726 | 332 | histname = "fHistMaxClusPtvsJetPt_"; |
333 | histname += i; | |
be7b6e63 | 334 | fHistMaxClusPtvsJetPt[i] = new TH2F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt, (Int_t)(fNbins / 2.5), fMinBinPt, fMaxBinPt / 2.5); |
e44e8726 | 335 | fHistMaxClusPtvsJetPt[i]->GetXaxis()->SetTitle("p_{T}^{jet} [GeV/c]"); |
336 | fHistMaxClusPtvsJetPt[i]->GetYaxis()->SetTitle("p_{T}^{clus} [GeV/c]"); | |
337 | fOutput->Add(fHistMaxClusPtvsJetPt[i]); | |
338 | } | |
339 | ||
340 | histname = "fHistMaxPartPtvsJetPt_"; | |
341 | histname += i; | |
be7b6e63 | 342 | fHistMaxPartPtvsJetPt[i] = new TH2F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt, (Int_t)(fNbins / 2.5), fMinBinPt, fMaxBinPt / 2.5); |
e44e8726 | 343 | fHistMaxPartPtvsJetPt[i]->GetXaxis()->SetTitle("p_{T}^{jet} [GeV/c]"); |
344 | fHistMaxPartPtvsJetPt[i]->GetYaxis()->SetTitle("p_{T}^{part} [GeV/c]"); | |
345 | fOutput->Add(fHistMaxPartPtvsJetPt[i]); | |
346 | ||
a5621834 | 347 | if (fAnaType != kEMCALOnly) { |
348 | histname = "fHistMaxTrackPtvsJetCorrPt_"; | |
349 | histname += i; | |
be7b6e63 | 350 | fHistMaxTrackPtvsJetCorrPt[i] = new TH2F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt, (Int_t)(fNbins / 2.5), fMinBinPt, fMaxBinPt / 2.5); |
a5621834 | 351 | fHistMaxTrackPtvsJetCorrPt[i]->GetXaxis()->SetTitle("p_{T}^{jet} [GeV/c]"); |
352 | fHistMaxTrackPtvsJetCorrPt[i]->GetYaxis()->SetTitle("p_{T}^{track} [GeV/c]"); | |
353 | fOutput->Add(fHistMaxTrackPtvsJetCorrPt[i]); | |
354 | } | |
e44e8726 | 355 | |
a5621834 | 356 | if (fAnaType == kEMCAL || fAnaType == kEMCALOnly) { |
e44e8726 | 357 | histname = "fHistMaxClusPtvsJetCorrPt_"; |
358 | histname += i; | |
be7b6e63 | 359 | fHistMaxClusPtvsJetCorrPt[i] = new TH2F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt, (Int_t)(fNbins / 2.5), fMinBinPt, fMaxBinPt / 2.5); |
e44e8726 | 360 | fHistMaxClusPtvsJetCorrPt[i]->GetXaxis()->SetTitle("p_{T}^{jet} [GeV/c]"); |
361 | fHistMaxClusPtvsJetCorrPt[i]->GetYaxis()->SetTitle("p_{T}^{clus} [GeV/c]"); | |
362 | fOutput->Add(fHistMaxClusPtvsJetCorrPt[i]); | |
363 | } | |
364 | ||
365 | histname = "fHistMaxPartPtvsJetCorrPt_"; | |
366 | histname += i; | |
58285fc6 | 367 | fHistMaxPartPtvsJetCorrPt[i] = new TH2F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt, (Int_t)(fNbins / 2.5), fMinBinPt, fMaxBinPt / 2.5); |
e44e8726 | 368 | fHistMaxPartPtvsJetCorrPt[i]->GetXaxis()->SetTitle("p_{T}^{jet} [GeV/c]"); |
369 | fHistMaxPartPtvsJetCorrPt[i]->GetYaxis()->SetTitle("p_{T}^{part} [GeV/c]"); | |
370 | fOutput->Add(fHistMaxPartPtvsJetCorrPt[i]); | |
371 | ||
58285fc6 | 372 | histname = "fHistConstituents_"; |
373 | histname += i; | |
374 | fHistConstituents[i] = new TH2F(histname.Data(), histname.Data(), 100, 1, 101, 100, -0.5, 99.5); | |
375 | fHistConstituents[i]->GetXaxis()->SetTitle("p_{T,part} [GeV/c]"); | |
376 | fHistConstituents[i]->GetYaxis()->SetTitle("no. of particles"); | |
377 | fOutput->Add(fHistConstituents[i]); | |
378 | ||
b12a85c3 | 379 | histname = "fHistRho_"; |
380 | histname += i; | |
6fd5039f | 381 | fHistRho[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2); |
b12a85c3 | 382 | fHistRho[i]->GetXaxis()->SetTitle("p_{T} [GeV/c]"); |
383 | fHistRho[i]->GetYaxis()->SetTitle("counts"); | |
384 | fOutput->Add(fHistRho[i]); | |
385 | ||
c92284d5 | 386 | histname = "fHistJetsCorrPt_"; |
b12a85c3 | 387 | histname += i; |
c92284d5 | 388 | fHistJetsCorrPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt); |
389 | fHistJetsCorrPt[i]->GetXaxis()->SetTitle("p_{T}^{corr} [GeV/c]"); | |
390 | fHistJetsCorrPt[i]->GetYaxis()->SetTitle("counts"); | |
391 | fOutput->Add(fHistJetsCorrPt[i]); | |
b12a85c3 | 392 | |
c92284d5 | 393 | histname = "fHistJetsCorrPtArea_"; |
2bddb6ae | 394 | histname += i; |
5d950148 | 395 | fHistJetsCorrPtArea[i] = new TH2F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt, 40, 0, fJetRadius * fJetRadius * TMath::Pi() * 3); |
c92284d5 | 396 | fHistJetsCorrPtArea[i]->GetXaxis()->SetTitle("p_{T}^{corr} [GeV/c]"); |
397 | fHistJetsCorrPtArea[i]->GetYaxis()->SetTitle("area"); | |
398 | fOutput->Add(fHistJetsCorrPtArea[i]); | |
2bddb6ae | 399 | |
c92284d5 | 400 | histname = "fHistLeadingJetCorrPt_"; |
b12a85c3 | 401 | histname += i; |
c92284d5 | 402 | fHistLeadingJetCorrPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt); |
403 | fHistLeadingJetCorrPt[i]->GetXaxis()->SetTitle("p_{T}^{RC} [GeV/c]"); | |
404 | fHistLeadingJetCorrPt[i]->GetYaxis()->SetTitle("counts"); | |
405 | fOutput->Add(fHistLeadingJetCorrPt[i]); | |
9b265496 | 406 | |
407 | histname = "fHistRCPtRigid_"; | |
408 | histname += i; | |
409 | fHistRCPtRigid[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2); | |
410 | fHistRCPtRigid[i]->GetXaxis()->SetTitle("rigid cone p_{T} [GeV/c]"); | |
411 | fHistRCPtRigid[i]->GetYaxis()->SetTitle("counts"); | |
412 | fOutput->Add(fHistRCPtRigid[i]); | |
413 | ||
b12a85c3 | 414 | histname = "fHistRCPt_"; |
c554a987 | 415 | histname += i; |
6fd5039f | 416 | fHistRCPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2); |
b12a85c3 | 417 | fHistRCPt[i]->GetXaxis()->SetTitle("rigid cone p_{T} [GeV/c]"); |
418 | fHistRCPt[i]->GetYaxis()->SetTitle("counts"); | |
419 | fOutput->Add(fHistRCPt[i]); | |
c554a987 | 420 | |
b12a85c3 | 421 | histname = "fHistRCPtExLJ_"; |
c554a987 | 422 | histname += i; |
6fd5039f | 423 | fHistRCPtExLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2); |
e44e8726 | 424 | fHistRCPtExLJ[i]->GetXaxis()->SetTitle("rigid cone p_{T}^{RC} [GeV/c]"); |
b12a85c3 | 425 | fHistRCPtExLJ[i]->GetYaxis()->SetTitle("counts"); |
426 | fOutput->Add(fHistRCPtExLJ[i]); | |
c554a987 | 427 | |
b12a85c3 | 428 | histname = "fHistRCPtRand_"; |
c554a987 | 429 | histname += i; |
6fd5039f | 430 | fHistRCPtRand[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2); |
e44e8726 | 431 | fHistRCPtRand[i]->GetXaxis()->SetTitle("rigid cone p_{T}^{RC} [GeV/c]"); |
b12a85c3 | 432 | fHistRCPtRand[i]->GetYaxis()->SetTitle("counts"); |
433 | fOutput->Add(fHistRCPtRand[i]); | |
a55e4f1d | 434 | |
9b265496 | 435 | histname = "fHistDeltaPtRCRigid_"; |
436 | histname += i; | |
437 | fHistDeltaPtRCRigid[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt); | |
438 | fHistDeltaPtRCRigid[i]->GetXaxis()->SetTitle("#deltap_{T}^{RC} [GeV/c]"); | |
439 | fHistDeltaPtRCRigid[i]->GetYaxis()->SetTitle("counts"); | |
440 | fOutput->Add(fHistDeltaPtRCRigid[i]); | |
441 | ||
a55e4f1d | 442 | histname = "fHistDeltaPtRC_"; |
443 | histname += i; | |
3a322119 | 444 | fHistDeltaPtRC[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt); |
e44e8726 | 445 | fHistDeltaPtRC[i]->GetXaxis()->SetTitle("#deltap_{T}^{RC} [GeV/c]"); |
a55e4f1d | 446 | fHistDeltaPtRC[i]->GetYaxis()->SetTitle("counts"); |
447 | fOutput->Add(fHistDeltaPtRC[i]); | |
448 | ||
449 | histname = "fHistDeltaPtRCExLJ_"; | |
450 | histname += i; | |
3a322119 | 451 | fHistDeltaPtRCExLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt); |
e44e8726 | 452 | fHistDeltaPtRCExLJ[i]->GetXaxis()->SetTitle("#deltap_{T}^{RC} [GeV/c]"); |
a55e4f1d | 453 | fHistDeltaPtRCExLJ[i]->GetYaxis()->SetTitle("counts"); |
454 | fOutput->Add(fHistDeltaPtRCExLJ[i]); | |
455 | ||
b12a85c3 | 456 | histname = "fHistDeltaPtRCRand_"; |
a55e4f1d | 457 | histname += i; |
3a322119 | 458 | fHistDeltaPtRCRand[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt); |
e44e8726 | 459 | fHistDeltaPtRCRand[i]->GetXaxis()->SetTitle("#deltap_{T}^{RC} [GeV/c]"); |
b12a85c3 | 460 | fHistDeltaPtRCRand[i]->GetYaxis()->SetTitle("counts"); |
461 | fOutput->Add(fHistDeltaPtRCRand[i]); | |
2bee31e9 | 462 | |
e44e8726 | 463 | if (!fEmbJetsName.IsNull()) { |
464 | histname = "fHistEmbJetsPt_"; | |
465 | histname += i; | |
466 | fHistEmbJetsPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt); | |
467 | fHistEmbJetsPt[i]->GetXaxis()->SetTitle("embedded jet p_{T}^{raw} [GeV/c]"); | |
468 | fHistEmbJetsPt[i]->GetYaxis()->SetTitle("counts"); | |
469 | fOutput->Add(fHistEmbJetsPt[i]); | |
2bee31e9 | 470 | |
e44e8726 | 471 | histname = "fHistEmbJetsCorrPt_"; |
472 | histname += i; | |
2510bb9c | 473 | fHistEmbJetsCorrPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt); |
e44e8726 | 474 | fHistEmbJetsCorrPt[i]->GetXaxis()->SetTitle("embedded jet p_{T}^{corr} [GeV/c]"); |
475 | fHistEmbJetsCorrPt[i]->GetYaxis()->SetTitle("counts"); | |
476 | fOutput->Add(fHistEmbJetsCorrPt[i]); | |
11d18b51 | 477 | |
478 | histname = "fHistEmbJetsArea_"; | |
479 | histname += i; | |
5d950148 | 480 | fHistEmbJetsArea[i] = new TH1F(histname.Data(), histname.Data(), 40, 0, fJetRadius * fJetRadius * TMath::Pi() * 3); |
11d18b51 | 481 | fHistEmbJetsArea[i]->GetXaxis()->SetTitle("area"); |
482 | fHistEmbJetsArea[i]->GetYaxis()->SetTitle("counts"); | |
483 | fOutput->Add(fHistEmbJetsArea[i]); | |
484 | ||
c92284d5 | 485 | histname = "fHistEmbPartPt_"; |
e44e8726 | 486 | histname += i; |
c92284d5 | 487 | fHistEmbPartPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt); |
488 | fHistEmbPartPt[i]->GetXaxis()->SetTitle("embedded particle p_{T}^{emb} [GeV/c]"); | |
489 | fHistEmbPartPt[i]->GetYaxis()->SetTitle("counts"); | |
490 | fOutput->Add(fHistEmbPartPt[i]); | |
491 | ||
492 | histname = "fHistDistEmbPartJetAxis_"; | |
493 | histname += i; | |
494 | fHistDistEmbPartJetAxis[i] = new TH1F(histname.Data(), histname.Data(), 50, 0, 0.5); | |
495 | fHistDistEmbPartJetAxis[i]->GetXaxis()->SetTitle("distance"); | |
496 | fHistDistEmbPartJetAxis[i]->GetYaxis()->SetTitle("counts"); | |
497 | fOutput->Add(fHistDistEmbPartJetAxis[i]); | |
b0e00dc4 | 498 | |
499 | histname = "fHistEmbNotFoundPhiEta_"; | |
500 | histname += i; | |
501 | fHistEmbNotFoundPhiEta[i] = new TH2F(histname.Data(), histname.Data(), 40, -2, 2, 64, 0, 6.4); | |
502 | fHistEmbNotFoundPhiEta[i]->GetXaxis()->SetTitle("#eta"); | |
503 | fHistEmbNotFoundPhiEta[i]->GetYaxis()->SetTitle("#phi"); | |
504 | fOutput->Add(fHistEmbNotFoundPhiEta[i]); | |
e44e8726 | 505 | |
506 | histname = "fHistDeltaPtEmb_"; | |
507 | histname += i; | |
3a322119 | 508 | fHistDeltaPtEmb[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt); |
e44e8726 | 509 | fHistDeltaPtEmb[i]->GetXaxis()->SetTitle("#deltap_{T}^{emb} [GeV/c]"); |
510 | fHistDeltaPtEmb[i]->GetYaxis()->SetTitle("counts"); | |
511 | fOutput->Add(fHistDeltaPtEmb[i]); | |
512 | } | |
e82e282c | 513 | } |
514 | ||
25283b37 | 515 | PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram |
516 | } | |
517 | ||
55264f20 | 518 | //________________________________________________________________________ |
6fd5039f | 519 | Bool_t AliAnalysisTaskSAJF::RetrieveEventObjects() |
25283b37 | 520 | { |
16d143bd | 521 | // Retrieve event objects. |
522 | ||
523 | if (!AliAnalysisTaskEmcalJet::RetrieveEventObjects()) | |
6fd5039f | 524 | return kFALSE; |
6fd5039f | 525 | |
a5621834 | 526 | if (fRho) |
527 | fRhoVal = fRho->GetVal(); | |
f0a0fd33 | 528 | |
6fd5039f | 529 | return kTRUE; |
2bee31e9 | 530 | } |
531 | ||
55264f20 | 532 | //________________________________________________________________________ |
6fd5039f | 533 | Bool_t AliAnalysisTaskSAJF::FillHistograms() |
25283b37 | 534 | { |
16d143bd | 535 | // Fill histograms. |
536 | ||
55264f20 | 537 | Int_t maxJetIndex = -1; |
538 | Int_t max2JetIndex = -1; | |
25283b37 | 539 | |
6fd5039f | 540 | GetLeadingJets(maxJetIndex, max2JetIndex); |
55264f20 | 541 | |
a5621834 | 542 | if (maxJetIndex < 0) { // no accepted jet, skipping |
e44e8726 | 543 | fHistEvents[fCentBin]->Fill("No jets", 1); |
544 | return kTRUE; | |
fb9ac42f | 545 | } |
c554a987 | 546 | |
e44e8726 | 547 | AliEmcalJet* jet = static_cast<AliEmcalJet*>(fJets->At(maxJetIndex)); |
548 | if (!jet) { // error, I cannot get the lead jet from collection (should never happen), skipping | |
e22bc1b8 | 549 | fHistEvents[fCentBin]->Fill("Max jet not found", 1); |
e44e8726 | 550 | return kTRUE; |
fb9ac42f | 551 | } |
c554a987 | 552 | |
e44e8726 | 553 | // OK, event accepted |
11d4d636 | 554 | |
a5621834 | 555 | if (fRhoVal == 0) |
556 | fHistEvents[fCentBin]->Fill("Rho == 0", 1); | |
557 | ||
558 | Float_t maxJetCorrPt = jet->Pt() - fRhoVal * jet->Area(); | |
e44e8726 | 559 | |
560 | if (maxJetCorrPt <= 0) | |
e22bc1b8 | 561 | fHistEvents[fCentBin]->Fill("Max jet <= 0", 1); |
e44e8726 | 562 | |
a5621834 | 563 | fHistEvents[fCentBin]->Fill("OK", 1); |
e44e8726 | 564 | |
565 | // ************ | |
566 | // General histograms | |
567 | // _________________________________ | |
568 | ||
569 | DoJetLoop(); | |
570 | DoTrackLoop(); | |
571 | DoClusterLoop(); | |
b12a85c3 | 572 | |
6fd5039f | 573 | fHistCentrality->Fill(fCent); |
a5621834 | 574 | fHistRho[fCentBin]->Fill(fRhoVal); |
6fd5039f | 575 | |
576 | if (jet) { | |
577 | fHistLeadingJetPt[fCentBin]->Fill(jet->Pt()); | |
a5621834 | 578 | fHistRhoVSleadJetPt->Fill(fRhoVal * jet->Area(), jet->Pt()); |
c92284d5 | 579 | fHistLeadingJetCorrPt[fCentBin]->Fill(maxJetCorrPt); |
6fd5039f | 580 | } |
55264f20 | 581 | |
582 | AliEmcalJet* jet2 = 0; | |
583 | if (max2JetIndex >= 0) | |
e44e8726 | 584 | jet2 = static_cast<AliEmcalJet*>(fJets->At(max2JetIndex)); |
55264f20 | 585 | |
6fd5039f | 586 | if (jet2) |
b5ee47fb | 587 | fHist2LeadingJetPt[fCentBin]->Fill(jet2->Pt()); |
b5ee47fb | 588 | |
b12a85c3 | 589 | // ************ |
590 | // Random cones | |
591 | // _________________________________ | |
a55e4f1d | 592 | |
d41a0b1c | 593 | const Float_t rcArea = fJetRadius * fJetRadius * TMath::Pi(); |
a5621834 | 594 | |
b12a85c3 | 595 | // Simple random cones |
596 | Float_t RCpt = 0; | |
9b265496 | 597 | Float_t RCptRigid = 0; |
b12a85c3 | 598 | Float_t RCeta = 0; |
599 | Float_t RCphi = 0; | |
a5621834 | 600 | GetRigidCone(RCpt, RCptRigid, RCeta, RCphi, 0); |
b12a85c3 | 601 | if (RCpt > 0) { |
d41a0b1c | 602 | fHistRCPt[fCentBin]->Fill(RCpt / rcArea); |
a5621834 | 603 | fHistDeltaPtRC[fCentBin]->Fill(RCpt - rcArea * fRhoVal); |
b12a85c3 | 604 | } |
9b265496 | 605 | if (RCptRigid > 0) { |
606 | fHistRCPtRigid[fCentBin]->Fill(RCptRigid / rcArea); | |
a5621834 | 607 | fHistDeltaPtRCRigid[fCentBin]->Fill(RCptRigid - rcArea * fRhoVal); |
9b265496 | 608 | } |
b12a85c3 | 609 | |
610 | // Random cones far from leading jet | |
9b265496 | 611 | RCpt = 0; |
612 | RCptRigid = 0; | |
613 | RCeta = 0; | |
614 | RCphi = 0; | |
a5621834 | 615 | GetRigidCone(RCpt, RCptRigid, RCeta, RCphi, jet); |
9b265496 | 616 | if (RCpt > 0) { |
617 | fHistRCPhiEta->Fill(RCeta, RCphi); | |
a5621834 | 618 | fHistRhoVSRCPt->Fill(fRhoVal, RCpt / rcArea); |
9b265496 | 619 | |
620 | Float_t dphi = RCphi - jet->Phi(); | |
b5ee47fb | 621 | if (dphi > 4.8) dphi -= TMath::Pi() * 2; |
622 | if (dphi < -1.6) dphi += TMath::Pi() * 2; | |
9b265496 | 623 | fHistRCPtExLJVSDPhiLJ->Fill(RCpt, dphi); |
b12a85c3 | 624 | |
9b265496 | 625 | fHistRCPtExLJ[fCentBin]->Fill(RCpt / rcArea); |
a5621834 | 626 | fHistDeltaPtRCExLJ[fCentBin]->Fill(RCpt - rcArea * fRhoVal); |
b12a85c3 | 627 | } |
628 | ||
629 | // Random cones with randomized particles | |
9b265496 | 630 | RCpt = 0; |
631 | RCptRigid = 0; | |
632 | RCeta = 0; | |
633 | RCphi = 0; | |
a5621834 | 634 | GetRigidCone(RCpt, RCptRigid, RCeta, RCphi, 0, fRandTracks, fRandCaloClusters); |
9b265496 | 635 | if (RCpt > 0) { |
636 | fHistRCPtRand[fCentBin]->Fill(RCpt / rcArea); | |
a5621834 | 637 | fHistDeltaPtRCRand[fCentBin]->Fill(RCpt - rcArea * fRhoVal); |
a55e4f1d | 638 | } |
2bee31e9 | 639 | |
b12a85c3 | 640 | // ************ |
641 | // Embedding | |
642 | // _________________________________ | |
643 | ||
df43b607 | 644 | if (!fEmbJets) |
6fd5039f | 645 | return kTRUE; |
df43b607 | 646 | |
b12a85c3 | 647 | AliEmcalJet *embJet = 0; |
e44e8726 | 648 | TObject *embPart = 0; |
2bee31e9 | 649 | |
e44e8726 | 650 | DoEmbJetLoop(embJet, embPart); |
2bee31e9 | 651 | |
fb9ac42f | 652 | if (embJet) { |
a825589f | 653 | Double_t probePt = 0; |
c92284d5 | 654 | Double_t probeEta = 0; |
655 | Double_t probePhi = 0; | |
b12a85c3 | 656 | |
e44e8726 | 657 | AliVCluster *cluster = dynamic_cast<AliVCluster*>(embPart); |
b5ee47fb | 658 | if (cluster) { |
a825589f | 659 | TLorentzVector nPart; |
660 | cluster->GetMomentum(nPart, fVertex); | |
c92284d5 | 661 | |
662 | probeEta = nPart.Eta(); | |
663 | probePhi = nPart.Phi(); | |
a825589f | 664 | probePt = nPart.Pt(); |
b5ee47fb | 665 | } |
b5ee47fb | 666 | else { |
e44e8726 | 667 | AliVTrack *track = dynamic_cast<AliVTrack*>(embPart); |
b12a85c3 | 668 | if (track) { |
c92284d5 | 669 | probeEta = track->Eta(); |
670 | probePhi = track->Phi(); | |
a825589f | 671 | probePt = track->Pt(); |
b12a85c3 | 672 | } |
673 | else { | |
c92284d5 | 674 | AliWarning(Form("%s - Embedded jet found but embedded particle not found (wrong type?)!", GetName())); |
6fd5039f | 675 | return kTRUE; |
b12a85c3 | 676 | } |
b5ee47fb | 677 | } |
c92284d5 | 678 | Double_t distProbeJet = TMath::Sqrt((embJet->Eta() - probeEta) * (embJet->Eta() - probeEta) + (embJet->Phi() - probePhi) * (embJet->Phi() - probePhi)); |
679 | ||
680 | fHistEmbPartPt[fCentBin]->Fill(probePt); | |
681 | fHistEmbPartPhiEta->Fill(probeEta, probePhi); | |
682 | ||
683 | fHistDistEmbPartJetAxis[fCentBin]->Fill(distProbeJet); | |
b12a85c3 | 684 | |
a825589f | 685 | fHistEmbJetsPt[fCentBin]->Fill(embJet->Pt()); |
a5621834 | 686 | fHistEmbJetsCorrPt[fCentBin]->Fill(embJet->Pt() - fRhoVal * embJet->Area()); |
11d18b51 | 687 | fHistEmbJetsArea[fCentBin]->Fill(embJet->Area()); |
a825589f | 688 | fHistEmbJetPhiEta->Fill(embJet->Eta(), embJet->Phi()); |
c92284d5 | 689 | |
a5621834 | 690 | fHistDeltaPtEmb[fCentBin]->Fill(embJet->Pt() - embJet->Area() * fRhoVal - probePt); |
691 | fHistRhoVSEmbBkg->Fill(embJet->Area() * fRhoVal, embJet->Pt() - probePt); | |
2bee31e9 | 692 | } |
693 | else { | |
b0e00dc4 | 694 | if (fAnaType != kEMCALOnly) |
695 | DoEmbTrackLoop(); | |
696 | if (fAnaType == kEMCAL || fAnaType == kEMCALOnly) | |
697 | DoEmbClusterLoop(); | |
a825589f | 698 | if (fEmbeddedTrackId >= 0) { |
b0e00dc4 | 699 | AliVTrack *track2 = static_cast<AliVTrack*>(fEmbTracks->At(fEmbeddedTrackId)); |
700 | fHistEmbNotFoundPhiEta[fCentBin]->Fill(track2->Eta(), track2->Phi()); | |
a825589f | 701 | } |
702 | else if (fEmbeddedClusterId >= 0) { | |
b0e00dc4 | 703 | AliVCluster *cluster2 = static_cast<AliVCluster*>(fEmbCaloClusters->At(fEmbeddedClusterId)); |
a825589f | 704 | TLorentzVector nPart; |
705 | cluster2->GetMomentum(nPart, fVertex); | |
b0e00dc4 | 706 | fHistEmbNotFoundPhiEta[fCentBin]->Fill(nPart.Eta(), nPart.Phi()); |
a825589f | 707 | } |
708 | else { | |
709 | AliWarning(Form("%s - Embedded particle not found!", GetName())); | |
710 | } | |
2bee31e9 | 711 | } |
6fd5039f | 712 | |
713 | return kTRUE; | |
55264f20 | 714 | } |
715 | ||
716 | //________________________________________________________________________ | |
6fd5039f | 717 | void AliAnalysisTaskSAJF::GetLeadingJets(Int_t &maxJetIndex, Int_t &max2JetIndex) |
55264f20 | 718 | { |
16d143bd | 719 | // Get the leading jets. |
720 | ||
df43b607 | 721 | if (!fJets) |
722 | return; | |
723 | ||
16d143bd | 724 | const Int_t njets = fJets->GetEntriesFast(); |
55264f20 | 725 | |
1f03e093 | 726 | Float_t maxJetPt = -999; |
727 | Float_t max2JetPt = -999; | |
25283b37 | 728 | for (Int_t ij = 0; ij < njets; ij++) { |
f0a0fd33 | 729 | |
e44e8726 | 730 | AliEmcalJet* jet = static_cast<AliEmcalJet*>(fJets->At(ij)); |
f0a0fd33 | 731 | |
25283b37 | 732 | if (!jet) { |
a55e4f1d | 733 | AliError(Form("Could not receive jet %d", ij)); |
25283b37 | 734 | continue; |
735 | } | |
f0a0fd33 | 736 | |
e44e8726 | 737 | if (!AcceptJet(jet)) |
91f4b7c5 | 738 | continue; |
739 | ||
a5621834 | 740 | Float_t corrPt = jet->Pt() - fRhoVal * jet->Area(); |
226f511d | 741 | |
6fd5039f | 742 | if (maxJetIndex == -1 || maxJetPt < corrPt) { |
743 | max2JetPt = maxJetPt; | |
744 | max2JetIndex = maxJetIndex; | |
745 | maxJetPt = corrPt; | |
746 | maxJetIndex = ij; | |
b12a85c3 | 747 | } |
6fd5039f | 748 | else if (max2JetIndex == -1 || max2JetPt < corrPt) { |
749 | max2JetPt = corrPt; | |
750 | max2JetIndex = ij; | |
b12a85c3 | 751 | } |
16d143bd | 752 | } |
6fd5039f | 753 | } |
754 | ||
e44e8726 | 755 | //________________________________________________________________________ |
756 | void AliAnalysisTaskSAJF::DoClusterLoop() | |
757 | { | |
758 | // Do cluster loop. | |
759 | ||
760 | if (!fCaloClusters) | |
761 | return; | |
762 | ||
763 | Int_t nclusters = fCaloClusters->GetEntriesFast(); | |
764 | ||
765 | for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) { | |
766 | AliVCluster* cluster = static_cast<AliVCluster*>(fCaloClusters->At(iClusters)); | |
767 | if (!cluster) { | |
768 | AliError(Form("Could not receive cluster %d", iClusters)); | |
769 | continue; | |
770 | } | |
771 | ||
b0e00dc4 | 772 | if (!AcceptCluster(cluster)) |
e44e8726 | 773 | continue; |
774 | ||
775 | fHistClustersPt[fCentBin]->Fill(cluster->E()); | |
776 | } | |
777 | } | |
778 | ||
779 | //________________________________________________________________________ | |
780 | void AliAnalysisTaskSAJF::DoTrackLoop() | |
781 | { | |
782 | // Do track loop. | |
783 | ||
784 | if (!fTracks) | |
785 | return; | |
786 | ||
787 | Int_t ntracks = fTracks->GetEntriesFast(); | |
788 | ||
789 | for (Int_t i = 0; i < ntracks; i++) { | |
790 | ||
791 | AliVParticle* track = static_cast<AliVParticle*>(fTracks->At(i)); // pointer to reconstructed to track | |
792 | ||
793 | if (!track) { | |
794 | AliError(Form("Could not retrieve track %d",i)); | |
795 | continue; | |
796 | } | |
797 | ||
798 | AliVTrack* vtrack = dynamic_cast<AliVTrack*>(track); | |
799 | ||
b0e00dc4 | 800 | if (vtrack && !AcceptTrack(vtrack)) |
e44e8726 | 801 | continue; |
802 | ||
803 | fHistTracksPt[fCentBin]->Fill(track->Pt()); | |
804 | } | |
805 | } | |
806 | ||
6fd5039f | 807 | //________________________________________________________________________ |
808 | void AliAnalysisTaskSAJF::DoJetLoop() | |
809 | { | |
16d143bd | 810 | // Do the jet loop. |
811 | ||
6fd5039f | 812 | if (!fJets) |
813 | return; | |
814 | ||
e44e8726 | 815 | const Double_t rho = fRho->GetVal(); |
816 | ||
16d143bd | 817 | const Int_t njets = fJets->GetEntriesFast(); |
6fd5039f | 818 | |
58285fc6 | 819 | TH1F constituents("constituents", "constituents", |
820 | fHistConstituents[0]->GetNbinsX(), fHistConstituents[0]->GetXaxis()->GetXmin(), fHistConstituents[0]->GetXaxis()->GetXmax()); | |
821 | ||
6fd5039f | 822 | for (Int_t ij = 0; ij < njets; ij++) { |
823 | ||
e44e8726 | 824 | AliEmcalJet* jet = static_cast<AliEmcalJet*>(fJets->At(ij)); |
6fd5039f | 825 | |
826 | if (!jet) { | |
827 | AliError(Form("Could not receive jet %d", ij)); | |
828 | continue; | |
829 | } | |
830 | ||
e44e8726 | 831 | if (!AcceptJet(jet)) |
6fd5039f | 832 | continue; |
833 | ||
e44e8726 | 834 | Float_t corrPt = jet->Pt() - rho * jet->Area(); |
226f511d | 835 | |
11d4d636 | 836 | fHistJetsPt[fCentBin]->Fill(jet->Pt()); |
2bddb6ae | 837 | fHistJetsPtArea[fCentBin]->Fill(jet->Pt(), jet->Area()); |
c92284d5 | 838 | fHistJetsCorrPt[fCentBin]->Fill(corrPt); |
839 | fHistJetsCorrPtArea[fCentBin]->Fill(corrPt, jet->Area()); | |
f0a0fd33 | 840 | |
8b9f02fd | 841 | fHistJetPhiEta[fCentBin]->Fill(jet->Eta(), jet->Phi()); |
a5621834 | 842 | |
e44e8726 | 843 | fHistMaxPartPtvsJetPt[fCentBin]->Fill(jet->Pt(), jet->MaxPartPt()); |
e44e8726 | 844 | fHistMaxPartPtvsJetCorrPt[fCentBin]->Fill(corrPt, jet->MaxPartPt()); |
845 | ||
8b9f02fd | 846 | if (fAnaType != kEMCALOnly) { |
847 | fHistMaxTrackPtvsJetPt[fCentBin]->Fill(jet->Pt(), jet->MaxTrackPt()); | |
848 | fHistMaxTrackPtvsJetCorrPt[fCentBin]->Fill(corrPt, jet->MaxTrackPt()); | |
849 | } | |
b12a85c3 | 850 | |
8b9f02fd | 851 | if (fAnaType == kEMCAL || fAnaType == kEMCALOnly) { |
e44e8726 | 852 | fHistMaxClusPtvsJetPt[fCentBin]->Fill(jet->Pt(), jet->MaxClusterPt()); |
853 | fHistMaxClusPtvsJetCorrPt[fCentBin]->Fill(corrPt, jet->MaxClusterPt()); | |
b12a85c3 | 854 | fHistJetsNEFvsPt[fCentBin]->Fill(jet->NEF(), jet->Pt()); |
e44e8726 | 855 | } |
226f511d | 856 | |
a825589f | 857 | Float_t scalarpt = 0; |
858 | ||
6e8d91c9 | 859 | if (fTracks) { |
860 | for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) { | |
861 | AliVParticle *track = jet->TrackAt(it, fTracks); | |
a825589f | 862 | if (track) { |
6e8d91c9 | 863 | fHistJetsZvsPt[fCentBin]->Fill(track->Pt() / jet->Pt(), jet->Pt()); |
58285fc6 | 864 | constituents.Fill(track->Pt()); |
a825589f | 865 | scalarpt += track->Pt(); |
866 | } | |
6e8d91c9 | 867 | } |
35789a2d | 868 | } |
a55e4f1d | 869 | |
6e8d91c9 | 870 | if (fCaloClusters) { |
871 | for (Int_t ic = 0; ic < jet->GetNumberOfClusters(); ic++) { | |
872 | AliVCluster *cluster = jet->ClusterAt(ic, fCaloClusters); | |
873 | ||
874 | if (cluster) { | |
875 | TLorentzVector nPart; | |
876 | cluster->GetMomentum(nPart, fVertex); | |
2bddb6ae | 877 | fHistJetsZvsPt[fCentBin]->Fill(nPart.Et() / jet->Pt(), jet->Pt()); |
a825589f | 878 | scalarpt += nPart.Pt(); |
58285fc6 | 879 | constituents.Fill(nPart.Pt()); |
6e8d91c9 | 880 | } |
55264f20 | 881 | } |
f0a0fd33 | 882 | } |
a825589f | 883 | |
884 | fHistDeltaVectorPt->Fill(scalarpt - jet->Pt()); | |
58285fc6 | 885 | |
886 | for (Int_t i = 1; i <= constituents.GetNbinsX(); i++) { | |
887 | fHistConstituents[fCentBin]->Fill(constituents.GetBinCenter(i), constituents.GetBinContent(i)); | |
888 | } | |
889 | ||
890 | constituents.Reset(); | |
25283b37 | 891 | } //jet loop |
55264f20 | 892 | } |
e82e282c | 893 | |
b0e00dc4 | 894 | //________________________________________________________________________ |
895 | void AliAnalysisTaskSAJF::DoEmbTrackLoop() | |
896 | { | |
897 | // Do track loop. | |
898 | ||
899 | if (!fEmbTracks) | |
900 | return; | |
901 | ||
902 | fEmbeddedTrackId = -1; | |
903 | ||
904 | Int_t ntracks = fEmbTracks->GetEntriesFast(); | |
905 | ||
906 | for (Int_t i = 0; i < ntracks; i++) { | |
907 | ||
908 | AliVParticle* track = static_cast<AliVParticle*>(fEmbTracks->At(i)); // pointer to reconstructed to track | |
909 | ||
910 | if (!track) { | |
911 | AliError(Form("Could not retrieve track %d",i)); | |
912 | continue; | |
913 | } | |
914 | ||
915 | AliVTrack* vtrack = dynamic_cast<AliVTrack*>(track); | |
916 | ||
917 | if (vtrack && !AcceptTrack(vtrack, kTRUE)) | |
918 | continue; | |
919 | ||
920 | if (track->GetLabel() == 100) { | |
921 | fEmbeddedTrackId = i; | |
922 | continue; | |
923 | } | |
924 | } | |
925 | } | |
926 | ||
927 | //________________________________________________________________________ | |
928 | void AliAnalysisTaskSAJF::DoEmbClusterLoop() | |
929 | { | |
930 | // Do cluster loop. | |
931 | ||
932 | if (!fEmbCaloClusters) | |
933 | return; | |
934 | ||
935 | fEmbeddedClusterId = -1; | |
936 | ||
937 | Int_t nclusters = fEmbCaloClusters->GetEntriesFast(); | |
938 | ||
939 | for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) { | |
940 | AliVCluster* cluster = static_cast<AliVCluster*>(fEmbCaloClusters->At(iClusters)); | |
941 | if (!cluster) { | |
942 | AliError(Form("Could not receive cluster %d", iClusters)); | |
943 | continue; | |
944 | } | |
945 | ||
946 | if (!AcceptCluster(cluster, kTRUE)) | |
947 | continue; | |
948 | ||
949 | if (cluster->Chi2() == 100) { | |
950 | fEmbeddedClusterId = iClusters; | |
951 | continue; | |
952 | } | |
953 | } | |
954 | } | |
955 | ||
55264f20 | 956 | //________________________________________________________________________ |
e44e8726 | 957 | void AliAnalysisTaskSAJF::DoEmbJetLoop(AliEmcalJet* &embJet, TObject* &embPart) |
55264f20 | 958 | { |
16d143bd | 959 | // Do the embedded jet loop. |
960 | ||
df43b607 | 961 | if (!fEmbJets) |
962 | return; | |
963 | ||
fb9ac42f | 964 | TLorentzVector maxClusVect; |
2bee31e9 | 965 | |
df43b607 | 966 | Int_t nembjets = fEmbJets->GetEntriesFast(); |
2bee31e9 | 967 | |
2bee31e9 | 968 | for (Int_t ij = 0; ij < nembjets; ij++) { |
969 | ||
e44e8726 | 970 | AliEmcalJet* jet = static_cast<AliEmcalJet*>(fEmbJets->At(ij)); |
2bee31e9 | 971 | |
972 | if (!jet) { | |
973 | AliError(Form("Could not receive jet %d", ij)); | |
974 | continue; | |
975 | } | |
976 | ||
df43b607 | 977 | if (!AcceptJet(jet)) |
978 | continue; | |
2bee31e9 | 979 | |
fb9ac42f | 980 | if (!jet->IsMC()) |
981 | continue; | |
982 | ||
df43b607 | 983 | AliVParticle *maxTrack = 0; |
2bee31e9 | 984 | |
b12a85c3 | 985 | for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) { |
e44e8726 | 986 | AliVParticle *track = jet->TrackAt(it, fEmbTracks); |
b12a85c3 | 987 | |
fb9ac42f | 988 | if (!track) |
989 | continue; | |
990 | ||
1f6fff78 | 991 | if (track->GetLabel() != 100) |
fb9ac42f | 992 | continue; |
b12a85c3 | 993 | |
994 | if (!maxTrack || track->Pt() > maxTrack->Pt()) | |
995 | maxTrack = track; | |
2bee31e9 | 996 | } |
2bee31e9 | 997 | |
b12a85c3 | 998 | AliVCluster *maxClus = 0; |
2bee31e9 | 999 | |
b12a85c3 | 1000 | for (Int_t ic = 0; ic < jet->GetNumberOfClusters(); ic++) { |
e44e8726 | 1001 | AliVCluster *cluster = jet->ClusterAt(ic, fEmbCaloClusters); |
b12a85c3 | 1002 | |
fb9ac42f | 1003 | if (!cluster) |
1004 | continue; | |
1005 | ||
1006 | if (cluster->Chi2() != 100) | |
1007 | continue; | |
b12a85c3 | 1008 | |
1009 | TLorentzVector nPart; | |
1010 | cluster->GetMomentum(nPart, fVertex); | |
1011 | ||
fb9ac42f | 1012 | if (!maxClus || nPart.Et() > maxClusVect.Et()) { |
1013 | new (&maxClusVect) TLorentzVector(nPart); | |
b12a85c3 | 1014 | maxClus = cluster; |
1015 | } | |
1016 | } | |
2bee31e9 | 1017 | |
fb9ac42f | 1018 | if ((maxClus && maxTrack && maxClusVect.Et() > maxTrack->Pt()) || (maxClus && !maxTrack)) { |
e44e8726 | 1019 | embPart = maxClus; |
fb9ac42f | 1020 | embJet = jet; |
b12a85c3 | 1021 | } |
1022 | else if (maxTrack) { | |
e44e8726 | 1023 | embPart = maxTrack; |
fb9ac42f | 1024 | embJet = jet; |
b12a85c3 | 1025 | } |
b12a85c3 | 1026 | |
e22bc1b8 | 1027 | return; // MC jet found, exit |
fb9ac42f | 1028 | } |
2bee31e9 | 1029 | } |
1030 | ||
a55e4f1d | 1031 | //________________________________________________________________________ |
a5621834 | 1032 | void AliAnalysisTaskSAJF::GetRigidCone(Float_t &pt, Float_t &ptrigid, Float_t &eta, Float_t &phi, |
b12a85c3 | 1033 | AliEmcalJet *jet, TClonesArray* tracks, TClonesArray* clusters) const |
a55e4f1d | 1034 | { |
16d143bd | 1035 | // Get rigid cone. |
1036 | ||
b12a85c3 | 1037 | if (!tracks) |
1038 | tracks = fTracks; | |
a55e4f1d | 1039 | |
b12a85c3 | 1040 | if (!clusters) |
1041 | clusters = fCaloClusters; | |
a55e4f1d | 1042 | |
b5ee47fb | 1043 | eta = 0; |
1044 | phi = 0; | |
b12a85c3 | 1045 | pt = 0; |
9b265496 | 1046 | ptrigid = 0; |
1047 | ||
1048 | if (!tracks && !clusters) | |
1049 | return; | |
a55e4f1d | 1050 | |
1051 | Float_t LJeta = 999; | |
1052 | Float_t LJphi = 999; | |
1053 | ||
1054 | if (jet) { | |
1055 | LJeta = jet->Eta(); | |
1056 | LJphi = jet->Phi(); | |
1057 | } | |
1058 | ||
1f6fff78 | 1059 | Float_t maxEta = fMaxEta; |
1060 | Float_t minEta = fMinEta; | |
1061 | Float_t maxPhi = fMaxPhi; | |
1062 | Float_t minPhi = fMinPhi; | |
b5ee47fb | 1063 | |
1064 | if (maxPhi > TMath::Pi() * 2) maxPhi = TMath::Pi() * 2; | |
1065 | if (minPhi < 0) minPhi = 0; | |
1066 | ||
a55e4f1d | 1067 | Float_t dLJ = 0; |
b12a85c3 | 1068 | Int_t repeats = 0; |
a55e4f1d | 1069 | do { |
b12a85c3 | 1070 | eta = gRandom->Rndm() * (maxEta - minEta) + minEta; |
1071 | phi = gRandom->Rndm() * (maxPhi - minPhi) + minPhi; | |
a55e4f1d | 1072 | dLJ = TMath::Sqrt((LJeta - eta) * (LJeta - eta) + (LJphi - phi) * (LJphi - phi)); |
b12a85c3 | 1073 | repeats++; |
1074 | } while (dLJ < fMinRC2LJ && repeats < 999); | |
1075 | ||
e44e8726 | 1076 | if (repeats == 999) { |
b0e00dc4 | 1077 | AliWarning(Form("%s: Could not get random cone!", GetName())); |
b12a85c3 | 1078 | return; |
e44e8726 | 1079 | } |
b5ee47fb | 1080 | |
9b265496 | 1081 | TVector3 rigidAxis; |
1082 | rigidAxis.SetPtEtaPhi(1, eta, phi); | |
1083 | rigidAxis = rigidAxis.Unit(); | |
1084 | ||
94d22b76 | 1085 | if ((fAnaType == kEMCAL || fAnaType == kEMCALOnly) && clusters) { |
b12a85c3 | 1086 | Int_t nclusters = clusters->GetEntriesFast(); |
b5ee47fb | 1087 | for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) { |
e44e8726 | 1088 | AliVCluster* cluster = static_cast<AliVCluster*>(clusters->At(iClusters)); |
b5ee47fb | 1089 | if (!cluster) { |
b0e00dc4 | 1090 | AliError(Form("Could not receive cluster %d", iClusters)); |
b5ee47fb | 1091 | continue; |
1092 | } | |
1093 | ||
121eb688 | 1094 | if (!AcceptCluster(cluster, fMCAna)) |
e44e8726 | 1095 | continue; |
b5ee47fb | 1096 | |
1097 | TLorentzVector nPart; | |
b12a85c3 | 1098 | cluster->GetMomentum(nPart, const_cast<Double_t*>(fVertex)); |
9b265496 | 1099 | |
1100 | Float_t d = TMath::Sqrt((nPart.Eta() - eta) * (nPart.Eta() - eta) + (nPart.Phi() - phi) * (nPart.Phi() - phi)); | |
1101 | ||
1102 | if (d <= fJetRadius) { | |
1103 | TVector3 vect = nPart.Vect(); | |
1104 | vect *= vect * rigidAxis / vect.Mag(); | |
1105 | ptrigid += vect.Pt(); | |
1106 | ||
b5ee47fb | 1107 | pt += nPart.Pt(); |
9b265496 | 1108 | } |
b5ee47fb | 1109 | } |
a55e4f1d | 1110 | } |
1111 | ||
df43b607 | 1112 | if (tracks) { |
1113 | Int_t ntracks = tracks->GetEntriesFast(); | |
1114 | for(Int_t iTracks = 0; iTracks < ntracks; iTracks++) { | |
e44e8726 | 1115 | AliVTrack* track = static_cast<AliVTrack*>(tracks->At(iTracks)); |
df43b607 | 1116 | if(!track) { |
1117 | AliError(Form("Could not retrieve track %d",iTracks)); | |
1118 | continue; | |
1119 | } | |
1120 | ||
121eb688 | 1121 | if (!AcceptTrack(track, fMCAna)) |
e44e8726 | 1122 | continue; |
df43b607 | 1123 | |
1124 | Float_t tracketa = track->Eta(); | |
1125 | Float_t trackphi = track->Phi(); | |
1126 | ||
1127 | if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi + 2 * TMath::Pi())) | |
1128 | trackphi += 2 * TMath::Pi(); | |
1129 | if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi - 2 * TMath::Pi())) | |
1130 | trackphi -= 2 * TMath::Pi(); | |
1131 | ||
1132 | Float_t d = TMath::Sqrt((tracketa - eta) * (tracketa - eta) + (trackphi - phi) * (trackphi - phi)); | |
9b265496 | 1133 | if (d <= fJetRadius){ |
1134 | TVector3 vect(track->Px(), track->Py(), track->Pz()); | |
1135 | vect *= vect * rigidAxis / vect.Mag(); | |
1136 | ptrigid += vect.Pt(); | |
1137 | ||
df43b607 | 1138 | pt += track->Pt(); |
9b265496 | 1139 | } |
df43b607 | 1140 | } |
25283b37 | 1141 | } |
f0a0fd33 | 1142 | } |
94d22b76 | 1143 | |
a55e4f1d | 1144 | //________________________________________________________________________ |
9b265496 | 1145 | void AliAnalysisTaskSAJF::ExecOnce() |
25283b37 | 1146 | { |
16d143bd | 1147 | // Initialize the analysis. |
1148 | ||
a5621834 | 1149 | if (!fRhoName.IsNull() && !fRho) { |
1150 | fRho = dynamic_cast<AliRhoParameter*>(InputEvent()->FindListObject(fRhoName)); | |
1151 | if (!fRho) { | |
1152 | AliError(Form("%s: Could not retrieve rho %s!", GetName(), fRhoName.Data())); | |
1153 | return; | |
1154 | } | |
1155 | } | |
1156 | ||
1157 | if (!fEmbJetsName.IsNull() && !fEmbJets) { | |
1158 | fEmbJets = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fEmbJetsName)); | |
1159 | if (!fEmbJets) { | |
1160 | AliError(Form("%s: Could not retrieve emb jets %s!", GetName(), fEmbJetsName.Data())); | |
1161 | return; | |
1162 | } | |
1163 | else if (!fEmbJets->GetClass()->GetBaseClass("AliEmcalJet")) { | |
1164 | AliError(Form("%s: Collection %s does not contain AliEmcalJet objects!", GetName(), fEmbJetsName.Data())); | |
1165 | fEmbJets = 0; | |
1166 | return; | |
1167 | } | |
1168 | } | |
1169 | ||
8b9f02fd | 1170 | if (!fEmbCaloName.IsNull() && (fAnaType == kEMCAL || fAnaType == kEMCALOnly) && !fEmbCaloClusters) { |
a5621834 | 1171 | fEmbCaloClusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fEmbCaloName)); |
1172 | if (!fEmbCaloClusters) { | |
1173 | AliError(Form("%s: Could not retrieve embedded clusters %s!", GetName(), fEmbCaloName.Data())); | |
1174 | return; | |
1175 | } | |
1176 | else if (!fEmbCaloClusters->GetClass()->GetBaseClass("AliVCluster") && !fEmbCaloClusters->GetClass()->GetBaseClass("AliEmcalParticle")) { | |
1177 | AliError(Form("%s: Collection %s does not contain AliVCluster nor AliEmcalParticle objects!", GetName(), fEmbCaloName.Data())); | |
1178 | fEmbCaloClusters = 0; | |
1179 | return; | |
1180 | } | |
1181 | } | |
1182 | ||
8b9f02fd | 1183 | if (!fEmbTracksName.IsNull() && fAnaType != kEMCALOnly && !fEmbTracks) { |
a5621834 | 1184 | fEmbTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fEmbTracksName)); |
1185 | if (!fEmbTracks) { | |
1186 | AliError(Form("%s: Could not retrieve embedded tracks %s!", GetName(), fEmbTracksName.Data())); | |
1187 | return; | |
1188 | } | |
1189 | else if (!fEmbTracks->GetClass()->GetBaseClass("AliVParticle") && !fEmbTracks->GetClass()->GetBaseClass("AliEmcalParticle")) { | |
1190 | AliError(Form("%s: Collection %s does not contain AliVParticle nor AliEmcalParticle objects!", GetName(), fEmbTracksName.Data())); | |
1191 | fEmbTracks = 0; | |
1192 | return; | |
1193 | } | |
1194 | } | |
1195 | ||
8b9f02fd | 1196 | if (!fRandCaloName.IsNull() && (fAnaType == kEMCAL || fAnaType == kEMCALOnly) && !fRandCaloClusters) { |
a5621834 | 1197 | fRandCaloClusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fRandCaloName)); |
1198 | if (!fRandCaloClusters) { | |
1199 | AliError(Form("%s: Could not retrieve randomized clusters %s!", GetName(), fRandCaloName.Data())); | |
1200 | return; | |
1201 | } | |
1202 | else if (!fRandCaloClusters->GetClass()->GetBaseClass("AliVCluster") && !fRandCaloClusters->GetClass()->GetBaseClass("AliEmcalParticle")) { | |
1203 | AliError(Form("%s: Collection %s does not contain AliVCluster nor AliEmcalParticle objects!", GetName(), fRandCaloName.Data())); | |
1204 | fRandCaloClusters = 0; | |
1205 | return; | |
1206 | } | |
1207 | } | |
1208 | ||
8b9f02fd | 1209 | if (!fRandTracksName.IsNull() && fAnaType != kEMCALOnly && !fRandTracks) { |
a5621834 | 1210 | fRandTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fRandTracksName)); |
1211 | if (!fRandTracks) { | |
1212 | AliError(Form("%s: Could not retrieve randomized tracks %s!", GetName(), fRandTracksName.Data())); | |
1213 | return; | |
1214 | } | |
1215 | else if (!fRandTracks->GetClass()->GetBaseClass("AliVParticle") && !fRandTracks->GetClass()->GetBaseClass("AliEmcalParticle")) { | |
1216 | AliError(Form("%s: Collection %s does not contain AliVParticle nor AliEmcalParticle objects!", GetName(), fRandTracksName.Data())); | |
1217 | fRandTracks = 0; | |
1218 | return; | |
1219 | } | |
1220 | } | |
1221 | ||
9b265496 | 1222 | AliAnalysisTaskEmcalJet::ExecOnce(); |
1223 | ||
b0e00dc4 | 1224 | if (fMinRC2LJ < 0) |
679e9805 | 1225 | fMinRC2LJ = fJetRadius * 1.5; |
b0e00dc4 | 1226 | |
679e9805 | 1227 | const Float_t maxDist = TMath::Max(fMaxPhi - fMinPhi, fMaxEta - fMinEta) / 2; |
1228 | if (fMinRC2LJ > maxDist) { | |
1229 | AliWarning(Form("The parameter fMinRC2LJ = %f is too large for the considered acceptance. " | |
1230 | "Will use fMinRC2LJ = %f", fMinRC2LJ, maxDist)); | |
1231 | fMinRC2LJ = maxDist; | |
1232 | } | |
25283b37 | 1233 | } |
1234 | ||
1235 | //________________________________________________________________________ | |
00514d01 | 1236 | void AliAnalysisTaskSAJF::Terminate(Option_t *) |
25283b37 | 1237 | { |
1238 | // Called once at the end of the analysis. | |
1239 | } |