30 #include <TClonesArray.h> 35 #include <THnSparse.h> 40 #include <AliVCluster.h> 41 #include <AliVParticle.h> 44 #include "AliAnalysisManager.h" 45 #include <AliVEventHandler.h> 52 #include "AliEMCALGeometry.h" 53 #include "AliOADBContainer.h" 55 #include "AliEMCALTriggerPatchInfo.h" 57 #include "AliMCEvent.h" 70 fPlotJetHistograms(kFALSE),
71 fPlotClusterHistograms(kFALSE),
72 fPlotParticleCompositionHistograms(kFALSE),
73 fComputeBackground(kFALSE),
74 fDoTriggerSimulation(kFALSE),
75 fPlotMatchedJetHistograms(kFALSE),
76 fComputeMBDownscaling(kFALSE),
90 fTrackMatchingDeltaEtaMax(0.015),
91 fTrackMatchingDeltaPhiMax(0.030),
97 fMinSharedMomentumFraction(0.5),
98 fMaxMatchedJetDistance(0.3),
99 fUseResponseMaker(kFALSE),
101 fUseAliEventCuts(kTRUE),
104 fUseManualEventCuts(kFALSE),
224 fEventCuts.fUseVariablesCorrelationCuts =
true;
235 for (
Int_t i=0; i<2; i++) {
237 TString jetContName = jetCont->GetName();
238 if (jetContName.Contains(
"mcparticles")) {
243 Printf(
"No MC jet container found!");
270 if (embeddingHelper) {
279 while ((obj = next())) {
301 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
304 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
306 title = histname +
";Centrality (%);Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
307 TH3* hist =
fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, 32, 0, 32, nPtBins5,
fMinPt,
fMaxPt);
310 title = histname +
";Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
317 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
319 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
329 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
331 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
332 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
335 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});NEF";
340 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
342 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
343 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
346 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});NEF";
353 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
354 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
355 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, 0, 100, nPtBins2,
fMinPt,
fMaxPt, 2, -0.5, 1.5,
"s");
359 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
361 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
362 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, nPtBins2,
fMinPt,
fMaxPt,
fMaxPt, 0,
fMaxPt);
365 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
370 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
372 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
373 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, nPtBins2,
fMinPt,
fMaxPt, 50, 0, 0.5);
376 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
381 nbinsx = 20; minx = 0; maxx = 100;
383 nbinsz = 50; minz = 0; maxz = 1.;
385 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
387 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
388 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
391 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
396 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
398 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
399 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
402 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
408 nbinsx = 20; minx = 0; maxx = 100;
410 nbinsz = 50; minz = 0; maxz = 1.;
412 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
414 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
415 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
418 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
423 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
425 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
426 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
429 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
435 nbinsx = 20; minx = 0; maxx = 100;
437 nbinsz = 50; minz = 0; maxz =
fMaxPt;
439 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
441 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
442 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
445 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
450 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
452 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
453 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
456 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
463 nbinsx = 20; minx = 0; maxx = 100;
466 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
467 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
470 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
471 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
477 nbinsx = 20; minx = 0; maxx = 100;
481 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
482 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#sum#it{E}_{nonlincorr} - #it{E}_{hadcorr}";
483 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
488 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
489 title = histname +
";#it{E}_{patch,med};type;#it{p}_{T}^{corr} (GeV/#it{c});Centrality (%)";
490 Int_t nbins5[4] = {100, 2, nPtBins2, 50};
500 histname =
"Trigger/hMBDownscaleFactor";
501 title = histname +
";Downscale factor;counts";
515 const Int_t nRcorrBins = 50;
517 const Int_t nCellBins = 30;
519 const Int_t nMatchedTrackBins = 5;
521 const Int_t nDeltaEtaBins = 60;
528 histname =
"ClusterHistograms/hM02";
529 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
533 histname =
"ClusterHistograms/hNcellsM02G04";
534 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
537 histname =
"ClusterHistograms/hNcellsM02L04";
538 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
545 histname =
"ClusterHistograms/hMatchedTrackPt";
546 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
549 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
550 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
553 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
554 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
558 histname =
"ClusterHistograms/hMatchedTrackN";
559 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
562 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
563 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
566 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
567 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
571 histname =
"ClusterHistograms/hM02Matched";
572 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
576 histname =
"ClusterHistograms/hM02Unmatched";
577 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
581 histname =
"ClusterHistograms/hDeltaEtaCentral";
582 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
585 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
586 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
593 histname =
"ClusterHistograms/hEoverPM02Central";
594 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
597 histname =
"ClusterHistograms/hEoverPM02Peripheral";
598 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
605 histname =
"ClusterHistograms/hRcorrVsCent";
606 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
610 histname =
"ClusterHistograms/hRcorr0-10";
611 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
615 histname =
"ClusterHistograms/hRcorr50-90";
616 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
620 histname =
"ClusterHistograms/hRcorrClusVsCent";
621 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
625 histname =
"ClusterHistograms/hRcorrClus0-10";
626 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
630 histname =
"ClusterHistograms/hRcorrClus50-90";
631 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
635 histname =
"ClusterHistograms/hTrackMultiplicity";
636 htitle = histname +
";N_{tracks};Centrality (%)";
649 const Int_t nRejBins = 32;
652 const Int_t nContributorTypes = 11;
654 const Int_t nParticleTypes = 17;
657 AliEmcalContainer* cont = 0;
659 while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) {
661 histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
662 htitle = histname +
";Rejection reason;#it{E}_{clus} (GeV/)";
668 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
669 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
673 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
674 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
679 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
680 htitle = histname +
";Centrality (%);M02;#it{E}_{photon} (GeV)";
684 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
685 htitle = histname +
";Centrality (%);M02;#it{E}_{hadron} (GeV)";
701 min[dim] = fM02HistBins[0];
705 title[dim] =
"#it{E}_{clus} (GeV)";
708 min[dim] = fPtHistBins[0];
712 title[dim] =
"Contributor type";
713 nbins[dim] = nContributorTypes;
716 binEdges[dim] = contributorTypeBins;
719 title[dim] =
"#it{p}_{T,jet}^{corr}";
726 TString thnname =
"JetPerformanceMC/hM02VsContributorTypeJets";
728 for (
Int_t i = 0; i < dim; i++) {
729 hn->GetAxis(i)->SetTitle(title[i]);
730 hn->SetBinEdges(i, binEdges[i]);
737 title[dim] =
"#it{p}_{T,jet}^{corr}";
744 title[dim] =
"Contributor type";
745 nbins[dim] = nContributorTypes;
748 binEdges[dim] = contributorTypeBins;
758 title[dim] =
"#it{p}_{T,sum} (GeV)";
761 min[dim] = fPtHistBins[0];
765 thnname =
"JetPerformanceMC/hJetComposition";
767 for (
Int_t i = 0; i < dim; i++) {
768 thn->GetAxis(i)->SetTitle(title[i]);
769 thn->SetBinEdges(i, binEdges[i]);
775 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
776 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
780 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
781 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
785 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
786 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
798 axis->SetBinLabel(1,
"SinglePhoton");
799 axis->SetBinLabel(2,
"SingleElectron");
800 axis->SetBinLabel(3,
"SingleChargedPion");
801 axis->SetBinLabel(4,
"SingleProton");
802 axis->SetBinLabel(5,
"SingleAntiProton");
803 axis->SetBinLabel(6,
"SingleChargedKaon");
804 axis->SetBinLabel(7,
"SingleK0L");
805 axis->SetBinLabel(8,
"SingleNeutron");
806 axis->SetBinLabel(9,
"SingleAntiNeutron");
807 axis->SetBinLabel(10,
"SingleOther");
808 axis->SetBinLabel(11,
"PhotonHadron");
809 axis->SetBinLabel(12,
"HadronPhoton");
810 axis->SetBinLabel(13,
"MergedPi0");
811 axis->SetBinLabel(14,
"PhotonPhotonOther");
812 axis->SetBinLabel(15,
"HadronHadron");
813 axis->SetBinLabel(16,
"TwoContributorsOther");
814 axis->SetBinLabel(17,
"MoreThanTwoContributors");
828 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
831 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
832 title = histname +
";Centrality;Scale factor;counts";
835 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
836 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
839 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jets->GetArrayName().Data());
840 title = histname +
";Centrality;Scale factor;counts";
845 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jets->GetArrayName().Data());
846 title = histname +
";Centrality;Scale factor;counts";
849 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jets->GetArrayName().Data());
850 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
853 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jets->GetArrayName().Data());
854 title = histname +
";Centrality;Scale factor;counts";
877 histname =
"TriggerSimHistograms/hEtaVsPhi";
878 title = histname +
";#eta_{patch} (rad);#phi_{patch} (rad)";
882 histname =
"TriggerSimHistograms/hNPatches";
883 title = histname +
";#it{N}_{patches};type";
887 histname =
"TriggerSimHistograms/hPatchE";
888 title = histname +
";Centrality (%);#it{E}_{patch} (GeV)";
892 histname =
"TriggerSimHistograms/hPatchMedianE";
893 title = histname +
";Centrality (%);#it{E}_{patch,med} (GeV);type";
894 fHistManager.
CreateTH3(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 50, 2, -0.5, 1.5);
900 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
903 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
904 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
910 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
911 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
920 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
921 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
922 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
925 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
926 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
927 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
931 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
932 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
936 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
937 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
941 nbinsx = 20; minx = 0; maxx = 100;
943 nbinsz = 50; minz = 0; maxz = 1.;
945 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
946 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
947 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
950 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
951 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
952 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
956 nbinsx = 20; minx = 0; maxx = 100;
958 nbinsz = 50; minz = 0; maxz = 1.;
960 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
961 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
962 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
965 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
966 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
967 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
971 nbinsx = 20; minx = 0; maxx = 100;
973 nbinsz = 50; minz = 0; maxz =
fMaxPt;
975 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
976 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
977 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
980 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
981 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
982 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1004 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
1006 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1007 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1010 title = histname +
";#it{p}_{T,corr}^{det} (GeV/#it{c});#it{p}_{T}^{truth} (GeV/#it{c})";
1015 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
1017 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1018 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1021 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1027 nbinsx = 20; minx = 0; maxx = 100;
1028 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1029 nbinsz = 250; minz = -5.; maxz = 5.;
1031 histname =
"MatchedJetHistograms/hJESshiftEMCal";
1033 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1034 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1037 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1042 histname =
"MatchedJetHistograms/hJESshiftDCal";
1044 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1045 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1048 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1054 nbinsx = 20; minx = 0; maxx = 100;
1056 nbinsz = 50; minz = 0; maxz = 1.;
1058 histname =
"MatchedJetHistograms/hNEFVsPt";
1060 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});Calo energy fraction";
1061 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1064 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});Calo energy fraction";
1069 nbinsx = 20; minx = 0; maxx = 100;
1070 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1071 nbinsz = 50; minz = 0; maxz = 1.;
1073 histname =
"MatchedJetHistograms/hZLeadingVsPt";
1075 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{z}_{leading}";
1076 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1079 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#it{z}_{leading}";
1084 nbinsx = 20; minx = 0; maxx = 100;
1085 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1086 nbinsz = 50; minz = 0; maxz = 1.;
1088 histname =
"MatchedJetHistograms/hMatchingDistance";
1090 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});R";
1091 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1093 histname =
"MatchedJetHistograms/hMatchingDistancepp";
1094 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});R";
1095 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1098 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});R";
1104 histname =
"MatchedJetHistograms/fHistJetMatchingQA";
1106 std::vector<std::string> binLabels = {
"noMatch",
"matchedJet",
"sharedMomentumFraction",
"partLevelMatchedJet",
"jetDistance",
"passedAllCuts"};
1107 auto histMatchedJetCuts =
fHistManager.
CreateTH1(histname.Data(), title.Data(), binLabels.size(), 0, binLabels.size());
1109 for (
unsigned int i = 1; i <= binLabels.size(); i++) {
1110 histMatchedJetCuts->GetXaxis()->SetBinLabel(i, binLabels.at(i-1).c_str());
1112 histMatchedJetCuts->GetYaxis()->SetTitle(
"Number of jets");
1137 TClass cls(objname);
1138 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1139 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1140 GetName(), cls.GetName(),
"EmcalTriggers"));
1145 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1165 TString triggerNameMB1 =
"CINT7-B-NOPF-CENT";
1166 TString triggerNameMB2 =
"CV0L7-B-NOPF-CENT";
1167 TString triggerNameJE =
"CINT7EJ1-B-NOPF-CENTNOPMD";
1172 for (
auto i : runtriggers) {
1173 if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
1182 TString histname =
"Trigger/hMBDownscaleFactor";
1219 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
1220 TString jetContName = jetCont->GetName();
1255 TClass cls(objname);
1256 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1257 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1258 GetName(), cls.GetName(),
"EmcalTriggers"));
1263 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1268 std::vector<Double_t> vecEMCal;
1269 std::vector<Double_t> vecDCal;
1271 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1274 if(!recpatch->IsJetHighSimple())
continue;
1276 histname =
"TriggerSimHistograms/hEtaVsPhi";
1279 histname =
"TriggerSimHistograms/hPatchE";
1282 if (recpatch->IsEMCal()) {
1283 vecEMCal.push_back(recpatch->GetPatchE());
1285 vecDCal.push_back(recpatch->GetPatchE());
1292 const Int_t nBkgPatchesEMCal = vecEMCal.size();
1293 const Int_t nBkgPatchesDCal = vecDCal.size();
1294 fMedianEMCal = TMath::Median(nBkgPatchesEMCal, &vecEMCal[0]);
1295 fMedianDCal = TMath::Median(nBkgPatchesDCal, &vecDCal[0]);
1297 histname =
"TriggerSimHistograms/hPatchMedianE";
1301 histname =
"TriggerSimHistograms/hNPatches";
1309 for(
auto p : *fTriggerPatchInfo){
1310 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1313 if(!recpatch->IsJetHighSimple())
continue;
1315 if (recpatch->IsEMCal()) {
1316 if ((recpatch->GetPatchE() -
fMedianDCal) > threshold) {
1321 if ((recpatch->GetPatchE() -
fMedianEMCal) > threshold) {
1369 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1370 TString jetContName = jets->GetName();
1375 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1379 for (
auto jet : jets->
all()) {
1393 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1402 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1412 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1414 else if (type ==
kDCal) {
1415 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1417 TLorentzVector leadPart;
1420 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
1429 UInt_t rejectionReason = 0;
1430 if (!jets->
AcceptJet(jet, rejectionReason)) {
1431 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1436 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), corrPt);
1443 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
1445 else if (type ==
kDCal) {
1446 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
1457 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1463 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1465 else if (type ==
kDCal) {
1466 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1468 const AliVTrack* track;
1469 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1470 track =
static_cast<AliVTrack*
>(jet->Track(i));
1471 z = track->Pt() / TMath::Abs(corrPt);
1482 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1484 else if (type ==
kDCal) {
1485 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1497 if (jet->Eta() > 0) {
1498 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
1501 else if (jet->Eta() < 0) {
1502 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
1511 const AliVCluster* clus =
nullptr;
1512 Int_t nClusters = jet->GetNumberOfClusters();
1513 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1514 clus = jet->Cluster(iClus);
1515 deltaEhadcorr += (clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy());
1518 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
1525 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
1546 const AliVCluster* clus;
1550 Double_t clusPhi = it.first.Phi_0_2pi();
1554 if (!clus->IsEMCAL()) {
1560 Int_t nTracksMatched = 0;
1561 const AliVTrack* track =
nullptr;
1562 for (
Int_t itrack=0; itrack < clus->GetNTracksMatched(); itrack++) {
1563 track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(itrack));
1568 Double_t trackPhi = TVector2::Phi_0_2pi(track->GetTrackPhiOnEMCal());
1569 Double_t trackEta = track->GetTrackEtaOnEMCal();
1570 Double_t deta = TMath::Abs(clusEta - trackEta);
1571 Double_t dphi = TMath::Abs(clusPhi - trackPhi);
1574 trackPSum += track->P();
1580 if (trackPSum > 1e-3) {
1581 EoverP = clus->GetNonLinCorrEnergy() / trackPSum;
1584 Double_t deltaE = clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy();
1586 if (trackPSum > 1e-3) {
1587 Rcorr = deltaE / trackPSum;
1589 Double_t RcorrClus = deltaE / clus->GetNonLinCorrEnergy();
1595 histname =
"ClusterHistograms/hM02";
1599 if (clus->GetM02() > 0.4) {
1600 histname =
"ClusterHistograms/hNcellsM02G04";
1603 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1604 histname =
"ClusterHistograms/hNcellsM02L04";
1612 histname =
"ClusterHistograms/hMatchedTrackPt";
1615 if (clus->GetM02() > 0.4) {
1616 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
1619 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1620 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
1625 histname =
"ClusterHistograms/hMatchedTrackN";
1628 if (clus->GetM02() > 0.4) {
1629 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
1632 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1633 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
1638 histname =
"ClusterHistograms/hM02Matched";
1639 if (nTracksMatched > 0) {
1644 histname =
"ClusterHistograms/hM02Unmatched";
1645 if (nTracksMatched == 0) {
1650 if (nTracksMatched == 1) {
1652 const AliVTrack* track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(0));
1654 Double_t trackEta = track->GetTrackEtaOnEMCal();
1655 Double_t deta = trackEta - clusEta;
1658 histname =
"ClusterHistograms/hDeltaEtaCentral";
1663 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
1674 histname =
"ClusterHistograms/hEoverPM02Central";
1678 histname =
"ClusterHistograms/hEoverPM02Peripheral";
1686 histname =
"ClusterHistograms/hRcorrVsCent";
1691 histname =
"ClusterHistograms/hRcorr0-10";
1697 histname =
"ClusterHistograms/hRcorr50-90";
1702 histname =
"ClusterHistograms/hRcorrClusVsCent";
1707 histname =
"ClusterHistograms/hRcorrClus0-10";
1713 histname =
"ClusterHistograms/hRcorrClus50-90";
1720 histname =
"ClusterHistograms/hTrackMultiplicity";
1733 const AliMCEvent* mcevent =
nullptr;
1735 mcevent = MCEvent();
1758 const AliVCluster* clus;
1759 std::vector<ContributorType> vecContributorTypes;
1760 std::vector<Int_t> vecContributorLabels;
1766 if (!clus->IsEMCAL()) {
1773 const Int_t nLabels = clus->GetNLabels();
1776 vecContributorTypes.clear();
1777 vecContributorLabels.clear();
1778 for (
Int_t iLabel=0; iLabel<nLabels; iLabel++) {
1780 Int_t label = clus->GetLabels()[iLabel];
1781 if (TMath::Abs(label) > 0) {
1784 vecContributorTypes.push_back(contributorType);
1785 vecContributorLabels.push_back(label);
1790 Int_t nLabelsPhysPrim = vecContributorTypes.size();
1792 if (nLabelsPhysPrim == 1) {
1794 contributorType = vecContributorTypes[0];
1796 if (contributorType ==
kPhoton) {
1799 else if (contributorType ==
kElectron) {
1805 else if (contributorType ==
kProton) {
1814 else if (contributorType ==
kK0L) {
1817 else if (contributorType ==
kNeutron) {
1828 else if (nLabelsPhysPrim == 2) {
1836 Double_t frac1 = clus->GetClusterMCEdepFraction(1);
1844 if (isHadron1 && isHadron2) {
1847 else if (isPhoton1 && isHadron2) {
1851 Double_t photonEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
1852 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
1855 else if (isHadron1 && isPhoton2) {
1859 Double_t hadronEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
1860 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
1863 else if (isPhoton1 && isPhoton2) {
1871 if (part1 && part2) {
1872 Int_t iMother1 = part1->GetMother();
1873 Int_t iMother2 = part2->GetMother();
1874 AliVParticle *mother1 = mcevent->GetTrack(iMother1);
1875 AliVParticle *mother2 = mcevent->GetTrack(iMother2);
1877 if (mother1 && mother2) {
1878 if ( (mother1->PdgCode() == 111) && (mother2->PdgCode() == 111) ) {
1879 if (iMother1 == iMother2) {
1891 else if (nLabelsPhysPrim > 2) {
1897 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
1898 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
1901 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
1902 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
1915 const AliVCluster* clus;
1917 for (
const auto jet : jets->
accepted()) {
1922 Double_t hadCaloEnergyUnmatched = 0;
1923 Double_t hadCaloEnergyMatchedNonlincorr = 0;
1924 Double_t hadCaloEnergyMatchedHadCorr = 0;
1927 Int_t nClusters = jet->GetNumberOfClusters();
1928 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1930 clus = jet->Cluster(iClus);
1934 Int_t label = TMath::Abs(clus->GetLabel());
1940 histname =
"JetPerformanceMC/hM02VsContributorTypeJets";
1941 Double_t x[4] = {clus->GetM02(), clus->GetNonLinCorrEnergy(), contributorType, jetPt};
1947 Bool_t hasMatchedTrack = (clus->GetNTracksMatched() > 0);
1949 if (hasMatchedTrack) {
1950 hadCaloEnergyMatchedNonlincorr += clus->GetNonLinCorrEnergy();
1951 hadCaloEnergyMatchedHadCorr += clus->GetHadCorrEnergy();
1954 hadCaloEnergyUnmatched += clus->GetNonLinCorrEnergy();
1963 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
1967 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
1971 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
1975 histname =
"JetPerformanceMC/hJetComposition";
1976 for (
Int_t type = 0; type < 8; type++) {
1983 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1985 clus = jet->Cluster(iClus);
1987 Int_t label = TMath::Abs(clus->GetLabel());
1992 if (type == contributorType) {
1994 pTsum += clus->GetNonLinCorrEnergy();
1999 Double_t x[4] = {jetPt, 1.*type, nSum, pTsum};
2019 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
2020 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
2021 Double_t phiMinDCal =
fGeom->GetDCALPhiMin() * TMath::DegToRad();
2022 Double_t phiMaxDCal =
fGeom->GetDCALPhiMax() * TMath::DegToRad();
2024 Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
2025 Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
2026 Double_t accDCal = 2 * (etaEMCal - etaMinDCal) * (phiMaxDCal - phiMinDCal);
2031 while ((jetCont = static_cast<AliJetContainer*>(nextJetColl()))) {
2034 TRandom3* r =
new TRandom3(0);
2036 Double_t etaEMCalfid = etaEMCal - jetR;
2037 Double_t etaMinDCalfid = etaMinDCal + jetR;
2038 Double_t phiMinEMCalfid = phiMinEMCal + jetR;
2039 Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
2040 Double_t phiMinDCalfid = phiMinDCal + jetR;
2041 Double_t phiMaxDCalfid = phiMaxDCal - jetR;
2042 Double_t accEMCalfid = 2 * etaEMCalfid * (phiMaxEMCalfid - phiMinEMCalfid);
2043 Double_t accDCalfid = 2 * (etaEMCalfid - etaMinDCalfid) * (phiMaxDCalfid - phiMinDCalfid);
2044 if ( (etaEMCalfid - etaMinDCalfid) < 0) {
2049 Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
2050 Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
2053 Double_t etaDCalRC = r->Uniform(etaMinDCalfid, etaEMCalfid);
2054 Double_t sign = r->Uniform(-1., 1.);
2056 etaDCalRC = -1*etaDCalRC;
2058 Double_t phiDCalRC = r->Uniform(phiMinDCalfid, phiMaxDCalfid);
2085 while ((partCont = static_cast<AliParticleContainer*>(nextPartCont()))) {
2087 TString partContName = partCont->GetName();
2088 if (!partContName.CompareTo(
"tracks")) {
2094 track = trackIterator.first;
2095 trackEta = track.Eta();
2097 trackPt = track.Pt();
2100 if (TMath::Abs(trackEta) < etaTPC) {
2101 trackPtSumTPC += trackPt;
2105 if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
2106 trackPtSumEMCal += trackPt;
2110 if (TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinEMCalfid && trackPhi < phiMaxEMCalfid) {
2111 trackPtSumEMCalfid += trackPt;
2116 if (TMath::Abs(trackEta) > etaMinDCal && TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinDCal && trackPhi < phiMaxDCal) {
2117 trackPtSumDCal += trackPt;
2123 if (TMath::Abs(trackEta) > etaMinDCalfid && TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinDCalfid && trackPhi < phiMaxDCalfid) {
2124 trackPtSumDCalfid += trackPt;
2129 deltaR =
GetDeltaR(&track, etaEMCalRC, phiEMCalRC);
2130 if (deltaR < jetR) {
2131 trackPtSumEMCalRC += trackPt;
2136 deltaR =
GetDeltaR(&track, etaDCalRC, phiDCalRC);
2137 if (deltaR < jetR) {
2138 trackPtSumDCalRC += trackPt;
2157 clus = clusIterator.first;
2158 clusEta = clus.Eta();
2163 if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
2164 clusPtSumEMCal += clusPt;
2168 if (TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinEMCalfid && clusPhi < phiMaxEMCalfid) {
2169 clusPtSumEMCalfid += clusPt;
2174 if (TMath::Abs(clusEta) > etaMinDCal && TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinDCal && clusPhi < phiMaxDCal) {
2175 clusPtSumDCal += clusPt;
2181 if (TMath::Abs(clusEta) > etaMinDCalfid && TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinDCalfid && clusPhi < phiMaxDCalfid) {
2182 clusPtSumDCalfid += clusPt;
2187 deltaR =
GetDeltaR(&clus, etaEMCalRC, phiEMCalRC);
2188 if (deltaR < jetR) {
2189 clusPtSumEMCalRC += clusPt;
2194 deltaR =
GetDeltaR(&clus, etaDCalRC, phiDCalRC);
2195 if (deltaR < jetR) {
2196 clusPtSumDCalRC += clusPt;
2205 Double_t numerator = (trackPtSumEMCal + clusPtSumEMCal) / accEMCal;
2206 Double_t denominator = trackPtSumTPC / accTPC;
2207 Double_t scaleFactor = numerator / denominator;
2208 TString histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
2212 if (accEMCalfid > 1e-3) {
2213 numerator = (trackPtSumEMCalfid + clusPtSumEMCalfid) / accEMCalfid;
2214 scaleFactor = numerator / denominator;
2215 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jetCont->GetArrayName().Data());
2221 numerator = (trackPtSumDCal + clusPtSumDCal) / accDCal;
2222 scaleFactor = numerator / denominator;
2223 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jetCont->GetArrayName().Data());
2229 if (accDCalfid > 1e-3) {
2230 numerator = (trackPtSumDCalfid + clusPtSumDCalfid) / accDCalfid;
2231 scaleFactor = numerator / denominator;
2232 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jetCont->GetArrayName().Data());
2241 Double_t deltaPt = trackPtSumEMCalRC + clusPtSumEMCalRC - rho * TMath::Pi() * jetR * jetR;
2242 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
2247 if (accDCalfid > 1e-3) {
2248 deltaPt = trackPtSumDCalRC + clusPtSumDCalRC - rho * TMath::Pi() * jetR * jetR;
2249 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jetCont->GetArrayName().Data());
2269 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2270 TString jetContName = jets->GetName();
2275 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
2279 for (
auto jet : jets->
all()) {
2285 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
2289 UInt_t rejectionReason = 0;
2290 if (!jets->
AcceptJet(jet, rejectionReason)) {
2291 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
2292 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
2306 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
2308 else if (type ==
kDCal) {
2309 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
2314 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
2319 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
2321 else if (type ==
kDCal) {
2322 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
2324 TLorentzVector leadPart;
2327 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2332 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
2334 else if (type ==
kDCal) {
2335 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
2337 const AliVTrack* track;
2338 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
2339 track =
static_cast<AliVTrack*
>(jet->Track(i));
2340 z = track->Pt() / TMath::Abs(corrPt);
2346 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
2348 else if (type ==
kDCal) {
2349 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
2368 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2369 TString jetContName = jets->GetName();
2372 if (jetContName.Contains(
"mcparticles")) {
2381 for (
auto jet : jets->
accepted()) {
2393 if (!matchedPartLevelJet) {
2396 UInt_t rejectionReason = 0;
2410 Float_t truthPt = matchedPartLevelJet->
Pt();
2414 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
2416 else if (type ==
kDCal) {
2417 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
2428 histname =
"MatchedJetHistograms/hJESshiftEMCal";
2430 else if (type ==
kDCal) {
2431 histname =
"MatchedJetHistograms/hJESshiftDCal";
2441 histname =
"MatchedJetHistograms/hNEFVsPt";
2450 histname =
"MatchedJetHistograms/hZLeadingVsPt";
2451 TLorentzVector leadPart;
2454 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2463 histname =
"MatchedJetHistograms/hMatchingDistance";
2473 histname =
"MatchedJetHistograms/hMatchingDistancepp";
2491 TString histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
2492 UInt_t rejectionReason = 0;
2495 return contributorType;
2498 if (part->GetGeneratorIndex() == 0) {
2506 else if (TMath::Abs(pdg) == 211) {
2509 else if (pdg == 2212) {
2512 else if (pdg == -2212) {
2515 else if (TMath::Abs(pdg) == 321) {
2518 else if (pdg == 130) {
2519 contributorType =
kK0L;
2521 else if (pdg == 2112) {
2524 else if (pdg == -2112) {
2527 else if (TMath::Abs(pdg) == 11) {
2530 else if (TMath::Abs(pdg) == 13) {
2531 contributorType =
kMuon;
2534 contributorType =
kOther;
2538 return contributorType;
2547 Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
2548 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
2607 bool returnValue =
false;
2614 AliDebugStream(4) <<
"Jet is matched!\nJet: " << jet->
toString() <<
"\n";
2620 AliDebugStream(4) <<
"Jet rejected due to shared momentum fraction of " << sharedFraction <<
", which is smaller than the min momentum fraction of " <<
fMinSharedMomentumFraction <<
"\n";
2621 returnValue =
false;
2624 AliDebugStream(4) <<
"Passed shared momentum fraction with value of " << sharedFraction <<
"\n";
2631 if (!partLevelJet) {
2632 AliDebugStream(4) <<
"Jet rejected due to no matching part level jet.\n";
2633 returnValue =
false;
2636 AliDebugStream(4) <<
"Det level jet has a required match to a part level jet.\n" <<
"Part level jet: " << partLevelJet->
toString() <<
"\n";
2644 AliDebugStream(4) <<
"Jet rejected due to matching distance of " << matchedJetDistance <<
", which is larger than the max distance of " <<
fMaxMatchedJetDistance <<
"\n";
2645 returnValue =
false;
2648 AliDebugStream(4) <<
"Jet passed distance cut with distance of " << matchedJetDistance <<
"\n";
2654 if (returnValue ==
true) {
2659 AliDebugStream(5) <<
"Rejected jet because it was not matched to a external event jet.\n";
2661 returnValue =
false;
2665 return partLevelJet;
2674 const char *ntracks,
2675 const char *nclusters,
2676 const char *nGenLev,
2686 ::Error(
"AddTaskEmcalJetPerformance",
"No analysis manager to connect to.");
2692 AliVEventHandler* handler = mgr->GetInputEventHandler();
2695 ::Error(
"AddTaskEmcalJetPerformance",
"This task requires an input event handler");
2707 if (handler->InheritsFrom(
"AliESDInputHandler")) {
2710 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
2721 if (trackName ==
"usedefault") {
2722 if (dataType ==
kESD) {
2723 trackName =
"Tracks";
2725 else if (dataType == kAOD) {
2726 trackName =
"tracks";
2733 if (clusName ==
"usedefault") {
2734 if (dataType ==
kESD) {
2735 clusName =
"CaloClusters";
2737 else if (dataType == kAOD) {
2738 clusName =
"caloClusters";
2745 TString name(
"AliAnalysisTaskEmcalJetPerformance");
2746 if (!trackName.IsNull()) {
2750 if (!clusName.IsNull()) {
2754 if (strcmp(suffix,
"") != 0) {
2767 if (trackName ==
"mcparticles") {
2769 partCont = mcpartCont;
2771 else if (trackName ==
"tracks" || trackName ==
"Tracks") {
2773 partCont = trackCont;
2779 if (nGenLev && strcmp(nGenLev,
"")!=0) {
2787 if (!clusName.IsNull()) {
2801 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
2803 contname +=
"_histos";
2804 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
2805 TList::Class(),AliAnalysisManager::kOutputContainer,
2806 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
2807 mgr->ConnectInput (task, 0, cinput1 );
2808 mgr->ConnectOutput (task, 1, coutput1 );
TObjArray fClusterCollArray
cluster collection array
void SetParticlePtCut(Double_t cut)
Double_t GetRhoVal() const
const TString & GetRhoName() const
AliEmcalJet * ClosestJet() const
AliJetContainer * GetJetContainer(Int_t i=0) const
Double_t ClosestJetDistance() const
UInt_t fOffTrigger
offline trigger for event selection
void AdoptParticleContainer(AliParticleContainer *cont)
const AliClusterIterableMomentumContainer accepted_momentum() const
Container with name, TClonesArray and cuts for particles.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
AliEmcalJet * MatchedJet() const
Declaration of class AliTLorentzVector.
static AliEmcalDownscaleFactorsOCDB * Instance()
AliClusterContainer * GetClusterContainer() const
void FillTH3(const char *hname, double x, double y, double z, double weight=1., Option_t *opt="")
Fill a 3D histogram within the container.
Declaration of class AliAnalysisTaskEmcalEmbeddingHelper.
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
Double_t GetDownscaleFactorForTriggerClass(const TString &trigger) const
Container for particles within the EMCAL framework.
void SetCaloTriggerPatchInfoName(const char *n)
void AdoptClusterContainer(AliClusterContainer *cont)
TObjArray fParticleCollArray
particle/track collection array
virtual Bool_t AcceptMCParticle(const AliAODMCParticle *vp, UInt_t &rejectionReason) const
bool AddQAPlotsToList(TList *list)
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
void GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
void SetRun(int runnumber)
void FillTHnSparse(const char *name, const double *x, double weight=1., Option_t *opt="")
bool IsInitialized() const
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Create a new TH2 within the container.
THashList * GetListOfHistograms() const
Get the list of histograms.
Double_t GetLeadingHadronPt(const AliEmcalJet *jet) const
AliEMCALGeometry * fGeom
!emcal geometry
UInt_t GetJetAcceptanceType() const
Double_t Phi_0_2pi() const
Implementation of task to embed external events.
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
BeamType fForceBeamType
forced beam type
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
Double_t fCent
!event centrality
Int_t GetNAcceptedTracks()
AliMCParticleContainer * AddMCParticleContainer(const char *n)
Create new container for MC particles and attach it to the task.
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
Calculates the fraction of momentum z of part 1 w.r.t. part 2 in the direction of part 2...
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
TObjArray fJetCollArray
jet collection array
AliRhoParameter * GetRhoParameter()
void RecordEmbeddedEventProperties()
virtual Bool_t IsEventSelected()
Performing event selection.
static Double_t * GenerateFixedBinArray(Int_t n, Double_t min, Double_t max)
std::vector< TString > GetTriggerClasses() const
Float_t GetJetRadius() const
AliEmcalList * fOutput
!output list
Handler for downscale factors for various triggers obtained from the OCDB.
AliMCParticleContainer * GetMCParticleContainer(Int_t i=0) const
void SelectPhysicalPrimaries(Bool_t s)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Double_t GetFractionSharedPt(const AliEmcalJet *jet, AliParticleContainer *cont2=0x0) const
const AliTrackIterableMomentumContainer accepted_momentum() const
Int_t GetRunNumber(TString)
void SetClusPtCut(Double_t cut)
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
Main initialization function on the worker.
const AliJetIterableContainer accepted() const
EDataType_t
Switch for the data type.
void SetClusECut(Double_t cut)
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Create a new THnSparse within the container.
Container structure for EMCAL clusters.
DCal fiducial acceptance (each eta, phi edge narrowed by jet R)
Container for MC-true particles within the EMCAL framework.
virtual AliAODMCParticle * GetMCParticleWithLabel(Int_t lab) const
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
EMCal fiducial acceptance (each eta, phi edge narrowed by jet R)
Container for jet within the EMCAL jet framework.
TH3 * CreateTH3(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, int nbinsz, double zmin, double zmax, Option_t *opt="")
Create a new TH2 within the container.
const AliJetIterableContainer all() const
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()