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 fHistEmbJetsPtArea[i] = 0;
60 fHistEmbJetsCorrPtArea[i] = 0;
61 fHistEmbPartPt[i] = 0;
62 fHistDistEmbPartJetAxis[i] = 0;
63 fHistEmbBkgArea[i] = 0;
64 fHistRhoVSEmbBkg[i] = 0;
65 fHistDeltaPtEmbArea[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 fHistEmbJetsPtArea[i] = 0;
106 fHistEmbJetsCorrPtArea[i] = 0;
107 fHistEmbPartPt[i] = 0;
108 fHistDistEmbPartJetAxis[i] = 0;
109 fHistEmbBkgArea[i] = 0;
110 fHistRhoVSEmbBkg[i] = 0;
111 fHistDeltaPtEmbArea[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 #it{p}_{T} (GeV/#it{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 #it{p}_{T} (GeV/#it{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 #it{p}_{T}^{RC} (GeV/#it{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 #it{p}_{T}^{RC} (GeV/#it{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, fNbins, fMinBinPt, fMaxBinPt);
179 fHistRhoVSRCPt[i]->GetXaxis()->SetTitle("A#rho (GeV/#it{c})");
180 fHistRhoVSRCPt[i]->GetYaxis()->SetTitle("rigid cone #it{p}_{T} (GeV/#it{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("#delta#it{p}_{T}^{RC} (GeV/#it{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("#delta#it{p}_{T}^{RC} (GeV/#it{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("#delta#it{p}_{T}^{RC} (GeV/#it{c})");
201 fHistDeltaPtRCRand[i]->GetYaxis()->SetTitle("counts");
202 fOutput->Add(fHistDeltaPtRCRand[i]);
204 if (!fEmbJetsName.IsNull()) {
205 histname = "fHistEmbJetsPtArea_";
207 fHistEmbJetsPtArea[i] = new TH2F(histname.Data(), histname.Data(), 40, 0, fJetRadius * fJetRadius * TMath::Pi() * 3, fNbins, fMinBinPt, fMaxBinPt);
208 fHistEmbJetsPtArea[i]->GetXaxis()->SetTitle("area");
209 fHistEmbJetsPtArea[i]->GetYaxis()->SetTitle("embedded jet #it{p}_{T}^{raw} (GeV/#it{c})");
210 fOutput->Add(fHistEmbJetsPtArea[i]);
212 histname = "fHistEmbJetsCorrPtArea_";
214 fHistEmbJetsCorrPtArea[i] = new TH2F(histname.Data(), histname.Data(), 40, 0, fJetRadius * fJetRadius * TMath::Pi() * 3, fNbins * 2, -fMaxBinPt, fMaxBinPt);
215 fHistEmbJetsCorrPtArea[i]->GetXaxis()->SetTitle("area");
216 fHistEmbJetsCorrPtArea[i]->GetYaxis()->SetTitle("embedded jet #it{p}_{T}^{corr} (GeV/#it{c})");
217 fOutput->Add(fHistEmbJetsCorrPtArea[i]);
219 histname = "fHistEmbPartPt_";
221 fHistEmbPartPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt);
222 fHistEmbPartPt[i]->GetXaxis()->SetTitle("embedded particle it{p}_{T}^{emb} (GeV/#it{c})");
223 fHistEmbPartPt[i]->GetYaxis()->SetTitle("counts");
224 fOutput->Add(fHistEmbPartPt[i]);
226 histname = "fHistDistEmbPartJetAxis_";
228 fHistDistEmbPartJetAxis[i] = new TH1F(histname.Data(), histname.Data(), 50, 0, 0.5);
229 fHistDistEmbPartJetAxis[i]->GetXaxis()->SetTitle("distance");
230 fHistDistEmbPartJetAxis[i]->GetYaxis()->SetTitle("counts");
231 fOutput->Add(fHistDistEmbPartJetAxis[i]);
233 histname = "fHistEmbNotFoundPhiEta_";
235 fHistEmbNotFoundPhiEta[i] = new TH2F(histname.Data(), histname.Data(), 40, -2, 2, 64, 0, 6.4);
236 fHistEmbNotFoundPhiEta[i]->GetXaxis()->SetTitle("#eta");
237 fHistEmbNotFoundPhiEta[i]->GetYaxis()->SetTitle("#phi");
238 fOutput->Add(fHistEmbNotFoundPhiEta[i]);
240 histname = "fHistEmbBkgArea_";
242 fHistEmbBkgArea[i] = new TH2F(histname.Data(), histname.Data(), 40, 0, fJetRadius * fJetRadius * TMath::Pi() * 3, fNbins, fMinBinPt, fMaxBinPt);
243 fHistEmbBkgArea[i]->GetXaxis()->SetTitle("area");
244 fHistEmbBkgArea[i]->GetYaxis()->SetTitle("background of embedded track (GeV/#it{c})");
245 fOutput->Add(fHistEmbBkgArea[i]);
247 histname = "fHistRhoVSEmbBkg_";
249 fHistRhoVSEmbBkg[i] = new TH2F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt, fNbins, fMinBinPt, fMaxBinPt);
250 fHistRhoVSEmbBkg[i]->GetXaxis()->SetTitle("A#rho (GeV/#it{c})");
251 fHistRhoVSEmbBkg[i]->GetYaxis()->SetTitle("background of embedded track (GeV/#it{c})");
252 fOutput->Add(fHistRhoVSEmbBkg[i]);
254 histname = "fHistDeltaPtEmbArea_";
256 fHistDeltaPtEmbArea[i] = new TH2F(histname.Data(), histname.Data(), 40, 0, fJetRadius * fJetRadius * TMath::Pi() * 3, fNbins * 2, -fMaxBinPt, fMaxBinPt);
257 fHistDeltaPtEmbArea[i]->GetXaxis()->SetTitle("area");
258 fHistDeltaPtEmbArea[i]->GetYaxis()->SetTitle("#delta#it{p}_{T}^{emb} (GeV/#it{c})");
259 fOutput->Add(fHistDeltaPtEmbArea[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 for (Int_t i = 0; i < fRCperEvent; i++) {
285 // Simple random cones
289 GetRandomCone(RCpt, RCeta, RCphi, 0);
291 fHistRCPhiEta->Fill(RCeta, RCphi);
292 fHistRhoVSRCPt[fCentBin]->Fill(fRhoVal * rcArea, RCpt);
294 fHistRCPt[fCentBin]->Fill(RCpt);
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);
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);
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 fHistEmbJetsPtArea[fCentBin]->Fill(embJet->Area(), embJet->Pt());
371 fHistEmbJetsCorrPtArea[fCentBin]->Fill(embJet->Area(), embJet->Pt() - fRhoVal * embJet->Area());
372 fHistEmbJetPhiEta->Fill(embJet->Eta(), embJet->Phi());
374 fHistEmbBkgArea[fCentBin]->Fill(embJet->Area(), embJet->Pt() - probePt);
375 fHistRhoVSEmbBkg[fCentBin]->Fill(fRhoVal * embJet->Area(), embJet->Pt() - probePt);
376 fHistDeltaPtEmbArea[fCentBin]->Fill(embJet->Area(), embJet->Pt() - embJet->Area() * fRhoVal - probePt);
382 if (fEmbCaloClusters)
384 if (fEmbeddedTrackId >= 0) {
385 AliVTrack *track2 = static_cast<AliVTrack*>(fEmbTracks->At(fEmbeddedTrackId));
386 fHistEmbNotFoundPhiEta[fCentBin]->Fill(track2->Eta(), track2->Phi());
388 else if (fEmbeddedClusterId >= 0) {
389 AliVCluster *cluster2 = static_cast<AliVCluster*>(fEmbCaloClusters->At(fEmbeddedClusterId));
390 TLorentzVector nPart;
391 cluster2->GetMomentum(nPart, fVertex);
392 fHistEmbNotFoundPhiEta[fCentBin]->Fill(nPart.Eta(), nPart.Phi());
395 AliWarning(Form("%s - Embedded particle not found!", GetName()));
402 //________________________________________________________________________
403 void AliAnalysisTaskDeltaPt::DoEmbTrackLoop()
410 fEmbeddedTrackId = -1;
412 Int_t ntracks = fEmbTracks->GetEntriesFast();
414 for (Int_t i = 0; i < ntracks; i++) {
416 AliVParticle* track = static_cast<AliVParticle*>(fEmbTracks->At(i)); // pointer to reconstructed to track
419 AliError(Form("Could not retrieve track %d",i));
423 AliVTrack* vtrack = dynamic_cast<AliVTrack*>(track);
425 if (vtrack && !AcceptTrack(vtrack, kTRUE))
428 if (track->GetLabel() == 100) {
429 fEmbeddedTrackId = i;
435 //________________________________________________________________________
436 void AliAnalysisTaskDeltaPt::DoEmbClusterLoop()
440 if (!fEmbCaloClusters)
443 fEmbeddedClusterId = -1;
445 Int_t nclusters = fEmbCaloClusters->GetEntriesFast();
447 for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) {
448 AliVCluster* cluster = static_cast<AliVCluster*>(fEmbCaloClusters->At(iClusters));
450 AliError(Form("Could not receive cluster %d", iClusters));
454 if (!AcceptCluster(cluster, kTRUE))
457 if (cluster->Chi2() == 100) {
458 fEmbeddedClusterId = iClusters;
464 //________________________________________________________________________
465 void AliAnalysisTaskDeltaPt::DoEmbJetLoop(AliEmcalJet* &embJet, TObject* &embPart)
467 // Do the embedded jet loop.
472 TLorentzVector maxClusVect;
474 Int_t nembjets = fEmbJets->GetEntriesFast();
476 for (Int_t ij = 0; ij < nembjets; ij++) {
478 AliEmcalJet* jet = static_cast<AliEmcalJet*>(fEmbJets->At(ij));
481 AliError(Form("Could not receive jet %d", ij));
491 AliVParticle *maxTrack = 0;
493 for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
494 AliVParticle *track = jet->TrackAt(it, fEmbTracks);
499 if (track->GetLabel() != 100)
502 if (!maxTrack || track->Pt() > maxTrack->Pt())
506 AliVCluster *maxClus = 0;
508 for (Int_t ic = 0; ic < jet->GetNumberOfClusters(); ic++) {
509 AliVCluster *cluster = jet->ClusterAt(ic, fEmbCaloClusters);
514 if (cluster->Chi2() != 100)
517 TLorentzVector nPart;
518 cluster->GetMomentum(nPart, fVertex);
520 if (!maxClus || nPart.Et() > maxClusVect.Et()) {
521 new (&maxClusVect) TLorentzVector(nPart);
526 if ((maxClus && maxTrack && maxClusVect.Et() > maxTrack->Pt()) || (maxClus && !maxTrack)) {
535 return; // MC jet found, exit
539 //________________________________________________________________________
540 void AliAnalysisTaskDeltaPt::GetRandomCone(Float_t &pt, Float_t &eta, Float_t &phi,
541 AliEmcalJet *jet, TClonesArray* tracks, TClonesArray* clusters) const
549 clusters = fCaloClusters;
555 if (!tracks && !clusters)
566 Float_t maxEta = fJetMaxEta;
567 Float_t minEta = fJetMinEta;
568 Float_t maxPhi = fJetMaxPhi;
569 Float_t minPhi = fJetMinPhi;
571 if (maxPhi > TMath::Pi() * 2) maxPhi = TMath::Pi() * 2;
572 if (minPhi < 0) minPhi = 0;
577 eta = gRandom->Rndm() * (maxEta - minEta) + minEta;
578 phi = gRandom->Rndm() * (maxPhi - minPhi) + minPhi;
579 dLJ = TMath::Sqrt((LJeta - eta) * (LJeta - eta) + (LJphi - phi) * (LJphi - phi));
581 } while (dLJ < fMinRC2LJ && repeats < 999);
583 if (repeats == 999) {
584 AliWarning(Form("%s: Could not get random cone!", GetName()));
589 Int_t nclusters = clusters->GetEntriesFast();
590 for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) {
591 AliVCluster* cluster = static_cast<AliVCluster*>(clusters->At(iClusters));
593 AliError(Form("Could not receive cluster %d", iClusters));
597 if (!AcceptCluster(cluster, fMCAna))
600 TLorentzVector nPart;
601 cluster->GetMomentum(nPart, const_cast<Double_t*>(fVertex));
603 Float_t d = TMath::Sqrt((nPart.Eta() - eta) * (nPart.Eta() - eta) + (nPart.Phi() - phi) * (nPart.Phi() - phi));
611 Int_t ntracks = tracks->GetEntriesFast();
612 for(Int_t iTracks = 0; iTracks < ntracks; iTracks++) {
613 AliVTrack* track = static_cast<AliVTrack*>(tracks->At(iTracks));
615 AliError(Form("Could not retrieve track %d",iTracks));
619 if (!AcceptTrack(track, fMCAna))
622 Float_t tracketa = track->Eta();
623 Float_t trackphi = track->Phi();
625 if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi + 2 * TMath::Pi()))
626 trackphi += 2 * TMath::Pi();
627 if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi - 2 * TMath::Pi()))
628 trackphi -= 2 * TMath::Pi();
630 Float_t d = TMath::Sqrt((tracketa - eta) * (tracketa - eta) + (trackphi - phi) * (trackphi - phi));
637 //________________________________________________________________________
638 void AliAnalysisTaskDeltaPt::ExecOnce()
640 // Initialize the analysis.
642 if (!fEmbJetsName.IsNull() && !fEmbJets) {
643 fEmbJets = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fEmbJetsName));
645 AliError(Form("%s: Could not retrieve embedded jets %s!", GetName(), fEmbJetsName.Data()));
648 else if (!fEmbJets->GetClass()->GetBaseClass("AliEmcalJet")) {
649 AliError(Form("%s: Collection %s does not contain AliEmcalJet objects!", GetName(), fEmbJetsName.Data()));
655 if (!fEmbCaloName.IsNull() && !fEmbCaloClusters) {
656 fEmbCaloClusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fEmbCaloName));
657 if (!fEmbCaloClusters) {
658 AliError(Form("%s: Could not retrieve embedded clusters %s!", GetName(), fEmbCaloName.Data()));
661 else if (!fEmbCaloClusters->GetClass()->GetBaseClass("AliVCluster") && !fEmbCaloClusters->GetClass()->GetBaseClass("AliEmcalParticle")) {
662 AliError(Form("%s: Collection %s does not contain AliVCluster nor AliEmcalParticle objects!", GetName(), fEmbCaloName.Data()));
663 fEmbCaloClusters = 0;
668 if (!fEmbTracksName.IsNull() && !fEmbTracks) {
669 fEmbTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fEmbTracksName));
671 AliError(Form("%s: Could not retrieve embedded tracks %s!", GetName(), fEmbTracksName.Data()));
674 else if (!fEmbTracks->GetClass()->GetBaseClass("AliVParticle") && !fEmbTracks->GetClass()->GetBaseClass("AliEmcalParticle")) {
675 AliError(Form("%s: Collection %s does not contain AliVParticle nor AliEmcalParticle objects!", GetName(), fEmbTracksName.Data()));
681 if (!fRandCaloName.IsNull() && !fRandCaloClusters) {
682 fRandCaloClusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fRandCaloName));
683 if (!fRandCaloClusters) {
684 AliError(Form("%s: Could not retrieve randomized clusters %s!", GetName(), fRandCaloName.Data()));
687 else if (!fRandCaloClusters->GetClass()->GetBaseClass("AliVCluster") && !fRandCaloClusters->GetClass()->GetBaseClass("AliEmcalParticle")) {
688 AliError(Form("%s: Collection %s does not contain AliVCluster nor AliEmcalParticle objects!", GetName(), fRandCaloName.Data()));
689 fRandCaloClusters = 0;
694 if (!fRandTracksName.IsNull() && !fRandTracks) {
695 fRandTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fRandTracksName));
697 AliError(Form("%s: Could not retrieve randomized tracks %s!", GetName(), fRandTracksName.Data()));
700 else if (!fRandTracks->GetClass()->GetBaseClass("AliVParticle") && !fRandTracks->GetClass()->GetBaseClass("AliEmcalParticle")) {
701 AliError(Form("%s: Collection %s does not contain AliVParticle nor AliEmcalParticle objects!", GetName(), fRandTracksName.Data()));
707 AliAnalysisTaskEmcalJet::ExecOnce();
709 if (fRCperEvent < 0) {
710 Double_t area = (fJetMaxEta - fJetMinEta) * (fJetMaxPhi - fJetMinPhi);
711 Double_t jetArea = TMath::Pi() * fJetRadius * fJetRadius;
712 fRCperEvent = TMath::FloorNint(area / jetArea - 0.5);
713 if (fRCperEvent == 0)
718 fMinRC2LJ = fJetRadius * 1.5;
720 const Float_t maxDist = TMath::Max(fJetMaxPhi - fJetMinPhi, fJetMaxEta - fJetMinEta) / 2;
721 if (fMinRC2LJ > maxDist) {
722 AliWarning(Form("The parameter fMinRC2LJ = %f is too large for the considered acceptance. "
723 "Will use fMinRC2LJ = %f", fMinRC2LJ, maxDist));
728 //________________________________________________________________________
729 void AliAnalysisTaskDeltaPt::Terminate(Option_t *)
731 // Called once at the end of the analysis.