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),
88 fTrackMatchingDeltaEtaMax(0.015),
89 fTrackMatchingDeltaPhiMax(0.030),
95 fMinSharedMomentumFraction(0.5),
96 fMaxMatchedJetDistance(0.3),
97 fUseAliEventCuts(kTRUE),
100 fUseManualEventCuts(kFALSE),
246 if (embeddingHelper) {
255 while ((obj = next())) {
275 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
278 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
279 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
285 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
286 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
295 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
296 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
297 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
299 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
300 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
301 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
305 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
306 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
307 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, 0, 100,
nPtBins, 0,
fMaxPt, 2, -0.5, 1.5,
"s");
311 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
312 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
316 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
317 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
321 nbinsx = 20; minx = 0; maxx = 100;
323 nbinsz = 50; minz = 0; maxz = 1.;
325 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
326 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
327 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
329 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
330 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
331 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
334 nbinsx = 20; minx = 0; maxx = 100;
336 nbinsz = 50; minz = 0; maxz = 1.;
338 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
339 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
340 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
342 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
343 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
344 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
347 nbinsx = 20; minx = 0; maxx = 100;
349 nbinsz = 50; minz = 0; maxz =
fMaxPt;
351 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
352 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
353 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
355 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
356 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
357 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
360 nbinsx = 20; minx = 0; maxx = 100;
364 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
365 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#sum#it{E}_{nonlincorr} - #it{E}_{hadcorr}";
366 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
370 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
371 title = histname +
";#it{E}_{patch,med};type;#it{p}_{T}^{corr} (GeV/#it{c});Centrality (%)";
382 histname =
"Trigger/hMBDownscaleFactor";
383 title = histname +
";Downscale factor;counts";
397 const Int_t nRcorrBins = 50;
399 const Int_t nCellBins = 30;
401 const Int_t nMatchedTrackBins = 5;
403 const Int_t nDeltaEtaBins = 60;
410 histname =
"ClusterHistograms/hM02";
411 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
415 histname =
"ClusterHistograms/hNcellsM02G04";
416 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
419 histname =
"ClusterHistograms/hNcellsM02L04";
420 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
427 histname =
"ClusterHistograms/hMatchedTrackPt";
428 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
431 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
432 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
435 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
436 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
440 histname =
"ClusterHistograms/hMatchedTrackN";
441 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
444 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
445 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
448 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
449 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
453 histname =
"ClusterHistograms/hM02Matched";
454 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
458 histname =
"ClusterHistograms/hM02Unmatched";
459 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
463 histname =
"ClusterHistograms/hDeltaEtaCentral";
464 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
467 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
468 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
475 histname =
"ClusterHistograms/hEoverPM02Central";
476 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
479 histname =
"ClusterHistograms/hEoverPM02Peripheral";
480 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
487 histname =
"ClusterHistograms/hRcorrVsCent";
488 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
492 histname =
"ClusterHistograms/hRcorr0-10";
493 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
497 histname =
"ClusterHistograms/hRcorr50-90";
498 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
502 histname =
"ClusterHistograms/hRcorrClusVsCent";
503 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
507 histname =
"ClusterHistograms/hRcorrClus0-10";
508 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
512 histname =
"ClusterHistograms/hRcorrClus50-90";
513 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
517 histname =
"ClusterHistograms/hTrackMultiplicity";
518 htitle = histname +
";N_{tracks};Centrality (%)";
531 const Int_t nRejBins = 32;
534 const Int_t nContributorTypes = 11;
536 const Int_t nParticleTypes = 17;
539 AliEmcalContainer* cont = 0;
541 while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) {
543 histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
544 htitle = histname +
";Rejection reason;#it{E}_{clus} (GeV/)";
550 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
551 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
555 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
556 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
561 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
562 htitle = histname +
";Centrality (%);M02;#it{E}_{photon} (GeV)";
566 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
567 htitle = histname +
";Centrality (%);M02;#it{E}_{hadron} (GeV)";
583 min[dim] = fM02HistBins[0];
587 title[dim] =
"#it{E}_{clus} (GeV)";
590 min[dim] = fPtHistBins[0];
594 title[dim] =
"Contributor type";
595 nbins[dim] = nContributorTypes;
598 binEdges[dim] = contributorTypeBins;
601 title[dim] =
"#it{p}_{T,jet}^{corr}";
608 TString thnname =
"JetPerformanceMC/hM02VsContributorTypeJets";
610 for (
Int_t i = 0; i < dim; i++) {
611 hn->GetAxis(i)->SetTitle(title[i]);
612 hn->SetBinEdges(i, binEdges[i]);
619 title[dim] =
"#it{p}_{T,jet}^{corr}";
626 title[dim] =
"Contributor type";
627 nbins[dim] = nContributorTypes;
630 binEdges[dim] = contributorTypeBins;
640 title[dim] =
"#it{p}_{T,sum} (GeV)";
643 min[dim] = fPtHistBins[0];
647 thnname =
"JetPerformanceMC/hJetComposition";
649 for (
Int_t i = 0; i < dim; i++) {
650 thn->GetAxis(i)->SetTitle(title[i]);
651 thn->SetBinEdges(i, binEdges[i]);
657 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
658 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
662 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
663 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
667 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
668 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
680 axis->SetBinLabel(1,
"SinglePhoton");
681 axis->SetBinLabel(2,
"SingleElectron");
682 axis->SetBinLabel(3,
"SingleChargedPion");
683 axis->SetBinLabel(4,
"SingleProton");
684 axis->SetBinLabel(5,
"SingleAntiProton");
685 axis->SetBinLabel(6,
"SingleChargedKaon");
686 axis->SetBinLabel(7,
"SingleK0L");
687 axis->SetBinLabel(8,
"SingleNeutron");
688 axis->SetBinLabel(9,
"SingleAntiNeutron");
689 axis->SetBinLabel(10,
"SingleOther");
690 axis->SetBinLabel(11,
"PhotonHadron");
691 axis->SetBinLabel(12,
"HadronPhoton");
692 axis->SetBinLabel(13,
"MergedPi0");
693 axis->SetBinLabel(14,
"PhotonPhotonOther");
694 axis->SetBinLabel(15,
"HadronHadron");
695 axis->SetBinLabel(16,
"TwoContributorsOther");
696 axis->SetBinLabel(17,
"MoreThanTwoContributors");
710 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
713 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
714 title = histname +
";Centrality;Scale factor;counts";
717 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
718 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
721 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jets->GetArrayName().Data());
722 title = histname +
";Centrality;Scale factor;counts";
726 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jets->GetArrayName().Data());
727 title = histname +
";Centrality;Scale factor;counts";
730 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jets->GetArrayName().Data());
731 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
734 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jets->GetArrayName().Data());
735 title = histname +
";Centrality;Scale factor;counts";
755 histname =
"TriggerSimHistograms/hEtaVsPhi";
756 title = histname +
";#eta_{patch} (rad);#phi_{patch} (rad)";
760 histname =
"TriggerSimHistograms/hNPatches";
761 title = histname +
";#it{N}_{patches};type";
765 histname =
"TriggerSimHistograms/hPatchE";
766 title = histname +
";Centrality (%);#it{E}_{patch} (GeV)";
770 histname =
"TriggerSimHistograms/hPatchMedianE";
771 title = histname +
";Centrality (%);#it{E}_{patch,med} (GeV);type";
772 fHistManager.
CreateTH3(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 50, 2, -0.5, 1.5);
778 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
781 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
782 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
788 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
789 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
798 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
799 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
800 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
802 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
803 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
804 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
807 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
808 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
812 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
813 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
817 nbinsx = 20; minx = 0; maxx = 100;
819 nbinsz = 50; minz = 0; maxz = 1.;
821 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
822 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
823 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
825 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
826 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
827 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
830 nbinsx = 20; minx = 0; maxx = 100;
832 nbinsz = 50; minz = 0; maxz = 1.;
834 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
835 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
836 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
838 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
839 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
840 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
843 nbinsx = 20; minx = 0; maxx = 100;
845 nbinsz = 50; minz = 0; maxz =
fMaxPt;
847 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
848 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
849 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
851 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
852 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
853 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
873 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
874 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
875 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
877 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
878 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
879 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
882 nbinsx = 20; minx = 0; maxx = 100;
884 nbinsz = 250; minz = -5.; maxz = 5.;
886 histname =
"MatchedJetHistograms/hJESshiftEMCal";
887 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
888 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
890 histname =
"MatchedJetHistograms/hJESshiftDCal";
891 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
892 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
895 nbinsx = 20; minx = 0; maxx = 100;
897 nbinsz = 50; minz = 0; maxz = 1.;
899 histname =
"MatchedJetHistograms/hNEFVsPt";
900 title = histname +
";Centrality (%);#it{p}_{T,corr}^{det} (GeV/#it{c});Calo energy fraction";
901 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
904 nbinsx = 20; minx = 0; maxx = 100;
906 nbinsz = 50; minz = 0; maxz = 1.;
908 histname =
"MatchedJetHistograms/hZLeadingVsPt";
909 title = histname +
";Centrality (%);#it{p}_{T,corr}^{det} (GeV/#it{c});#it{z}_{leading}";
910 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
913 nbinsx = 20; minx = 0; maxx = 100;
915 nbinsz = 50; minz = 0; maxz = 1.;
917 histname =
"MatchedJetHistograms/hMatchingDistance";
918 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});R";
919 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
921 histname =
"MatchedJetHistograms/hMatchingDistancepp";
922 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});R";
923 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
926 histname =
"MatchedJetHistograms/fHistJetMatchingQA";
928 std::vector<std::string> binLabels = {
"noMatch",
"matchedJet",
"sharedMomentumFraction",
"partLevelMatchedJet",
"jetDistance",
"passedAllCuts"};
929 auto histMatchedJetCuts =
fHistManager.
CreateTH1(histname.Data(), title.Data(), binLabels.size(), 0, binLabels.size());
931 for (
unsigned int i = 1; i <= binLabels.size(); i++) {
932 histMatchedJetCuts->GetXaxis()->SetBinLabel(i, binLabels.at(i-1).c_str());
934 histMatchedJetCuts->GetYaxis()->SetTitle(
"Number of jets");
959 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
960 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
961 GetName(), cls.GetName(),
"EmcalTriggers"));
966 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
986 TString triggerNameMB1 =
"CINT7-B-NOPF-CENT";
987 TString triggerNameMB2 =
"CV0L7-B-NOPF-CENT";
988 TString triggerNameJE =
"CINT7EJ1-B-NOPF-CENTNOPMD";
993 for (
auto i : runtriggers) {
994 if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
1003 TString histname =
"Trigger/hMBDownscaleFactor";
1040 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
1041 TString jetContName = jetCont->GetName();
1076 TClass cls(objname);
1077 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1078 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1079 GetName(), cls.GetName(),
"EmcalTriggers"));
1084 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1089 std::vector<Double_t> vecEMCal;
1090 std::vector<Double_t> vecDCal;
1092 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1095 if(!recpatch->IsJetHighSimple())
continue;
1097 histname =
"TriggerSimHistograms/hEtaVsPhi";
1100 histname =
"TriggerSimHistograms/hPatchE";
1103 if (recpatch->IsEMCal()) {
1104 vecEMCal.push_back(recpatch->GetPatchE());
1106 vecDCal.push_back(recpatch->GetPatchE());
1113 const Int_t nBkgPatchesEMCal = vecEMCal.size();
1114 const Int_t nBkgPatchesDCal = vecDCal.size();
1115 fMedianEMCal = TMath::Median(nBkgPatchesEMCal, &vecEMCal[0]);
1116 fMedianDCal = TMath::Median(nBkgPatchesDCal, &vecDCal[0]);
1118 histname =
"TriggerSimHistograms/hPatchMedianE";
1122 histname =
"TriggerSimHistograms/hNPatches";
1130 for(
auto p : *fTriggerPatchInfo){
1131 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1134 if(!recpatch->IsJetHighSimple())
continue;
1136 if (recpatch->IsEMCal()) {
1137 if ((recpatch->GetPatchE() -
fMedianDCal) > threshold) {
1142 if ((recpatch->GetPatchE() -
fMedianEMCal) > threshold) {
1190 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1191 TString jetContName = jets->GetName();
1196 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1200 for (
auto jet : jets->
all()) {
1206 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1211 UInt_t rejectionReason = 0;
1212 if (!jets->
AcceptJet(jet, rejectionReason)) {
1213 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1214 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
1226 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
1228 else if (type ==
kDCal) {
1229 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
1235 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1240 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1245 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1247 else if (type ==
kDCal) {
1248 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1250 TLorentzVector leadPart;
1253 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
1258 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1260 else if (type ==
kDCal) {
1261 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1263 const AliVTrack* track;
1264 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1265 track =
static_cast<AliVTrack*
>(jet->Track(i));
1266 z = track->Pt() / TMath::Abs(corrPt);
1272 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1274 else if (type ==
kDCal) {
1275 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1281 const AliVCluster* clus =
nullptr;
1282 Int_t nClusters = jet->GetNumberOfClusters();
1283 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1284 clus = jet->Cluster(iClus);
1285 deltaEhadcorr += (clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy());
1288 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
1294 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
1315 const AliVCluster* clus;
1319 Double_t clusPhi = it.first.Phi_0_2pi();
1323 if (!clus->IsEMCAL()) {
1329 Int_t nTracksMatched = 0;
1330 const AliVTrack* track =
nullptr;
1331 for (
Int_t itrack=0; itrack < clus->GetNTracksMatched(); itrack++) {
1332 track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(itrack));
1337 Double_t trackPhi = TVector2::Phi_0_2pi(track->GetTrackPhiOnEMCal());
1338 Double_t trackEta = track->GetTrackEtaOnEMCal();
1339 Double_t deta = TMath::Abs(clusEta - trackEta);
1340 Double_t dphi = TMath::Abs(clusPhi - trackPhi);
1343 trackPSum += track->P();
1349 if (trackPSum > 1e-3) {
1350 EoverP = clus->GetNonLinCorrEnergy() / trackPSum;
1353 Double_t deltaE = clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy();
1355 if (trackPSum > 1e-3) {
1356 Rcorr = deltaE / trackPSum;
1358 Double_t RcorrClus = deltaE / clus->GetNonLinCorrEnergy();
1364 histname =
"ClusterHistograms/hM02";
1368 if (clus->GetM02() > 0.4) {
1369 histname =
"ClusterHistograms/hNcellsM02G04";
1372 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1373 histname =
"ClusterHistograms/hNcellsM02L04";
1381 histname =
"ClusterHistograms/hMatchedTrackPt";
1384 if (clus->GetM02() > 0.4) {
1385 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
1388 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1389 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
1394 histname =
"ClusterHistograms/hMatchedTrackN";
1397 if (clus->GetM02() > 0.4) {
1398 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
1401 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1402 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
1407 histname =
"ClusterHistograms/hM02Matched";
1408 if (nTracksMatched > 0) {
1413 histname =
"ClusterHistograms/hM02Unmatched";
1414 if (nTracksMatched == 0) {
1419 if (nTracksMatched == 1) {
1421 const AliVTrack* track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(0));
1423 Double_t trackEta = track->GetTrackEtaOnEMCal();
1424 Double_t deta = trackEta - clusEta;
1427 histname =
"ClusterHistograms/hDeltaEtaCentral";
1432 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
1443 histname =
"ClusterHistograms/hEoverPM02Central";
1447 histname =
"ClusterHistograms/hEoverPM02Peripheral";
1455 histname =
"ClusterHistograms/hRcorrVsCent";
1460 histname =
"ClusterHistograms/hRcorr0-10";
1466 histname =
"ClusterHistograms/hRcorr50-90";
1471 histname =
"ClusterHistograms/hRcorrClusVsCent";
1476 histname =
"ClusterHistograms/hRcorrClus0-10";
1482 histname =
"ClusterHistograms/hRcorrClus50-90";
1489 histname =
"ClusterHistograms/hTrackMultiplicity";
1502 const AliMCEvent* mcevent =
nullptr;
1504 mcevent = MCEvent();
1527 const AliVCluster* clus;
1528 std::vector<ContributorType> vecContributorTypes;
1529 std::vector<Int_t> vecContributorLabels;
1535 if (!clus->IsEMCAL()) {
1542 const Int_t nLabels = clus->GetNLabels();
1545 vecContributorTypes.clear();
1546 vecContributorLabels.clear();
1547 for (
Int_t iLabel=0; iLabel<nLabels; iLabel++) {
1549 Int_t label = clus->GetLabels()[iLabel];
1550 if (TMath::Abs(label) > 0) {
1553 vecContributorTypes.push_back(contributorType);
1554 vecContributorLabels.push_back(label);
1559 Int_t nLabelsPhysPrim = vecContributorTypes.size();
1561 if (nLabelsPhysPrim == 1) {
1563 contributorType = vecContributorTypes[0];
1565 if (contributorType ==
kPhoton) {
1568 else if (contributorType ==
kElectron) {
1574 else if (contributorType ==
kProton) {
1583 else if (contributorType ==
kK0L) {
1586 else if (contributorType ==
kNeutron) {
1597 else if (nLabelsPhysPrim == 2) {
1605 Double_t frac1 = clus->GetClusterMCEdepFraction(1);
1613 if (isHadron1 && isHadron2) {
1616 else if (isPhoton1 && isHadron2) {
1620 Double_t photonEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
1621 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
1624 else if (isHadron1 && isPhoton2) {
1628 Double_t hadronEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
1629 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
1632 else if (isPhoton1 && isPhoton2) {
1640 if (part1 && part2) {
1641 Int_t iMother1 = part1->GetMother();
1642 Int_t iMother2 = part2->GetMother();
1643 AliVParticle *mother1 = mcevent->GetTrack(iMother1);
1644 AliVParticle *mother2 = mcevent->GetTrack(iMother2);
1646 if (mother1 && mother2) {
1647 if ( (mother1->PdgCode() == 111) && (mother2->PdgCode() == 111) ) {
1648 if (iMother1 == iMother2) {
1660 else if (nLabelsPhysPrim > 2) {
1666 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
1667 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
1670 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
1671 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
1684 const AliVCluster* clus;
1686 for (
const auto jet : jets->
accepted()) {
1691 Double_t hadCaloEnergyUnmatched = 0;
1692 Double_t hadCaloEnergyMatchedNonlincorr = 0;
1693 Double_t hadCaloEnergyMatchedHadCorr = 0;
1696 Int_t nClusters = jet->GetNumberOfClusters();
1697 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1699 clus = jet->Cluster(iClus);
1703 Int_t label = TMath::Abs(clus->GetLabel());
1709 histname =
"JetPerformanceMC/hM02VsContributorTypeJets";
1710 Double_t x[4] = {clus->GetM02(), clus->GetNonLinCorrEnergy(), contributorType, jetPt};
1716 Bool_t hasMatchedTrack = (clus->GetNTracksMatched() > 0);
1718 if (hasMatchedTrack) {
1719 hadCaloEnergyMatchedNonlincorr += clus->GetNonLinCorrEnergy();
1720 hadCaloEnergyMatchedHadCorr += clus->GetHadCorrEnergy();
1723 hadCaloEnergyUnmatched += clus->GetNonLinCorrEnergy();
1732 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
1736 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
1740 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
1744 histname =
"JetPerformanceMC/hJetComposition";
1745 for (
Int_t type = 0; type < 8; type++) {
1752 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1754 clus = jet->Cluster(iClus);
1756 Int_t label = TMath::Abs(clus->GetLabel());
1761 if (type == contributorType) {
1763 pTsum += clus->GetNonLinCorrEnergy();
1768 Double_t x[4] = {jetPt, 1.*type, nSum, pTsum};
1788 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
1789 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
1790 Double_t phiMinDCal =
fGeom->GetDCALPhiMin() * TMath::DegToRad();
1791 Double_t phiMaxDCal =
fGeom->GetDCALPhiMax() * TMath::DegToRad();
1793 Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
1794 Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
1795 Double_t accDCal = 2 * (etaEMCal - etaMinDCal) * (phiMaxDCal - phiMinDCal);
1800 while ((jetCont = static_cast<AliJetContainer*>(nextJetColl()))) {
1803 TRandom3* r =
new TRandom3(0);
1805 Double_t etaEMCalfid = etaEMCal - jetR;
1806 Double_t etaMinDCalfid = etaMinDCal + jetR;
1807 Double_t phiMinEMCalfid = phiMinEMCal + jetR;
1808 Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
1809 Double_t phiMinDCalfid = phiMinDCal + jetR;
1810 Double_t phiMaxDCalfid = phiMaxDCal - jetR;
1811 Double_t accEMCalfid = 2 * etaEMCalfid * (phiMaxEMCalfid - phiMinEMCalfid);
1812 Double_t accDCalfid = 2 * (etaEMCalfid - etaMinDCalfid) * (phiMaxDCalfid - phiMinDCalfid);
1813 if ( (etaEMCalfid - etaMinDCalfid) < 0) {
1818 Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
1819 Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
1822 Double_t etaDCalRC = r->Uniform(etaMinDCalfid, etaEMCalfid);
1823 Double_t sign = r->Uniform(-1., 1.);
1825 etaDCalRC = -1*etaDCalRC;
1827 Double_t phiDCalRC = r->Uniform(phiMinDCalfid, phiMaxDCalfid);
1854 while ((partCont = static_cast<AliParticleContainer*>(nextPartCont()))) {
1856 TString partContName = partCont->GetName();
1857 if (!partContName.CompareTo(
"tracks")) {
1863 track = trackIterator.first;
1864 trackEta = track.Eta();
1866 trackPt = track.Pt();
1869 if (TMath::Abs(trackEta) < etaTPC) {
1870 trackPtSumTPC += trackPt;
1874 if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
1875 trackPtSumEMCal += trackPt;
1879 if (TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinEMCalfid && trackPhi < phiMaxEMCalfid) {
1880 trackPtSumEMCalfid += trackPt;
1884 if (TMath::Abs(trackEta) > etaMinDCal && TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinDCal && trackPhi < phiMaxDCal) {
1885 trackPtSumDCal += trackPt;
1889 if (TMath::Abs(trackEta) > etaMinDCalfid && TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinDCalfid && trackPhi < phiMaxDCalfid) {
1890 trackPtSumDCalfid += trackPt;
1894 deltaR =
GetDeltaR(&track, etaEMCalRC, phiEMCalRC);
1895 if (deltaR < jetR) {
1896 trackPtSumEMCalRC += trackPt;
1900 deltaR =
GetDeltaR(&track, etaDCalRC, phiDCalRC);
1901 if (deltaR < jetR) {
1902 trackPtSumDCalRC += trackPt;
1920 clus = clusIterator.first;
1921 clusEta = clus.Eta();
1926 if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
1927 clusPtSumEMCal += clusPt;
1931 if (TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinEMCalfid && clusPhi < phiMaxEMCalfid) {
1932 clusPtSumEMCalfid += clusPt;
1936 if (TMath::Abs(clusEta) > etaMinDCal && TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinDCal && clusPhi < phiMaxDCal) {
1937 clusPtSumDCal += clusPt;
1941 if (TMath::Abs(clusEta) > etaMinDCalfid && TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinDCalfid && clusPhi < phiMaxDCalfid) {
1942 clusPtSumDCalfid += clusPt;
1946 deltaR =
GetDeltaR(&clus, etaEMCalRC, phiEMCalRC);
1947 if (deltaR < jetR) {
1948 clusPtSumEMCalRC += clusPt;
1952 deltaR =
GetDeltaR(&clus, etaDCalRC, phiDCalRC);
1953 if (deltaR < jetR) {
1954 clusPtSumDCalRC += clusPt;
1962 Double_t numerator = (trackPtSumEMCal + clusPtSumEMCal) / accEMCal;
1963 Double_t denominator = trackPtSumTPC / accTPC;
1964 Double_t scaleFactor = numerator / denominator;
1965 TString histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
1969 if (accEMCalfid > 1e-3) {
1970 numerator = (trackPtSumEMCalfid + clusPtSumEMCalfid) / accEMCalfid;
1971 scaleFactor = numerator / denominator;
1972 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jetCont->GetArrayName().Data());
1977 numerator = (trackPtSumDCal + clusPtSumDCal) / accDCal;
1978 scaleFactor = numerator / denominator;
1979 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jetCont->GetArrayName().Data());
1983 if (accDCalfid > 1e-3) {
1984 numerator = (trackPtSumDCalfid + clusPtSumDCalfid) / accDCalfid;
1985 scaleFactor = numerator / denominator;
1986 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jetCont->GetArrayName().Data());
1994 Double_t deltaPt = trackPtSumEMCalRC + clusPtSumEMCalRC - rho * TMath::Pi() * jetR * jetR;
1995 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
1999 if (accDCalfid > 1e-3) {
2000 deltaPt = trackPtSumDCalRC + clusPtSumDCalRC - rho * TMath::Pi() * jetR * jetR;
2001 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jetCont->GetArrayName().Data());
2020 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2021 TString jetContName = jets->GetName();
2026 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
2030 for (
auto jet : jets->
all()) {
2036 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
2040 UInt_t rejectionReason = 0;
2041 if (!jets->
AcceptJet(jet, rejectionReason)) {
2042 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
2043 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
2055 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
2057 else if (type ==
kDCal) {
2058 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
2063 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
2068 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
2070 else if (type ==
kDCal) {
2071 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
2073 TLorentzVector leadPart;
2076 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2081 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
2083 else if (type ==
kDCal) {
2084 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
2086 const AliVTrack* track;
2087 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
2088 track =
static_cast<AliVTrack*
>(jet->Track(i));
2089 z = track->Pt() / TMath::Abs(corrPt);
2095 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
2097 else if (type ==
kDCal) {
2098 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
2117 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2118 TString jetContName = jets->GetName();
2121 if (jetContName.Contains(
"mcparticles")) {
2130 for (
auto jet : jets->
accepted()) {
2134 if (!matchedPartLevelJet) {
2145 Float_t truthPt = matchedPartLevelJet->
Pt();
2149 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
2151 else if (type ==
kDCal) {
2152 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
2158 histname =
"MatchedJetHistograms/hJESshiftEMCal";
2160 else if (type ==
kDCal) {
2161 histname =
"MatchedJetHistograms/hJESshiftDCal";
2166 histname =
"MatchedJetHistograms/hNEFVsPt";
2170 histname =
"MatchedJetHistograms/hZLeadingVsPt";
2171 TLorentzVector leadPart;
2174 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2178 histname =
"MatchedJetHistograms/hMatchingDistance";
2182 histname =
"MatchedJetHistograms/hMatchingDistancepp";
2199 TString histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
2200 UInt_t rejectionReason = 0;
2203 return contributorType;
2206 if (part->GetGeneratorIndex() == 0) {
2214 else if (TMath::Abs(pdg) == 211) {
2217 else if (pdg == 2212) {
2220 else if (pdg == -2212) {
2223 else if (TMath::Abs(pdg) == 321) {
2226 else if (pdg == 130) {
2227 contributorType =
kK0L;
2229 else if (pdg == 2112) {
2232 else if (pdg == -2112) {
2235 else if (TMath::Abs(pdg) == 11) {
2238 else if (TMath::Abs(pdg) == 13) {
2239 contributorType =
kMuon;
2242 contributorType =
kOther;
2246 return contributorType;
2255 Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
2256 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
2315 bool returnValue =
false;
2322 AliDebugStream(4) <<
"Jet is matched!\nJet: " << jet->
toString() <<
"\n";
2328 AliDebugStream(4) <<
"Jet rejected due to shared momentum fraction of " << sharedFraction <<
", which is smaller than the min momentum fraction of " <<
fMinSharedMomentumFraction <<
"\n";
2329 returnValue =
false;
2332 AliDebugStream(4) <<
"Passed shared momentum fraction with value of " << sharedFraction <<
"\n";
2339 if (!partLevelJet) {
2340 AliDebugStream(4) <<
"Jet rejected due to no matching part level jet.\n";
2341 returnValue =
false;
2344 AliDebugStream(4) <<
"Det level jet has a required match to a part level jet.\n" <<
"Part level jet: " << partLevelJet->
toString() <<
"\n";
2352 AliDebugStream(4) <<
"Jet rejected due to matching distance of " << matchedJetDistance <<
", which is larger than the max distance of " <<
fMaxMatchedJetDistance <<
"\n";
2353 returnValue =
false;
2356 AliDebugStream(4) <<
"Jet passed distance cut with distance of " << matchedJetDistance <<
"\n";
2362 if (returnValue ==
true) {
2367 AliDebugStream(5) <<
"Rejected jet because it was not matched to a external event jet.\n";
2369 returnValue =
false;
2373 return partLevelJet;
2382 const char *ntracks,
2383 const char *nclusters,
2384 const char *nGenLev,
2394 ::Error(
"AddTaskEmcalJetPerformance",
"No analysis manager to connect to.");
2400 AliVEventHandler* handler = mgr->GetInputEventHandler();
2403 ::Error(
"AddTaskEmcalJetPerformance",
"This task requires an input event handler");
2415 if (handler->InheritsFrom(
"AliESDInputHandler")) {
2418 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
2429 if (trackName ==
"usedefault") {
2430 if (dataType ==
kESD) {
2431 trackName =
"Tracks";
2433 else if (dataType == kAOD) {
2434 trackName =
"tracks";
2441 if (clusName ==
"usedefault") {
2442 if (dataType ==
kESD) {
2443 clusName =
"CaloClusters";
2445 else if (dataType == kAOD) {
2446 clusName =
"caloClusters";
2453 TString name(
"AliAnalysisTaskEmcalJetPerformance");
2454 if (!trackName.IsNull()) {
2458 if (!clusName.IsNull()) {
2462 if (strcmp(suffix,
"") != 0) {
2475 if (trackName ==
"mcparticles") {
2477 partCont = mcpartCont;
2479 else if (trackName ==
"tracks" || trackName ==
"Tracks") {
2481 partCont = trackCont;
2487 if (nGenLev && strcmp(nGenLev,
"")!=0) {
2495 if (!clusName.IsNull()) {
2509 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
2511 contname +=
"_histos";
2512 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
2513 TList::Class(),AliAnalysisManager::kOutputContainer,
2514 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
2515 mgr->ConnectInput (task, 0, cinput1 );
2516 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.
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
TString part
use mixed event to constrain combinatorial background
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.
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.
DCal acceptance – spans ONLY DCal (no PHOS or gap)
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.
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
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()