7 #include <TClonesArray.h>
11 #include <TLorentzVector.h>
14 #include "AliVCluster.h"
15 #include "AliVParticle.h"
16 #include "AliVTrack.h"
17 #include "AliEmcalJet.h"
18 #include "AliRhoParameter.h"
21 #include "AliAnalysisTaskDeltaPt.h"
23 ClassImp(AliAnalysisTaskDeltaPt)
25 //________________________________________________________________________
26 AliAnalysisTaskDeltaPt::AliAnalysisTaskDeltaPt() :
27 AliAnalysisTaskEmcalJet("AliAnalysisTaskDeltaPt", kTRUE),
33 fRandTracksName("TracksRandomized"),
34 fRandCaloName("CaloClustersRandomized"),
41 fEmbeddedClusterId(-1),
44 fHistRCPtExLJVSDPhiLJ(0),
48 // Default constructor.
50 for (Int_t i = 0; i < 4; i++) {
54 fHistRhoVSRCPt[i] = 0;
55 fHistDeltaPtRC[i] = 0;
56 fHistDeltaPtRCExLJ[i] = 0;
57 fHistDeltaPtRCRand[i] = 0;
58 fHistEmbNotFoundPhiEta[i] = 0;
59 fHistEmbJetsPt[i] = 0;
60 fHistEmbJetsCorrPt[i] = 0;
61 fHistEmbJetsArea[i] = 0;
62 fHistEmbPartPt[i] = 0;
63 fHistDistEmbPartJetAxis[i] = 0;
64 fHistRhoVSEmbBkg[i] = 0;
65 fHistDeltaPtEmb[i] = 0;
68 SetMakeGeneralHistograms(kTRUE);
71 //________________________________________________________________________
72 AliAnalysisTaskDeltaPt::AliAnalysisTaskDeltaPt(const char *name) :
73 AliAnalysisTaskEmcalJet(name, kTRUE),
79 fRandTracksName("TracksRandomized"),
80 fRandCaloName("CaloClustersRandomized"),
87 fEmbeddedClusterId(-1),
90 fHistRCPtExLJVSDPhiLJ(0),
94 // Standard constructor.
96 for (Int_t i = 0; i < 4; i++) {
100 fHistRhoVSRCPt[i] = 0;
101 fHistDeltaPtRC[i] = 0;
102 fHistDeltaPtRCExLJ[i] = 0;
103 fHistDeltaPtRCRand[i] = 0;
104 fHistEmbNotFoundPhiEta[i] = 0;
105 fHistEmbJetsPt[i] = 0;
106 fHistEmbJetsCorrPt[i] = 0;
107 fHistEmbJetsArea[i] = 0;
108 fHistEmbPartPt[i] = 0;
109 fHistDistEmbPartJetAxis[i] = 0;
110 fHistRhoVSEmbBkg[i] = 0;
111 fHistDeltaPtEmb[i] = 0;
114 SetMakeGeneralHistograms(kTRUE);
117 //________________________________________________________________________
118 AliAnalysisTaskDeltaPt::~AliAnalysisTaskDeltaPt()
123 //________________________________________________________________________
124 void AliAnalysisTaskDeltaPt::UserCreateOutputObjects()
126 // Create user output.
128 AliAnalysisTaskEmcalJet::UserCreateOutputObjects();
130 fHistRCPhiEta = new TH2F("fHistRCPhiEta","Phi-Eta distribution of rigid cones", 50, -1, 1, 101, 0, TMath::Pi() * 2.02);
131 fHistRCPhiEta->GetXaxis()->SetTitle("#eta");
132 fHistRCPhiEta->GetYaxis()->SetTitle("#phi");
133 fOutput->Add(fHistRCPhiEta);
135 fHistRCPtExLJVSDPhiLJ = new TH2F("fHistRCPtExLJVSDPhiLJ","fHistRCPtExLJVSDPhiLJ", fNbins, fMinBinPt, fMaxBinPt, 128, -1.6, 4.8);
136 fHistRCPtExLJVSDPhiLJ->GetXaxis()->SetTitle("rigid cone p_{T} [GeV/c]");
137 fHistRCPtExLJVSDPhiLJ->GetYaxis()->SetTitle("#Delta#phi");
138 fOutput->Add(fHistRCPtExLJVSDPhiLJ);
140 if (!fJetsName.IsNull()) {
141 fHistEmbJetPhiEta = new TH2F("fHistEmbJetPhiEta","Phi-Eta distribution of embedded jets", 50, -1, 1, 101, 0, TMath::Pi() * 2.02);
142 fHistEmbJetPhiEta->GetXaxis()->SetTitle("#eta");
143 fHistEmbJetPhiEta->GetYaxis()->SetTitle("#phi");
144 fOutput->Add(fHistEmbJetPhiEta);
146 fHistEmbPartPhiEta = new TH2F("fHistEmbPartPhiEta","Phi-Eta distribution of embedded particles", 50, -1, 1, 101, 0, TMath::Pi() * 2.02);
147 fHistEmbPartPhiEta->GetXaxis()->SetTitle("#eta");
148 fHistEmbPartPhiEta->GetYaxis()->SetTitle("#phi");
149 fOutput->Add(fHistEmbPartPhiEta);
154 for (Int_t i = 0; i < 4; i++) {
155 histname = "fHistRCPt_";
157 fHistRCPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2);
158 fHistRCPt[i]->GetXaxis()->SetTitle("rigid cone p_{T} [GeV/c]");
159 fHistRCPt[i]->GetYaxis()->SetTitle("counts");
160 fOutput->Add(fHistRCPt[i]);
162 histname = "fHistRCPtExLJ_";
164 fHistRCPtExLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2);
165 fHistRCPtExLJ[i]->GetXaxis()->SetTitle("rigid cone p_{T}^{RC} [GeV/c]");
166 fHistRCPtExLJ[i]->GetYaxis()->SetTitle("counts");
167 fOutput->Add(fHistRCPtExLJ[i]);
169 histname = "fHistRCPtRand_";
171 fHistRCPtRand[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2);
172 fHistRCPtRand[i]->GetXaxis()->SetTitle("rigid cone p_{T}^{RC} [GeV/c]");
173 fHistRCPtRand[i]->GetYaxis()->SetTitle("counts");
174 fOutput->Add(fHistRCPtRand[i]);
176 histname = "fHistRhoVSRCPt_";
178 fHistRhoVSRCPt[i] = new TH2F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt*2, fNbins, fMinBinPt, fMaxBinPt);
179 fHistRhoVSRCPt[i]->GetXaxis()->SetTitle("A#rho [GeV/c]");
180 fHistRhoVSRCPt[i]->GetYaxis()->SetTitle("rigid cone p_{T} [GeV/c]");
181 fOutput->Add(fHistRhoVSRCPt[i]);
183 histname = "fHistDeltaPtRC_";
185 fHistDeltaPtRC[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt);
186 fHistDeltaPtRC[i]->GetXaxis()->SetTitle("#deltap_{T}^{RC} [GeV/c]");
187 fHistDeltaPtRC[i]->GetYaxis()->SetTitle("counts");
188 fOutput->Add(fHistDeltaPtRC[i]);
190 histname = "fHistDeltaPtRCExLJ_";
192 fHistDeltaPtRCExLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt);
193 fHistDeltaPtRCExLJ[i]->GetXaxis()->SetTitle("#deltap_{T}^{RC} [GeV/c]");
194 fHistDeltaPtRCExLJ[i]->GetYaxis()->SetTitle("counts");
195 fOutput->Add(fHistDeltaPtRCExLJ[i]);
197 histname = "fHistDeltaPtRCRand_";
199 fHistDeltaPtRCRand[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt);
200 fHistDeltaPtRCRand[i]->GetXaxis()->SetTitle("#deltap_{T}^{RC} [GeV/c]");
201 fHistDeltaPtRCRand[i]->GetYaxis()->SetTitle("counts");
202 fOutput->Add(fHistDeltaPtRCRand[i]);
204 if (!fEmbJetsName.IsNull()) {
205 histname = "fHistEmbJetsPt_";
207 fHistEmbJetsPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt);
208 fHistEmbJetsPt[i]->GetXaxis()->SetTitle("embedded jet p_{T}^{raw} [GeV/c]");
209 fHistEmbJetsPt[i]->GetYaxis()->SetTitle("counts");
210 fOutput->Add(fHistEmbJetsPt[i]);
212 histname = "fHistEmbJetsCorrPt_";
214 fHistEmbJetsCorrPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt);
215 fHistEmbJetsCorrPt[i]->GetXaxis()->SetTitle("embedded jet p_{T}^{corr} [GeV/c]");
216 fHistEmbJetsCorrPt[i]->GetYaxis()->SetTitle("counts");
217 fOutput->Add(fHistEmbJetsCorrPt[i]);
219 histname = "fHistEmbJetsArea_";
221 fHistEmbJetsArea[i] = new TH1F(histname.Data(), histname.Data(), 40, 0, fJetRadius * fJetRadius * TMath::Pi() * 3);
222 fHistEmbJetsArea[i]->GetXaxis()->SetTitle("area");
223 fHistEmbJetsArea[i]->GetYaxis()->SetTitle("counts");
224 fOutput->Add(fHistEmbJetsArea[i]);
226 histname = "fHistEmbPartPt_";
228 fHistEmbPartPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt);
229 fHistEmbPartPt[i]->GetXaxis()->SetTitle("embedded particle p_{T}^{emb} [GeV/c]");
230 fHistEmbPartPt[i]->GetYaxis()->SetTitle("counts");
231 fOutput->Add(fHistEmbPartPt[i]);
233 histname = "fHistDistEmbPartJetAxis_";
235 fHistDistEmbPartJetAxis[i] = new TH1F(histname.Data(), histname.Data(), 50, 0, 0.5);
236 fHistDistEmbPartJetAxis[i]->GetXaxis()->SetTitle("distance");
237 fHistDistEmbPartJetAxis[i]->GetYaxis()->SetTitle("counts");
238 fOutput->Add(fHistDistEmbPartJetAxis[i]);
240 histname = "fHistEmbNotFoundPhiEta_";
242 fHistEmbNotFoundPhiEta[i] = new TH2F(histname.Data(), histname.Data(), 40, -2, 2, 64, 0, 6.4);
243 fHistEmbNotFoundPhiEta[i]->GetXaxis()->SetTitle("#eta");
244 fHistEmbNotFoundPhiEta[i]->GetYaxis()->SetTitle("#phi");
245 fOutput->Add(fHistEmbNotFoundPhiEta[i]);
247 histname = "fHistRhoVSEmbBkg_";
249 fHistRhoVSEmbBkg[i] = new TH2F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt*2, fNbins, fMinBinPt, fMaxBinPt);
250 fHistRhoVSEmbBkg[i]->GetXaxis()->SetTitle("A#rho [GeV/c]");
251 fHistRhoVSEmbBkg[i]->GetYaxis()->SetTitle("background of embedded track [GeV/c]");
252 fOutput->Add(fHistRhoVSEmbBkg[i]);
254 histname = "fHistDeltaPtEmb_";
256 fHistDeltaPtEmb[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt);
257 fHistDeltaPtEmb[i]->GetXaxis()->SetTitle("#deltap_{T}^{emb} [GeV/c]");
258 fHistDeltaPtEmb[i]->GetYaxis()->SetTitle("counts");
259 fOutput->Add(fHistDeltaPtEmb[i]);
263 PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram
266 //________________________________________________________________________
267 Bool_t AliAnalysisTaskDeltaPt::FillHistograms()
271 Int_t *sortedJets = GetSortedArray(fJets);
273 AliEmcalJet* jet = 0;
275 if (sortedJets && sortedJets[0] > 0)
276 jet = static_cast<AliEmcalJet*>(fJets->At(sortedJets[0]));
280 // _________________________________
282 const Float_t rcArea = fJetRadius * fJetRadius * TMath::Pi();
284 // Simple random cones
285 for (Int_t i = 0; i < fRCperEvent; i++) {
289 GetRandomCone(RCpt, RCeta, RCphi, 0);
291 fHistRCPhiEta->Fill(RCeta, RCphi);
292 fHistRhoVSRCPt[fCentBin]->Fill(fRhoVal, RCpt);
294 fHistRCPt[fCentBin]->Fill(RCpt / rcArea);
295 fHistDeltaPtRC[fCentBin]->Fill(RCpt - rcArea * fRhoVal);
298 // Random cones far from leading jet
302 GetRandomCone(RCpt, RCeta, RCphi, jet);
305 Float_t dphi = RCphi - jet->Phi();
306 if (dphi > 4.8) dphi -= TMath::Pi() * 2;
307 if (dphi < -1.6) dphi += TMath::Pi() * 2;
308 fHistRCPtExLJVSDPhiLJ->Fill(RCpt, dphi);
310 fHistRCPtExLJ[fCentBin]->Fill(RCpt / rcArea);
311 fHistDeltaPtRCExLJ[fCentBin]->Fill(RCpt - rcArea * fRhoVal);
314 // Random cones with randomized particles
318 GetRandomCone(RCpt, RCeta, RCphi, 0, fRandTracks, fRandCaloClusters);
320 fHistRCPtRand[fCentBin]->Fill(RCpt / rcArea);
321 fHistDeltaPtRCRand[fCentBin]->Fill(RCpt - rcArea * fRhoVal);
327 // _________________________________
332 AliEmcalJet *embJet = 0;
333 TObject *embPart = 0;
335 DoEmbJetLoop(embJet, embPart);
338 Double_t probePt = 0;
339 Double_t probeEta = 0;
340 Double_t probePhi = 0;
342 AliVCluster *cluster = dynamic_cast<AliVCluster*>(embPart);
344 TLorentzVector nPart;
345 cluster->GetMomentum(nPart, fVertex);
347 probeEta = nPart.Eta();
348 probePhi = nPart.Phi();
349 probePt = nPart.Pt();
352 AliVTrack *track = dynamic_cast<AliVTrack*>(embPart);
354 probeEta = track->Eta();
355 probePhi = track->Phi();
356 probePt = track->Pt();
359 AliWarning(Form("%s - Embedded jet found but embedded particle not found (wrong type?)!", GetName()));
363 Double_t distProbeJet = TMath::Sqrt((embJet->Eta() - probeEta) * (embJet->Eta() - probeEta) + (embJet->Phi() - probePhi) * (embJet->Phi() - probePhi));
365 fHistEmbPartPt[fCentBin]->Fill(probePt);
366 fHistEmbPartPhiEta->Fill(probeEta, probePhi);
368 fHistDistEmbPartJetAxis[fCentBin]->Fill(distProbeJet);
370 fHistEmbJetsPt[fCentBin]->Fill(embJet->Pt());
371 fHistEmbJetsCorrPt[fCentBin]->Fill(embJet->Pt() - fRhoVal * embJet->Area());
372 fHistEmbJetsArea[fCentBin]->Fill(embJet->Area());
373 fHistEmbJetPhiEta->Fill(embJet->Eta(), embJet->Phi());
375 fHistDeltaPtEmb[fCentBin]->Fill(embJet->Pt() - embJet->Area() * fRhoVal - probePt);
376 fHistRhoVSEmbBkg[fCentBin]->Fill(fRhoVal, embJet->Pt() - probePt);
381 if (fEmbCaloClusters)
383 if (fEmbeddedTrackId >= 0) {
384 AliVTrack *track2 = static_cast<AliVTrack*>(fEmbTracks->At(fEmbeddedTrackId));
385 fHistEmbNotFoundPhiEta[fCentBin]->Fill(track2->Eta(), track2->Phi());
387 else if (fEmbeddedClusterId >= 0) {
388 AliVCluster *cluster2 = static_cast<AliVCluster*>(fEmbCaloClusters->At(fEmbeddedClusterId));
389 TLorentzVector nPart;
390 cluster2->GetMomentum(nPart, fVertex);
391 fHistEmbNotFoundPhiEta[fCentBin]->Fill(nPart.Eta(), nPart.Phi());
394 AliWarning(Form("%s - Embedded particle not found!", GetName()));
401 //________________________________________________________________________
402 void AliAnalysisTaskDeltaPt::DoEmbTrackLoop()
409 fEmbeddedTrackId = -1;
411 Int_t ntracks = fEmbTracks->GetEntriesFast();
413 for (Int_t i = 0; i < ntracks; i++) {
415 AliVParticle* track = static_cast<AliVParticle*>(fEmbTracks->At(i)); // pointer to reconstructed to track
418 AliError(Form("Could not retrieve track %d",i));
422 AliVTrack* vtrack = dynamic_cast<AliVTrack*>(track);
424 if (vtrack && !AcceptTrack(vtrack, kTRUE))
427 if (track->GetLabel() == 100) {
428 fEmbeddedTrackId = i;
434 //________________________________________________________________________
435 void AliAnalysisTaskDeltaPt::DoEmbClusterLoop()
439 if (!fEmbCaloClusters)
442 fEmbeddedClusterId = -1;
444 Int_t nclusters = fEmbCaloClusters->GetEntriesFast();
446 for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) {
447 AliVCluster* cluster = static_cast<AliVCluster*>(fEmbCaloClusters->At(iClusters));
449 AliError(Form("Could not receive cluster %d", iClusters));
453 if (!AcceptCluster(cluster, kTRUE))
456 if (cluster->Chi2() == 100) {
457 fEmbeddedClusterId = iClusters;
463 //________________________________________________________________________
464 void AliAnalysisTaskDeltaPt::DoEmbJetLoop(AliEmcalJet* &embJet, TObject* &embPart)
466 // Do the embedded jet loop.
471 TLorentzVector maxClusVect;
473 Int_t nembjets = fEmbJets->GetEntriesFast();
475 for (Int_t ij = 0; ij < nembjets; ij++) {
477 AliEmcalJet* jet = static_cast<AliEmcalJet*>(fEmbJets->At(ij));
480 AliError(Form("Could not receive jet %d", ij));
490 AliVParticle *maxTrack = 0;
492 for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
493 AliVParticle *track = jet->TrackAt(it, fEmbTracks);
498 if (track->GetLabel() != 100)
501 if (!maxTrack || track->Pt() > maxTrack->Pt())
505 AliVCluster *maxClus = 0;
507 for (Int_t ic = 0; ic < jet->GetNumberOfClusters(); ic++) {
508 AliVCluster *cluster = jet->ClusterAt(ic, fEmbCaloClusters);
513 if (cluster->Chi2() != 100)
516 TLorentzVector nPart;
517 cluster->GetMomentum(nPart, fVertex);
519 if (!maxClus || nPart.Et() > maxClusVect.Et()) {
520 new (&maxClusVect) TLorentzVector(nPart);
525 if ((maxClus && maxTrack && maxClusVect.Et() > maxTrack->Pt()) || (maxClus && !maxTrack)) {
534 return; // MC jet found, exit
538 //________________________________________________________________________
539 void AliAnalysisTaskDeltaPt::GetRandomCone(Float_t &pt, Float_t &eta, Float_t &phi,
540 AliEmcalJet *jet, TClonesArray* tracks, TClonesArray* clusters) const
548 clusters = fCaloClusters;
554 if (!tracks && !clusters)
565 Float_t maxEta = fJetMaxEta;
566 Float_t minEta = fJetMinEta;
567 Float_t maxPhi = fJetMaxPhi;
568 Float_t minPhi = fJetMinPhi;
570 if (maxPhi > TMath::Pi() * 2) maxPhi = TMath::Pi() * 2;
571 if (minPhi < 0) minPhi = 0;
576 eta = gRandom->Rndm() * (maxEta - minEta) + minEta;
577 phi = gRandom->Rndm() * (maxPhi - minPhi) + minPhi;
578 dLJ = TMath::Sqrt((LJeta - eta) * (LJeta - eta) + (LJphi - phi) * (LJphi - phi));
580 } while (dLJ < fMinRC2LJ && repeats < 999);
582 if (repeats == 999) {
583 AliWarning(Form("%s: Could not get random cone!", GetName()));
588 Int_t nclusters = clusters->GetEntriesFast();
589 for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) {
590 AliVCluster* cluster = static_cast<AliVCluster*>(clusters->At(iClusters));
592 AliError(Form("Could not receive cluster %d", iClusters));
596 if (!AcceptCluster(cluster, fMCAna))
599 TLorentzVector nPart;
600 cluster->GetMomentum(nPart, const_cast<Double_t*>(fVertex));
602 Float_t d = TMath::Sqrt((nPart.Eta() - eta) * (nPart.Eta() - eta) + (nPart.Phi() - phi) * (nPart.Phi() - phi));
610 Int_t ntracks = tracks->GetEntriesFast();
611 for(Int_t iTracks = 0; iTracks < ntracks; iTracks++) {
612 AliVTrack* track = static_cast<AliVTrack*>(tracks->At(iTracks));
614 AliError(Form("Could not retrieve track %d",iTracks));
618 if (!AcceptTrack(track, fMCAna))
621 Float_t tracketa = track->Eta();
622 Float_t trackphi = track->Phi();
624 if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi + 2 * TMath::Pi()))
625 trackphi += 2 * TMath::Pi();
626 if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi - 2 * TMath::Pi()))
627 trackphi -= 2 * TMath::Pi();
629 Float_t d = TMath::Sqrt((tracketa - eta) * (tracketa - eta) + (trackphi - phi) * (trackphi - phi));
636 //________________________________________________________________________
637 void AliAnalysisTaskDeltaPt::ExecOnce()
639 // Initialize the analysis.
641 if (!fEmbJetsName.IsNull() && !fEmbJets) {
642 fEmbJets = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fEmbJetsName));
644 AliError(Form("%s: Could not retrieve embedded jets %s!", GetName(), fEmbJetsName.Data()));
647 else if (!fEmbJets->GetClass()->GetBaseClass("AliEmcalJet")) {
648 AliError(Form("%s: Collection %s does not contain AliEmcalJet objects!", GetName(), fEmbJetsName.Data()));
654 if (!fEmbCaloName.IsNull() && !fEmbCaloClusters) {
655 fEmbCaloClusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fEmbCaloName));
656 if (!fEmbCaloClusters) {
657 AliError(Form("%s: Could not retrieve embedded clusters %s!", GetName(), fEmbCaloName.Data()));
660 else if (!fEmbCaloClusters->GetClass()->GetBaseClass("AliVCluster") && !fEmbCaloClusters->GetClass()->GetBaseClass("AliEmcalParticle")) {
661 AliError(Form("%s: Collection %s does not contain AliVCluster nor AliEmcalParticle objects!", GetName(), fEmbCaloName.Data()));
662 fEmbCaloClusters = 0;
667 if (!fEmbTracksName.IsNull() && !fEmbTracks) {
668 fEmbTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fEmbTracksName));
670 AliError(Form("%s: Could not retrieve embedded tracks %s!", GetName(), fEmbTracksName.Data()));
673 else if (!fEmbTracks->GetClass()->GetBaseClass("AliVParticle") && !fEmbTracks->GetClass()->GetBaseClass("AliEmcalParticle")) {
674 AliError(Form("%s: Collection %s does not contain AliVParticle nor AliEmcalParticle objects!", GetName(), fEmbTracksName.Data()));
680 if (!fRandCaloName.IsNull() && !fRandCaloClusters) {
681 fRandCaloClusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fRandCaloName));
682 if (!fRandCaloClusters) {
683 AliError(Form("%s: Could not retrieve randomized clusters %s!", GetName(), fRandCaloName.Data()));
686 else if (!fRandCaloClusters->GetClass()->GetBaseClass("AliVCluster") && !fRandCaloClusters->GetClass()->GetBaseClass("AliEmcalParticle")) {
687 AliError(Form("%s: Collection %s does not contain AliVCluster nor AliEmcalParticle objects!", GetName(), fRandCaloName.Data()));
688 fRandCaloClusters = 0;
693 if (!fRandTracksName.IsNull() && !fRandTracks) {
694 fRandTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fRandTracksName));
696 AliError(Form("%s: Could not retrieve randomized tracks %s!", GetName(), fRandTracksName.Data()));
699 else if (!fRandTracks->GetClass()->GetBaseClass("AliVParticle") && !fRandTracks->GetClass()->GetBaseClass("AliEmcalParticle")) {
700 AliError(Form("%s: Collection %s does not contain AliVParticle nor AliEmcalParticle objects!", GetName(), fRandTracksName.Data()));
706 AliAnalysisTaskEmcalJet::ExecOnce();
708 if (fRCperEvent < 0) {
709 Double_t area = (fJetMaxEta - fJetMinEta) * (fJetMaxPhi - fJetMinPhi);
710 Double_t jetArea = TMath::Pi() * fJetRadius * fJetRadius;
711 fRCperEvent = TMath::FloorNint(area / jetArea - 0.5);
712 if (fRCperEvent == 0)
717 fMinRC2LJ = fJetRadius * 1.5;
719 const Float_t maxDist = TMath::Max(fJetMaxPhi - fJetMinPhi, fJetMaxEta - fJetMinEta) / 2;
720 if (fMinRC2LJ > maxDist) {
721 AliWarning(Form("The parameter fMinRC2LJ = %f is too large for the considered acceptance. "
722 "Will use fMinRC2LJ = %f", fMinRC2LJ, maxDist));
727 //________________________________________________________________________
728 void AliAnalysisTaskDeltaPt::Terminate(Option_t *)
730 // Called once at the end of the analysis.