30 #include <TClonesArray.h> 35 #include <THnSparse.h> 40 #include <AliVCluster.h> 41 #include <AliVParticle.h> 43 #include "AliAnalysisManager.h" 44 #include <AliVEventHandler.h> 51 #include "AliEMCALGeometry.h" 52 #include "AliOADBContainer.h" 54 #include "AliEMCALTriggerPatchInfo.h" 56 #include "AliMCEvent.h" 69 fPlotJetHistograms(kFALSE),
70 fPlotClusterHistograms(kFALSE),
71 fPlotCellNonlinearityHistograms(kFALSE),
72 fPlotParticleCompositionHistograms(kFALSE),
73 fComputeBackground(kFALSE),
74 fDoTriggerSimulation(kFALSE),
75 fPlotMatchedJetHistograms(kFALSE),
76 fComputeMBDownscaling(kFALSE),
78 fDoClosureTest(kFALSE),
79 fFillChargedFluctuations(kFALSE),
92 fTrackMatchingDeltaEtaMax(0.015),
93 fTrackMatchingDeltaPhiMax(0.030),
98 fDoTriggerResponse(kFALSE),
99 fDoJetMatchingGeometrical(kFALSE),
100 fDoJetMatchingMCFraction(kFALSE),
104 fDetJetContainerPPIntermediate(
nullptr),
105 fRequireMatchedJetAccepted(kFALSE),
107 fMinSharedMomentumFraction(0.5),
108 fMCJetMinMatchingPt(0.15),
109 fPlotJetMatchCandThresh(1.),
110 fUseAliEventCuts(kTRUE),
113 fUseManualEventCuts(kFALSE),
243 fEventCuts.fUseVariablesCorrelationCuts =
true;
258 Printf(
"Geometrical jet matching enabled.");
260 for (
Int_t i=0; i<2; i++) {
262 TString jetContName = jetCont->GetName();
263 if (jetContName.Contains(
"mcparticles")) {
273 Printf(
"MC-fraction jet matching enabled.");
275 for (
Int_t i=0; i<3; i++) {
277 TString jetContName = jetCont->GetName();
278 if (jetContName.Contains(
"mcparticles")) {
281 else if (jetContName.Contains(
"Combined")) {
292 Printf(
"No MC jet container found!");
297 Printf(
"No det-level jet container found!");
303 Printf(
"No intermediate pp det-level jet container found, despite MC-fraction matching enabled!");
335 if (embeddingHelper) {
344 while ((obj = next())) {
366 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
375 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
377 title = histname +
";Centrality (%);Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
378 TH3* hist =
fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, 32, 0, 32, nPtBins5,
fMinPt,
fMaxPt);
381 title = histname +
";Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
388 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
390 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
394 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
404 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
406 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
407 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
410 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});NEF";
415 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
417 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
418 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
421 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});NEF";
428 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
429 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
430 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, 0, 100, nPtBins2,
fMinPt,
fMaxPt, 2, -0.5, 1.5,
"s");
434 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
436 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
437 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, nPtBins2,
fMinPt,
fMaxPt,
fMaxPt, 0,
fMaxPt);
440 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
445 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
447 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}/#piR^{2}";
448 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, nPtBins2,
fMinPt,
fMaxPt, 75, 0, 3);
451 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}/#piR^{2}";
456 nbinsx = 20; minx = 0; maxx = 100;
458 nbinsz = 50; minz = 0; maxz = 1.;
460 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
462 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
463 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
466 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
471 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
473 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
474 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
477 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
483 nbinsx = 20; minx = 0; maxx = 100;
485 nbinsz = 50; minz = 0; maxz = 1.;
487 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
489 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
490 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
493 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
498 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
500 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
501 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
504 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
510 nbinsx = 20; minx = 0; maxx = 100;
512 nbinsz = 50; minz = 0; maxz =
fMaxPt;
514 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
516 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
517 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
520 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
525 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
527 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
528 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
531 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
538 nbinsx = 20; minx = 0; maxx = 100;
541 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
542 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
545 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
546 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
552 nbinsx = 20; minx = 0; maxx = 100;
556 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
557 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#sum#it{E}_{nonlincorr} - #it{E}_{hadcorr}";
558 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
563 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
564 title = histname +
";#it{E}_{patch,med};type;#it{p}_{T}^{corr} (GeV/#it{c});Centrality (%)";
565 Int_t nbins5[4] = {100, 2, nPtBins2, 50};
575 histname =
"Trigger/hMBDownscaleFactor";
576 title = histname +
";Downscale factor;counts";
590 const Int_t nRcorrBins = 50;
592 const Int_t nCellBins = 30;
594 const Int_t nMatchedTrackBins = 5;
596 const Int_t nDeltaEtaBins = 60;
603 histname =
"ClusterHistograms/hM02";
604 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
608 histname =
"ClusterHistograms/hNcellsM02G04";
609 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
612 histname =
"ClusterHistograms/hNcellsM02L04";
613 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
620 histname =
"ClusterHistograms/hMatchedTrackPt";
621 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
624 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
625 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
628 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
629 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
633 histname =
"ClusterHistograms/hMatchedTrackN";
634 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
637 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
638 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
641 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
642 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
646 histname =
"ClusterHistograms/hM02Matched";
647 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
651 histname =
"ClusterHistograms/hM02Unmatched";
652 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
656 histname =
"ClusterHistograms/hDeltaEtaCentral";
657 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
660 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
661 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
668 histname =
"ClusterHistograms/hEoverPM02Central";
669 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
672 histname =
"ClusterHistograms/hEoverPM02Peripheral";
673 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
680 histname =
"ClusterHistograms/hRcorrVsCent";
681 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
685 histname =
"ClusterHistograms/hRcorr0-10";
686 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
690 histname =
"ClusterHistograms/hRcorr50-90";
691 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
695 histname =
"ClusterHistograms/hRcorrClusVsCent";
696 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
700 histname =
"ClusterHistograms/hRcorrClus0-10";
701 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
705 histname =
"ClusterHistograms/hRcorrClus50-90";
706 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
710 histname =
"ClusterHistograms/hTrackMultiplicity";
711 htitle = histname +
";N_{tracks};Centrality (%)";
725 histname =
"CellNonlinearityHistograms/hClusterNonlinearity";
726 htitle = histname +
";E_{cluster}; E_{NonLinCorr}/E";
730 histname =
"CellNonlinearityHistograms/hCellNonlinearity";
731 htitle = histname +
";E_{cell}; E_{NonLinCorr}/E";
735 histname =
"CellNonlinearityHistograms/hLeadingCellNonlinearity";
736 htitle = histname +
";E_{leading cell}; E_{NonLinCorr}/E";
750 const Int_t nRejBins = 32;
753 const Int_t nContributorTypes = 11;
755 const Int_t nParticleTypes = 17;
758 AliEmcalContainer* cont = 0;
760 while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) {
762 histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
763 htitle = histname +
";Rejection reason;#it{E}_{clus} (GeV/)";
769 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
770 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
774 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
775 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
780 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
781 htitle = histname +
";Centrality (%);M02;#it{E}_{photon} (GeV)";
785 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
786 htitle = histname +
";Centrality (%);M02;#it{E}_{hadron} (GeV)";
802 min[dim] = fM02HistBins[0];
806 title[dim] =
"#it{E}_{clus} (GeV)";
809 min[dim] = fPtHistBins[0];
813 title[dim] =
"Contributor type";
814 nbins[dim] = nContributorTypes;
817 binEdges[dim] = contributorTypeBins;
820 title[dim] =
"#it{p}_{T,jet}^{corr}";
827 TString thnname =
"JetPerformanceMC/hM02VsContributorTypeJets";
829 for (
Int_t i = 0; i < dim; i++) {
830 hn->GetAxis(i)->SetTitle(title[i]);
831 hn->SetBinEdges(i, binEdges[i]);
838 title[dim] =
"#it{p}_{T,jet}^{corr}";
845 title[dim] =
"Contributor type";
846 nbins[dim] = nContributorTypes;
849 binEdges[dim] = contributorTypeBins;
859 title[dim] =
"#it{p}_{T,sum} (GeV)";
862 min[dim] = fPtHistBins[0];
866 thnname =
"JetPerformanceMC/hJetComposition";
868 for (
Int_t i = 0; i < dim; i++) {
869 thn->GetAxis(i)->SetTitle(title[i]);
870 thn->SetBinEdges(i, binEdges[i]);
876 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
877 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
881 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
882 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
886 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
887 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
899 axis->SetBinLabel(1,
"SinglePhoton");
900 axis->SetBinLabel(2,
"SingleElectron");
901 axis->SetBinLabel(3,
"SingleChargedPion");
902 axis->SetBinLabel(4,
"SingleProton");
903 axis->SetBinLabel(5,
"SingleAntiProton");
904 axis->SetBinLabel(6,
"SingleChargedKaon");
905 axis->SetBinLabel(7,
"SingleK0L");
906 axis->SetBinLabel(8,
"SingleNeutron");
907 axis->SetBinLabel(9,
"SingleAntiNeutron");
908 axis->SetBinLabel(10,
"SingleOther");
909 axis->SetBinLabel(11,
"PhotonHadron");
910 axis->SetBinLabel(12,
"HadronPhoton");
911 axis->SetBinLabel(13,
"MergedPi0");
912 axis->SetBinLabel(14,
"PhotonPhotonOther");
913 axis->SetBinLabel(15,
"HadronHadron");
914 axis->SetBinLabel(16,
"TwoContributorsOther");
915 axis->SetBinLabel(17,
"MoreThanTwoContributors");
929 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
932 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
933 title = histname +
";Centrality;Scale factor;counts";
935 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
937 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
941 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
944 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCalExcl", jets->GetArrayName().Data());
946 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
950 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
954 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCalCharged", jets->GetArrayName().Data());
956 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
960 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
963 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCalChargedExcl", jets->GetArrayName().Data());
965 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
969 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
973 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jets->GetArrayName().Data());
974 title = histname +
";Centrality;Scale factor;counts";
979 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jets->GetArrayName().Data());
980 title = histname +
";Centrality;Scale factor;counts";
983 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jets->GetArrayName().Data());
984 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
987 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jets->GetArrayName().Data());
988 title = histname +
";Centrality;Scale factor;counts";
1011 histname =
"TriggerSimHistograms/hEtaVsPhi";
1012 title = histname +
";#eta_{patch} (rad);#phi_{patch} (rad)";
1016 histname =
"TriggerSimHistograms/hNPatches";
1017 title = histname +
";#it{N}_{patches};type";
1021 histname =
"TriggerSimHistograms/hPatchE";
1022 title = histname +
";Centrality (%);#it{E}_{patch} (GeV)";
1026 histname =
"TriggerSimHistograms/hPatchMedianE";
1027 title = histname +
";Centrality (%);#it{E}_{patch,med} (GeV);type";
1028 fHistManager.
CreateTH3(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 50, 2, -0.5, 1.5);
1031 histname =
"TriggerSimHistograms/hMaxPatchResponseMatrix";
1032 title = histname +
";#it{E}_{maxpatch,det} (GeV);#it{E}_{maxpatch,truth} (GeV)";
1035 histname =
"TriggerSimHistograms/hEMCalEnergyResponseMatrix";
1036 title = histname +
";#Sigma#it{E}_{clus,EMCal} (GeV);#it{E}_{EMCal,truth} (GeV)";
1044 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1047 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1048 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
1054 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
1055 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
1064 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
1065 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
1066 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1069 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
1070 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
1071 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1075 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1076 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
1080 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
1081 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}/#piR^{2}";
1085 nbinsx = 20; minx = 0; maxx = 100;
1087 nbinsz = 50; minz = 0; maxz = 1.;
1089 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1090 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
1091 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1094 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1095 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
1096 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1100 nbinsx = 20; minx = 0; maxx = 100;
1102 nbinsz = 50; minz = 0; maxz = 1.;
1104 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1105 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
1106 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1109 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1110 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
1111 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1115 nbinsx = 20; minx = 0; maxx = 100;
1117 nbinsz = 50; minz = 0; maxz =
fMaxPt;
1119 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1120 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
1121 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1124 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1125 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
1126 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1147 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
1149 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1150 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1153 title = histname +
";#it{p}_{T,corr}^{det} (GeV/#it{c});#it{p}_{T}^{truth} (GeV/#it{c})";
1158 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
1160 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1161 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1164 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1170 nbinsx = 20; minx = 0; maxx = 100;
1171 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1172 nbinsz = 250; minz = -5.; maxz = 5.;
1174 histname =
"MatchedJetHistograms/hJESshiftEMCal";
1176 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1177 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1180 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1185 histname =
"MatchedJetHistograms/hJESshiftDCal";
1187 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1188 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1191 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1197 nbinsx = 20; minx = 0; maxx = 100;
1199 nbinsz = 50; minz = 0; maxz = 1.;
1201 histname =
"MatchedJetHistograms/hNEFVsPt";
1203 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});Calo energy fraction";
1204 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1207 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});Calo energy fraction";
1212 nbinsx = 20; minx = 0; maxx = 100;
1213 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1214 nbinsz = 50; minz = 0; maxz = 1.;
1216 histname =
"MatchedJetHistograms/hZLeadingVsPt";
1218 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{z}_{leading}";
1219 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1222 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#it{z}_{leading}";
1230 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1231 nbinsz = 100; minz = 0; maxz = 4.;
1232 histname =
"MatchedJetHistograms/hMatchingDistance";
1233 title = histname +
";#it{p}_{T}^{det} (GeV/#it{c});#it{p}_{T}^{truth} (GeV/#it{c});R";
1234 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1237 histname =
"MatchedJetHistograms/fHistJetMatchingQA";
1239 std::vector<std::string> binLabels = {
"noMatch",
"matchedJet",
"uniqueMatch",
"jetDistance",
"passedAllCuts"};
1240 auto histMatchedJetCuts =
fHistManager.
CreateTH1(histname.Data(), title.Data(), binLabels.size(), 0, binLabels.size());
1242 for (
unsigned int i = 1; i <= binLabels.size(); i++) {
1243 histMatchedJetCuts->GetXaxis()->SetBinLabel(i, binLabels.at(i-1).c_str());
1245 histMatchedJetCuts->GetYaxis()->SetTitle(
"Number of jets");
1252 nbinsy = 20; miny = 0; maxy = 1.;
1253 nbinsz = 100; minz = 0; maxz = 4.;
1254 histname =
"MatchedJetHistograms/hMatchingDistanceVsMCFraction";
1255 title = histname +
";#it{p}_{T}^{det} (GeV/#it{c});MC fraction;#DeltaR";
1256 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1259 histname =
"MatchedJetHistograms/fHistJetMatchingQA";
1261 std::vector<std::string> binLabels = {
"noMatch",
"matchedJet",
"sharedMomentumFraction",
"partLevelMatchedJet",
"jetDistancePPdet",
"jetDistancePPtruth",
"passedAllCuts"};
1262 auto histMatchedJetCuts =
fHistManager.
CreateTH1(histname.Data(), title.Data(), binLabels.size(), 0, binLabels.size());
1264 for (
unsigned int i = 1; i <= binLabels.size(); i++) {
1265 histMatchedJetCuts->GetXaxis()->SetBinLabel(i, binLabels.at(i-1).c_str());
1267 histMatchedJetCuts->GetYaxis()->SetTitle(
"Number of jets");
1292 TClass cls(objname);
1293 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1294 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1295 GetName(), cls.GetName(),
"EmcalTriggers"));
1300 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1320 TString triggerNameMB1 =
"CINT7-B-NOPF-CENT";
1321 TString triggerNameMB2 =
"CV0L7-B-NOPF-CENT";
1322 TString triggerNameJE =
"CINT7EJ1-B-NOPF-CENTNOPMD";
1327 for (
auto i : runtriggers) {
1328 if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
1337 TString histname =
"Trigger/hMBDownscaleFactor";
1375 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
1376 TString jetContName = jetCont->GetName();
1410 TClass cls(objname);
1411 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1412 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1413 GetName(), cls.GetName(),
"EmcalTriggers"));
1418 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1423 std::vector<Double_t> vecEMCal;
1424 std::vector<Double_t> vecDCal;
1427 AliEMCALTriggerPatchInfo *maxPatch =
nullptr;
1429 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1432 if(!recpatch->IsJetHighSimple())
continue;
1434 patchE = recpatch->GetPatchE();
1436 histname =
"TriggerSimHistograms/hEtaVsPhi";
1439 histname =
"TriggerSimHistograms/hPatchE";
1442 if (recpatch->IsEMCal()) {
1443 vecEMCal.push_back(patchE);
1444 if (patchE > maxPatchEnergy) {
1445 maxPatchEnergy = patchE;
1446 maxPatch = recpatch;
1449 vecDCal.push_back(patchE);
1456 const Int_t nBkgPatchesEMCal = vecEMCal.size();
1457 const Int_t nBkgPatchesDCal = vecDCal.size();
1458 fMedianEMCal = TMath::Median(nBkgPatchesEMCal, &vecEMCal[0]);
1459 fMedianDCal = TMath::Median(nBkgPatchesDCal, &vecDCal[0]);
1461 histname =
"TriggerSimHistograms/hPatchMedianE";
1465 histname =
"TriggerSimHistograms/hNPatches";
1472 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
1473 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
1484 part = mcpart.first;
1485 partEta = part.Eta();
1489 if (partPhi < maxPatch->GetPhiMax() && partPhi > maxPatch->GetPhiMin()) {
1490 if (partEta < maxPatch->GetEtaMax() && partEta > maxPatch->GetEtaMin()) {
1491 truthEnergyPatch += partE;
1495 if (partPhi < phiMaxEMCal && partPhi > phiMinEMCal) {
1496 if (partEta < 0.7 && partEta > -0.7) {
1497 truthEnergyEMCal += partE;
1503 const AliVCluster* clus;
1508 clusFourVec.Clear();
1509 clusFourVec = clusIterator.first;
1510 clusEta = clusFourVec.Eta();
1512 clus = clusIterator.second;
1513 if (clus->IsEMCAL()) {
1514 if (clusPhi < phiMaxEMCal && clusPhi > phiMinEMCal) {
1515 if (clusEta < 0.7 && clusEta > -0.7) {
1516 detEnergyEMCal += clusFourVec.E();
1523 histname =
"TriggerSimHistograms/hMaxPatchResponseMatrix";
1527 histname =
"TriggerSimHistograms/hEMCalEnergyResponseMatrix";
1536 for(
auto p : *fTriggerPatchInfo){
1537 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1540 if(!recpatch->IsJetHighSimple())
continue;
1542 if (recpatch->IsEMCal()) {
1543 if ((recpatch->GetPatchE() -
fMedianDCal) > threshold) {
1548 if ((recpatch->GetPatchE() -
fMedianEMCal) > threshold) {
1599 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1600 TString jetContName = jets->GetName();
1611 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1615 for (
auto jet : jets->
all()) {
1630 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1639 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1649 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1651 else if (type ==
kDCal) {
1652 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1654 TLorentzVector leadPart;
1657 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
1666 UInt_t rejectionReason = 0;
1667 if (!jets->
AcceptJet(jet, rejectionReason)) {
1668 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1673 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), corrPt);
1680 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
1682 else if (type ==
kDCal) {
1683 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
1694 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1700 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1702 else if (type ==
kDCal) {
1703 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1705 const AliVTrack* track;
1706 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1707 track =
static_cast<AliVTrack*
>(jet->Track(i));
1708 z = track->Pt() / TMath::Abs(corrPt);
1719 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1721 else if (type ==
kDCal) {
1722 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1734 if (jet->Eta() > 0) {
1735 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
1738 else if (jet->Eta() < 0) {
1739 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
1748 const AliVCluster* clus =
nullptr;
1749 Int_t nClusters = jet->GetNumberOfClusters();
1750 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1751 clus = jet->Cluster(iClus);
1752 deltaEhadcorr += (clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy());
1755 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
1762 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
1783 const AliVCluster* clus;
1787 Double_t clusPhi = it.first.Phi_0_2pi();
1791 if (!clus->IsEMCAL()) {
1797 Int_t nTracksMatched = 0;
1798 const AliVTrack* track =
nullptr;
1799 for (
Int_t itrack=0; itrack < clus->GetNTracksMatched(); itrack++) {
1800 track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(itrack));
1805 Double_t trackPhi = TVector2::Phi_0_2pi(track->GetTrackPhiOnEMCal());
1806 Double_t trackEta = track->GetTrackEtaOnEMCal();
1807 Double_t deta = TMath::Abs(clusEta - trackEta);
1808 Double_t dphi = TMath::Abs(clusPhi - trackPhi);
1811 trackPSum += track->P();
1817 if (trackPSum > 1e-3) {
1818 EoverP = clus->GetNonLinCorrEnergy() / trackPSum;
1821 Double_t deltaE = clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy();
1823 if (trackPSum > 1e-3) {
1824 Rcorr = deltaE / trackPSum;
1826 Double_t RcorrClus = deltaE / clus->GetNonLinCorrEnergy();
1832 histname =
"ClusterHistograms/hM02";
1836 if (clus->GetM02() > 0.4) {
1837 histname =
"ClusterHistograms/hNcellsM02G04";
1840 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1841 histname =
"ClusterHistograms/hNcellsM02L04";
1849 histname =
"ClusterHistograms/hMatchedTrackPt";
1852 if (clus->GetM02() > 0.4) {
1853 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
1856 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1857 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
1862 histname =
"ClusterHistograms/hMatchedTrackN";
1865 if (clus->GetM02() > 0.4) {
1866 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
1869 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1870 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
1875 histname =
"ClusterHistograms/hM02Matched";
1876 if (nTracksMatched > 0) {
1881 histname =
"ClusterHistograms/hM02Unmatched";
1882 if (nTracksMatched == 0) {
1887 if (nTracksMatched == 1) {
1889 const AliVTrack* track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(0));
1891 Double_t trackEta = track->GetTrackEtaOnEMCal();
1892 Double_t deta = trackEta - clusEta;
1895 histname =
"ClusterHistograms/hDeltaEtaCentral";
1900 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
1911 histname =
"ClusterHistograms/hEoverPM02Central";
1915 histname =
"ClusterHistograms/hEoverPM02Peripheral";
1923 histname =
"ClusterHistograms/hRcorrVsCent";
1928 histname =
"ClusterHistograms/hRcorr0-10";
1934 histname =
"ClusterHistograms/hRcorr50-90";
1939 histname =
"ClusterHistograms/hRcorrClusVsCent";
1944 histname =
"ClusterHistograms/hRcorrClus0-10";
1950 histname =
"ClusterHistograms/hRcorrClus50-90";
1957 histname =
"ClusterHistograms/hTrackMultiplicity";
1972 const AliVCluster* clus;
1979 if (!clus->IsEMCAL()) {
1987 Double_t clusEnergyNonLinCorr = clus->GetNonLinCorrEnergy();
1988 Double_t correctionFactor = clusEnergyNonLinCorr/clusEnergy;
1991 TString histname =
"CellNonlinearityHistograms/hClusterNonlinearity";
1995 histname =
"CellNonlinearityHistograms/hCellNonlinearity";
1997 for (
Int_t iCell = 0; iCell < clus->GetNCells(); iCell++) {
1999 Int_t absId = clus->GetCellAbsId(iCell);
2001 if (eCell > leadEcell) {
2009 histname =
"CellNonlinearityHistograms/hLeadingCellNonlinearity";
2022 const AliMCEvent* mcevent =
nullptr;
2024 mcevent = MCEvent();
2047 const AliVCluster* clus;
2048 std::vector<ContributorType> vecContributorTypes;
2049 std::vector<Int_t> vecContributorLabels;
2055 if (!clus->IsEMCAL()) {
2062 const Int_t nLabels = clus->GetNLabels();
2065 vecContributorTypes.clear();
2066 vecContributorLabels.clear();
2067 for (
Int_t iLabel=0; iLabel<nLabels; iLabel++) {
2069 Int_t label = clus->GetLabels()[iLabel];
2070 if (TMath::Abs(label) > 0) {
2073 vecContributorTypes.push_back(contributorType);
2074 vecContributorLabels.push_back(label);
2079 Int_t nLabelsPhysPrim = vecContributorTypes.size();
2081 if (nLabelsPhysPrim == 1) {
2083 contributorType = vecContributorTypes[0];
2085 if (contributorType ==
kPhoton) {
2088 else if (contributorType ==
kElectron) {
2094 else if (contributorType ==
kProton) {
2103 else if (contributorType ==
kK0L) {
2106 else if (contributorType ==
kNeutron) {
2117 else if (nLabelsPhysPrim == 2) {
2125 Double_t frac1 = clus->GetClusterMCEdepFraction(1);
2133 if (isHadron1 && isHadron2) {
2136 else if (isPhoton1 && isHadron2) {
2140 Double_t photonEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
2141 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
2144 else if (isHadron1 && isPhoton2) {
2148 Double_t hadronEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
2149 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
2152 else if (isPhoton1 && isPhoton2) {
2160 if (part1 && part2) {
2161 Int_t iMother1 = part1->GetMother();
2162 Int_t iMother2 = part2->GetMother();
2163 AliVParticle *mother1 = mcevent->GetTrack(iMother1);
2164 AliVParticle *mother2 = mcevent->GetTrack(iMother2);
2166 if (mother1 && mother2) {
2167 if ( (mother1->PdgCode() == 111) && (mother2->PdgCode() == 111) ) {
2168 if (iMother1 == iMother2) {
2180 else if (nLabelsPhysPrim > 2) {
2186 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
2187 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
2190 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
2191 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
2204 const AliVCluster* clus;
2206 for (
const auto jet : jets->
accepted()) {
2211 Double_t hadCaloEnergyUnmatched = 0;
2212 Double_t hadCaloEnergyMatchedNonlincorr = 0;
2213 Double_t hadCaloEnergyMatchedHadCorr = 0;
2216 Int_t nClusters = jet->GetNumberOfClusters();
2217 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
2219 clus = jet->Cluster(iClus);
2223 Int_t label = TMath::Abs(clus->GetLabel());
2229 histname =
"JetPerformanceMC/hM02VsContributorTypeJets";
2230 Double_t x[4] = {clus->GetM02(), clus->GetNonLinCorrEnergy(), contributorType, jetPt};
2236 Bool_t hasMatchedTrack = (clus->GetNTracksMatched() > 0);
2238 if (hasMatchedTrack) {
2239 hadCaloEnergyMatchedNonlincorr += clus->GetNonLinCorrEnergy();
2240 hadCaloEnergyMatchedHadCorr += clus->GetHadCorrEnergy();
2243 hadCaloEnergyUnmatched += clus->GetNonLinCorrEnergy();
2252 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
2256 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
2260 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
2264 histname =
"JetPerformanceMC/hJetComposition";
2265 for (
Int_t type = 0; type < 8; type++) {
2272 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
2274 clus = jet->Cluster(iClus);
2276 Int_t label = TMath::Abs(clus->GetLabel());
2281 if (type == contributorType) {
2283 pTsum += clus->GetNonLinCorrEnergy();
2288 Double_t x[4] = {jetPt, 1.*type, nSum, pTsum};
2308 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
2309 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
2310 Double_t phiMinDCal =
fGeom->GetDCALPhiMin() * TMath::DegToRad();
2311 Double_t phiMaxDCal =
fGeom->GetDCALPhiMax() * TMath::DegToRad();
2313 Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
2314 Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
2315 Double_t accDCal = 2 * (etaEMCal - etaMinDCal) * (phiMaxDCal - phiMinDCal);
2320 while ((jetCont = static_cast<AliJetContainer*>(nextJetColl()))) {
2324 Int_t maxJetIds[] = {-1, -1};
2325 Float_t maxJetPts[] = { 0, 0};
2332 if (jet->
Pt() > maxJetPts[0]) {
2333 maxJetPts[1] = maxJetPts[0];
2334 maxJetIds[1] = maxJetIds[0];
2335 maxJetPts[0] = jet->
Pt();
2338 else if (jet->
Pt() > maxJetPts[1]) {
2339 maxJetPts[1] = jet->
Pt();
2345 TRandom3* r =
new TRandom3(0);
2347 Double_t etaEMCalfid = etaEMCal - jetR;
2348 Double_t etaMinDCalfid = etaMinDCal + jetR;
2349 Double_t phiMinEMCalfid = phiMinEMCal + jetR;
2350 Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
2351 Double_t phiMinDCalfid = phiMinDCal + jetR;
2352 Double_t phiMaxDCalfid = phiMaxDCal - jetR;
2353 Double_t accEMCalfid = 2 * etaEMCalfid * (phiMaxEMCalfid - phiMinEMCalfid);
2354 Double_t accDCalfid = 2 * (etaEMCalfid - etaMinDCalfid) * (phiMaxDCalfid - phiMinDCalfid);
2355 if ( (etaEMCalfid - etaMinDCalfid) < 0) {
2360 Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
2361 Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
2364 Double_t etaDCalRC = r->Uniform(etaMinDCalfid, etaEMCalfid);
2365 Double_t sign = r->Uniform(-1., 1.);
2367 etaDCalRC = -1*etaDCalRC;
2369 Double_t phiDCalRC = r->Uniform(phiMinDCalfid, phiMaxDCalfid);
2391 AliVParticle* track;
2398 while ((partCont = static_cast<AliParticleContainer*>(nextPartCont()))) {
2400 TString partContName = partCont->GetName();
2401 if (!partContName.CompareTo(
"tracks") || !partContName.CompareTo(
"thermalparticles")) {
2405 trackVec = trackIterator.first;
2406 trackEta = trackVec.Eta();
2408 trackPt = trackVec.Pt();
2410 track = trackIterator.second;
2411 TClonesArray* fTracksContArray = partCont->GetArray();
2412 trackID = fTracksContArray->IndexOf(track);
2415 if (TMath::Abs(trackEta) < etaTPC) {
2416 trackPtSumTPC += trackPt;
2420 if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
2421 trackPtSumEMCal += trackPt;
2425 if (TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinEMCalfid && trackPhi < phiMaxEMCalfid) {
2426 trackPtSumEMCalfid += trackPt;
2431 if (TMath::Abs(trackEta) > etaMinDCal && TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinDCal && trackPhi < phiMaxDCal) {
2432 trackPtSumDCal += trackPt;
2438 if (TMath::Abs(trackEta) > etaMinDCalfid && TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinDCalfid && trackPhi < phiMaxDCalfid) {
2439 trackPtSumDCalfid += trackPt;
2444 deltaR =
GetDeltaR(&trackVec, etaEMCalRC, phiEMCalRC);
2445 if (deltaR < jetR) {
2446 trackPtSumEMCalRC += trackPt;
2457 deltaR =
GetDeltaR(&trackVec, etaDCalRC, phiDCalRC);
2458 if (deltaR < jetR) {
2459 trackPtSumDCalRC += trackPt;
2468 TString jetContName = jetCont->GetName();
2469 if (!jetContName.Contains(
"Charged")) {
2480 clusVec = clusIterator.first;
2481 clusEta = clusVec.Eta();
2483 clusPt = clusVec.Pt();
2484 clus = clusIterator.second;
2485 TClonesArray* fClusContArray = clusCont->GetArray();
2486 clusID = fClusContArray->IndexOf(clus);
2489 if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
2490 clusPtSumEMCal += clusPt;
2494 if (TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinEMCalfid && clusPhi < phiMaxEMCalfid) {
2495 clusPtSumEMCalfid += clusPt;
2500 if (TMath::Abs(clusEta) > etaMinDCal && TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinDCal && clusPhi < phiMaxDCal) {
2501 clusPtSumDCal += clusPt;
2507 if (TMath::Abs(clusEta) > etaMinDCalfid && TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinDCalfid && clusPhi < phiMaxDCalfid) {
2508 clusPtSumDCalfid += clusPt;
2513 deltaR =
GetDeltaR(&clusVec, etaEMCalRC, phiEMCalRC);
2514 if (deltaR < jetR) {
2515 clusPtSumEMCalRC += clusPt;
2525 deltaR =
GetDeltaR(&clusVec, etaDCalRC, phiDCalRC);
2526 if (deltaR < jetR) {
2527 clusPtSumDCalRC += clusPt;
2535 Double_t numerator = (trackPtSumEMCal + clusPtSumEMCal) / accEMCal;
2536 Double_t denominator = trackPtSumTPC / accTPC;
2537 Double_t scaleFactor = numerator / denominator;
2538 TString histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
2542 if (accEMCalfid > 1e-3) {
2543 numerator = (trackPtSumEMCalfid + clusPtSumEMCalfid) / accEMCalfid;
2544 scaleFactor = numerator / denominator;
2545 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jetCont->GetArrayName().Data());
2551 numerator = (trackPtSumDCal + clusPtSumDCal) / accDCal;
2552 scaleFactor = numerator / denominator;
2553 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jetCont->GetArrayName().Data());
2559 if (accDCalfid > 1e-3) {
2560 numerator = (trackPtSumDCalfid + clusPtSumDCalfid) / accDCalfid;
2561 scaleFactor = numerator / denominator;
2562 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jetCont->GetArrayName().Data());
2570 Double_t deltaPt = trackPtSumEMCalRC - rho * TMath::Pi() * jetR * jetR;
2572 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCalCharged", jetCont->GetArrayName().Data());
2577 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCalChargedExcl", jetCont->GetArrayName().Data());
2581 deltaPt += clusPtSumEMCalRC;
2582 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
2587 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCalExcl", jetCont->GetArrayName().Data());
2592 if (accDCalfid > 1e-3) {
2593 deltaPt = trackPtSumDCalRC + clusPtSumDCalRC - rho * TMath::Pi() * jetR * jetR;
2594 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jetCont->GetArrayName().Data());
2614 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2615 TString jetContName = jets->GetName();
2621 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
2625 for (
auto jet : jets->
all()) {
2631 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
2635 UInt_t rejectionReason = 0;
2636 if (!jets->
AcceptJet(jet, rejectionReason)) {
2637 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
2638 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
2652 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
2654 else if (type ==
kDCal) {
2655 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
2660 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
2665 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
2667 else if (type ==
kDCal) {
2668 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
2670 TLorentzVector leadPart;
2673 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2678 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
2680 else if (type ==
kDCal) {
2681 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
2683 const AliVTrack* track;
2684 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
2685 track =
static_cast<AliVTrack*
>(jet->Track(i));
2686 z = track->Pt() / TMath::Abs(corrPt);
2692 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
2694 else if (type ==
kDCal) {
2695 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
2755 if (!matchedPartLevelJet) {
2758 Float_t truthPt = matchedPartLevelJet->
Pt();
2771 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
2773 else if (type ==
kDCal) {
2774 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
2785 histname =
"MatchedJetHistograms/hJESshiftEMCal";
2787 else if (type ==
kDCal) {
2788 histname =
"MatchedJetHistograms/hJESshiftDCal";
2798 histname =
"MatchedJetHistograms/hNEFVsPt";
2807 histname =
"MatchedJetHistograms/hZLeadingVsPt";
2808 TLorentzVector leadPart;
2811 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2829 for (
auto jet1 : jetCont1->
all()) {
2830 jet1->ResetMatching();
2832 for (
auto jet2 : jetCont2->
all()) {
2833 jet2->ResetMatching();
2836 for (
auto jet1 : jetCont1->
accepted()) {
2838 if (bUseJetCont2Acceptance) {
2839 for (
auto jet2 : jetCont2->
accepted()) {
2844 for (
auto jet2 : jetCont2->
all()) {
2862 if (deltaR < jet1->ClosestJetDistance()) {
2866 if (deltaR < jet2->ClosestJetDistance()) {
2886 TString histNameQA =
"MatchedJetHistograms/fHistJetMatchingQA";
2891 bool returnValue =
false;
2899 returnValue =
false;
2905 TString histname =
"MatchedJetHistograms/hMatchingDistance";
2912 returnValue =
false;
2919 if (returnValue ==
true) {
2925 returnValue =
false;
2929 return partLevelJet;
2936 bool returnValue =
false;
2947 returnValue =
false;
2956 if (!partLevelJet) {
2957 returnValue =
false;
2966 returnValue =
false;
2976 returnValue =
false;
2984 if (returnValue ==
true) {
2989 TString histname =
"MatchedJetHistograms/hMatchingDistanceVsMCFraction";
2995 returnValue =
false;
2999 return partLevelJet;
3015 TString histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
3016 UInt_t rejectionReason = 0;
3019 return contributorType;
3022 if (part->GetGeneratorIndex() == 0) {
3030 else if (TMath::Abs(pdg) == 211) {
3033 else if (pdg == 2212) {
3036 else if (pdg == -2212) {
3039 else if (TMath::Abs(pdg) == 321) {
3042 else if (pdg == 130) {
3043 contributorType =
kK0L;
3045 else if (pdg == 2112) {
3048 else if (pdg == -2112) {
3051 else if (TMath::Abs(pdg) == 11) {
3054 else if (TMath::Abs(pdg) == 13) {
3055 contributorType =
kMuon;
3058 contributorType =
kOther;
3062 return contributorType;
3071 Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
3072 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
3118 for (
Int_t i=0; i<2; i++)
3120 if(maxJetIds[i]==-1)
continue;
3122 Int_t ClusterConstituentID=-1;
3123 Int_t TrackConstituentID =-1;
3133 if(ClusterConstituentID>-1 || TrackConstituentID>-1)
3144 const char *ntracks,
3145 const char *nclusters,
3146 const char *nGenLev,
3156 ::Error(
"AddTaskEmcalJetPerformance",
"No analysis manager to connect to.");
3162 AliVEventHandler* handler = mgr->GetInputEventHandler();
3165 ::Error(
"AddTaskEmcalJetPerformance",
"This task requires an input event handler");
3177 if (handler->InheritsFrom(
"AliESDInputHandler")) {
3180 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
3191 if (trackName ==
"usedefault") {
3192 if (dataType ==
kESD) {
3193 trackName =
"Tracks";
3195 else if (dataType == kAOD) {
3196 trackName =
"tracks";
3203 if (clusName ==
"usedefault") {
3204 if (dataType ==
kESD) {
3205 clusName =
"CaloClusters";
3207 else if (dataType == kAOD) {
3208 clusName =
"caloClusters";
3215 TString name(
"AliAnalysisTaskEmcalJetPerformance");
3216 if (!trackName.IsNull()) {
3220 if (!clusName.IsNull()) {
3224 if (strcmp(suffix,
"") != 0) {
3237 if (trackName ==
"mcparticles") {
3239 partCont = mcpartCont;
3241 else if (trackName ==
"tracks" || trackName ==
"Tracks") {
3243 partCont = trackCont;
3249 if (nGenLev && strcmp(nGenLev,
"")!=0) {
3257 if (!clusName.IsNull()) {
3271 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
3273 contname +=
"_histos";
3274 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
3275 TList::Class(),AliAnalysisManager::kOutputContainer,
3276 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
3277 mgr->ConnectInput (task, 0, cinput1 );
3278 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
const AliMCParticleIterableMomentumContainer 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()
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)
Int_t ContainsCluster(AliVCluster *cluster, TClonesArray *clusters) const
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.
Int_t ContainsTrack(AliVParticle *track, TClonesArray *tracks) const
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
Double_t DeltaR(const AliVParticle *part) const
AliVCaloCells * fCaloCells
!cells
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.
void SetClosestJet(AliEmcalJet *j, Double_t d)
AliMCParticleContainer * GetMCParticleContainer(Int_t i=0) const
const AliParticleIterableMomentumContainer accepted_momentum() 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
Int_t GetRunNumber(TString)
void SetClusPtCut(Double_t cut)
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
Main initialization function on the worker.
void SetJetAcceptanceType(UInt_t type)
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.
AliEmcalJet * GetJet(Int_t i) const
const AliJetIterableContainer all() const
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()