5 // Author: S.Aiola, C.Loizides
7 #include "AliJetModelBaseTask.h"
9 #include <TClonesArray.h>
11 #include <TLorentzVector.h>
16 #include "AliVEvent.h"
17 #include "AliAODCaloCluster.h"
18 #include "AliESDCaloCluster.h"
19 #include "AliVCluster.h"
20 #include "AliEMCALDigit.h"
21 #include "AliEMCALRecPoint.h"
22 #include "AliESDCaloCells.h"
23 #include "AliAODCaloCells.h"
24 #include "AliAODMCParticle.h"
25 #include "AliVCaloCells.h"
26 #include "AliPicoTrack.h"
27 #include "AliEMCALGeometry.h"
29 #include "AliNamedArrayI.h"
31 ClassImp(AliJetModelBaseTask)
33 //________________________________________________________________________
34 AliJetModelBaseTask::AliJetModelBaseTask() :
35 AliAnalysisTaskSE("AliJetModelBaseTask"),
44 fOutMCParticlesName(),
50 fPhiMax(TMath::Pi() * 2),
59 fPtPhiEvPlDistribution(0),
75 fOutMCParticlesMap(0),
80 // Default constructor.
87 //________________________________________________________________________
88 AliJetModelBaseTask::AliJetModelBaseTask(const char *name, Bool_t drawqa) :
89 AliAnalysisTaskSE(name),
91 fTracksName("PicoTracks"),
92 fOutTracksName("PicoTracksEmbedded"),
93 fCaloName("CaloClustersCorr"),
94 fOutCaloName("CaloClustersCorrEmbedded"),
98 fOutMCParticlesName(""),
100 fSuffix("Processed"),
104 fPhiMax(TMath::Pi() * 2),
113 fPtPhiEvPlDistribution(0),
129 fOutMCParticlesMap(0),
134 // Standard constructor.
137 DefineOutput(1, TList::Class());
145 //________________________________________________________________________
146 AliJetModelBaseTask::~AliJetModelBaseTask()
151 //________________________________________________________________________
152 void AliJetModelBaseTask::UserCreateOutputObjects()
154 // Create user output.
159 fOutput = new TList();
162 PostData(1, fOutput);
165 //________________________________________________________________________
166 void AliJetModelBaseTask::UserExec(Option_t *)
168 // Execute per event.
171 fIsInit = ExecOnce();
180 const AliVVertex *vert = InputEvent()->GetPrimaryVertex();
182 vert->GetXYZ(fVertex);
186 fOutTracks->Delete();
188 fOutClusters->Delete();
190 fOutMCParticles->Delete();
193 if (fDensitySpectrum) {
194 fNTracks = TMath::Nint(fDensitySpectrum->GetRandom());
195 fNCells = TMath::Nint(fDensitySpectrum->GetRandom());
196 fNClusters = TMath::Nint(fDensitySpectrum->GetRandom());
200 if (fOutMCParticlesMap)
201 fOutMCParticlesMap->Clear();
203 AliVCaloCells *tempCaloCells = 0;
208 tempCaloCells = fCaloCells;
209 fCaloCells = static_cast<AliVCaloCells*>(tempCaloCells->Clone(Form("%s_old",fCaloCells->GetName())));
213 if (fPtPhiEvPlDistribution)
214 fPsi = gRandom->Rndm() * TMath::Pi();
218 if (fCaloCells && !fCopyArray) {
220 fCaloCells = tempCaloCells;
224 //________________________________________________________________________
225 Bool_t AliJetModelBaseTask::ExecOnce()
230 gRandom = new TRandom3(0);
232 fEsdMode = InputEvent()->InheritsFrom("AliESDEvent");
234 if (fPtMax < fPtMin) {
235 AliWarning (Form("PtMax (%f) < PtMin (%f), setting PtMax = PtMin = %f", fPtMax, fPtMin, fPtMin));
239 if (fEtaMax < fEtaMin) {
240 AliWarning (Form("EtaMax (%f) < EtaMin (%f), setting EtaMax = EtaMin = %f", fEtaMax, fEtaMin, fEtaMin));
244 if (fPhiMax < fPhiMin) {
245 AliWarning (Form("PhiMax (%f) < PhiMin (%f), setting PhiMax = PhiMin = %f", fPhiMax, fPhiMin, fPhiMin));
249 if (!fCellsName.IsNull()) {
250 fCaloCells = dynamic_cast<AliVCaloCells*>(InputEvent()->FindListObject(fCellsName));
252 AliWarning(Form("%s: Couldn't retrieve calo cells with name %s!", GetName(), fCellsName.Data()));
254 else if (!fCaloCells->InheritsFrom("AliVCaloCells")) {
255 AliError(Form("%s: Collection %s does not contain a AliVCaloCells object!", GetName(), fCellsName.Data()));
260 if (!fOutCaloCells) {
261 fOutCellsName = fCellsName;
263 fOutCellsName += fSuffix;
264 if (fCopyArray || !fCaloCells) {
266 fOutCaloCells = new AliESDCaloCells(fOutCellsName,fOutCellsName);
268 fOutCaloCells = new AliAODCaloCells(fOutCellsName,fOutCellsName);
270 if (InputEvent()->FindListObject(fOutCellsName)) {
271 AliFatal(Form("%s: Collection %s is already present in the event!", GetName(), fOutCellsName.Data()));
275 InputEvent()->AddObject(fOutCaloCells);
279 fOutCaloCells = fCaloCells;
284 if (!fTracksName.IsNull()) {
285 fTracks = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTracksName));
287 AliWarning(Form("%s: Couldn't retrieve tracks with name %s!", GetName(), fTracksName.Data()));
289 else if (!fTracks->GetClass()->GetBaseClass("AliPicoTrack")) {
290 AliError(Form("%s: Collection %s does not contain AliPicoTrack objects!", GetName(), fTracksName.Data()));
296 fOutTracksName = fTracksName;
298 fOutTracksName += fSuffix;
299 if (fCopyArray || !fTracks) {
300 fOutTracks = new TClonesArray("AliPicoTrack");
301 fOutTracks->SetName(fOutTracksName);
302 if (InputEvent()->FindListObject(fOutTracksName)) {
303 AliFatal(Form("%s: Collection %s is already present in the event!", GetName(), fOutTracksName.Data()));
307 InputEvent()->AddObject(fOutTracks);
311 fOutTracks = fTracks;
316 if (!fCaloName.IsNull()) {
317 fClusters = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fCaloName));
320 AliWarning(Form("%s: Couldn't retrieve clusters with name %s!", GetName(), fCaloName.Data()));
322 else if (!fClusters->GetClass()->GetBaseClass("AliVCluster")) {
323 AliError(Form("%s: Collection %s does not contain AliVCluster objects!", GetName(), fCaloName.Data()));
329 fOutCaloName = fCaloName;
331 fOutCaloName += fSuffix;
334 className = fClusters->GetClass()->GetName();
336 className = "AliESDCaloCluster";
338 className = "AliAODCaloCluster";
340 if (fCopyArray || !fClusters) {
341 fOutClusters = new TClonesArray(className.Data());
342 fOutClusters->SetName(fOutCaloName);
343 if (InputEvent()->FindListObject(fOutCaloName)) {
344 AliFatal(Form("%s: Collection %s is already present in the event!", GetName(), fOutCaloName.Data()));
348 InputEvent()->AddObject(fOutClusters);
352 fOutClusters = fClusters;
357 if (!fMCParticlesName.IsNull()) {
358 fMCParticles = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fMCParticlesName));
360 AliWarning(Form("%s: Couldn't retrieve MC particles with name %s!", GetName(), fMCParticlesName.Data()));
363 if (!fMCParticles->GetClass()->GetBaseClass("AliAODMCParticle")) {
364 AliError(Form("%s: Collection %s does not contain AliAODMCParticle objects!", GetName(), fMCParticlesName.Data()));
369 fMCParticlesMap = dynamic_cast<AliNamedArrayI*>(InputEvent()->FindListObject(fMCParticlesName + "_Map"));
371 if (!fMCParticlesMap) {
372 AliWarning(Form("%s: Could not retrieve map for MC particles %s! Will assume MC labels consistent with indexes...", GetName(), fMCParticlesName.Data()));
373 fMCParticlesMap = new AliNamedArrayI(fMCParticlesName + "_Map", 99999);
374 for (Int_t i = 0; i < 99999; i++) {
375 fMCParticlesMap->AddAt(i,i);
380 if (!fOutMCParticles) {
381 fOutMCParticlesName = fMCParticlesName;
383 fOutMCParticlesName += fSuffix;
384 if (fCopyArray || !fMCParticles) {
386 fOutMCParticles = new TClonesArray("AliAODMCParticle");
387 fOutMCParticles->SetName(fOutMCParticlesName);
388 if (InputEvent()->FindListObject(fOutMCParticlesName)) {
389 AliFatal(Form("%s: Collection %s is already present in the event!", GetName(), fOutMCParticlesName.Data()));
393 InputEvent()->AddObject(fOutMCParticles);
396 fOutMCParticlesMap = new AliNamedArrayI(fOutMCParticlesName + "_Map",99999);
397 if (InputEvent()->FindListObject(fOutMCParticlesName + "_Map")) {
398 AliFatal(Form("%s: Map %s_Map is already present in the event!", GetName(), fOutMCParticlesName.Data()));
402 InputEvent()->AddObject(fOutMCParticlesMap);
406 fOutMCParticles = fMCParticles;
407 fOutMCParticlesMap = fMCParticlesMap;
413 if (fGeomName.Length() > 0) {
414 fGeom = AliEMCALGeometry::GetInstance(fGeomName);
416 AliFatal(Form("Could not get geometry with name %s!", fGeomName.Data()));
420 fGeom = AliEMCALGeometry::GetInstance();
422 AliFatal("Could not get default geometry!");
431 //________________________________________________________________________
432 Int_t AliJetModelBaseTask::SetNumberOfOutCells(Int_t n)
434 if (fOutCaloCells->GetNumberOfCells() < n) {
435 fOutCaloCells->DeleteContainer();
436 fOutCaloCells->CreateContainer(n);
439 fOutCaloCells->SetNumberOfCells(n);
447 //________________________________________________________________________
448 Int_t AliJetModelBaseTask::AddCell(Double_t e, Double_t eta, Double_t phi)
450 // Add a cell to the event.
453 if (eta < -100 || phi < 0) {
454 GetRandomCell(eta, phi, absId);
457 fGeom->EtaPhiFromIndex(absId, eta, phi);
461 AliWarning(Form("Unable to embed cell in eta = %f, phi = %f!"
462 " Maybe the eta-phi range is not inside the EMCal acceptance (eta = [%f, %f], phi = [%f, %f])",
463 eta, phi, fEtaMin, fEtaMax, fPhiMin, fPhiMax));
468 Double_t pt = GetRandomPt();
469 TLorentzVector nPart;
470 nPart.SetPtEtaPhiM(pt, eta, phi, 0);
474 return AddCell(e, absId);
477 //________________________________________________________________________
478 Int_t AliJetModelBaseTask::AddCell(Double_t e, Int_t absId, Double_t time, Int_t label)
480 // Add a cell to the event.
485 label += fMarkMC + fMCLabelShift;
489 pos = fCaloCells->GetCellPosition(absId);
492 Bool_t increaseOnSuccess = kFALSE;
495 increaseOnSuccess = kTRUE;
499 Short_t cellNumber = -1;
501 Double_t old_time = 0;
503 Double_t old_efrac = 0;
504 fOutCaloCells->GetCell(pos, cellNumber, old_e, old_time, old_label, old_efrac);
506 efrac = e / (old_e + e);
508 if (old_label > 0 && e < old_efrac * old_e) {
517 Bool_t r = fOutCaloCells->SetCell(pos, absId, e, time, label, efrac);
520 if (increaseOnSuccess)
528 //________________________________________________________________________
529 AliVCluster* AliJetModelBaseTask::AddCluster(AliVCluster *oc)
531 // Add a cluster to the event.
533 const Int_t nClusters = fOutClusters->GetEntriesFast();
534 AliVCluster *dc = static_cast<AliVCluster*>(fOutClusters->New(nClusters));
535 dc->SetType(AliVCluster::kEMCALClusterv1);
537 Float_t pos[3] = {0};
538 oc->GetPosition(pos);
539 dc->SetPosition(pos);
540 dc->SetNCells(oc->GetNCells());
541 dc->SetCellsAbsId(oc->GetCellsAbsId());
542 dc->SetCellsAmplitudeFraction(oc->GetCellsAmplitudeFraction());
543 dc->SetID(oc->GetID());
544 dc->SetDispersion(oc->GetDispersion());
545 dc->SetEmcCpvDistance(-1);
547 dc->SetTOF(oc->GetTOF()); //time-of-flight
548 dc->SetNExMax(oc->GetNExMax()); //number of local maxima
549 dc->SetM02(oc->GetM02());
550 dc->SetM20(oc->GetM20());
551 dc->SetDistanceToBadChannel(oc->GetDistanceToBadChannel());
554 UInt_t nlabels = oc->GetNLabels();
555 Int_t *labels = oc->GetLabels();
557 if (nlabels != 0 && labels)
558 parents.Set(nlabels, labels);
565 if (fMarkMC+fMCLabelShift != 0) {
566 for (UInt_t i = 0; i < nlabels; i++) {
567 parents[i] += fMarkMC+fMCLabelShift;
571 AliESDCaloCluster *esdClus = dynamic_cast<AliESDCaloCluster*>(dc);
573 esdClus->AddLabels(parents);
576 AliAODCaloCluster *aodClus = dynamic_cast<AliAODCaloCluster*>(dc);
578 aodClus->SetLabel(parents.GetArray(), nlabels);
584 //________________________________________________________________________
585 AliVCluster* AliJetModelBaseTask::AddCluster(Double_t e, Double_t eta, Double_t phi, Int_t label)
587 // Add a cluster to the event.
590 if (eta < -100 || phi < 0) {
591 GetRandomCell(eta, phi, absId);
594 fGeom->EtaPhiFromIndex(absId, eta, phi);
598 AliWarning(Form("Unable to embed cluster in eta = %f, phi = %f!"
599 " Maybe the eta-phi range is not inside the EMCal acceptance (eta = [%f, %f], phi = [%f, %f])",
600 eta, phi, fEtaMin, fEtaMax, fPhiMin, fPhiMax));
605 Double_t pt = GetRandomPt();
606 TLorentzVector nPart;
607 nPart.SetPtEtaPhiM(pt, eta, phi, 0);
611 return AddCluster(e, absId, label);
614 //________________________________________________________________________
615 AliVCluster* AliJetModelBaseTask::AddCluster(Double_t e, Int_t absId, Int_t label)
617 // Add a cluster to the event.
619 const Int_t nClusters = fOutClusters->GetEntriesFast();
621 TClonesArray digits("AliEMCALDigit", 1);
623 AliEMCALDigit *digit = static_cast<AliEMCALDigit*>(digits.New(0));
625 digit->SetIndexInList(0);
626 digit->SetType(AliEMCALDigit::kHG);
627 digit->SetAmplitude(e);
629 AliEMCALRecPoint recPoint("");
630 recPoint.AddDigit(*digit, e, kFALSE);
631 recPoint.EvalGlobalPosition(0, &digits);
634 recPoint.GetGlobalPosition(gpos);
638 AliVCluster *cluster = static_cast<AliVCluster*>(fOutClusters->New(nClusters));
639 cluster->SetType(AliVCluster::kEMCALClusterv1);
640 cluster->SetE(recPoint.GetEnergy());
641 cluster->SetPosition(g);
642 cluster->SetNCells(1);
643 UShort_t shortAbsId = absId;
644 cluster->SetCellsAbsId(&shortAbsId);
645 Double32_t fract = 1;
646 cluster->SetCellsAmplitudeFraction(&fract);
647 cluster->SetID(nClusters);
648 cluster->SetEmcCpvDistance(-1);
654 label += fMarkMC+fMCLabelShift;
657 AliESDCaloCluster *esdClus = static_cast<AliESDCaloCluster*>(cluster);
658 TArrayI parents(1, &label);
659 esdClus->AddLabels(parents);
662 AliAODCaloCluster *aodClus = static_cast<AliAODCaloCluster*>(cluster);
663 aodClus->SetLabel(&label, 1);
669 //________________________________________________________________________
670 AliPicoTrack* AliJetModelBaseTask::AddTrack(Double_t pt, Double_t eta, Double_t phi, Byte_t type, Double_t etaemc, Double_t phiemc, Double_t ptemc, Bool_t ise, Int_t label, Short_t charge, Double_t mass)
672 // Add a track to the event.
674 if (pt < 0 && eta < -100 && phi < 0) {
675 GetRandomParticle(pt,eta,phi);
681 eta = GetRandomEta();
683 phi = GetRandomPhi(pt);
687 label += fMarkMC+fMCLabelShift;
689 label -= fMarkMC+fMCLabelShift;
691 const Int_t nTracks = fOutTracks->GetEntriesFast();
693 AliPicoTrack *track = new ((*fOutTracks)[nTracks]) AliPicoTrack(pt,
708 //________________________________________________________________________
709 AliAODMCParticle* AliJetModelBaseTask::AddMCParticle(AliAODMCParticle *part, Int_t origIndex)
711 const Int_t nPart = fOutMCParticles->GetEntriesFast();
713 AliAODMCParticle *aodpart = new ((*fOutMCParticles)[nPart]) AliAODMCParticle(*part);
715 if (origIndex + fMCLabelShift >= fOutMCParticlesMap->GetSize())
716 fOutMCParticlesMap->Set((origIndex + fMCLabelShift)*2);
718 fOutMCParticlesMap->AddAt(nPart, origIndex + fMCLabelShift);
719 AliDebug(2, Form("Setting bin %d to %d (fMCLabelShift=%d, origIndex=%d)",
720 origIndex + fMCLabelShift, fOutMCParticlesMap->At(origIndex + fMCLabelShift), fMCLabelShift, origIndex));
725 //________________________________________________________________________
726 void AliJetModelBaseTask::CopyCells()
733 for (Short_t i = 0; i < fCaloCells->GetNumberOfCells(); i++) {
737 Short_t cellNum = -1;
740 fCaloCells->GetCell(i, cellNum, amp, time, mclabel, efrac);
745 fOutCaloCells->SetCell(i, cellNum, amp, time, mclabel, efrac);
749 AliDebug(2, Form("%d cells from the current event", fAddedCells));
752 //________________________________________________________________________
753 void AliJetModelBaseTask::CopyClusters()
755 // Copy all the clusters in the new collection
759 const Int_t nClusters = fClusters->GetEntriesFast();
760 Int_t nCopiedClusters = 0;
763 for (Int_t i = 0; i < nClusters; ++i) {
764 AliESDCaloCluster *esdcluster = static_cast<AliESDCaloCluster*>(fClusters->At(i));
765 if (!esdcluster || !esdcluster->IsEMCAL())
767 AliESDCaloCluster *clus = new ((*fOutClusters)[nCopiedClusters]) AliESDCaloCluster(*esdcluster);
769 TArrayI *labels = clus->GetLabelsArray();
777 for (Int_t i = 0; i < nClusters; ++i) {
778 AliAODCaloCluster *aodcluster = static_cast<AliAODCaloCluster*>(fClusters->At(i));
779 if (!aodcluster || !aodcluster->IsEMCAL())
781 AliAODCaloCluster *clus = new ((*fOutClusters)[nCopiedClusters]) AliAODCaloCluster(*aodcluster);
789 //________________________________________________________________________
790 void AliJetModelBaseTask::CopyTracks()
792 // Copy all the tracks in the new collection
797 const Int_t nTracks = fTracks->GetEntriesFast();
798 Int_t nCopiedTracks = 0;
799 for (Int_t i = 0; i < nTracks; ++i) {
800 AliPicoTrack *picotrack = static_cast<AliPicoTrack*>(fTracks->At(i));
803 AliPicoTrack *track = new ((*fOutTracks)[nCopiedTracks]) AliPicoTrack(*picotrack);
804 if (!fIsMC && track->GetLabel() != 0)
810 //________________________________________________________________________
811 void AliJetModelBaseTask::CopyMCParticles()
813 // Copy all the MC particles in the new collection
818 const Int_t nPart = fMCParticles->GetEntriesFast();
819 Int_t nCopiedPart = 0;
820 for (Int_t i = 0; i < nPart; ++i) {
821 AliAODMCParticle *part = static_cast<AliAODMCParticle*>(fMCParticles->At(i));
824 new ((*fOutMCParticles)[nCopiedPart]) AliAODMCParticle(*part);
829 if (!fMCParticlesMap || !fOutMCParticlesMap)
832 if (fOutMCParticlesMap->GetSize() < fMCParticlesMap->GetSize())
833 fOutMCParticlesMap->Set(fMCParticlesMap->GetSize() * 2);
835 for (Int_t i = 0; i < fMCParticlesMap->GetSize(); i++) {
836 fOutMCParticlesMap->AddAt(fMCParticlesMap->At(i), i);
837 if (fMCParticlesMap->At(i) >= 0)
841 AliDebug(2,Form("MC particles copied. fMCLabelShift=%d",fMCLabelShift));
844 //________________________________________________________________________
845 void AliJetModelBaseTask::GetRandomCell(Double_t &eta, Double_t &phi, Int_t &absId)
850 Double_t rndEta = eta;
851 Double_t rndPhi = phi;
854 rndEta = GetRandomEta(kTRUE);
856 rndPhi = GetRandomPhi(kTRUE);
857 fGeom->GetAbsCellIdFromEtaPhi(rndEta, rndPhi, absId);
859 } while (absId == -1 && repeats < 100);
862 AliWarning(Form("Could not extract random cluster! Random eta-phi extracted more than 100 times!\n"
863 "eta [%f, %f], phi [%f, %f]\n", fEtaMin, fEtaMax, fPhiMin, fPhiMax));
871 //________________________________________________________________________
872 Double_t AliJetModelBaseTask::GetRandomEta(Bool_t emcal)
876 Double_t etamax = fEtaMax;
877 Double_t etamin = fEtaMin;
880 const Double_t EmcalMinEta = fGeom->GetArm1EtaMin();
881 const Double_t EmcalMaxEta = fGeom->GetArm1EtaMax();
883 if (etamax > EmcalMaxEta) etamax = EmcalMaxEta;
884 if (etamax < EmcalMinEta) etamax = EmcalMinEta;
885 if (etamin > EmcalMaxEta) etamin = EmcalMaxEta;
886 if (etamin < EmcalMinEta) etamin = EmcalMinEta;
889 return gRandom->Rndm() * (etamax - etamin) + etamin;
892 //________________________________________________________________________
893 Double_t AliJetModelBaseTask::GetRandomPhi(Bool_t emcal)
897 Double_t phimax = fPhiMax;
898 Double_t phimin = fPhiMin;
901 const Double_t EmcalMinPhi = fGeom->GetArm1PhiMin() * TMath::DegToRad();
902 const Double_t EmcalMaxPhi = fGeom->GetArm1PhiMax() * TMath::DegToRad();
904 if (phimax > EmcalMaxPhi) phimax = EmcalMaxPhi;
905 if (phimax < EmcalMinPhi) phimax = EmcalMinPhi;
906 if (phimin > EmcalMaxPhi) phimin = EmcalMaxPhi;
907 if (phimin < EmcalMinPhi) phimin = EmcalMinPhi;
910 Double_t result = gRandom->Rndm() * (phimax - phimin) + phimin;
915 //________________________________________________________________________
916 Double_t AliJetModelBaseTask::GetRandomPt()
921 return fPtSpectrum->GetRandom();
923 return gRandom->Rndm() * (fPtMax - fPtMin) + fPtMin;
926 //________________________________________________________________________
927 void AliJetModelBaseTask::GetRandomParticle(Double_t &pt, Double_t &eta, Double_t &phi, Bool_t emcal)
929 // Get a random particle.
931 eta = GetRandomEta(emcal);
933 if (fPtPhiEvPlDistribution) {
934 Double_t phimax = fPhiMax;
935 Double_t phimin = fPhiMin;
938 const Double_t EmcalMinPhi = fGeom->GetArm1PhiMin() * TMath::DegToRad();
939 const Double_t EmcalMaxPhi = fGeom->GetArm1PhiMax() * TMath::DegToRad();
941 if (phimax > EmcalMaxPhi) phimax = EmcalMaxPhi;
942 if (phimax < EmcalMinPhi) phimax = EmcalMinPhi;
943 if (phimin > EmcalMaxPhi) phimin = EmcalMaxPhi;
944 if (phimin < EmcalMinPhi) phimin = EmcalMinPhi;
947 if (fPtPhiEvPlDistribution->GetXmin() > phimax || fPtPhiEvPlDistribution->GetXmax() < phimin) {
948 AliWarning(Form("The hisogram %s does not overlap with the EMCal acceptance limits. It will be ignored.",fPtPhiEvPlDistribution->GetName()));
950 phi = GetRandomPhi(emcal);
954 fPtPhiEvPlDistribution->GetRandom2(pt,phi);
956 if (phi > TMath::Pi() * 2) phi -= TMath::Pi() * 2;
957 } while (phi > phimax || phi < phimin);
962 phi = GetRandomPhi(emcal);
966 //________________________________________________________________________
967 void AliJetModelBaseTask::Run()