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 fPlotParticleCompositionHistograms(kFALSE),
72 fComputeBackground(kFALSE),
73 fDoTriggerSimulation(kFALSE),
74 fPlotMatchedJetHistograms(kFALSE),
75 fComputeMBDownscaling(kFALSE),
77 fDoClosureTest(kFALSE),
90 fTrackMatchingDeltaEtaMax(0.015),
91 fTrackMatchingDeltaPhiMax(0.030),
96 fDoTriggerResponse(kFALSE),
97 fDoJetMatchingGeometrical(kFALSE),
98 fDoJetMatchingMCFraction(kFALSE),
102 fDetJetContainerPPIntermediate(
nullptr),
103 fRequireMatchedJetAccepted(kFALSE),
105 fMinSharedMomentumFraction(0.5),
106 fMCJetMinMatchingPt(0.15),
107 fPlotJetMatchCandThresh(1.),
108 fUseAliEventCuts(kTRUE),
111 fUseManualEventCuts(kFALSE),
239 fEventCuts.fUseVariablesCorrelationCuts =
true;
254 Printf(
"Geometrical jet matching enabled.");
256 for (
Int_t i=0; i<2; i++) {
258 TString jetContName = jetCont->GetName();
259 if (jetContName.Contains(
"mcparticles")) {
269 Printf(
"MC-fraction jet matching enabled.");
271 for (
Int_t i=0; i<3; i++) {
273 TString jetContName = jetCont->GetName();
274 if (jetContName.Contains(
"mcparticles")) {
277 else if (jetContName.Contains(
"Combined")) {
288 Printf(
"No MC jet container found!");
293 Printf(
"No det-level jet container found!");
299 Printf(
"No intermediate pp det-level jet container found, despite MC-fraction matching enabled!");
328 if (embeddingHelper) {
337 while ((obj = next())) {
359 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
368 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
370 title = histname +
";Centrality (%);Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
371 TH3* hist =
fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, 32, 0, 32, nPtBins5,
fMinPt,
fMaxPt);
374 title = histname +
";Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
381 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
382 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
391 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
393 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
394 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
397 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});NEF";
402 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
404 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
405 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
408 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});NEF";
415 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
416 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
417 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, 0, 100, nPtBins2,
fMinPt,
fMaxPt, 2, -0.5, 1.5,
"s");
421 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
423 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
424 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, nPtBins2,
fMinPt,
fMaxPt,
fMaxPt, 0,
fMaxPt);
427 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
432 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
434 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
435 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, nPtBins2,
fMinPt,
fMaxPt, 50, 0, 0.5);
438 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
443 nbinsx = 20; minx = 0; maxx = 100;
445 nbinsz = 50; minz = 0; maxz = 1.;
447 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
449 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
450 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
453 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
458 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
460 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
461 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
464 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
470 nbinsx = 20; minx = 0; maxx = 100;
472 nbinsz = 50; minz = 0; maxz = 1.;
474 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
476 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
477 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
480 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
485 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
487 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
488 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
491 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
497 nbinsx = 20; minx = 0; maxx = 100;
499 nbinsz = 50; minz = 0; maxz =
fMaxPt;
501 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
503 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
504 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
507 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
512 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
514 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
515 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
518 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
525 nbinsx = 20; minx = 0; maxx = 100;
528 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
529 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
532 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
533 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
539 nbinsx = 20; minx = 0; maxx = 100;
543 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
544 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#sum#it{E}_{nonlincorr} - #it{E}_{hadcorr}";
545 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
550 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
551 title = histname +
";#it{E}_{patch,med};type;#it{p}_{T}^{corr} (GeV/#it{c});Centrality (%)";
552 Int_t nbins5[4] = {100, 2, nPtBins2, 50};
562 histname =
"Trigger/hMBDownscaleFactor";
563 title = histname +
";Downscale factor;counts";
577 const Int_t nRcorrBins = 50;
579 const Int_t nCellBins = 30;
581 const Int_t nMatchedTrackBins = 5;
583 const Int_t nDeltaEtaBins = 60;
590 histname =
"ClusterHistograms/hM02";
591 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
595 histname =
"ClusterHistograms/hNcellsM02G04";
596 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
599 histname =
"ClusterHistograms/hNcellsM02L04";
600 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
607 histname =
"ClusterHistograms/hMatchedTrackPt";
608 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
611 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
612 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
615 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
616 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
620 histname =
"ClusterHistograms/hMatchedTrackN";
621 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
624 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
625 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
628 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
629 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
633 histname =
"ClusterHistograms/hM02Matched";
634 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
638 histname =
"ClusterHistograms/hM02Unmatched";
639 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
643 histname =
"ClusterHistograms/hDeltaEtaCentral";
644 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
647 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
648 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
655 histname =
"ClusterHistograms/hEoverPM02Central";
656 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
659 histname =
"ClusterHistograms/hEoverPM02Peripheral";
660 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
667 histname =
"ClusterHistograms/hRcorrVsCent";
668 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
672 histname =
"ClusterHistograms/hRcorr0-10";
673 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
677 histname =
"ClusterHistograms/hRcorr50-90";
678 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
682 histname =
"ClusterHistograms/hRcorrClusVsCent";
683 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
687 histname =
"ClusterHistograms/hRcorrClus0-10";
688 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
692 histname =
"ClusterHistograms/hRcorrClus50-90";
693 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
697 histname =
"ClusterHistograms/hTrackMultiplicity";
698 htitle = histname +
";N_{tracks};Centrality (%)";
711 const Int_t nRejBins = 32;
714 const Int_t nContributorTypes = 11;
716 const Int_t nParticleTypes = 17;
719 AliEmcalContainer* cont = 0;
721 while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) {
723 histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
724 htitle = histname +
";Rejection reason;#it{E}_{clus} (GeV/)";
730 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
731 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
735 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
736 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
741 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
742 htitle = histname +
";Centrality (%);M02;#it{E}_{photon} (GeV)";
746 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
747 htitle = histname +
";Centrality (%);M02;#it{E}_{hadron} (GeV)";
763 min[dim] = fM02HistBins[0];
767 title[dim] =
"#it{E}_{clus} (GeV)";
770 min[dim] = fPtHistBins[0];
774 title[dim] =
"Contributor type";
775 nbins[dim] = nContributorTypes;
778 binEdges[dim] = contributorTypeBins;
781 title[dim] =
"#it{p}_{T,jet}^{corr}";
788 TString thnname =
"JetPerformanceMC/hM02VsContributorTypeJets";
790 for (
Int_t i = 0; i < dim; i++) {
791 hn->GetAxis(i)->SetTitle(title[i]);
792 hn->SetBinEdges(i, binEdges[i]);
799 title[dim] =
"#it{p}_{T,jet}^{corr}";
806 title[dim] =
"Contributor type";
807 nbins[dim] = nContributorTypes;
810 binEdges[dim] = contributorTypeBins;
820 title[dim] =
"#it{p}_{T,sum} (GeV)";
823 min[dim] = fPtHistBins[0];
827 thnname =
"JetPerformanceMC/hJetComposition";
829 for (
Int_t i = 0; i < dim; i++) {
830 thn->GetAxis(i)->SetTitle(title[i]);
831 thn->SetBinEdges(i, binEdges[i]);
837 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
838 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
842 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
843 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
847 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
848 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
860 axis->SetBinLabel(1,
"SinglePhoton");
861 axis->SetBinLabel(2,
"SingleElectron");
862 axis->SetBinLabel(3,
"SingleChargedPion");
863 axis->SetBinLabel(4,
"SingleProton");
864 axis->SetBinLabel(5,
"SingleAntiProton");
865 axis->SetBinLabel(6,
"SingleChargedKaon");
866 axis->SetBinLabel(7,
"SingleK0L");
867 axis->SetBinLabel(8,
"SingleNeutron");
868 axis->SetBinLabel(9,
"SingleAntiNeutron");
869 axis->SetBinLabel(10,
"SingleOther");
870 axis->SetBinLabel(11,
"PhotonHadron");
871 axis->SetBinLabel(12,
"HadronPhoton");
872 axis->SetBinLabel(13,
"MergedPi0");
873 axis->SetBinLabel(14,
"PhotonPhotonOther");
874 axis->SetBinLabel(15,
"HadronHadron");
875 axis->SetBinLabel(16,
"TwoContributorsOther");
876 axis->SetBinLabel(17,
"MoreThanTwoContributors");
890 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
893 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
894 title = histname +
";Centrality;Scale factor;counts";
897 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
898 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
901 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jets->GetArrayName().Data());
902 title = histname +
";Centrality;Scale factor;counts";
907 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jets->GetArrayName().Data());
908 title = histname +
";Centrality;Scale factor;counts";
911 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jets->GetArrayName().Data());
912 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
915 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jets->GetArrayName().Data());
916 title = histname +
";Centrality;Scale factor;counts";
939 histname =
"TriggerSimHistograms/hEtaVsPhi";
940 title = histname +
";#eta_{patch} (rad);#phi_{patch} (rad)";
944 histname =
"TriggerSimHistograms/hNPatches";
945 title = histname +
";#it{N}_{patches};type";
949 histname =
"TriggerSimHistograms/hPatchE";
950 title = histname +
";Centrality (%);#it{E}_{patch} (GeV)";
954 histname =
"TriggerSimHistograms/hPatchMedianE";
955 title = histname +
";Centrality (%);#it{E}_{patch,med} (GeV);type";
956 fHistManager.
CreateTH3(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 50, 2, -0.5, 1.5);
959 histname =
"TriggerSimHistograms/hMaxPatchResponseMatrix";
960 title = histname +
";#it{E}_{maxpatch,det} (GeV);#it{E}_{maxpatch,truth} (GeV)";
963 histname =
"TriggerSimHistograms/hEMCalEnergyResponseMatrix";
964 title = histname +
";#Sigma#it{E}_{clus,EMCal} (GeV);#it{E}_{EMCal,truth} (GeV)";
972 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
975 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
976 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
982 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
983 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
992 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
993 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
994 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
997 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
998 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
999 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1003 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1004 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
1008 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
1009 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
1013 nbinsx = 20; minx = 0; maxx = 100;
1015 nbinsz = 50; minz = 0; maxz = 1.;
1017 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1018 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
1019 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1022 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1023 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
1024 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1028 nbinsx = 20; minx = 0; maxx = 100;
1030 nbinsz = 50; minz = 0; maxz = 1.;
1032 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1033 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
1034 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1037 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1038 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
1039 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1043 nbinsx = 20; minx = 0; maxx = 100;
1045 nbinsz = 50; minz = 0; maxz =
fMaxPt;
1047 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1048 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
1049 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1052 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1053 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
1054 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1075 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
1077 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1078 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1081 title = histname +
";#it{p}_{T,corr}^{det} (GeV/#it{c});#it{p}_{T}^{truth} (GeV/#it{c})";
1086 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
1088 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1089 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1092 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1098 nbinsx = 20; minx = 0; maxx = 100;
1099 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1100 nbinsz = 250; minz = -5.; maxz = 5.;
1102 histname =
"MatchedJetHistograms/hJESshiftEMCal";
1104 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1105 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1108 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1113 histname =
"MatchedJetHistograms/hJESshiftDCal";
1115 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1116 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1119 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1125 nbinsx = 20; minx = 0; maxx = 100;
1127 nbinsz = 50; minz = 0; maxz = 1.;
1129 histname =
"MatchedJetHistograms/hNEFVsPt";
1131 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});Calo energy fraction";
1132 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1135 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});Calo energy fraction";
1140 nbinsx = 20; minx = 0; maxx = 100;
1141 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1142 nbinsz = 50; minz = 0; maxz = 1.;
1144 histname =
"MatchedJetHistograms/hZLeadingVsPt";
1146 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{z}_{leading}";
1147 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1150 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#it{z}_{leading}";
1158 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1159 nbinsz = 100; minz = 0; maxz = 4.;
1160 histname =
"MatchedJetHistograms/hMatchingDistance";
1161 title = histname +
";#it{p}_{T}^{det} (GeV/#it{c});#it{p}_{T}^{truth} (GeV/#it{c});R";
1162 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1165 histname =
"MatchedJetHistograms/fHistJetMatchingQA";
1167 std::vector<std::string> binLabels = {
"noMatch",
"matchedJet",
"uniqueMatch",
"jetDistance",
"passedAllCuts"};
1168 auto histMatchedJetCuts =
fHistManager.
CreateTH1(histname.Data(), title.Data(), binLabels.size(), 0, binLabels.size());
1170 for (
unsigned int i = 1; i <= binLabels.size(); i++) {
1171 histMatchedJetCuts->GetXaxis()->SetBinLabel(i, binLabels.at(i-1).c_str());
1173 histMatchedJetCuts->GetYaxis()->SetTitle(
"Number of jets");
1180 nbinsy = 20; miny = 0; maxy = 1.;
1181 nbinsz = 100; minz = 0; maxz = 4.;
1182 histname =
"MatchedJetHistograms/hMatchingDistanceVsMCFraction";
1183 title = histname +
";#it{p}_{T}^{det} (GeV/#it{c});MC fraction;#DeltaR";
1184 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1187 histname =
"MatchedJetHistograms/fHistJetMatchingQA";
1189 std::vector<std::string> binLabels = {
"noMatch",
"matchedJet",
"sharedMomentumFraction",
"partLevelMatchedJet",
"jetDistancePPdet",
"jetDistancePPtruth",
"passedAllCuts"};
1190 auto histMatchedJetCuts =
fHistManager.
CreateTH1(histname.Data(), title.Data(), binLabels.size(), 0, binLabels.size());
1192 for (
unsigned int i = 1; i <= binLabels.size(); i++) {
1193 histMatchedJetCuts->GetXaxis()->SetBinLabel(i, binLabels.at(i-1).c_str());
1195 histMatchedJetCuts->GetYaxis()->SetTitle(
"Number of jets");
1220 TClass cls(objname);
1221 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1222 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1223 GetName(), cls.GetName(),
"EmcalTriggers"));
1228 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1248 TString triggerNameMB1 =
"CINT7-B-NOPF-CENT";
1249 TString triggerNameMB2 =
"CV0L7-B-NOPF-CENT";
1250 TString triggerNameJE =
"CINT7EJ1-B-NOPF-CENTNOPMD";
1255 for (
auto i : runtriggers) {
1256 if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
1265 TString histname =
"Trigger/hMBDownscaleFactor";
1302 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
1303 TString jetContName = jetCont->GetName();
1338 TClass cls(objname);
1339 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1340 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1341 GetName(), cls.GetName(),
"EmcalTriggers"));
1346 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1351 std::vector<Double_t> vecEMCal;
1352 std::vector<Double_t> vecDCal;
1355 AliEMCALTriggerPatchInfo *maxPatch =
nullptr;
1357 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1360 if(!recpatch->IsJetHighSimple())
continue;
1362 patchE = recpatch->GetPatchE();
1364 histname =
"TriggerSimHistograms/hEtaVsPhi";
1367 histname =
"TriggerSimHistograms/hPatchE";
1370 if (recpatch->IsEMCal()) {
1371 vecEMCal.push_back(patchE);
1372 if (patchE > maxPatchEnergy) {
1373 maxPatchEnergy = patchE;
1374 maxPatch = recpatch;
1377 vecDCal.push_back(patchE);
1384 const Int_t nBkgPatchesEMCal = vecEMCal.size();
1385 const Int_t nBkgPatchesDCal = vecDCal.size();
1386 fMedianEMCal = TMath::Median(nBkgPatchesEMCal, &vecEMCal[0]);
1387 fMedianDCal = TMath::Median(nBkgPatchesDCal, &vecDCal[0]);
1389 histname =
"TriggerSimHistograms/hPatchMedianE";
1393 histname =
"TriggerSimHistograms/hNPatches";
1400 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
1401 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
1412 part = mcpart.first;
1413 partEta = part.Eta();
1417 if (partPhi < maxPatch->GetPhiMax() && partPhi > maxPatch->GetPhiMin()) {
1418 if (partEta < maxPatch->GetEtaMax() && partEta > maxPatch->GetEtaMin()) {
1419 truthEnergyPatch += partE;
1423 if (partPhi < phiMaxEMCal && partPhi > phiMinEMCal) {
1424 if (partEta < 0.7 && partEta > -0.7) {
1425 truthEnergyEMCal += partE;
1431 const AliVCluster* clus;
1436 clusFourVec.Clear();
1437 clusFourVec = clusIterator.first;
1438 clusEta = clusFourVec.Eta();
1440 clus = clusIterator.second;
1441 if (clus->IsEMCAL()) {
1442 if (clusPhi < phiMaxEMCal && clusPhi > phiMinEMCal) {
1443 if (clusEta < 0.7 && clusEta > -0.7) {
1444 detEnergyEMCal += clusFourVec.E();
1451 histname =
"TriggerSimHistograms/hMaxPatchResponseMatrix";
1455 histname =
"TriggerSimHistograms/hEMCalEnergyResponseMatrix";
1464 for(
auto p : *fTriggerPatchInfo){
1465 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1468 if(!recpatch->IsJetHighSimple())
continue;
1470 if (recpatch->IsEMCal()) {
1471 if ((recpatch->GetPatchE() -
fMedianDCal) > threshold) {
1476 if ((recpatch->GetPatchE() -
fMedianEMCal) > threshold) {
1524 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1525 TString jetContName = jets->GetName();
1536 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1540 for (
auto jet : jets->
all()) {
1554 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1563 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1573 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1575 else if (type ==
kDCal) {
1576 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1578 TLorentzVector leadPart;
1581 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
1590 UInt_t rejectionReason = 0;
1591 if (!jets->
AcceptJet(jet, rejectionReason)) {
1592 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1597 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), corrPt);
1604 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
1606 else if (type ==
kDCal) {
1607 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
1618 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1624 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1626 else if (type ==
kDCal) {
1627 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1629 const AliVTrack* track;
1630 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1631 track =
static_cast<AliVTrack*
>(jet->Track(i));
1632 z = track->Pt() / TMath::Abs(corrPt);
1643 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1645 else if (type ==
kDCal) {
1646 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1658 if (jet->Eta() > 0) {
1659 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
1662 else if (jet->Eta() < 0) {
1663 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
1672 const AliVCluster* clus =
nullptr;
1673 Int_t nClusters = jet->GetNumberOfClusters();
1674 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1675 clus = jet->Cluster(iClus);
1676 deltaEhadcorr += (clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy());
1679 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
1686 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
1707 const AliVCluster* clus;
1711 Double_t clusPhi = it.first.Phi_0_2pi();
1715 if (!clus->IsEMCAL()) {
1721 Int_t nTracksMatched = 0;
1722 const AliVTrack* track =
nullptr;
1723 for (
Int_t itrack=0; itrack < clus->GetNTracksMatched(); itrack++) {
1724 track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(itrack));
1729 Double_t trackPhi = TVector2::Phi_0_2pi(track->GetTrackPhiOnEMCal());
1730 Double_t trackEta = track->GetTrackEtaOnEMCal();
1731 Double_t deta = TMath::Abs(clusEta - trackEta);
1732 Double_t dphi = TMath::Abs(clusPhi - trackPhi);
1735 trackPSum += track->P();
1741 if (trackPSum > 1e-3) {
1742 EoverP = clus->GetNonLinCorrEnergy() / trackPSum;
1745 Double_t deltaE = clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy();
1747 if (trackPSum > 1e-3) {
1748 Rcorr = deltaE / trackPSum;
1750 Double_t RcorrClus = deltaE / clus->GetNonLinCorrEnergy();
1756 histname =
"ClusterHistograms/hM02";
1760 if (clus->GetM02() > 0.4) {
1761 histname =
"ClusterHistograms/hNcellsM02G04";
1764 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1765 histname =
"ClusterHistograms/hNcellsM02L04";
1773 histname =
"ClusterHistograms/hMatchedTrackPt";
1776 if (clus->GetM02() > 0.4) {
1777 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
1780 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1781 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
1786 histname =
"ClusterHistograms/hMatchedTrackN";
1789 if (clus->GetM02() > 0.4) {
1790 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
1793 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1794 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
1799 histname =
"ClusterHistograms/hM02Matched";
1800 if (nTracksMatched > 0) {
1805 histname =
"ClusterHistograms/hM02Unmatched";
1806 if (nTracksMatched == 0) {
1811 if (nTracksMatched == 1) {
1813 const AliVTrack* track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(0));
1815 Double_t trackEta = track->GetTrackEtaOnEMCal();
1816 Double_t deta = trackEta - clusEta;
1819 histname =
"ClusterHistograms/hDeltaEtaCentral";
1824 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
1835 histname =
"ClusterHistograms/hEoverPM02Central";
1839 histname =
"ClusterHistograms/hEoverPM02Peripheral";
1847 histname =
"ClusterHistograms/hRcorrVsCent";
1852 histname =
"ClusterHistograms/hRcorr0-10";
1858 histname =
"ClusterHistograms/hRcorr50-90";
1863 histname =
"ClusterHistograms/hRcorrClusVsCent";
1868 histname =
"ClusterHistograms/hRcorrClus0-10";
1874 histname =
"ClusterHistograms/hRcorrClus50-90";
1881 histname =
"ClusterHistograms/hTrackMultiplicity";
1894 const AliMCEvent* mcevent =
nullptr;
1896 mcevent = MCEvent();
1919 const AliVCluster* clus;
1920 std::vector<ContributorType> vecContributorTypes;
1921 std::vector<Int_t> vecContributorLabels;
1927 if (!clus->IsEMCAL()) {
1934 const Int_t nLabels = clus->GetNLabels();
1937 vecContributorTypes.clear();
1938 vecContributorLabels.clear();
1939 for (
Int_t iLabel=0; iLabel<nLabels; iLabel++) {
1941 Int_t label = clus->GetLabels()[iLabel];
1942 if (TMath::Abs(label) > 0) {
1945 vecContributorTypes.push_back(contributorType);
1946 vecContributorLabels.push_back(label);
1951 Int_t nLabelsPhysPrim = vecContributorTypes.size();
1953 if (nLabelsPhysPrim == 1) {
1955 contributorType = vecContributorTypes[0];
1957 if (contributorType ==
kPhoton) {
1960 else if (contributorType ==
kElectron) {
1966 else if (contributorType ==
kProton) {
1975 else if (contributorType ==
kK0L) {
1978 else if (contributorType ==
kNeutron) {
1989 else if (nLabelsPhysPrim == 2) {
1997 Double_t frac1 = clus->GetClusterMCEdepFraction(1);
2005 if (isHadron1 && isHadron2) {
2008 else if (isPhoton1 && isHadron2) {
2012 Double_t photonEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
2013 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
2016 else if (isHadron1 && isPhoton2) {
2020 Double_t hadronEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
2021 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
2024 else if (isPhoton1 && isPhoton2) {
2032 if (part1 && part2) {
2033 Int_t iMother1 = part1->GetMother();
2034 Int_t iMother2 = part2->GetMother();
2035 AliVParticle *mother1 = mcevent->GetTrack(iMother1);
2036 AliVParticle *mother2 = mcevent->GetTrack(iMother2);
2038 if (mother1 && mother2) {
2039 if ( (mother1->PdgCode() == 111) && (mother2->PdgCode() == 111) ) {
2040 if (iMother1 == iMother2) {
2052 else if (nLabelsPhysPrim > 2) {
2058 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
2059 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
2062 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
2063 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
2076 const AliVCluster* clus;
2078 for (
const auto jet : jets->
accepted()) {
2083 Double_t hadCaloEnergyUnmatched = 0;
2084 Double_t hadCaloEnergyMatchedNonlincorr = 0;
2085 Double_t hadCaloEnergyMatchedHadCorr = 0;
2088 Int_t nClusters = jet->GetNumberOfClusters();
2089 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
2091 clus = jet->Cluster(iClus);
2095 Int_t label = TMath::Abs(clus->GetLabel());
2101 histname =
"JetPerformanceMC/hM02VsContributorTypeJets";
2102 Double_t x[4] = {clus->GetM02(), clus->GetNonLinCorrEnergy(), contributorType, jetPt};
2108 Bool_t hasMatchedTrack = (clus->GetNTracksMatched() > 0);
2110 if (hasMatchedTrack) {
2111 hadCaloEnergyMatchedNonlincorr += clus->GetNonLinCorrEnergy();
2112 hadCaloEnergyMatchedHadCorr += clus->GetHadCorrEnergy();
2115 hadCaloEnergyUnmatched += clus->GetNonLinCorrEnergy();
2124 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
2128 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
2132 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
2136 histname =
"JetPerformanceMC/hJetComposition";
2137 for (
Int_t type = 0; type < 8; type++) {
2144 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
2146 clus = jet->Cluster(iClus);
2148 Int_t label = TMath::Abs(clus->GetLabel());
2153 if (type == contributorType) {
2155 pTsum += clus->GetNonLinCorrEnergy();
2160 Double_t x[4] = {jetPt, 1.*type, nSum, pTsum};
2180 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
2181 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
2182 Double_t phiMinDCal =
fGeom->GetDCALPhiMin() * TMath::DegToRad();
2183 Double_t phiMaxDCal =
fGeom->GetDCALPhiMax() * TMath::DegToRad();
2185 Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
2186 Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
2187 Double_t accDCal = 2 * (etaEMCal - etaMinDCal) * (phiMaxDCal - phiMinDCal);
2192 while ((jetCont = static_cast<AliJetContainer*>(nextJetColl()))) {
2195 TRandom3* r =
new TRandom3(0);
2197 Double_t etaEMCalfid = etaEMCal - jetR;
2198 Double_t etaMinDCalfid = etaMinDCal + jetR;
2199 Double_t phiMinEMCalfid = phiMinEMCal + jetR;
2200 Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
2201 Double_t phiMinDCalfid = phiMinDCal + jetR;
2202 Double_t phiMaxDCalfid = phiMaxDCal - jetR;
2203 Double_t accEMCalfid = 2 * etaEMCalfid * (phiMaxEMCalfid - phiMinEMCalfid);
2204 Double_t accDCalfid = 2 * (etaEMCalfid - etaMinDCalfid) * (phiMaxDCalfid - phiMinDCalfid);
2205 if ( (etaEMCalfid - etaMinDCalfid) < 0) {
2210 Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
2211 Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
2214 Double_t etaDCalRC = r->Uniform(etaMinDCalfid, etaEMCalfid);
2215 Double_t sign = r->Uniform(-1., 1.);
2217 etaDCalRC = -1*etaDCalRC;
2219 Double_t phiDCalRC = r->Uniform(phiMinDCalfid, phiMaxDCalfid);
2246 while ((partCont = static_cast<AliParticleContainer*>(nextPartCont()))) {
2248 TString partContName = partCont->GetName();
2249 if (!partContName.CompareTo(
"tracks") || !partContName.CompareTo(
"thermalparticles")) {
2254 track = trackIterator.first;
2255 trackEta = track.Eta();
2257 trackPt = track.Pt();
2260 if (TMath::Abs(trackEta) < etaTPC) {
2261 trackPtSumTPC += trackPt;
2265 if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
2266 trackPtSumEMCal += trackPt;
2270 if (TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinEMCalfid && trackPhi < phiMaxEMCalfid) {
2271 trackPtSumEMCalfid += trackPt;
2276 if (TMath::Abs(trackEta) > etaMinDCal && TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinDCal && trackPhi < phiMaxDCal) {
2277 trackPtSumDCal += trackPt;
2283 if (TMath::Abs(trackEta) > etaMinDCalfid && TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinDCalfid && trackPhi < phiMaxDCalfid) {
2284 trackPtSumDCalfid += trackPt;
2289 deltaR =
GetDeltaR(&track, etaEMCalRC, phiEMCalRC);
2290 if (deltaR < jetR) {
2291 trackPtSumEMCalRC += trackPt;
2296 deltaR =
GetDeltaR(&track, etaDCalRC, phiDCalRC);
2297 if (deltaR < jetR) {
2298 trackPtSumDCalRC += trackPt;
2317 clus = clusIterator.first;
2318 clusEta = clus.Eta();
2323 if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
2324 clusPtSumEMCal += clusPt;
2328 if (TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinEMCalfid && clusPhi < phiMaxEMCalfid) {
2329 clusPtSumEMCalfid += clusPt;
2334 if (TMath::Abs(clusEta) > etaMinDCal && TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinDCal && clusPhi < phiMaxDCal) {
2335 clusPtSumDCal += clusPt;
2341 if (TMath::Abs(clusEta) > etaMinDCalfid && TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinDCalfid && clusPhi < phiMaxDCalfid) {
2342 clusPtSumDCalfid += clusPt;
2347 deltaR =
GetDeltaR(&clus, etaEMCalRC, phiEMCalRC);
2348 if (deltaR < jetR) {
2349 clusPtSumEMCalRC += clusPt;
2354 deltaR =
GetDeltaR(&clus, etaDCalRC, phiDCalRC);
2355 if (deltaR < jetR) {
2356 clusPtSumDCalRC += clusPt;
2365 Double_t numerator = (trackPtSumEMCal + clusPtSumEMCal) / accEMCal;
2366 Double_t denominator = trackPtSumTPC / accTPC;
2367 Double_t scaleFactor = numerator / denominator;
2368 TString histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
2372 if (accEMCalfid > 1e-3) {
2373 numerator = (trackPtSumEMCalfid + clusPtSumEMCalfid) / accEMCalfid;
2374 scaleFactor = numerator / denominator;
2375 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jetCont->GetArrayName().Data());
2381 numerator = (trackPtSumDCal + clusPtSumDCal) / accDCal;
2382 scaleFactor = numerator / denominator;
2383 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jetCont->GetArrayName().Data());
2389 if (accDCalfid > 1e-3) {
2390 numerator = (trackPtSumDCalfid + clusPtSumDCalfid) / accDCalfid;
2391 scaleFactor = numerator / denominator;
2392 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jetCont->GetArrayName().Data());
2401 Double_t deltaPt = trackPtSumEMCalRC + clusPtSumEMCalRC - rho * TMath::Pi() * jetR * jetR;
2402 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
2407 if (accDCalfid > 1e-3) {
2408 deltaPt = trackPtSumDCalRC + clusPtSumDCalRC - rho * TMath::Pi() * jetR * jetR;
2409 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jetCont->GetArrayName().Data());
2429 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2430 TString jetContName = jets->GetName();
2435 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
2439 for (
auto jet : jets->
all()) {
2445 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
2449 UInt_t rejectionReason = 0;
2450 if (!jets->
AcceptJet(jet, rejectionReason)) {
2451 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
2452 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
2466 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
2468 else if (type ==
kDCal) {
2469 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
2474 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
2479 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
2481 else if (type ==
kDCal) {
2482 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
2484 TLorentzVector leadPart;
2487 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2492 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
2494 else if (type ==
kDCal) {
2495 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
2497 const AliVTrack* track;
2498 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
2499 track =
static_cast<AliVTrack*
>(jet->Track(i));
2500 z = track->Pt() / TMath::Abs(corrPt);
2506 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
2508 else if (type ==
kDCal) {
2509 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
2569 if (!matchedPartLevelJet) {
2572 Float_t truthPt = matchedPartLevelJet->
Pt();
2585 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
2587 else if (type ==
kDCal) {
2588 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
2599 histname =
"MatchedJetHistograms/hJESshiftEMCal";
2601 else if (type ==
kDCal) {
2602 histname =
"MatchedJetHistograms/hJESshiftDCal";
2612 histname =
"MatchedJetHistograms/hNEFVsPt";
2621 histname =
"MatchedJetHistograms/hZLeadingVsPt";
2622 TLorentzVector leadPart;
2625 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2643 for (
auto jet1 : jetCont1->
all()) {
2644 jet1->ResetMatching();
2646 for (
auto jet2 : jetCont2->
all()) {
2647 jet2->ResetMatching();
2650 for (
auto jet1 : jetCont1->
accepted()) {
2652 if (bUseJetCont2Acceptance) {
2653 for (
auto jet2 : jetCont2->
accepted()) {
2658 for (
auto jet2 : jetCont2->
all()) {
2676 if (deltaR < jet1->ClosestJetDistance()) {
2680 if (deltaR < jet2->ClosestJetDistance()) {
2700 TString histNameQA =
"MatchedJetHistograms/fHistJetMatchingQA";
2705 bool returnValue =
false;
2713 returnValue =
false;
2719 TString histname =
"MatchedJetHistograms/hMatchingDistance";
2726 returnValue =
false;
2733 if (returnValue ==
true) {
2739 returnValue =
false;
2743 return partLevelJet;
2750 bool returnValue =
false;
2761 returnValue =
false;
2770 if (!partLevelJet) {
2771 returnValue =
false;
2780 returnValue =
false;
2790 returnValue =
false;
2798 if (returnValue ==
true) {
2803 TString histname =
"MatchedJetHistograms/hMatchingDistanceVsMCFraction";
2809 returnValue =
false;
2813 return partLevelJet;
2829 TString histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
2830 UInt_t rejectionReason = 0;
2833 return contributorType;
2836 if (part->GetGeneratorIndex() == 0) {
2844 else if (TMath::Abs(pdg) == 211) {
2847 else if (pdg == 2212) {
2850 else if (pdg == -2212) {
2853 else if (TMath::Abs(pdg) == 321) {
2856 else if (pdg == 130) {
2857 contributorType =
kK0L;
2859 else if (pdg == 2112) {
2862 else if (pdg == -2112) {
2865 else if (TMath::Abs(pdg) == 11) {
2868 else if (TMath::Abs(pdg) == 13) {
2869 contributorType =
kMuon;
2872 contributorType =
kOther;
2876 return contributorType;
2885 Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
2886 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
2928 const char *ntracks,
2929 const char *nclusters,
2930 const char *nGenLev,
2940 ::Error(
"AddTaskEmcalJetPerformance",
"No analysis manager to connect to.");
2946 AliVEventHandler* handler = mgr->GetInputEventHandler();
2949 ::Error(
"AddTaskEmcalJetPerformance",
"This task requires an input event handler");
2961 if (handler->InheritsFrom(
"AliESDInputHandler")) {
2964 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
2975 if (trackName ==
"usedefault") {
2976 if (dataType ==
kESD) {
2977 trackName =
"Tracks";
2979 else if (dataType == kAOD) {
2980 trackName =
"tracks";
2987 if (clusName ==
"usedefault") {
2988 if (dataType ==
kESD) {
2989 clusName =
"CaloClusters";
2991 else if (dataType == kAOD) {
2992 clusName =
"caloClusters";
2999 TString name(
"AliAnalysisTaskEmcalJetPerformance");
3000 if (!trackName.IsNull()) {
3004 if (!clusName.IsNull()) {
3008 if (strcmp(suffix,
"") != 0) {
3021 if (trackName ==
"mcparticles") {
3023 partCont = mcpartCont;
3025 else if (trackName ==
"tracks" || trackName ==
"Tracks") {
3027 partCont = trackCont;
3033 if (nGenLev && strcmp(nGenLev,
"")!=0) {
3041 if (!clusName.IsNull()) {
3055 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
3057 contname +=
"_histos";
3058 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
3059 TList::Class(),AliAnalysisManager::kOutputContainer,
3060 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
3061 mgr->ConnectInput (task, 0, cinput1 );
3062 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()
AliClusterContainer * GetClusterContainer() const
void FillTH3(const char *hname, double x, double y, double z, double weight=1., Option_t *opt="")
Fill a 3D histogram within the container.
Declaration of class AliAnalysisTaskEmcalEmbeddingHelper.
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
Double_t GetDownscaleFactorForTriggerClass(const TString &trigger) const
Container for particles within the EMCAL framework.
void SetCaloTriggerPatchInfoName(const char *n)
void AdoptClusterContainer(AliClusterContainer *cont)
TObjArray fParticleCollArray
particle/track collection array
virtual Bool_t AcceptMCParticle(const AliAODMCParticle *vp, UInt_t &rejectionReason) const
bool AddQAPlotsToList(TList *list)
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
void GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
void SetRun(int runnumber)
void FillTHnSparse(const char *name, const double *x, double weight=1., Option_t *opt="")
bool IsInitialized() const
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Create a new TH2 within the container.
THashList * GetListOfHistograms() const
Get the list of histograms.
Double_t GetLeadingHadronPt(const AliEmcalJet *jet) const
AliEMCALGeometry * fGeom
!emcal geometry
UInt_t GetJetAcceptanceType() const
Double_t Phi_0_2pi() const
Implementation of task to embed external events.
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
BeamType fForceBeamType
forced beam type
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
Double_t fCent
!event centrality
Int_t GetNAcceptedTracks()
AliMCParticleContainer * AddMCParticleContainer(const char *n)
Create new container for MC particles and attach it to the task.
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
Calculates the fraction of momentum z of part 1 w.r.t. part 2 in the direction of part 2...
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
TObjArray fJetCollArray
jet collection array
Double_t DeltaR(const AliVParticle *part) const
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.
const AliJetIterableContainer all() const
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()