30 #include <TClonesArray.h> 35 #include <THnSparse.h> 40 #include <AliVCluster.h> 41 #include <AliVParticle.h> 44 #include "AliAnalysisManager.h" 45 #include <AliVEventHandler.h> 52 #include "AliEMCALGeometry.h" 53 #include "AliOADBContainer.h" 55 #include "AliEMCALTriggerPatchInfo.h" 57 #include "AliMCEvent.h" 70 fPlotJetHistograms(kFALSE),
71 fPlotClusterHistograms(kFALSE),
72 fPlotParticleCompositionHistograms(kFALSE),
73 fComputeBackground(kFALSE),
74 fDoTriggerSimulation(kFALSE),
75 fPlotMatchedJetHistograms(kFALSE),
76 fComputeMBDownscaling(kFALSE),
90 fTrackMatchingDeltaEtaMax(0.015),
91 fTrackMatchingDeltaPhiMax(0.030),
96 fDoTriggerResponse(kFALSE),
97 fDoJetMatchingGeometrical(kFALSE),
98 fDoJetMatchingMCFraction(kFALSE),
102 fDetJetContainerPPIntermediate(
nullptr),
104 fMinSharedMomentumFraction(0.5),
105 fMCJetMinMatchingPt(0.15),
106 fPlotJetMatchCandThresh(1.),
107 fUseAliEventCuts(kTRUE),
110 fUseManualEventCuts(kFALSE),
236 fEventCuts.fUseVariablesCorrelationCuts =
true;
251 Printf(
"Geometrical jet matching enabled.");
253 for (
Int_t i=0; i<2; i++) {
255 TString jetContName = jetCont->GetName();
256 if (jetContName.Contains(
"mcparticles")) {
266 Printf(
"MC-fraction jet matching enabled.");
268 for (
Int_t i=0; i<3; i++) {
270 TString jetContName = jetCont->GetName();
271 if (jetContName.Contains(
"mcparticles")) {
274 else if (jetContName.Contains(
"Combined")) {
285 Printf(
"No MC jet container found!");
290 Printf(
"No det-level jet container found!");
296 Printf(
"No intermediate pp det-level jet container found, despite MC-fraction matching enabled!");
325 if (embeddingHelper) {
334 while ((obj = next())) {
356 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
363 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
365 title = histname +
";Centrality (%);Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
366 TH3* hist =
fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, 32, 0, 32, nPtBins5,
fMinPt,
fMaxPt);
369 title = histname +
";Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
376 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
378 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
388 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
390 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
391 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
394 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});NEF";
399 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", 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";
412 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
413 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
414 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, 0, 100, nPtBins2,
fMinPt,
fMaxPt, 2, -0.5, 1.5,
"s");
418 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
420 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
421 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, nPtBins2,
fMinPt,
fMaxPt,
fMaxPt, 0,
fMaxPt);
424 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
429 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
431 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
432 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, nPtBins2,
fMinPt,
fMaxPt, 50, 0, 0.5);
435 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
440 nbinsx = 20; minx = 0; maxx = 100;
442 nbinsz = 50; minz = 0; maxz = 1.;
444 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
446 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
447 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
450 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
455 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", 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}";
467 nbinsx = 20; minx = 0; maxx = 100;
469 nbinsz = 50; minz = 0; maxz = 1.;
471 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
473 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
474 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
477 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
482 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", 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}";
494 nbinsx = 20; minx = 0; maxx = 100;
496 nbinsz = 50; minz = 0; maxz =
fMaxPt;
498 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
500 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
501 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
504 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
509 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", 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";
522 nbinsx = 20; minx = 0; maxx = 100;
525 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
526 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
529 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
530 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
536 nbinsx = 20; minx = 0; maxx = 100;
540 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
541 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#sum#it{E}_{nonlincorr} - #it{E}_{hadcorr}";
542 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
547 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
548 title = histname +
";#it{E}_{patch,med};type;#it{p}_{T}^{corr} (GeV/#it{c});Centrality (%)";
549 Int_t nbins5[4] = {100, 2, nPtBins2, 50};
559 histname =
"Trigger/hMBDownscaleFactor";
560 title = histname +
";Downscale factor;counts";
574 const Int_t nRcorrBins = 50;
576 const Int_t nCellBins = 30;
578 const Int_t nMatchedTrackBins = 5;
580 const Int_t nDeltaEtaBins = 60;
587 histname =
"ClusterHistograms/hM02";
588 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
592 histname =
"ClusterHistograms/hNcellsM02G04";
593 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
596 histname =
"ClusterHistograms/hNcellsM02L04";
597 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
604 histname =
"ClusterHistograms/hMatchedTrackPt";
605 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
608 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
609 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
612 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
613 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
617 histname =
"ClusterHistograms/hMatchedTrackN";
618 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
621 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
622 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
625 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
626 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
630 histname =
"ClusterHistograms/hM02Matched";
631 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
635 histname =
"ClusterHistograms/hM02Unmatched";
636 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
640 histname =
"ClusterHistograms/hDeltaEtaCentral";
641 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
644 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
645 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
652 histname =
"ClusterHistograms/hEoverPM02Central";
653 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
656 histname =
"ClusterHistograms/hEoverPM02Peripheral";
657 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
664 histname =
"ClusterHistograms/hRcorrVsCent";
665 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
669 histname =
"ClusterHistograms/hRcorr0-10";
670 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
674 histname =
"ClusterHistograms/hRcorr50-90";
675 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
679 histname =
"ClusterHistograms/hRcorrClusVsCent";
680 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
684 histname =
"ClusterHistograms/hRcorrClus0-10";
685 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
689 histname =
"ClusterHistograms/hRcorrClus50-90";
690 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
694 histname =
"ClusterHistograms/hTrackMultiplicity";
695 htitle = histname +
";N_{tracks};Centrality (%)";
708 const Int_t nRejBins = 32;
711 const Int_t nContributorTypes = 11;
713 const Int_t nParticleTypes = 17;
716 AliEmcalContainer* cont = 0;
718 while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) {
720 histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
721 htitle = histname +
";Rejection reason;#it{E}_{clus} (GeV/)";
727 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
728 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
732 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
733 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
738 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
739 htitle = histname +
";Centrality (%);M02;#it{E}_{photon} (GeV)";
743 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
744 htitle = histname +
";Centrality (%);M02;#it{E}_{hadron} (GeV)";
760 min[dim] = fM02HistBins[0];
764 title[dim] =
"#it{E}_{clus} (GeV)";
767 min[dim] = fPtHistBins[0];
771 title[dim] =
"Contributor type";
772 nbins[dim] = nContributorTypes;
775 binEdges[dim] = contributorTypeBins;
778 title[dim] =
"#it{p}_{T,jet}^{corr}";
785 TString thnname =
"JetPerformanceMC/hM02VsContributorTypeJets";
787 for (
Int_t i = 0; i < dim; i++) {
788 hn->GetAxis(i)->SetTitle(title[i]);
789 hn->SetBinEdges(i, binEdges[i]);
796 title[dim] =
"#it{p}_{T,jet}^{corr}";
803 title[dim] =
"Contributor type";
804 nbins[dim] = nContributorTypes;
807 binEdges[dim] = contributorTypeBins;
817 title[dim] =
"#it{p}_{T,sum} (GeV)";
820 min[dim] = fPtHistBins[0];
824 thnname =
"JetPerformanceMC/hJetComposition";
826 for (
Int_t i = 0; i < dim; i++) {
827 thn->GetAxis(i)->SetTitle(title[i]);
828 thn->SetBinEdges(i, binEdges[i]);
834 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
835 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
839 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
840 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
844 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
845 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
857 axis->SetBinLabel(1,
"SinglePhoton");
858 axis->SetBinLabel(2,
"SingleElectron");
859 axis->SetBinLabel(3,
"SingleChargedPion");
860 axis->SetBinLabel(4,
"SingleProton");
861 axis->SetBinLabel(5,
"SingleAntiProton");
862 axis->SetBinLabel(6,
"SingleChargedKaon");
863 axis->SetBinLabel(7,
"SingleK0L");
864 axis->SetBinLabel(8,
"SingleNeutron");
865 axis->SetBinLabel(9,
"SingleAntiNeutron");
866 axis->SetBinLabel(10,
"SingleOther");
867 axis->SetBinLabel(11,
"PhotonHadron");
868 axis->SetBinLabel(12,
"HadronPhoton");
869 axis->SetBinLabel(13,
"MergedPi0");
870 axis->SetBinLabel(14,
"PhotonPhotonOther");
871 axis->SetBinLabel(15,
"HadronHadron");
872 axis->SetBinLabel(16,
"TwoContributorsOther");
873 axis->SetBinLabel(17,
"MoreThanTwoContributors");
887 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
890 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
891 title = histname +
";Centrality;Scale factor;counts";
894 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
895 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
898 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jets->GetArrayName().Data());
899 title = histname +
";Centrality;Scale factor;counts";
904 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jets->GetArrayName().Data());
905 title = histname +
";Centrality;Scale factor;counts";
908 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jets->GetArrayName().Data());
909 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
912 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jets->GetArrayName().Data());
913 title = histname +
";Centrality;Scale factor;counts";
936 histname =
"TriggerSimHistograms/hEtaVsPhi";
937 title = histname +
";#eta_{patch} (rad);#phi_{patch} (rad)";
941 histname =
"TriggerSimHistograms/hNPatches";
942 title = histname +
";#it{N}_{patches};type";
946 histname =
"TriggerSimHistograms/hPatchE";
947 title = histname +
";Centrality (%);#it{E}_{patch} (GeV)";
951 histname =
"TriggerSimHistograms/hPatchMedianE";
952 title = histname +
";Centrality (%);#it{E}_{patch,med} (GeV);type";
953 fHistManager.
CreateTH3(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 50, 2, -0.5, 1.5);
956 histname =
"TriggerSimHistograms/hMaxPatchResponseMatrix";
957 title = histname +
";#it{E}_{maxpatch,det} (GeV);#it{E}_{maxpatch,truth} (GeV)";
960 histname =
"TriggerSimHistograms/hEMCalEnergyResponseMatrix";
961 title = histname +
";#Sigma#it{E}_{clus,EMCal} (GeV);#it{E}_{EMCal,truth} (GeV)";
969 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
972 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
973 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
979 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
980 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
989 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
990 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
991 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
994 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
995 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
996 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1000 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1001 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
1005 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
1006 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
1010 nbinsx = 20; minx = 0; maxx = 100;
1012 nbinsz = 50; minz = 0; maxz = 1.;
1014 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1015 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
1016 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1019 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1020 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
1021 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1025 nbinsx = 20; minx = 0; maxx = 100;
1027 nbinsz = 50; minz = 0; maxz = 1.;
1029 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1030 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
1031 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1034 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1035 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
1036 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1040 nbinsx = 20; minx = 0; maxx = 100;
1042 nbinsz = 50; minz = 0; maxz =
fMaxPt;
1044 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1045 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
1046 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1049 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1050 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
1051 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1072 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
1074 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1075 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1078 title = histname +
";#it{p}_{T,corr}^{det} (GeV/#it{c});#it{p}_{T}^{truth} (GeV/#it{c})";
1083 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
1085 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1086 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1089 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1095 nbinsx = 20; minx = 0; maxx = 100;
1096 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1097 nbinsz = 250; minz = -5.; maxz = 5.;
1099 histname =
"MatchedJetHistograms/hJESshiftEMCal";
1101 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1102 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1105 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1110 histname =
"MatchedJetHistograms/hJESshiftDCal";
1112 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1113 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1116 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1122 nbinsx = 20; minx = 0; maxx = 100;
1124 nbinsz = 50; minz = 0; maxz = 1.;
1126 histname =
"MatchedJetHistograms/hNEFVsPt";
1128 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});Calo energy fraction";
1129 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1132 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});Calo energy fraction";
1137 nbinsx = 20; minx = 0; maxx = 100;
1138 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1139 nbinsz = 50; minz = 0; maxz = 1.;
1141 histname =
"MatchedJetHistograms/hZLeadingVsPt";
1143 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{z}_{leading}";
1144 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1147 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#it{z}_{leading}";
1155 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1156 nbinsz = 100; minz = 0; maxz = 4.;
1157 histname =
"MatchedJetHistograms/hMatchingDistance";
1158 title = histname +
";#it{p}_{T}^{det} (GeV/#it{c});#it{p}_{T}^{truth} (GeV/#it{c});R";
1159 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1162 histname =
"MatchedJetHistograms/fHistJetMatchingQA";
1164 std::vector<std::string> binLabels = {
"noMatch",
"matchedJet",
"uniqueMatch",
"jetDistance",
"passedAllCuts"};
1165 auto histMatchedJetCuts =
fHistManager.
CreateTH1(histname.Data(), title.Data(), binLabels.size(), 0, binLabels.size());
1167 for (
unsigned int i = 1; i <= binLabels.size(); i++) {
1168 histMatchedJetCuts->GetXaxis()->SetBinLabel(i, binLabels.at(i-1).c_str());
1170 histMatchedJetCuts->GetYaxis()->SetTitle(
"Number of jets");
1177 nbinsy = 20; miny = 0; maxy = 1.;
1178 nbinsz = 100; minz = 0; maxz = 4.;
1179 histname =
"MatchedJetHistograms/hMatchingDistanceVsMCFraction";
1180 title = histname +
";#it{p}_{T}^{det} (GeV/#it{c});MC fraction;#DeltaR";
1181 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1184 histname =
"MatchedJetHistograms/fHistJetMatchingQA";
1186 std::vector<std::string> binLabels = {
"noMatch",
"matchedJet",
"sharedMomentumFraction",
"partLevelMatchedJet",
"jetDistance",
"passedAllCuts"};
1187 auto histMatchedJetCuts =
fHistManager.
CreateTH1(histname.Data(), title.Data(), binLabels.size(), 0, binLabels.size());
1189 for (
unsigned int i = 1; i <= binLabels.size(); i++) {
1190 histMatchedJetCuts->GetXaxis()->SetBinLabel(i, binLabels.at(i-1).c_str());
1192 histMatchedJetCuts->GetYaxis()->SetTitle(
"Number of jets");
1217 TClass cls(objname);
1218 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1219 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1220 GetName(), cls.GetName(),
"EmcalTriggers"));
1225 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1245 TString triggerNameMB1 =
"CINT7-B-NOPF-CENT";
1246 TString triggerNameMB2 =
"CV0L7-B-NOPF-CENT";
1247 TString triggerNameJE =
"CINT7EJ1-B-NOPF-CENTNOPMD";
1252 for (
auto i : runtriggers) {
1253 if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
1262 TString histname =
"Trigger/hMBDownscaleFactor";
1299 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
1300 TString jetContName = jetCont->GetName();
1335 TClass cls(objname);
1336 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1337 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1338 GetName(), cls.GetName(),
"EmcalTriggers"));
1343 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1348 std::vector<Double_t> vecEMCal;
1349 std::vector<Double_t> vecDCal;
1352 AliEMCALTriggerPatchInfo *maxPatch =
nullptr;
1354 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1357 if(!recpatch->IsJetHighSimple())
continue;
1359 patchE = recpatch->GetPatchE();
1361 histname =
"TriggerSimHistograms/hEtaVsPhi";
1364 histname =
"TriggerSimHistograms/hPatchE";
1367 if (recpatch->IsEMCal()) {
1368 vecEMCal.push_back(patchE);
1369 if (patchE > maxPatchEnergy) {
1370 maxPatchEnergy = patchE;
1371 maxPatch = recpatch;
1374 vecDCal.push_back(patchE);
1381 const Int_t nBkgPatchesEMCal = vecEMCal.size();
1382 const Int_t nBkgPatchesDCal = vecDCal.size();
1383 fMedianEMCal = TMath::Median(nBkgPatchesEMCal, &vecEMCal[0]);
1384 fMedianDCal = TMath::Median(nBkgPatchesDCal, &vecDCal[0]);
1386 histname =
"TriggerSimHistograms/hPatchMedianE";
1390 histname =
"TriggerSimHistograms/hNPatches";
1397 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
1398 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
1409 part = mcpart.first;
1410 partEta = part.Eta();
1414 if (partPhi < maxPatch->GetPhiMax() && partPhi > maxPatch->GetPhiMin()) {
1415 if (partEta < maxPatch->GetEtaMax() && partEta > maxPatch->GetEtaMin()) {
1416 truthEnergyPatch += partE;
1420 if (partPhi < phiMaxEMCal && partPhi > phiMinEMCal) {
1421 if (partEta < 0.7 && partEta > -0.7) {
1422 truthEnergyEMCal += partE;
1428 const AliVCluster* clus;
1433 clusFourVec.Clear();
1434 clusFourVec = clusIterator.first;
1435 clusEta = clusFourVec.Eta();
1437 clus = clusIterator.second;
1438 if (clus->IsEMCAL()) {
1439 if (clusPhi < phiMaxEMCal && clusPhi > phiMinEMCal) {
1440 if (clusEta < 0.7 && clusEta > -0.7) {
1441 detEnergyEMCal += clusFourVec.E();
1448 histname =
"TriggerSimHistograms/hMaxPatchResponseMatrix";
1452 histname =
"TriggerSimHistograms/hEMCalEnergyResponseMatrix";
1461 for(
auto p : *fTriggerPatchInfo){
1462 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1465 if(!recpatch->IsJetHighSimple())
continue;
1467 if (recpatch->IsEMCal()) {
1468 if ((recpatch->GetPatchE() -
fMedianDCal) > threshold) {
1473 if ((recpatch->GetPatchE() -
fMedianEMCal) > threshold) {
1521 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1522 TString jetContName = jets->GetName();
1531 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1535 for (
auto jet : jets->
all()) {
1549 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1558 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1568 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1570 else if (type ==
kDCal) {
1571 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1573 TLorentzVector leadPart;
1576 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
1585 UInt_t rejectionReason = 0;
1586 if (!jets->
AcceptJet(jet, rejectionReason)) {
1587 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1592 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), corrPt);
1599 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
1601 else if (type ==
kDCal) {
1602 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
1613 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1619 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1621 else if (type ==
kDCal) {
1622 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1624 const AliVTrack* track;
1625 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1626 track =
static_cast<AliVTrack*
>(jet->Track(i));
1627 z = track->Pt() / TMath::Abs(corrPt);
1638 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1640 else if (type ==
kDCal) {
1641 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1653 if (jet->Eta() > 0) {
1654 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
1657 else if (jet->Eta() < 0) {
1658 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
1667 const AliVCluster* clus =
nullptr;
1668 Int_t nClusters = jet->GetNumberOfClusters();
1669 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1670 clus = jet->Cluster(iClus);
1671 deltaEhadcorr += (clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy());
1674 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
1681 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
1702 const AliVCluster* clus;
1706 Double_t clusPhi = it.first.Phi_0_2pi();
1710 if (!clus->IsEMCAL()) {
1716 Int_t nTracksMatched = 0;
1717 const AliVTrack* track =
nullptr;
1718 for (
Int_t itrack=0; itrack < clus->GetNTracksMatched(); itrack++) {
1719 track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(itrack));
1724 Double_t trackPhi = TVector2::Phi_0_2pi(track->GetTrackPhiOnEMCal());
1725 Double_t trackEta = track->GetTrackEtaOnEMCal();
1726 Double_t deta = TMath::Abs(clusEta - trackEta);
1727 Double_t dphi = TMath::Abs(clusPhi - trackPhi);
1730 trackPSum += track->P();
1736 if (trackPSum > 1e-3) {
1737 EoverP = clus->GetNonLinCorrEnergy() / trackPSum;
1740 Double_t deltaE = clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy();
1742 if (trackPSum > 1e-3) {
1743 Rcorr = deltaE / trackPSum;
1745 Double_t RcorrClus = deltaE / clus->GetNonLinCorrEnergy();
1751 histname =
"ClusterHistograms/hM02";
1755 if (clus->GetM02() > 0.4) {
1756 histname =
"ClusterHistograms/hNcellsM02G04";
1759 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1760 histname =
"ClusterHistograms/hNcellsM02L04";
1768 histname =
"ClusterHistograms/hMatchedTrackPt";
1771 if (clus->GetM02() > 0.4) {
1772 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
1775 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1776 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
1781 histname =
"ClusterHistograms/hMatchedTrackN";
1784 if (clus->GetM02() > 0.4) {
1785 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
1788 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1789 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
1794 histname =
"ClusterHistograms/hM02Matched";
1795 if (nTracksMatched > 0) {
1800 histname =
"ClusterHistograms/hM02Unmatched";
1801 if (nTracksMatched == 0) {
1806 if (nTracksMatched == 1) {
1808 const AliVTrack* track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(0));
1810 Double_t trackEta = track->GetTrackEtaOnEMCal();
1811 Double_t deta = trackEta - clusEta;
1814 histname =
"ClusterHistograms/hDeltaEtaCentral";
1819 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
1830 histname =
"ClusterHistograms/hEoverPM02Central";
1834 histname =
"ClusterHistograms/hEoverPM02Peripheral";
1842 histname =
"ClusterHistograms/hRcorrVsCent";
1847 histname =
"ClusterHistograms/hRcorr0-10";
1853 histname =
"ClusterHistograms/hRcorr50-90";
1858 histname =
"ClusterHistograms/hRcorrClusVsCent";
1863 histname =
"ClusterHistograms/hRcorrClus0-10";
1869 histname =
"ClusterHistograms/hRcorrClus50-90";
1876 histname =
"ClusterHistograms/hTrackMultiplicity";
1889 const AliMCEvent* mcevent =
nullptr;
1891 mcevent = MCEvent();
1914 const AliVCluster* clus;
1915 std::vector<ContributorType> vecContributorTypes;
1916 std::vector<Int_t> vecContributorLabels;
1922 if (!clus->IsEMCAL()) {
1929 const Int_t nLabels = clus->GetNLabels();
1932 vecContributorTypes.clear();
1933 vecContributorLabels.clear();
1934 for (
Int_t iLabel=0; iLabel<nLabels; iLabel++) {
1936 Int_t label = clus->GetLabels()[iLabel];
1937 if (TMath::Abs(label) > 0) {
1940 vecContributorTypes.push_back(contributorType);
1941 vecContributorLabels.push_back(label);
1946 Int_t nLabelsPhysPrim = vecContributorTypes.size();
1948 if (nLabelsPhysPrim == 1) {
1950 contributorType = vecContributorTypes[0];
1952 if (contributorType ==
kPhoton) {
1955 else if (contributorType ==
kElectron) {
1961 else if (contributorType ==
kProton) {
1970 else if (contributorType ==
kK0L) {
1973 else if (contributorType ==
kNeutron) {
1984 else if (nLabelsPhysPrim == 2) {
1992 Double_t frac1 = clus->GetClusterMCEdepFraction(1);
2000 if (isHadron1 && isHadron2) {
2003 else if (isPhoton1 && isHadron2) {
2007 Double_t photonEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
2008 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
2011 else if (isHadron1 && isPhoton2) {
2015 Double_t hadronEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
2016 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
2019 else if (isPhoton1 && isPhoton2) {
2027 if (part1 && part2) {
2028 Int_t iMother1 = part1->GetMother();
2029 Int_t iMother2 = part2->GetMother();
2030 AliVParticle *mother1 = mcevent->GetTrack(iMother1);
2031 AliVParticle *mother2 = mcevent->GetTrack(iMother2);
2033 if (mother1 && mother2) {
2034 if ( (mother1->PdgCode() == 111) && (mother2->PdgCode() == 111) ) {
2035 if (iMother1 == iMother2) {
2047 else if (nLabelsPhysPrim > 2) {
2053 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
2054 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
2057 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
2058 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
2071 const AliVCluster* clus;
2073 for (
const auto jet : jets->
accepted()) {
2078 Double_t hadCaloEnergyUnmatched = 0;
2079 Double_t hadCaloEnergyMatchedNonlincorr = 0;
2080 Double_t hadCaloEnergyMatchedHadCorr = 0;
2083 Int_t nClusters = jet->GetNumberOfClusters();
2084 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
2086 clus = jet->Cluster(iClus);
2090 Int_t label = TMath::Abs(clus->GetLabel());
2096 histname =
"JetPerformanceMC/hM02VsContributorTypeJets";
2097 Double_t x[4] = {clus->GetM02(), clus->GetNonLinCorrEnergy(), contributorType, jetPt};
2103 Bool_t hasMatchedTrack = (clus->GetNTracksMatched() > 0);
2105 if (hasMatchedTrack) {
2106 hadCaloEnergyMatchedNonlincorr += clus->GetNonLinCorrEnergy();
2107 hadCaloEnergyMatchedHadCorr += clus->GetHadCorrEnergy();
2110 hadCaloEnergyUnmatched += clus->GetNonLinCorrEnergy();
2119 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
2123 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
2127 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
2131 histname =
"JetPerformanceMC/hJetComposition";
2132 for (
Int_t type = 0; type < 8; type++) {
2139 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
2141 clus = jet->Cluster(iClus);
2143 Int_t label = TMath::Abs(clus->GetLabel());
2148 if (type == contributorType) {
2150 pTsum += clus->GetNonLinCorrEnergy();
2155 Double_t x[4] = {jetPt, 1.*type, nSum, pTsum};
2175 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
2176 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
2177 Double_t phiMinDCal =
fGeom->GetDCALPhiMin() * TMath::DegToRad();
2178 Double_t phiMaxDCal =
fGeom->GetDCALPhiMax() * TMath::DegToRad();
2180 Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
2181 Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
2182 Double_t accDCal = 2 * (etaEMCal - etaMinDCal) * (phiMaxDCal - phiMinDCal);
2187 while ((jetCont = static_cast<AliJetContainer*>(nextJetColl()))) {
2190 TRandom3* r =
new TRandom3(0);
2192 Double_t etaEMCalfid = etaEMCal - jetR;
2193 Double_t etaMinDCalfid = etaMinDCal + jetR;
2194 Double_t phiMinEMCalfid = phiMinEMCal + jetR;
2195 Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
2196 Double_t phiMinDCalfid = phiMinDCal + jetR;
2197 Double_t phiMaxDCalfid = phiMaxDCal - jetR;
2198 Double_t accEMCalfid = 2 * etaEMCalfid * (phiMaxEMCalfid - phiMinEMCalfid);
2199 Double_t accDCalfid = 2 * (etaEMCalfid - etaMinDCalfid) * (phiMaxDCalfid - phiMinDCalfid);
2200 if ( (etaEMCalfid - etaMinDCalfid) < 0) {
2205 Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
2206 Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
2209 Double_t etaDCalRC = r->Uniform(etaMinDCalfid, etaEMCalfid);
2210 Double_t sign = r->Uniform(-1., 1.);
2212 etaDCalRC = -1*etaDCalRC;
2214 Double_t phiDCalRC = r->Uniform(phiMinDCalfid, phiMaxDCalfid);
2241 while ((partCont = static_cast<AliParticleContainer*>(nextPartCont()))) {
2243 TString partContName = partCont->GetName();
2244 if (!partContName.CompareTo(
"tracks")) {
2250 track = trackIterator.first;
2251 trackEta = track.Eta();
2253 trackPt = track.Pt();
2256 if (TMath::Abs(trackEta) < etaTPC) {
2257 trackPtSumTPC += trackPt;
2261 if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
2262 trackPtSumEMCal += trackPt;
2266 if (TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinEMCalfid && trackPhi < phiMaxEMCalfid) {
2267 trackPtSumEMCalfid += trackPt;
2272 if (TMath::Abs(trackEta) > etaMinDCal && TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinDCal && trackPhi < phiMaxDCal) {
2273 trackPtSumDCal += trackPt;
2279 if (TMath::Abs(trackEta) > etaMinDCalfid && TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinDCalfid && trackPhi < phiMaxDCalfid) {
2280 trackPtSumDCalfid += trackPt;
2285 deltaR =
GetDeltaR(&track, etaEMCalRC, phiEMCalRC);
2286 if (deltaR < jetR) {
2287 trackPtSumEMCalRC += trackPt;
2292 deltaR =
GetDeltaR(&track, etaDCalRC, phiDCalRC);
2293 if (deltaR < jetR) {
2294 trackPtSumDCalRC += trackPt;
2313 clus = clusIterator.first;
2314 clusEta = clus.Eta();
2319 if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
2320 clusPtSumEMCal += clusPt;
2324 if (TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinEMCalfid && clusPhi < phiMaxEMCalfid) {
2325 clusPtSumEMCalfid += clusPt;
2330 if (TMath::Abs(clusEta) > etaMinDCal && TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinDCal && clusPhi < phiMaxDCal) {
2331 clusPtSumDCal += clusPt;
2337 if (TMath::Abs(clusEta) > etaMinDCalfid && TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinDCalfid && clusPhi < phiMaxDCalfid) {
2338 clusPtSumDCalfid += clusPt;
2343 deltaR =
GetDeltaR(&clus, etaEMCalRC, phiEMCalRC);
2344 if (deltaR < jetR) {
2345 clusPtSumEMCalRC += clusPt;
2350 deltaR =
GetDeltaR(&clus, etaDCalRC, phiDCalRC);
2351 if (deltaR < jetR) {
2352 clusPtSumDCalRC += clusPt;
2361 Double_t numerator = (trackPtSumEMCal + clusPtSumEMCal) / accEMCal;
2362 Double_t denominator = trackPtSumTPC / accTPC;
2363 Double_t scaleFactor = numerator / denominator;
2364 TString histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
2368 if (accEMCalfid > 1e-3) {
2369 numerator = (trackPtSumEMCalfid + clusPtSumEMCalfid) / accEMCalfid;
2370 scaleFactor = numerator / denominator;
2371 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jetCont->GetArrayName().Data());
2377 numerator = (trackPtSumDCal + clusPtSumDCal) / accDCal;
2378 scaleFactor = numerator / denominator;
2379 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jetCont->GetArrayName().Data());
2385 if (accDCalfid > 1e-3) {
2386 numerator = (trackPtSumDCalfid + clusPtSumDCalfid) / accDCalfid;
2387 scaleFactor = numerator / denominator;
2388 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jetCont->GetArrayName().Data());
2397 Double_t deltaPt = trackPtSumEMCalRC + clusPtSumEMCalRC - rho * TMath::Pi() * jetR * jetR;
2398 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
2403 if (accDCalfid > 1e-3) {
2404 deltaPt = trackPtSumDCalRC + clusPtSumDCalRC - rho * TMath::Pi() * jetR * jetR;
2405 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jetCont->GetArrayName().Data());
2425 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2426 TString jetContName = jets->GetName();
2431 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
2435 for (
auto jet : jets->
all()) {
2441 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
2445 UInt_t rejectionReason = 0;
2446 if (!jets->
AcceptJet(jet, rejectionReason)) {
2447 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
2448 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
2462 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
2464 else if (type ==
kDCal) {
2465 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
2470 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
2475 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
2477 else if (type ==
kDCal) {
2478 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
2480 TLorentzVector leadPart;
2483 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2488 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
2490 else if (type ==
kDCal) {
2491 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
2493 const AliVTrack* track;
2494 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
2495 track =
static_cast<AliVTrack*
>(jet->Track(i));
2496 z = track->Pt() / TMath::Abs(corrPt);
2502 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
2504 else if (type ==
kDCal) {
2505 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
2547 if (!matchedPartLevelJet) {
2550 Float_t truthPt = matchedPartLevelJet->
Pt();
2563 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
2565 else if (type ==
kDCal) {
2566 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
2577 histname =
"MatchedJetHistograms/hJESshiftEMCal";
2579 else if (type ==
kDCal) {
2580 histname =
"MatchedJetHistograms/hJESshiftDCal";
2590 histname =
"MatchedJetHistograms/hNEFVsPt";
2599 histname =
"MatchedJetHistograms/hZLeadingVsPt";
2600 TLorentzVector leadPart;
2603 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2621 for (
auto jet1 : jetCont1->
all()) {
2622 jet1->ResetMatching();
2624 for (
auto jet2 : jetCont2->
all()) {
2625 jet2->ResetMatching();
2628 for (
auto jet1 : jetCont1->
accepted()) {
2630 if (bUseJetCont2Acceptance) {
2631 for (
auto jet2 : jetCont2->
accepted()) {
2636 for (
auto jet2 : jetCont2->
all()) {
2654 if (deltaR < jet1->ClosestJetDistance()) {
2658 if (deltaR < jet2->ClosestJetDistance()) {
2678 TString histNameQA =
"MatchedJetHistograms/fHistJetMatchingQA";
2683 bool returnValue =
false;
2691 returnValue =
false;
2697 TString histname =
"MatchedJetHistograms/hMatchingDistance";
2704 returnValue =
false;
2711 if (returnValue ==
true) {
2717 returnValue =
false;
2721 return partLevelJet;
2728 bool returnValue =
false;
2739 returnValue =
false;
2748 if (!partLevelJet) {
2749 returnValue =
false;
2758 returnValue =
false;
2765 if (returnValue ==
true) {
2770 TString histname =
"MatchedJetHistograms/hMatchingDistanceVsMCFraction";
2776 returnValue =
false;
2780 return partLevelJet;
2796 TString histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
2797 UInt_t rejectionReason = 0;
2800 return contributorType;
2803 if (part->GetGeneratorIndex() == 0) {
2811 else if (TMath::Abs(pdg) == 211) {
2814 else if (pdg == 2212) {
2817 else if (pdg == -2212) {
2820 else if (TMath::Abs(pdg) == 321) {
2823 else if (pdg == 130) {
2824 contributorType =
kK0L;
2826 else if (pdg == 2112) {
2829 else if (pdg == -2112) {
2832 else if (TMath::Abs(pdg) == 11) {
2835 else if (TMath::Abs(pdg) == 13) {
2836 contributorType =
kMuon;
2839 contributorType =
kOther;
2843 return contributorType;
2852 Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
2853 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
2895 const char *ntracks,
2896 const char *nclusters,
2897 const char *nGenLev,
2907 ::Error(
"AddTaskEmcalJetPerformance",
"No analysis manager to connect to.");
2913 AliVEventHandler* handler = mgr->GetInputEventHandler();
2916 ::Error(
"AddTaskEmcalJetPerformance",
"This task requires an input event handler");
2928 if (handler->InheritsFrom(
"AliESDInputHandler")) {
2931 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
2942 if (trackName ==
"usedefault") {
2943 if (dataType ==
kESD) {
2944 trackName =
"Tracks";
2946 else if (dataType == kAOD) {
2947 trackName =
"tracks";
2954 if (clusName ==
"usedefault") {
2955 if (dataType ==
kESD) {
2956 clusName =
"CaloClusters";
2958 else if (dataType == kAOD) {
2959 clusName =
"caloClusters";
2966 TString name(
"AliAnalysisTaskEmcalJetPerformance");
2967 if (!trackName.IsNull()) {
2971 if (!clusName.IsNull()) {
2975 if (strcmp(suffix,
"") != 0) {
2988 if (trackName ==
"mcparticles") {
2990 partCont = mcpartCont;
2992 else if (trackName ==
"tracks" || trackName ==
"Tracks") {
2994 partCont = trackCont;
3000 if (nGenLev && strcmp(nGenLev,
"")!=0) {
3008 if (!clusName.IsNull()) {
3022 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
3024 contname +=
"_histos";
3025 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
3026 TList::Class(),AliAnalysisManager::kOutputContainer,
3027 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
3028 mgr->ConnectInput (task, 0, cinput1 );
3029 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
void SelectPhysicalPrimaries(Bool_t s)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Double_t GetFractionSharedPt(const AliEmcalJet *jet, AliParticleContainer *cont2=0x0) const
const AliTrackIterableMomentumContainer accepted_momentum() const
Int_t GetRunNumber(TString)
void SetClusPtCut(Double_t cut)
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
Main initialization function on the worker.
const AliJetIterableContainer accepted() const
EDataType_t
Switch for the data type.
void SetClusECut(Double_t cut)
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Create a new THnSparse within the container.
Container structure for EMCAL clusters.
DCal fiducial acceptance (each eta, phi edge narrowed by jet R)
Container for MC-true particles within the EMCAL framework.
virtual AliAODMCParticle * GetMCParticleWithLabel(Int_t lab) const
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
EMCal fiducial acceptance (each eta, phi edge narrowed by jet R)
Container for jet within the EMCAL jet framework.
TH3 * CreateTH3(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, int nbinsz, double zmin, double zmax, Option_t *opt="")
Create a new TH2 within the container.
const AliJetIterableContainer all() const
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()