9 #include <TClonesArray.h>
13 #include <TLorentzVector.h>
15 #include <TParameter.h>
17 #include "AliAnalysisManager.h"
18 #include "AliCentrality.h"
19 #include "AliVCluster.h"
20 #include "AliVParticle.h"
21 #include "AliVTrack.h"
22 #include "AliEmcalJet.h"
23 #include "AliVEventHandler.h"
24 #include "AliRhoParameter.h"
27 #include "AliAnalysisTaskDeltaPt.h"
29 ClassImp(AliAnalysisTaskDeltaPt)
31 //________________________________________________________________________
32 AliAnalysisTaskDeltaPt::AliAnalysisTaskDeltaPt() :
33 AliAnalysisTaskEmcalJet("AliAnalysisTaskDeltaPt", kTRUE),
39 fRandTracksName("TracksRandomized"),
40 fRandCaloName("CaloClustersRandomized"),
47 fEmbeddedClusterId(-1),
50 fHistRCPtExLJVSDPhiLJ(0),
53 fHistEmbPartPhiEta(0),
56 // Default constructor.
58 for (Int_t i = 0; i < 4; i++) {
62 fHistDeltaPtRC[i] = 0;
63 fHistDeltaPtRCExLJ[i] = 0;
64 fHistDeltaPtRCRand[i] = 0;
65 fHistEmbNotFoundPhiEta[i] = 0;
66 fHistEmbJetsPt[i] = 0;
67 fHistEmbJetsCorrPt[i] = 0;
68 fHistEmbJetsArea[i] = 0;
69 fHistEmbPartPt[i] = 0;
70 fHistDistEmbPartJetAxis[i] = 0;
71 fHistDeltaPtEmb[i] = 0;
74 SetMakeGeneralHistograms(kTRUE);
77 //________________________________________________________________________
78 AliAnalysisTaskDeltaPt::AliAnalysisTaskDeltaPt(const char *name) :
79 AliAnalysisTaskEmcalJet(name, kTRUE),
85 fRandTracksName("TracksRandomized"),
86 fRandCaloName("CaloClustersRandomized"),
93 fEmbeddedClusterId(-1),
96 fHistRCPtExLJVSDPhiLJ(0),
99 fHistEmbPartPhiEta(0),
102 // Standard constructor.
104 for (Int_t i = 0; i < 4; i++) {
106 fHistRCPtExLJ[i] = 0;
107 fHistRCPtRand[i] = 0;
108 fHistDeltaPtRC[i] = 0;
109 fHistDeltaPtRCExLJ[i] = 0;
110 fHistDeltaPtRCRand[i] = 0;
111 fHistEmbNotFoundPhiEta[i] = 0;
112 fHistEmbJetsPt[i] = 0;
113 fHistEmbJetsCorrPt[i] = 0;
114 fHistEmbJetsArea[i] = 0;
115 fHistEmbPartPt[i] = 0;
116 fHistDistEmbPartJetAxis[i] = 0;
117 fHistDeltaPtEmb[i] = 0;
120 SetMakeGeneralHistograms(kTRUE);
123 //________________________________________________________________________
124 AliAnalysisTaskDeltaPt::~AliAnalysisTaskDeltaPt()
129 //________________________________________________________________________
130 void AliAnalysisTaskDeltaPt::UserCreateOutputObjects()
132 // Create user output.
134 AliAnalysisTaskEmcalJet::UserCreateOutputObjects();
136 fHistRCPhiEta = new TH2F("fHistRCPhiEta","Phi-Eta distribution of rigid cones", 50, -1, 1, 101, 0, TMath::Pi() * 2.02);
137 fHistRCPhiEta->GetXaxis()->SetTitle("#eta");
138 fHistRCPhiEta->GetYaxis()->SetTitle("#phi");
139 fOutput->Add(fHistRCPhiEta);
141 fHistRCPtExLJVSDPhiLJ = new TH2F("fHistRCPtExLJVSDPhiLJ","fHistRCPtExLJVSDPhiLJ", fNbins, fMinBinPt, fMaxBinPt, 128, -1.6, 4.8);
142 fHistRCPtExLJVSDPhiLJ->GetXaxis()->SetTitle("rigid cone p_{T} [GeV/c]");
143 fHistRCPtExLJVSDPhiLJ->GetYaxis()->SetTitle("#Delta#phi");
144 fOutput->Add(fHistRCPtExLJVSDPhiLJ);
146 fHistRhoVSRCPt = new TH2F("fHistRhoVSRCPt","fHistRhoVSRCPt", fNbins, fMinBinPt, fMaxBinPt, fNbins, fMinBinPt, fMaxBinPt);
147 fHistRhoVSRCPt->GetXaxis()->SetTitle("A#rho [GeV/c]");
148 fHistRhoVSRCPt->GetYaxis()->SetTitle("rigid cone p_{T} [GeV/c]");
149 fOutput->Add(fHistRhoVSRCPt);
151 if (!fJetsName.IsNull()) {
152 fHistEmbJetPhiEta = new TH2F("fHistEmbJetPhiEta","Phi-Eta distribution of embedded jets", 50, -1, 1, 101, 0, TMath::Pi() * 2.02);
153 fHistEmbJetPhiEta->GetXaxis()->SetTitle("#eta");
154 fHistEmbJetPhiEta->GetYaxis()->SetTitle("#phi");
155 fOutput->Add(fHistEmbJetPhiEta);
157 fHistEmbPartPhiEta = new TH2F("fHistEmbPartPhiEta","Phi-Eta distribution of embedded particles", 50, -1, 1, 101, 0, TMath::Pi() * 2.02);
158 fHistEmbPartPhiEta->GetXaxis()->SetTitle("#eta");
159 fHistEmbPartPhiEta->GetYaxis()->SetTitle("#phi");
160 fOutput->Add(fHistEmbPartPhiEta);
162 fHistRhoVSEmbBkg = new TH2F("fHistRhoVSEmbBkg","fHistRhoVSEmbBkg", fNbins, fMinBinPt, fMaxBinPt, fNbins, fMinBinPt, fMaxBinPt);
163 fHistRhoVSEmbBkg->GetXaxis()->SetTitle("A#rho [GeV/c]");
164 fHistRhoVSEmbBkg->GetYaxis()->SetTitle("background of embedded track [GeV/c]");
165 fOutput->Add(fHistRhoVSEmbBkg);
170 for (Int_t i = 0; i < 4; i++) {
171 histname = "fHistRCPt_";
173 fHistRCPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2);
174 fHistRCPt[i]->GetXaxis()->SetTitle("rigid cone p_{T} [GeV/c]");
175 fHistRCPt[i]->GetYaxis()->SetTitle("counts");
176 fOutput->Add(fHistRCPt[i]);
178 histname = "fHistRCPtExLJ_";
180 fHistRCPtExLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2);
181 fHistRCPtExLJ[i]->GetXaxis()->SetTitle("rigid cone p_{T}^{RC} [GeV/c]");
182 fHistRCPtExLJ[i]->GetYaxis()->SetTitle("counts");
183 fOutput->Add(fHistRCPtExLJ[i]);
185 histname = "fHistRCPtRand_";
187 fHistRCPtRand[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt * 2);
188 fHistRCPtRand[i]->GetXaxis()->SetTitle("rigid cone p_{T}^{RC} [GeV/c]");
189 fHistRCPtRand[i]->GetYaxis()->SetTitle("counts");
190 fOutput->Add(fHistRCPtRand[i]);
192 histname = "fHistDeltaPtRC_";
194 fHistDeltaPtRC[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt);
195 fHistDeltaPtRC[i]->GetXaxis()->SetTitle("#deltap_{T}^{RC} [GeV/c]");
196 fHistDeltaPtRC[i]->GetYaxis()->SetTitle("counts");
197 fOutput->Add(fHistDeltaPtRC[i]);
199 histname = "fHistDeltaPtRCExLJ_";
201 fHistDeltaPtRCExLJ[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt);
202 fHistDeltaPtRCExLJ[i]->GetXaxis()->SetTitle("#deltap_{T}^{RC} [GeV/c]");
203 fHistDeltaPtRCExLJ[i]->GetYaxis()->SetTitle("counts");
204 fOutput->Add(fHistDeltaPtRCExLJ[i]);
206 histname = "fHistDeltaPtRCRand_";
208 fHistDeltaPtRCRand[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt);
209 fHistDeltaPtRCRand[i]->GetXaxis()->SetTitle("#deltap_{T}^{RC} [GeV/c]");
210 fHistDeltaPtRCRand[i]->GetYaxis()->SetTitle("counts");
211 fOutput->Add(fHistDeltaPtRCRand[i]);
213 if (!fEmbJetsName.IsNull()) {
214 histname = "fHistEmbJetsPt_";
216 fHistEmbJetsPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt);
217 fHistEmbJetsPt[i]->GetXaxis()->SetTitle("embedded jet p_{T}^{raw} [GeV/c]");
218 fHistEmbJetsPt[i]->GetYaxis()->SetTitle("counts");
219 fOutput->Add(fHistEmbJetsPt[i]);
221 histname = "fHistEmbJetsCorrPt_";
223 fHistEmbJetsCorrPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt);
224 fHistEmbJetsCorrPt[i]->GetXaxis()->SetTitle("embedded jet p_{T}^{corr} [GeV/c]");
225 fHistEmbJetsCorrPt[i]->GetYaxis()->SetTitle("counts");
226 fOutput->Add(fHistEmbJetsCorrPt[i]);
228 histname = "fHistEmbJetsArea_";
230 fHistEmbJetsArea[i] = new TH1F(histname.Data(), histname.Data(), 40, 0, fJetRadius * fJetRadius * TMath::Pi() * 3);
231 fHistEmbJetsArea[i]->GetXaxis()->SetTitle("area");
232 fHistEmbJetsArea[i]->GetYaxis()->SetTitle("counts");
233 fOutput->Add(fHistEmbJetsArea[i]);
235 histname = "fHistEmbPartPt_";
237 fHistEmbPartPt[i] = new TH1F(histname.Data(), histname.Data(), fNbins, fMinBinPt, fMaxBinPt);
238 fHistEmbPartPt[i]->GetXaxis()->SetTitle("embedded particle p_{T}^{emb} [GeV/c]");
239 fHistEmbPartPt[i]->GetYaxis()->SetTitle("counts");
240 fOutput->Add(fHistEmbPartPt[i]);
242 histname = "fHistDistEmbPartJetAxis_";
244 fHistDistEmbPartJetAxis[i] = new TH1F(histname.Data(), histname.Data(), 50, 0, 0.5);
245 fHistDistEmbPartJetAxis[i]->GetXaxis()->SetTitle("distance");
246 fHistDistEmbPartJetAxis[i]->GetYaxis()->SetTitle("counts");
247 fOutput->Add(fHistDistEmbPartJetAxis[i]);
249 histname = "fHistEmbNotFoundPhiEta_";
251 fHistEmbNotFoundPhiEta[i] = new TH2F(histname.Data(), histname.Data(), 40, -2, 2, 64, 0, 6.4);
252 fHistEmbNotFoundPhiEta[i]->GetXaxis()->SetTitle("#eta");
253 fHistEmbNotFoundPhiEta[i]->GetYaxis()->SetTitle("#phi");
254 fOutput->Add(fHistEmbNotFoundPhiEta[i]);
256 histname = "fHistDeltaPtEmb_";
258 fHistDeltaPtEmb[i] = new TH1F(histname.Data(), histname.Data(), fNbins * 2, -fMaxBinPt, fMaxBinPt);
259 fHistDeltaPtEmb[i]->GetXaxis()->SetTitle("#deltap_{T}^{emb} [GeV/c]");
260 fHistDeltaPtEmb[i]->GetYaxis()->SetTitle("counts");
261 fOutput->Add(fHistDeltaPtEmb[i]);
265 PostData(1, fOutput); // Post data for ALL output slots >0 here, to get at least an empty histogram
268 //________________________________________________________________________
269 Bool_t AliAnalysisTaskDeltaPt::FillHistograms()
273 Int_t *sortedJets = GetSortedArray(fJets);
275 AliEmcalJet* jet = 0;
277 if (sortedJets && sortedJets[0] > 0)
278 jet = static_cast<AliEmcalJet*>(fJets->At(sortedJets[0]));
282 // _________________________________
284 const Float_t rcArea = fJetRadius * fJetRadius * TMath::Pi();
286 // Simple random cones
287 for (Int_t i = 0; i < fRCperEvent; i++) {
291 GetRandomCone(RCpt, RCeta, RCphi, 0);
293 fHistRCPhiEta->Fill(RCeta, RCphi);
294 fHistRhoVSRCPt->Fill(fRhoVal * rcArea, RCpt);
296 fHistRCPt[fCentBin]->Fill(RCpt / rcArea);
297 fHistDeltaPtRC[fCentBin]->Fill(RCpt - rcArea * fRhoVal);
300 // Random cones far from leading jet
304 GetRandomCone(RCpt, RCeta, RCphi, jet);
307 Float_t dphi = RCphi - jet->Phi();
308 if (dphi > 4.8) dphi -= TMath::Pi() * 2;
309 if (dphi < -1.6) dphi += TMath::Pi() * 2;
310 fHistRCPtExLJVSDPhiLJ->Fill(RCpt, dphi);
312 fHistRCPtExLJ[fCentBin]->Fill(RCpt / rcArea);
313 fHistDeltaPtRCExLJ[fCentBin]->Fill(RCpt - rcArea * fRhoVal);
316 // Random cones with randomized particles
320 GetRandomCone(RCpt, RCeta, RCphi, 0, fRandTracks, fRandCaloClusters);
322 fHistRCPtRand[fCentBin]->Fill(RCpt / rcArea);
323 fHistDeltaPtRCRand[fCentBin]->Fill(RCpt - rcArea * fRhoVal);
329 // _________________________________
334 AliEmcalJet *embJet = 0;
335 TObject *embPart = 0;
337 DoEmbJetLoop(embJet, embPart);
340 Double_t probePt = 0;
341 Double_t probeEta = 0;
342 Double_t probePhi = 0;
344 AliVCluster *cluster = dynamic_cast<AliVCluster*>(embPart);
346 TLorentzVector nPart;
347 cluster->GetMomentum(nPart, fVertex);
349 probeEta = nPart.Eta();
350 probePhi = nPart.Phi();
351 probePt = nPart.Pt();
354 AliVTrack *track = dynamic_cast<AliVTrack*>(embPart);
356 probeEta = track->Eta();
357 probePhi = track->Phi();
358 probePt = track->Pt();
361 AliWarning(Form("%s - Embedded jet found but embedded particle not found (wrong type?)!", GetName()));
365 Double_t distProbeJet = TMath::Sqrt((embJet->Eta() - probeEta) * (embJet->Eta() - probeEta) + (embJet->Phi() - probePhi) * (embJet->Phi() - probePhi));
367 fHistEmbPartPt[fCentBin]->Fill(probePt);
368 fHistEmbPartPhiEta->Fill(probeEta, probePhi);
370 fHistDistEmbPartJetAxis[fCentBin]->Fill(distProbeJet);
372 fHistEmbJetsPt[fCentBin]->Fill(embJet->Pt());
373 fHistEmbJetsCorrPt[fCentBin]->Fill(embJet->Pt() - fRhoVal * embJet->Area());
374 fHistEmbJetsArea[fCentBin]->Fill(embJet->Area());
375 fHistEmbJetPhiEta->Fill(embJet->Eta(), embJet->Phi());
377 fHistDeltaPtEmb[fCentBin]->Fill(embJet->Pt() - embJet->Area() * fRhoVal - probePt);
378 fHistRhoVSEmbBkg->Fill(embJet->Area() * fRhoVal, embJet->Pt() - probePt);
383 if (fEmbCaloClusters)
385 if (fEmbeddedTrackId >= 0) {
386 AliVTrack *track2 = static_cast<AliVTrack*>(fEmbTracks->At(fEmbeddedTrackId));
387 fHistEmbNotFoundPhiEta[fCentBin]->Fill(track2->Eta(), track2->Phi());
389 else if (fEmbeddedClusterId >= 0) {
390 AliVCluster *cluster2 = static_cast<AliVCluster*>(fEmbCaloClusters->At(fEmbeddedClusterId));
391 TLorentzVector nPart;
392 cluster2->GetMomentum(nPart, fVertex);
393 fHistEmbNotFoundPhiEta[fCentBin]->Fill(nPart.Eta(), nPart.Phi());
396 AliWarning(Form("%s - Embedded particle not found!", GetName()));
403 //________________________________________________________________________
404 void AliAnalysisTaskDeltaPt::DoEmbTrackLoop()
411 fEmbeddedTrackId = -1;
413 Int_t ntracks = fEmbTracks->GetEntriesFast();
415 for (Int_t i = 0; i < ntracks; i++) {
417 AliVParticle* track = static_cast<AliVParticle*>(fEmbTracks->At(i)); // pointer to reconstructed to track
420 AliError(Form("Could not retrieve track %d",i));
424 AliVTrack* vtrack = dynamic_cast<AliVTrack*>(track);
426 if (vtrack && !AcceptTrack(vtrack, kTRUE))
429 if (track->GetLabel() == 100) {
430 fEmbeddedTrackId = i;
436 //________________________________________________________________________
437 void AliAnalysisTaskDeltaPt::DoEmbClusterLoop()
441 if (!fEmbCaloClusters)
444 fEmbeddedClusterId = -1;
446 Int_t nclusters = fEmbCaloClusters->GetEntriesFast();
448 for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) {
449 AliVCluster* cluster = static_cast<AliVCluster*>(fEmbCaloClusters->At(iClusters));
451 AliError(Form("Could not receive cluster %d", iClusters));
455 if (!AcceptCluster(cluster, kTRUE))
458 if (cluster->Chi2() == 100) {
459 fEmbeddedClusterId = iClusters;
465 //________________________________________________________________________
466 void AliAnalysisTaskDeltaPt::DoEmbJetLoop(AliEmcalJet* &embJet, TObject* &embPart)
468 // Do the embedded jet loop.
473 TLorentzVector maxClusVect;
475 Int_t nembjets = fEmbJets->GetEntriesFast();
477 for (Int_t ij = 0; ij < nembjets; ij++) {
479 AliEmcalJet* jet = static_cast<AliEmcalJet*>(fEmbJets->At(ij));
482 AliError(Form("Could not receive jet %d", ij));
492 AliVParticle *maxTrack = 0;
494 for (Int_t it = 0; it < jet->GetNumberOfTracks(); it++) {
495 AliVParticle *track = jet->TrackAt(it, fEmbTracks);
500 if (track->GetLabel() != 100)
503 if (!maxTrack || track->Pt() > maxTrack->Pt())
507 AliVCluster *maxClus = 0;
509 for (Int_t ic = 0; ic < jet->GetNumberOfClusters(); ic++) {
510 AliVCluster *cluster = jet->ClusterAt(ic, fEmbCaloClusters);
515 if (cluster->Chi2() != 100)
518 TLorentzVector nPart;
519 cluster->GetMomentum(nPart, fVertex);
521 if (!maxClus || nPart.Et() > maxClusVect.Et()) {
522 new (&maxClusVect) TLorentzVector(nPart);
527 if ((maxClus && maxTrack && maxClusVect.Et() > maxTrack->Pt()) || (maxClus && !maxTrack)) {
536 return; // MC jet found, exit
540 //________________________________________________________________________
541 void AliAnalysisTaskDeltaPt::GetRandomCone(Float_t &pt, Float_t &eta, Float_t &phi,
542 AliEmcalJet *jet, TClonesArray* tracks, TClonesArray* clusters) const
550 clusters = fCaloClusters;
556 if (!tracks && !clusters)
567 Float_t maxEta = fJetMaxEta;
568 Float_t minEta = fJetMinEta;
569 Float_t maxPhi = fJetMaxPhi;
570 Float_t minPhi = fJetMinPhi;
572 if (maxPhi > TMath::Pi() * 2) maxPhi = TMath::Pi() * 2;
573 if (minPhi < 0) minPhi = 0;
578 eta = gRandom->Rndm() * (maxEta - minEta) + minEta;
579 phi = gRandom->Rndm() * (maxPhi - minPhi) + minPhi;
580 dLJ = TMath::Sqrt((LJeta - eta) * (LJeta - eta) + (LJphi - phi) * (LJphi - phi));
582 } while (dLJ < fMinRC2LJ && repeats < 999);
584 if (repeats == 999) {
585 AliWarning(Form("%s: Could not get random cone!", GetName()));
590 Int_t nclusters = clusters->GetEntriesFast();
591 for (Int_t iClusters = 0; iClusters < nclusters; iClusters++) {
592 AliVCluster* cluster = static_cast<AliVCluster*>(clusters->At(iClusters));
594 AliError(Form("Could not receive cluster %d", iClusters));
598 if (!AcceptCluster(cluster, fMCAna))
601 TLorentzVector nPart;
602 cluster->GetMomentum(nPart, const_cast<Double_t*>(fVertex));
604 Float_t d = TMath::Sqrt((nPart.Eta() - eta) * (nPart.Eta() - eta) + (nPart.Phi() - phi) * (nPart.Phi() - phi));
612 Int_t ntracks = tracks->GetEntriesFast();
613 for(Int_t iTracks = 0; iTracks < ntracks; iTracks++) {
614 AliVTrack* track = static_cast<AliVTrack*>(tracks->At(iTracks));
616 AliError(Form("Could not retrieve track %d",iTracks));
620 if (!AcceptTrack(track, fMCAna))
623 Float_t tracketa = track->Eta();
624 Float_t trackphi = track->Phi();
626 if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi + 2 * TMath::Pi()))
627 trackphi += 2 * TMath::Pi();
628 if (TMath::Abs(trackphi - phi) > TMath::Abs(trackphi - phi - 2 * TMath::Pi()))
629 trackphi -= 2 * TMath::Pi();
631 Float_t d = TMath::Sqrt((tracketa - eta) * (tracketa - eta) + (trackphi - phi) * (trackphi - phi));
638 //________________________________________________________________________
639 void AliAnalysisTaskDeltaPt::ExecOnce()
641 // Initialize the analysis.
643 if (!fEmbJetsName.IsNull() && !fEmbJets) {
644 fEmbJets = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fEmbJetsName));
646 AliError(Form("%s: Could not retrieve embedded jets %s!", GetName(), fEmbJetsName.Data()));
649 else if (!fEmbJets->GetClass()->GetBaseClass("AliEmcalJet")) {
650 AliError(Form("%s: Collection %s does not contain AliEmcalJet objects!", GetName(), fEmbJetsName.Data()));
656 if (!fEmbCaloName.IsNull() && !fEmbCaloClusters) {
657 fEmbCaloClusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fEmbCaloName));
658 if (!fEmbCaloClusters) {
659 AliError(Form("%s: Could not retrieve embedded clusters %s!", GetName(), fEmbCaloName.Data()));
662 else if (!fEmbCaloClusters->GetClass()->GetBaseClass("AliVCluster") && !fEmbCaloClusters->GetClass()->GetBaseClass("AliEmcalParticle")) {
663 AliError(Form("%s: Collection %s does not contain AliVCluster nor AliEmcalParticle objects!", GetName(), fEmbCaloName.Data()));
664 fEmbCaloClusters = 0;
669 if (!fEmbTracksName.IsNull() && !fEmbTracks) {
670 fEmbTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fEmbTracksName));
672 AliError(Form("%s: Could not retrieve embedded tracks %s!", GetName(), fEmbTracksName.Data()));
675 else if (!fEmbTracks->GetClass()->GetBaseClass("AliVParticle") && !fEmbTracks->GetClass()->GetBaseClass("AliEmcalParticle")) {
676 AliError(Form("%s: Collection %s does not contain AliVParticle nor AliEmcalParticle objects!", GetName(), fEmbTracksName.Data()));
682 if (!fRandCaloName.IsNull() && !fRandCaloClusters) {
683 fRandCaloClusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fRandCaloName));
684 if (!fRandCaloClusters) {
685 AliError(Form("%s: Could not retrieve randomized clusters %s!", GetName(), fRandCaloName.Data()));
688 else if (!fRandCaloClusters->GetClass()->GetBaseClass("AliVCluster") && !fRandCaloClusters->GetClass()->GetBaseClass("AliEmcalParticle")) {
689 AliError(Form("%s: Collection %s does not contain AliVCluster nor AliEmcalParticle objects!", GetName(), fRandCaloName.Data()));
690 fRandCaloClusters = 0;
695 if (!fRandTracksName.IsNull() && !fRandTracks) {
696 fRandTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fRandTracksName));
698 AliError(Form("%s: Could not retrieve randomized tracks %s!", GetName(), fRandTracksName.Data()));
701 else if (!fRandTracks->GetClass()->GetBaseClass("AliVParticle") && !fRandTracks->GetClass()->GetBaseClass("AliEmcalParticle")) {
702 AliError(Form("%s: Collection %s does not contain AliVParticle nor AliEmcalParticle objects!", GetName(), fRandTracksName.Data()));
708 AliAnalysisTaskEmcalJet::ExecOnce();
710 if (fRCperEvent < 0) {
711 Double_t area = (fJetMaxEta - fJetMinEta) * (fJetMaxPhi - fJetMinPhi);
712 Double_t jetArea = TMath::Pi() * fJetRadius * fJetRadius;
713 fRCperEvent = TMath::FloorNint(area / jetArea - 0.5);
714 if (fRCperEvent == 0)
719 fMinRC2LJ = fJetRadius * 1.5;
721 const Float_t maxDist = TMath::Max(fJetMaxPhi - fJetMinPhi, fJetMaxEta - fJetMinEta) / 2;
722 if (fMinRC2LJ > maxDist) {
723 AliWarning(Form("The parameter fMinRC2LJ = %f is too large for the considered acceptance. "
724 "Will use fMinRC2LJ = %f", fMinRC2LJ, maxDist));
729 //________________________________________________________________________
730 void AliAnalysisTaskDeltaPt::Terminate(Option_t *)
732 // Called once at the end of the analysis.