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),
78 fFillChargedFluctuations(kFALSE),
91 fTrackMatchingDeltaEtaMax(0.015),
92 fTrackMatchingDeltaPhiMax(0.030),
97 fDoTriggerResponse(kFALSE),
98 fDoJetMatchingGeometrical(kFALSE),
99 fDoJetMatchingMCFraction(kFALSE),
103 fDetJetContainerPPIntermediate(
nullptr),
104 fRequireMatchedJetAccepted(kFALSE),
106 fMinSharedMomentumFraction(0.5),
107 fMCJetMinMatchingPt(0.15),
108 fPlotJetMatchCandThresh(1.),
109 fUseAliEventCuts(kTRUE),
112 fUseManualEventCuts(kFALSE),
241 fEventCuts.fUseVariablesCorrelationCuts =
true;
256 Printf(
"Geometrical jet matching enabled.");
258 for (
Int_t i=0; i<2; i++) {
260 TString jetContName = jetCont->GetName();
261 if (jetContName.Contains(
"mcparticles")) {
271 Printf(
"MC-fraction jet matching enabled.");
273 for (
Int_t i=0; i<3; i++) {
275 TString jetContName = jetCont->GetName();
276 if (jetContName.Contains(
"mcparticles")) {
279 else if (jetContName.Contains(
"Combined")) {
290 Printf(
"No MC jet container found!");
295 Printf(
"No det-level jet container found!");
301 Printf(
"No intermediate pp det-level jet container found, despite MC-fraction matching enabled!");
330 if (embeddingHelper) {
339 while ((obj = next())) {
361 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
370 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
372 title = histname +
";Centrality (%);Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
373 TH3* hist =
fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, 32, 0, 32, nPtBins5,
fMinPt,
fMaxPt);
376 title = histname +
";Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
383 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
385 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
389 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
399 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
401 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
402 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
405 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});NEF";
410 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
412 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
413 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
416 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});NEF";
423 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
424 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
425 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, 0, 100, nPtBins2,
fMinPt,
fMaxPt, 2, -0.5, 1.5,
"s");
429 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
431 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
432 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, nPtBins2,
fMinPt,
fMaxPt,
fMaxPt, 0,
fMaxPt);
435 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
440 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
442 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}/#piR^{2}";
443 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, nPtBins2,
fMinPt,
fMaxPt, 75, 0, 3);
446 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}/#piR^{2}";
451 nbinsx = 20; minx = 0; maxx = 100;
453 nbinsz = 50; minz = 0; maxz = 1.;
455 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
457 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
458 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
461 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
466 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
468 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
469 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
472 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
478 nbinsx = 20; minx = 0; maxx = 100;
480 nbinsz = 50; minz = 0; maxz = 1.;
482 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
484 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
485 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
488 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
493 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
495 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
496 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
499 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
505 nbinsx = 20; minx = 0; maxx = 100;
507 nbinsz = 50; minz = 0; maxz =
fMaxPt;
509 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
511 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
512 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
515 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
520 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
522 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
523 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
526 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
533 nbinsx = 20; minx = 0; maxx = 100;
536 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
537 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
540 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
541 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
547 nbinsx = 20; minx = 0; maxx = 100;
551 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
552 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#sum#it{E}_{nonlincorr} - #it{E}_{hadcorr}";
553 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
558 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
559 title = histname +
";#it{E}_{patch,med};type;#it{p}_{T}^{corr} (GeV/#it{c});Centrality (%)";
560 Int_t nbins5[4] = {100, 2, nPtBins2, 50};
570 histname =
"Trigger/hMBDownscaleFactor";
571 title = histname +
";Downscale factor;counts";
585 const Int_t nRcorrBins = 50;
587 const Int_t nCellBins = 30;
589 const Int_t nMatchedTrackBins = 5;
591 const Int_t nDeltaEtaBins = 60;
598 histname =
"ClusterHistograms/hM02";
599 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
603 histname =
"ClusterHistograms/hNcellsM02G04";
604 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
607 histname =
"ClusterHistograms/hNcellsM02L04";
608 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
615 histname =
"ClusterHistograms/hMatchedTrackPt";
616 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
619 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
620 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
623 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
624 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
628 histname =
"ClusterHistograms/hMatchedTrackN";
629 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
632 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
633 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
636 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
637 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
641 histname =
"ClusterHistograms/hM02Matched";
642 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
646 histname =
"ClusterHistograms/hM02Unmatched";
647 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
651 histname =
"ClusterHistograms/hDeltaEtaCentral";
652 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
655 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
656 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
663 histname =
"ClusterHistograms/hEoverPM02Central";
664 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
667 histname =
"ClusterHistograms/hEoverPM02Peripheral";
668 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
675 histname =
"ClusterHistograms/hRcorrVsCent";
676 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
680 histname =
"ClusterHistograms/hRcorr0-10";
681 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
685 histname =
"ClusterHistograms/hRcorr50-90";
686 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
690 histname =
"ClusterHistograms/hRcorrClusVsCent";
691 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
695 histname =
"ClusterHistograms/hRcorrClus0-10";
696 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
700 histname =
"ClusterHistograms/hRcorrClus50-90";
701 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
705 histname =
"ClusterHistograms/hTrackMultiplicity";
706 htitle = histname +
";N_{tracks};Centrality (%)";
719 const Int_t nRejBins = 32;
722 const Int_t nContributorTypes = 11;
724 const Int_t nParticleTypes = 17;
727 AliEmcalContainer* cont = 0;
729 while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) {
731 histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
732 htitle = histname +
";Rejection reason;#it{E}_{clus} (GeV/)";
738 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
739 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
743 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
744 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
749 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
750 htitle = histname +
";Centrality (%);M02;#it{E}_{photon} (GeV)";
754 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
755 htitle = histname +
";Centrality (%);M02;#it{E}_{hadron} (GeV)";
771 min[dim] = fM02HistBins[0];
775 title[dim] =
"#it{E}_{clus} (GeV)";
778 min[dim] = fPtHistBins[0];
782 title[dim] =
"Contributor type";
783 nbins[dim] = nContributorTypes;
786 binEdges[dim] = contributorTypeBins;
789 title[dim] =
"#it{p}_{T,jet}^{corr}";
796 TString thnname =
"JetPerformanceMC/hM02VsContributorTypeJets";
798 for (
Int_t i = 0; i < dim; i++) {
799 hn->GetAxis(i)->SetTitle(title[i]);
800 hn->SetBinEdges(i, binEdges[i]);
807 title[dim] =
"#it{p}_{T,jet}^{corr}";
814 title[dim] =
"Contributor type";
815 nbins[dim] = nContributorTypes;
818 binEdges[dim] = contributorTypeBins;
828 title[dim] =
"#it{p}_{T,sum} (GeV)";
831 min[dim] = fPtHistBins[0];
835 thnname =
"JetPerformanceMC/hJetComposition";
837 for (
Int_t i = 0; i < dim; i++) {
838 thn->GetAxis(i)->SetTitle(title[i]);
839 thn->SetBinEdges(i, binEdges[i]);
845 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
846 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
850 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
851 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
855 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
856 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
868 axis->SetBinLabel(1,
"SinglePhoton");
869 axis->SetBinLabel(2,
"SingleElectron");
870 axis->SetBinLabel(3,
"SingleChargedPion");
871 axis->SetBinLabel(4,
"SingleProton");
872 axis->SetBinLabel(5,
"SingleAntiProton");
873 axis->SetBinLabel(6,
"SingleChargedKaon");
874 axis->SetBinLabel(7,
"SingleK0L");
875 axis->SetBinLabel(8,
"SingleNeutron");
876 axis->SetBinLabel(9,
"SingleAntiNeutron");
877 axis->SetBinLabel(10,
"SingleOther");
878 axis->SetBinLabel(11,
"PhotonHadron");
879 axis->SetBinLabel(12,
"HadronPhoton");
880 axis->SetBinLabel(13,
"MergedPi0");
881 axis->SetBinLabel(14,
"PhotonPhotonOther");
882 axis->SetBinLabel(15,
"HadronHadron");
883 axis->SetBinLabel(16,
"TwoContributorsOther");
884 axis->SetBinLabel(17,
"MoreThanTwoContributors");
898 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
901 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
902 title = histname +
";Centrality;Scale factor;counts";
904 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
906 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
910 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
913 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCalExcl", jets->GetArrayName().Data());
915 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
919 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
923 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCalCharged", jets->GetArrayName().Data());
925 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
929 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
932 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCalChargedExcl", jets->GetArrayName().Data());
934 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
938 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
942 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jets->GetArrayName().Data());
943 title = histname +
";Centrality;Scale factor;counts";
948 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jets->GetArrayName().Data());
949 title = histname +
";Centrality;Scale factor;counts";
952 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jets->GetArrayName().Data());
953 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
956 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jets->GetArrayName().Data());
957 title = histname +
";Centrality;Scale factor;counts";
980 histname =
"TriggerSimHistograms/hEtaVsPhi";
981 title = histname +
";#eta_{patch} (rad);#phi_{patch} (rad)";
985 histname =
"TriggerSimHistograms/hNPatches";
986 title = histname +
";#it{N}_{patches};type";
990 histname =
"TriggerSimHistograms/hPatchE";
991 title = histname +
";Centrality (%);#it{E}_{patch} (GeV)";
995 histname =
"TriggerSimHistograms/hPatchMedianE";
996 title = histname +
";Centrality (%);#it{E}_{patch,med} (GeV);type";
997 fHistManager.
CreateTH3(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 50, 2, -0.5, 1.5);
1000 histname =
"TriggerSimHistograms/hMaxPatchResponseMatrix";
1001 title = histname +
";#it{E}_{maxpatch,det} (GeV);#it{E}_{maxpatch,truth} (GeV)";
1004 histname =
"TriggerSimHistograms/hEMCalEnergyResponseMatrix";
1005 title = histname +
";#Sigma#it{E}_{clus,EMCal} (GeV);#it{E}_{EMCal,truth} (GeV)";
1013 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1016 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1017 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
1023 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
1024 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
1033 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
1034 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
1035 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1038 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
1039 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
1040 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1044 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1045 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
1049 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
1050 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}/#piR^{2}";
1054 nbinsx = 20; minx = 0; maxx = 100;
1056 nbinsz = 50; minz = 0; maxz = 1.;
1058 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1059 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
1060 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1063 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1064 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
1065 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1069 nbinsx = 20; minx = 0; maxx = 100;
1071 nbinsz = 50; minz = 0; maxz = 1.;
1073 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1074 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
1075 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1078 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1079 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
1080 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1084 nbinsx = 20; minx = 0; maxx = 100;
1086 nbinsz = 50; minz = 0; maxz =
fMaxPt;
1088 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1089 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
1090 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1093 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1094 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
1095 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1116 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
1118 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1119 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1122 title = histname +
";#it{p}_{T,corr}^{det} (GeV/#it{c});#it{p}_{T}^{truth} (GeV/#it{c})";
1127 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
1129 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1130 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1133 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1139 nbinsx = 20; minx = 0; maxx = 100;
1140 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1141 nbinsz = 250; minz = -5.; maxz = 5.;
1143 histname =
"MatchedJetHistograms/hJESshiftEMCal";
1145 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1146 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1149 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1154 histname =
"MatchedJetHistograms/hJESshiftDCal";
1156 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1157 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1160 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1166 nbinsx = 20; minx = 0; maxx = 100;
1168 nbinsz = 50; minz = 0; maxz = 1.;
1170 histname =
"MatchedJetHistograms/hNEFVsPt";
1172 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});Calo energy fraction";
1173 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1176 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});Calo energy fraction";
1181 nbinsx = 20; minx = 0; maxx = 100;
1182 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1183 nbinsz = 50; minz = 0; maxz = 1.;
1185 histname =
"MatchedJetHistograms/hZLeadingVsPt";
1187 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{z}_{leading}";
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});#it{z}_{leading}";
1199 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1200 nbinsz = 100; minz = 0; maxz = 4.;
1201 histname =
"MatchedJetHistograms/hMatchingDistance";
1202 title = histname +
";#it{p}_{T}^{det} (GeV/#it{c});#it{p}_{T}^{truth} (GeV/#it{c});R";
1203 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1206 histname =
"MatchedJetHistograms/fHistJetMatchingQA";
1208 std::vector<std::string> binLabels = {
"noMatch",
"matchedJet",
"uniqueMatch",
"jetDistance",
"passedAllCuts"};
1209 auto histMatchedJetCuts =
fHistManager.
CreateTH1(histname.Data(), title.Data(), binLabels.size(), 0, binLabels.size());
1211 for (
unsigned int i = 1; i <= binLabels.size(); i++) {
1212 histMatchedJetCuts->GetXaxis()->SetBinLabel(i, binLabels.at(i-1).c_str());
1214 histMatchedJetCuts->GetYaxis()->SetTitle(
"Number of jets");
1221 nbinsy = 20; miny = 0; maxy = 1.;
1222 nbinsz = 100; minz = 0; maxz = 4.;
1223 histname =
"MatchedJetHistograms/hMatchingDistanceVsMCFraction";
1224 title = histname +
";#it{p}_{T}^{det} (GeV/#it{c});MC fraction;#DeltaR";
1225 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1228 histname =
"MatchedJetHistograms/fHistJetMatchingQA";
1230 std::vector<std::string> binLabels = {
"noMatch",
"matchedJet",
"sharedMomentumFraction",
"partLevelMatchedJet",
"jetDistancePPdet",
"jetDistancePPtruth",
"passedAllCuts"};
1231 auto histMatchedJetCuts =
fHistManager.
CreateTH1(histname.Data(), title.Data(), binLabels.size(), 0, binLabels.size());
1233 for (
unsigned int i = 1; i <= binLabels.size(); i++) {
1234 histMatchedJetCuts->GetXaxis()->SetBinLabel(i, binLabels.at(i-1).c_str());
1236 histMatchedJetCuts->GetYaxis()->SetTitle(
"Number of jets");
1261 TClass cls(objname);
1262 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1263 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1264 GetName(), cls.GetName(),
"EmcalTriggers"));
1269 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1289 TString triggerNameMB1 =
"CINT7-B-NOPF-CENT";
1290 TString triggerNameMB2 =
"CV0L7-B-NOPF-CENT";
1291 TString triggerNameJE =
"CINT7EJ1-B-NOPF-CENTNOPMD";
1296 for (
auto i : runtriggers) {
1297 if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
1306 TString histname =
"Trigger/hMBDownscaleFactor";
1343 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
1344 TString jetContName = jetCont->GetName();
1379 TClass cls(objname);
1380 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1381 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1382 GetName(), cls.GetName(),
"EmcalTriggers"));
1387 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1392 std::vector<Double_t> vecEMCal;
1393 std::vector<Double_t> vecDCal;
1396 AliEMCALTriggerPatchInfo *maxPatch =
nullptr;
1398 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1401 if(!recpatch->IsJetHighSimple())
continue;
1403 patchE = recpatch->GetPatchE();
1405 histname =
"TriggerSimHistograms/hEtaVsPhi";
1408 histname =
"TriggerSimHistograms/hPatchE";
1411 if (recpatch->IsEMCal()) {
1412 vecEMCal.push_back(patchE);
1413 if (patchE > maxPatchEnergy) {
1414 maxPatchEnergy = patchE;
1415 maxPatch = recpatch;
1418 vecDCal.push_back(patchE);
1425 const Int_t nBkgPatchesEMCal = vecEMCal.size();
1426 const Int_t nBkgPatchesDCal = vecDCal.size();
1427 fMedianEMCal = TMath::Median(nBkgPatchesEMCal, &vecEMCal[0]);
1428 fMedianDCal = TMath::Median(nBkgPatchesDCal, &vecDCal[0]);
1430 histname =
"TriggerSimHistograms/hPatchMedianE";
1434 histname =
"TriggerSimHistograms/hNPatches";
1441 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
1442 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
1453 part = mcpart.first;
1454 partEta = part.Eta();
1458 if (partPhi < maxPatch->GetPhiMax() && partPhi > maxPatch->GetPhiMin()) {
1459 if (partEta < maxPatch->GetEtaMax() && partEta > maxPatch->GetEtaMin()) {
1460 truthEnergyPatch += partE;
1464 if (partPhi < phiMaxEMCal && partPhi > phiMinEMCal) {
1465 if (partEta < 0.7 && partEta > -0.7) {
1466 truthEnergyEMCal += partE;
1472 const AliVCluster* clus;
1477 clusFourVec.Clear();
1478 clusFourVec = clusIterator.first;
1479 clusEta = clusFourVec.Eta();
1481 clus = clusIterator.second;
1482 if (clus->IsEMCAL()) {
1483 if (clusPhi < phiMaxEMCal && clusPhi > phiMinEMCal) {
1484 if (clusEta < 0.7 && clusEta > -0.7) {
1485 detEnergyEMCal += clusFourVec.E();
1492 histname =
"TriggerSimHistograms/hMaxPatchResponseMatrix";
1496 histname =
"TriggerSimHistograms/hEMCalEnergyResponseMatrix";
1505 for(
auto p : *fTriggerPatchInfo){
1506 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1509 if(!recpatch->IsJetHighSimple())
continue;
1511 if (recpatch->IsEMCal()) {
1512 if ((recpatch->GetPatchE() -
fMedianDCal) > threshold) {
1517 if ((recpatch->GetPatchE() -
fMedianEMCal) > threshold) {
1565 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1566 TString jetContName = jets->GetName();
1577 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1581 for (
auto jet : jets->
all()) {
1596 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1605 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1615 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1617 else if (type ==
kDCal) {
1618 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1620 TLorentzVector leadPart;
1623 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
1632 UInt_t rejectionReason = 0;
1633 if (!jets->
AcceptJet(jet, rejectionReason)) {
1634 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1639 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), corrPt);
1646 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
1648 else if (type ==
kDCal) {
1649 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
1660 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1666 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1668 else if (type ==
kDCal) {
1669 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1671 const AliVTrack* track;
1672 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1673 track =
static_cast<AliVTrack*
>(jet->Track(i));
1674 z = track->Pt() / TMath::Abs(corrPt);
1685 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1687 else if (type ==
kDCal) {
1688 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1700 if (jet->Eta() > 0) {
1701 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
1704 else if (jet->Eta() < 0) {
1705 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
1714 const AliVCluster* clus =
nullptr;
1715 Int_t nClusters = jet->GetNumberOfClusters();
1716 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1717 clus = jet->Cluster(iClus);
1718 deltaEhadcorr += (clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy());
1721 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
1728 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
1749 const AliVCluster* clus;
1753 Double_t clusPhi = it.first.Phi_0_2pi();
1757 if (!clus->IsEMCAL()) {
1763 Int_t nTracksMatched = 0;
1764 const AliVTrack* track =
nullptr;
1765 for (
Int_t itrack=0; itrack < clus->GetNTracksMatched(); itrack++) {
1766 track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(itrack));
1771 Double_t trackPhi = TVector2::Phi_0_2pi(track->GetTrackPhiOnEMCal());
1772 Double_t trackEta = track->GetTrackEtaOnEMCal();
1773 Double_t deta = TMath::Abs(clusEta - trackEta);
1774 Double_t dphi = TMath::Abs(clusPhi - trackPhi);
1777 trackPSum += track->P();
1783 if (trackPSum > 1e-3) {
1784 EoverP = clus->GetNonLinCorrEnergy() / trackPSum;
1787 Double_t deltaE = clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy();
1789 if (trackPSum > 1e-3) {
1790 Rcorr = deltaE / trackPSum;
1792 Double_t RcorrClus = deltaE / clus->GetNonLinCorrEnergy();
1798 histname =
"ClusterHistograms/hM02";
1802 if (clus->GetM02() > 0.4) {
1803 histname =
"ClusterHistograms/hNcellsM02G04";
1806 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1807 histname =
"ClusterHistograms/hNcellsM02L04";
1815 histname =
"ClusterHistograms/hMatchedTrackPt";
1818 if (clus->GetM02() > 0.4) {
1819 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
1822 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1823 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
1828 histname =
"ClusterHistograms/hMatchedTrackN";
1831 if (clus->GetM02() > 0.4) {
1832 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
1835 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1836 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
1841 histname =
"ClusterHistograms/hM02Matched";
1842 if (nTracksMatched > 0) {
1847 histname =
"ClusterHistograms/hM02Unmatched";
1848 if (nTracksMatched == 0) {
1853 if (nTracksMatched == 1) {
1855 const AliVTrack* track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(0));
1857 Double_t trackEta = track->GetTrackEtaOnEMCal();
1858 Double_t deta = trackEta - clusEta;
1861 histname =
"ClusterHistograms/hDeltaEtaCentral";
1866 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
1877 histname =
"ClusterHistograms/hEoverPM02Central";
1881 histname =
"ClusterHistograms/hEoverPM02Peripheral";
1889 histname =
"ClusterHistograms/hRcorrVsCent";
1894 histname =
"ClusterHistograms/hRcorr0-10";
1900 histname =
"ClusterHistograms/hRcorr50-90";
1905 histname =
"ClusterHistograms/hRcorrClusVsCent";
1910 histname =
"ClusterHistograms/hRcorrClus0-10";
1916 histname =
"ClusterHistograms/hRcorrClus50-90";
1923 histname =
"ClusterHistograms/hTrackMultiplicity";
1936 const AliMCEvent* mcevent =
nullptr;
1938 mcevent = MCEvent();
1961 const AliVCluster* clus;
1962 std::vector<ContributorType> vecContributorTypes;
1963 std::vector<Int_t> vecContributorLabels;
1969 if (!clus->IsEMCAL()) {
1976 const Int_t nLabels = clus->GetNLabels();
1979 vecContributorTypes.clear();
1980 vecContributorLabels.clear();
1981 for (
Int_t iLabel=0; iLabel<nLabels; iLabel++) {
1983 Int_t label = clus->GetLabels()[iLabel];
1984 if (TMath::Abs(label) > 0) {
1987 vecContributorTypes.push_back(contributorType);
1988 vecContributorLabels.push_back(label);
1993 Int_t nLabelsPhysPrim = vecContributorTypes.size();
1995 if (nLabelsPhysPrim == 1) {
1997 contributorType = vecContributorTypes[0];
1999 if (contributorType ==
kPhoton) {
2002 else if (contributorType ==
kElectron) {
2008 else if (contributorType ==
kProton) {
2017 else if (contributorType ==
kK0L) {
2020 else if (contributorType ==
kNeutron) {
2031 else if (nLabelsPhysPrim == 2) {
2039 Double_t frac1 = clus->GetClusterMCEdepFraction(1);
2047 if (isHadron1 && isHadron2) {
2050 else if (isPhoton1 && isHadron2) {
2054 Double_t photonEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
2055 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
2058 else if (isHadron1 && isPhoton2) {
2062 Double_t hadronEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
2063 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
2066 else if (isPhoton1 && isPhoton2) {
2074 if (part1 && part2) {
2075 Int_t iMother1 = part1->GetMother();
2076 Int_t iMother2 = part2->GetMother();
2077 AliVParticle *mother1 = mcevent->GetTrack(iMother1);
2078 AliVParticle *mother2 = mcevent->GetTrack(iMother2);
2080 if (mother1 && mother2) {
2081 if ( (mother1->PdgCode() == 111) && (mother2->PdgCode() == 111) ) {
2082 if (iMother1 == iMother2) {
2094 else if (nLabelsPhysPrim > 2) {
2100 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
2101 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
2104 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
2105 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
2118 const AliVCluster* clus;
2120 for (
const auto jet : jets->
accepted()) {
2125 Double_t hadCaloEnergyUnmatched = 0;
2126 Double_t hadCaloEnergyMatchedNonlincorr = 0;
2127 Double_t hadCaloEnergyMatchedHadCorr = 0;
2130 Int_t nClusters = jet->GetNumberOfClusters();
2131 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
2133 clus = jet->Cluster(iClus);
2137 Int_t label = TMath::Abs(clus->GetLabel());
2143 histname =
"JetPerformanceMC/hM02VsContributorTypeJets";
2144 Double_t x[4] = {clus->GetM02(), clus->GetNonLinCorrEnergy(), contributorType, jetPt};
2150 Bool_t hasMatchedTrack = (clus->GetNTracksMatched() > 0);
2152 if (hasMatchedTrack) {
2153 hadCaloEnergyMatchedNonlincorr += clus->GetNonLinCorrEnergy();
2154 hadCaloEnergyMatchedHadCorr += clus->GetHadCorrEnergy();
2157 hadCaloEnergyUnmatched += clus->GetNonLinCorrEnergy();
2166 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
2170 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
2174 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
2178 histname =
"JetPerformanceMC/hJetComposition";
2179 for (
Int_t type = 0; type < 8; type++) {
2186 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
2188 clus = jet->Cluster(iClus);
2190 Int_t label = TMath::Abs(clus->GetLabel());
2195 if (type == contributorType) {
2197 pTsum += clus->GetNonLinCorrEnergy();
2202 Double_t x[4] = {jetPt, 1.*type, nSum, pTsum};
2222 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
2223 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
2224 Double_t phiMinDCal =
fGeom->GetDCALPhiMin() * TMath::DegToRad();
2225 Double_t phiMaxDCal =
fGeom->GetDCALPhiMax() * TMath::DegToRad();
2227 Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
2228 Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
2229 Double_t accDCal = 2 * (etaEMCal - etaMinDCal) * (phiMaxDCal - phiMinDCal);
2234 while ((jetCont = static_cast<AliJetContainer*>(nextJetColl()))) {
2238 Int_t maxJetIds[] = {-1, -1};
2239 Float_t maxJetPts[] = { 0, 0};
2246 if (jet->
Pt() > maxJetPts[0]) {
2247 maxJetPts[1] = maxJetPts[0];
2248 maxJetIds[1] = maxJetIds[0];
2249 maxJetPts[0] = jet->
Pt();
2252 else if (jet->
Pt() > maxJetPts[1]) {
2253 maxJetPts[1] = jet->
Pt();
2259 TRandom3* r =
new TRandom3(0);
2261 Double_t etaEMCalfid = etaEMCal - jetR;
2262 Double_t etaMinDCalfid = etaMinDCal + jetR;
2263 Double_t phiMinEMCalfid = phiMinEMCal + jetR;
2264 Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
2265 Double_t phiMinDCalfid = phiMinDCal + jetR;
2266 Double_t phiMaxDCalfid = phiMaxDCal - jetR;
2267 Double_t accEMCalfid = 2 * etaEMCalfid * (phiMaxEMCalfid - phiMinEMCalfid);
2268 Double_t accDCalfid = 2 * (etaEMCalfid - etaMinDCalfid) * (phiMaxDCalfid - phiMinDCalfid);
2269 if ( (etaEMCalfid - etaMinDCalfid) < 0) {
2274 Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
2275 Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
2278 Double_t etaDCalRC = r->Uniform(etaMinDCalfid, etaEMCalfid);
2279 Double_t sign = r->Uniform(-1., 1.);
2281 etaDCalRC = -1*etaDCalRC;
2283 Double_t phiDCalRC = r->Uniform(phiMinDCalfid, phiMaxDCalfid);
2305 AliVParticle* track;
2312 while ((partCont = static_cast<AliParticleContainer*>(nextPartCont()))) {
2314 TString partContName = partCont->GetName();
2315 if (!partContName.CompareTo(
"tracks") || !partContName.CompareTo(
"thermalparticles")) {
2319 trackVec = trackIterator.first;
2320 trackEta = trackVec.Eta();
2322 trackPt = trackVec.Pt();
2324 track = trackIterator.second;
2325 TClonesArray* fTracksContArray = partCont->GetArray();
2326 trackID = fTracksContArray->IndexOf(track);
2329 if (TMath::Abs(trackEta) < etaTPC) {
2330 trackPtSumTPC += trackPt;
2334 if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
2335 trackPtSumEMCal += trackPt;
2339 if (TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinEMCalfid && trackPhi < phiMaxEMCalfid) {
2340 trackPtSumEMCalfid += trackPt;
2345 if (TMath::Abs(trackEta) > etaMinDCal && TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinDCal && trackPhi < phiMaxDCal) {
2346 trackPtSumDCal += trackPt;
2352 if (TMath::Abs(trackEta) > etaMinDCalfid && TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinDCalfid && trackPhi < phiMaxDCalfid) {
2353 trackPtSumDCalfid += trackPt;
2358 deltaR =
GetDeltaR(&trackVec, etaEMCalRC, phiEMCalRC);
2359 if (deltaR < jetR) {
2360 trackPtSumEMCalRC += trackPt;
2371 deltaR =
GetDeltaR(&trackVec, etaDCalRC, phiDCalRC);
2372 if (deltaR < jetR) {
2373 trackPtSumDCalRC += trackPt;
2382 TString jetContName = jetCont->GetName();
2383 if (!jetContName.Contains(
"Charged")) {
2394 clusVec = clusIterator.first;
2395 clusEta = clusVec.Eta();
2397 clusPt = clusVec.Pt();
2398 clus = clusIterator.second;
2399 TClonesArray* fClusContArray = clusCont->GetArray();
2400 clusID = fClusContArray->IndexOf(clus);
2403 if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
2404 clusPtSumEMCal += clusPt;
2408 if (TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinEMCalfid && clusPhi < phiMaxEMCalfid) {
2409 clusPtSumEMCalfid += clusPt;
2414 if (TMath::Abs(clusEta) > etaMinDCal && TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinDCal && clusPhi < phiMaxDCal) {
2415 clusPtSumDCal += clusPt;
2421 if (TMath::Abs(clusEta) > etaMinDCalfid && TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinDCalfid && clusPhi < phiMaxDCalfid) {
2422 clusPtSumDCalfid += clusPt;
2427 deltaR =
GetDeltaR(&clusVec, etaEMCalRC, phiEMCalRC);
2428 if (deltaR < jetR) {
2429 clusPtSumEMCalRC += clusPt;
2439 deltaR =
GetDeltaR(&clusVec, etaDCalRC, phiDCalRC);
2440 if (deltaR < jetR) {
2441 clusPtSumDCalRC += clusPt;
2449 Double_t numerator = (trackPtSumEMCal + clusPtSumEMCal) / accEMCal;
2450 Double_t denominator = trackPtSumTPC / accTPC;
2451 Double_t scaleFactor = numerator / denominator;
2452 TString histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
2456 if (accEMCalfid > 1e-3) {
2457 numerator = (trackPtSumEMCalfid + clusPtSumEMCalfid) / accEMCalfid;
2458 scaleFactor = numerator / denominator;
2459 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jetCont->GetArrayName().Data());
2465 numerator = (trackPtSumDCal + clusPtSumDCal) / accDCal;
2466 scaleFactor = numerator / denominator;
2467 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jetCont->GetArrayName().Data());
2473 if (accDCalfid > 1e-3) {
2474 numerator = (trackPtSumDCalfid + clusPtSumDCalfid) / accDCalfid;
2475 scaleFactor = numerator / denominator;
2476 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jetCont->GetArrayName().Data());
2484 Double_t deltaPt = trackPtSumEMCalRC - rho * TMath::Pi() * jetR * jetR;
2486 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCalCharged", jetCont->GetArrayName().Data());
2491 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCalChargedExcl", jetCont->GetArrayName().Data());
2495 deltaPt += clusPtSumEMCalRC;
2496 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
2501 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCalExcl", jetCont->GetArrayName().Data());
2506 if (accDCalfid > 1e-3) {
2507 deltaPt = trackPtSumDCalRC + clusPtSumDCalRC - rho * TMath::Pi() * jetR * jetR;
2508 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jetCont->GetArrayName().Data());
2528 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2529 TString jetContName = jets->GetName();
2535 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
2539 for (
auto jet : jets->
all()) {
2545 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
2549 UInt_t rejectionReason = 0;
2550 if (!jets->
AcceptJet(jet, rejectionReason)) {
2551 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
2552 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
2566 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
2568 else if (type ==
kDCal) {
2569 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
2574 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
2579 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
2581 else if (type ==
kDCal) {
2582 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
2584 TLorentzVector leadPart;
2587 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2592 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
2594 else if (type ==
kDCal) {
2595 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
2597 const AliVTrack* track;
2598 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
2599 track =
static_cast<AliVTrack*
>(jet->Track(i));
2600 z = track->Pt() / TMath::Abs(corrPt);
2606 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
2608 else if (type ==
kDCal) {
2609 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
2669 if (!matchedPartLevelJet) {
2672 Float_t truthPt = matchedPartLevelJet->
Pt();
2685 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
2687 else if (type ==
kDCal) {
2688 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
2699 histname =
"MatchedJetHistograms/hJESshiftEMCal";
2701 else if (type ==
kDCal) {
2702 histname =
"MatchedJetHistograms/hJESshiftDCal";
2712 histname =
"MatchedJetHistograms/hNEFVsPt";
2721 histname =
"MatchedJetHistograms/hZLeadingVsPt";
2722 TLorentzVector leadPart;
2725 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2743 for (
auto jet1 : jetCont1->
all()) {
2744 jet1->ResetMatching();
2746 for (
auto jet2 : jetCont2->
all()) {
2747 jet2->ResetMatching();
2750 for (
auto jet1 : jetCont1->
accepted()) {
2752 if (bUseJetCont2Acceptance) {
2753 for (
auto jet2 : jetCont2->
accepted()) {
2758 for (
auto jet2 : jetCont2->
all()) {
2776 if (deltaR < jet1->ClosestJetDistance()) {
2780 if (deltaR < jet2->ClosestJetDistance()) {
2800 TString histNameQA =
"MatchedJetHistograms/fHistJetMatchingQA";
2805 bool returnValue =
false;
2813 returnValue =
false;
2819 TString histname =
"MatchedJetHistograms/hMatchingDistance";
2826 returnValue =
false;
2833 if (returnValue ==
true) {
2839 returnValue =
false;
2843 return partLevelJet;
2850 bool returnValue =
false;
2861 returnValue =
false;
2870 if (!partLevelJet) {
2871 returnValue =
false;
2880 returnValue =
false;
2890 returnValue =
false;
2898 if (returnValue ==
true) {
2903 TString histname =
"MatchedJetHistograms/hMatchingDistanceVsMCFraction";
2909 returnValue =
false;
2913 return partLevelJet;
2929 TString histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
2930 UInt_t rejectionReason = 0;
2933 return contributorType;
2936 if (part->GetGeneratorIndex() == 0) {
2944 else if (TMath::Abs(pdg) == 211) {
2947 else if (pdg == 2212) {
2950 else if (pdg == -2212) {
2953 else if (TMath::Abs(pdg) == 321) {
2956 else if (pdg == 130) {
2957 contributorType =
kK0L;
2959 else if (pdg == 2112) {
2962 else if (pdg == -2112) {
2965 else if (TMath::Abs(pdg) == 11) {
2968 else if (TMath::Abs(pdg) == 13) {
2969 contributorType =
kMuon;
2972 contributorType =
kOther;
2976 return contributorType;
2985 Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
2986 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
3032 for (
Int_t i=0; i<2; i++)
3034 if(maxJetIds[i]==-1)
continue;
3036 Int_t ClusterConstituentID=-1;
3037 Int_t TrackConstituentID =-1;
3047 if(ClusterConstituentID>-1 || TrackConstituentID>-1)
3058 const char *ntracks,
3059 const char *nclusters,
3060 const char *nGenLev,
3070 ::Error(
"AddTaskEmcalJetPerformance",
"No analysis manager to connect to.");
3076 AliVEventHandler* handler = mgr->GetInputEventHandler();
3079 ::Error(
"AddTaskEmcalJetPerformance",
"This task requires an input event handler");
3091 if (handler->InheritsFrom(
"AliESDInputHandler")) {
3094 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
3105 if (trackName ==
"usedefault") {
3106 if (dataType ==
kESD) {
3107 trackName =
"Tracks";
3109 else if (dataType == kAOD) {
3110 trackName =
"tracks";
3117 if (clusName ==
"usedefault") {
3118 if (dataType ==
kESD) {
3119 clusName =
"CaloClusters";
3121 else if (dataType == kAOD) {
3122 clusName =
"caloClusters";
3129 TString name(
"AliAnalysisTaskEmcalJetPerformance");
3130 if (!trackName.IsNull()) {
3134 if (!clusName.IsNull()) {
3138 if (strcmp(suffix,
"") != 0) {
3151 if (trackName ==
"mcparticles") {
3153 partCont = mcpartCont;
3155 else if (trackName ==
"tracks" || trackName ==
"Tracks") {
3157 partCont = trackCont;
3163 if (nGenLev && strcmp(nGenLev,
"")!=0) {
3171 if (!clusName.IsNull()) {
3185 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
3187 contname +=
"_histos";
3188 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
3189 TList::Class(),AliAnalysisManager::kOutputContainer,
3190 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
3191 mgr->ConnectInput (task, 0, cinput1 );
3192 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
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()