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),
89 fTrackMatchingDeltaEtaMax(0.015),
90 fTrackMatchingDeltaPhiMax(0.030),
96 fMinSharedMomentumFraction(0.5),
97 fMaxMatchedJetDistance(0.3),
98 fUseResponseMaker(kFALSE),
100 fUseAliEventCuts(kTRUE),
103 fUseManualEventCuts(kFALSE),
222 fEventCuts.fUseVariablesCorrelationCuts =
true;
233 for (
Int_t i=0; i<2; i++) {
235 TString jetContName = jetCont->GetName();
236 if (jetContName.Contains(
"mcparticles")) {
241 Printf(
"No MC jet container found!");
268 if (embeddingHelper) {
277 while ((obj = next())) {
297 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
300 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
302 title = histname +
";Centrality (%);Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
303 TH3* hist =
fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, 32, 0, 32, 50, 0,
fMaxPt);
306 title = histname +
";Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
313 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
315 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
325 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
327 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
328 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
331 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});NEF";
336 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
338 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
339 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
342 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});NEF";
349 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
350 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
351 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, 0, 100,
nPtBins, 0,
fMaxPt, 2, -0.5, 1.5,
"s");
355 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
357 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
358 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100,
nPtBins, 0,
fMaxPt,
fMaxPt, 0,
fMaxPt);
361 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
366 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
368 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
369 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100,
nPtBins, 0,
fMaxPt, 50, 0, 0.5);
372 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
377 nbinsx = 20; minx = 0; maxx = 100;
379 nbinsz = 50; minz = 0; maxz = 1.;
381 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
383 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
384 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
387 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
392 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
394 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
395 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
398 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
404 nbinsx = 20; minx = 0; maxx = 100;
406 nbinsz = 50; minz = 0; maxz = 1.;
408 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
410 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
411 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
414 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
419 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
421 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
422 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
425 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
431 nbinsx = 20; minx = 0; maxx = 100;
433 nbinsz = 50; minz = 0; maxz =
fMaxPt;
435 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
437 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
438 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
441 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
446 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
448 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
449 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
452 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
459 nbinsx = 20; minx = 0; maxx = 100;
462 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
463 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
466 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
467 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
473 nbinsx = 20; minx = 0; maxx = 100;
477 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
478 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#sum#it{E}_{nonlincorr} - #it{E}_{hadcorr}";
479 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
484 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
485 title = histname +
";#it{E}_{patch,med};type;#it{p}_{T}^{corr} (GeV/#it{c});Centrality (%)";
496 histname =
"Trigger/hMBDownscaleFactor";
497 title = histname +
";Downscale factor;counts";
511 const Int_t nRcorrBins = 50;
513 const Int_t nCellBins = 30;
515 const Int_t nMatchedTrackBins = 5;
517 const Int_t nDeltaEtaBins = 60;
524 histname =
"ClusterHistograms/hM02";
525 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
529 histname =
"ClusterHistograms/hNcellsM02G04";
530 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
533 histname =
"ClusterHistograms/hNcellsM02L04";
534 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
541 histname =
"ClusterHistograms/hMatchedTrackPt";
542 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
545 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
546 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
549 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
550 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
554 histname =
"ClusterHistograms/hMatchedTrackN";
555 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
558 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
559 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
562 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
563 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
567 histname =
"ClusterHistograms/hM02Matched";
568 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
572 histname =
"ClusterHistograms/hM02Unmatched";
573 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
577 histname =
"ClusterHistograms/hDeltaEtaCentral";
578 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
581 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
582 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
589 histname =
"ClusterHistograms/hEoverPM02Central";
590 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
593 histname =
"ClusterHistograms/hEoverPM02Peripheral";
594 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
601 histname =
"ClusterHistograms/hRcorrVsCent";
602 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
606 histname =
"ClusterHistograms/hRcorr0-10";
607 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
611 histname =
"ClusterHistograms/hRcorr50-90";
612 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
616 histname =
"ClusterHistograms/hRcorrClusVsCent";
617 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
621 histname =
"ClusterHistograms/hRcorrClus0-10";
622 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
626 histname =
"ClusterHistograms/hRcorrClus50-90";
627 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
631 histname =
"ClusterHistograms/hTrackMultiplicity";
632 htitle = histname +
";N_{tracks};Centrality (%)";
645 const Int_t nRejBins = 32;
648 const Int_t nContributorTypes = 11;
650 const Int_t nParticleTypes = 17;
653 AliEmcalContainer* cont = 0;
655 while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) {
657 histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
658 htitle = histname +
";Rejection reason;#it{E}_{clus} (GeV/)";
664 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
665 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
669 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
670 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
675 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
676 htitle = histname +
";Centrality (%);M02;#it{E}_{photon} (GeV)";
680 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
681 htitle = histname +
";Centrality (%);M02;#it{E}_{hadron} (GeV)";
697 min[dim] = fM02HistBins[0];
701 title[dim] =
"#it{E}_{clus} (GeV)";
704 min[dim] = fPtHistBins[0];
708 title[dim] =
"Contributor type";
709 nbins[dim] = nContributorTypes;
712 binEdges[dim] = contributorTypeBins;
715 title[dim] =
"#it{p}_{T,jet}^{corr}";
722 TString thnname =
"JetPerformanceMC/hM02VsContributorTypeJets";
724 for (
Int_t i = 0; i < dim; i++) {
725 hn->GetAxis(i)->SetTitle(title[i]);
726 hn->SetBinEdges(i, binEdges[i]);
733 title[dim] =
"#it{p}_{T,jet}^{corr}";
740 title[dim] =
"Contributor type";
741 nbins[dim] = nContributorTypes;
744 binEdges[dim] = contributorTypeBins;
754 title[dim] =
"#it{p}_{T,sum} (GeV)";
757 min[dim] = fPtHistBins[0];
761 thnname =
"JetPerformanceMC/hJetComposition";
763 for (
Int_t i = 0; i < dim; i++) {
764 thn->GetAxis(i)->SetTitle(title[i]);
765 thn->SetBinEdges(i, binEdges[i]);
771 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
772 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
776 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
777 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
781 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
782 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
794 axis->SetBinLabel(1,
"SinglePhoton");
795 axis->SetBinLabel(2,
"SingleElectron");
796 axis->SetBinLabel(3,
"SingleChargedPion");
797 axis->SetBinLabel(4,
"SingleProton");
798 axis->SetBinLabel(5,
"SingleAntiProton");
799 axis->SetBinLabel(6,
"SingleChargedKaon");
800 axis->SetBinLabel(7,
"SingleK0L");
801 axis->SetBinLabel(8,
"SingleNeutron");
802 axis->SetBinLabel(9,
"SingleAntiNeutron");
803 axis->SetBinLabel(10,
"SingleOther");
804 axis->SetBinLabel(11,
"PhotonHadron");
805 axis->SetBinLabel(12,
"HadronPhoton");
806 axis->SetBinLabel(13,
"MergedPi0");
807 axis->SetBinLabel(14,
"PhotonPhotonOther");
808 axis->SetBinLabel(15,
"HadronHadron");
809 axis->SetBinLabel(16,
"TwoContributorsOther");
810 axis->SetBinLabel(17,
"MoreThanTwoContributors");
824 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
827 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
828 title = histname +
";Centrality;Scale factor;counts";
831 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
832 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
835 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jets->GetArrayName().Data());
836 title = histname +
";Centrality;Scale factor;counts";
841 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jets->GetArrayName().Data());
842 title = histname +
";Centrality;Scale factor;counts";
845 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jets->GetArrayName().Data());
846 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
849 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jets->GetArrayName().Data());
850 title = histname +
";Centrality;Scale factor;counts";
871 histname =
"TriggerSimHistograms/hEtaVsPhi";
872 title = histname +
";#eta_{patch} (rad);#phi_{patch} (rad)";
876 histname =
"TriggerSimHistograms/hNPatches";
877 title = histname +
";#it{N}_{patches};type";
881 histname =
"TriggerSimHistograms/hPatchE";
882 title = histname +
";Centrality (%);#it{E}_{patch} (GeV)";
886 histname =
"TriggerSimHistograms/hPatchMedianE";
887 title = histname +
";Centrality (%);#it{E}_{patch,med} (GeV);type";
888 fHistManager.
CreateTH3(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 50, 2, -0.5, 1.5);
894 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
897 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
898 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
904 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
905 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
914 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
915 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
916 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
919 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
920 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
921 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
925 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
926 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
930 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
931 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
935 nbinsx = 20; minx = 0; maxx = 100;
937 nbinsz = 50; minz = 0; maxz = 1.;
939 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
940 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
941 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
944 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
945 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
946 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
950 nbinsx = 20; minx = 0; maxx = 100;
952 nbinsz = 50; minz = 0; maxz = 1.;
954 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
955 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
956 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
959 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
960 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
961 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
965 nbinsx = 20; minx = 0; maxx = 100;
967 nbinsz = 50; minz = 0; maxz =
fMaxPt;
969 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
970 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
971 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
974 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
975 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
976 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
997 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
999 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1000 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1003 title = histname +
";#it{p}_{T,corr}^{det} (GeV/#it{c});#it{p}_{T}^{truth} (GeV/#it{c})";
1008 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
1010 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1011 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1014 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1020 nbinsx = 20; minx = 0; maxx = 100;
1022 nbinsz = 250; minz = -5.; maxz = 5.;
1024 histname =
"MatchedJetHistograms/hJESshiftEMCal";
1026 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1027 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1030 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1035 histname =
"MatchedJetHistograms/hJESshiftDCal";
1037 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1038 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1041 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1047 nbinsx = 20; minx = 0; maxx = 100;
1049 nbinsz = 50; minz = 0; maxz = 1.;
1051 histname =
"MatchedJetHistograms/hNEFVsPt";
1053 title = histname +
";Centrality (%);#it{p}_{T,corr}^{det} (GeV/#it{c});Calo energy fraction";
1054 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1057 title = histname +
";#it{p}_{T,corr}^{det} (GeV/#it{c});Calo energy fraction";
1062 nbinsx = 20; minx = 0; maxx = 100;
1064 nbinsz = 50; minz = 0; maxz = 1.;
1066 histname =
"MatchedJetHistograms/hZLeadingVsPt";
1068 title = histname +
";Centrality (%);#it{p}_{T,corr}^{det} (GeV/#it{c});#it{z}_{leading}";
1069 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1072 title = histname +
";#it{p}_{T,corr}^{det} (GeV/#it{c});#it{z}_{leading}";
1077 nbinsx = 20; minx = 0; maxx = 100;
1079 nbinsz = 50; minz = 0; maxz = 1.;
1081 histname =
"MatchedJetHistograms/hMatchingDistance";
1083 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});R";
1084 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1086 histname =
"MatchedJetHistograms/hMatchingDistancepp";
1087 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});R";
1088 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1091 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});R";
1097 histname =
"MatchedJetHistograms/fHistJetMatchingQA";
1099 std::vector<std::string> binLabels = {
"noMatch",
"matchedJet",
"sharedMomentumFraction",
"partLevelMatchedJet",
"jetDistance",
"passedAllCuts"};
1100 auto histMatchedJetCuts =
fHistManager.
CreateTH1(histname.Data(), title.Data(), binLabels.size(), 0, binLabels.size());
1102 for (
unsigned int i = 1; i <= binLabels.size(); i++) {
1103 histMatchedJetCuts->GetXaxis()->SetBinLabel(i, binLabels.at(i-1).c_str());
1105 histMatchedJetCuts->GetYaxis()->SetTitle(
"Number of jets");
1130 TClass cls(objname);
1131 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1132 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1133 GetName(), cls.GetName(),
"EmcalTriggers"));
1138 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1158 TString triggerNameMB1 =
"CINT7-B-NOPF-CENT";
1159 TString triggerNameMB2 =
"CV0L7-B-NOPF-CENT";
1160 TString triggerNameJE =
"CINT7EJ1-B-NOPF-CENTNOPMD";
1165 for (
auto i : runtriggers) {
1166 if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
1175 TString histname =
"Trigger/hMBDownscaleFactor";
1212 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
1213 TString jetContName = jetCont->GetName();
1248 TClass cls(objname);
1249 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1250 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1251 GetName(), cls.GetName(),
"EmcalTriggers"));
1256 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1261 std::vector<Double_t> vecEMCal;
1262 std::vector<Double_t> vecDCal;
1264 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1267 if(!recpatch->IsJetHighSimple())
continue;
1269 histname =
"TriggerSimHistograms/hEtaVsPhi";
1272 histname =
"TriggerSimHistograms/hPatchE";
1275 if (recpatch->IsEMCal()) {
1276 vecEMCal.push_back(recpatch->GetPatchE());
1278 vecDCal.push_back(recpatch->GetPatchE());
1285 const Int_t nBkgPatchesEMCal = vecEMCal.size();
1286 const Int_t nBkgPatchesDCal = vecDCal.size();
1287 fMedianEMCal = TMath::Median(nBkgPatchesEMCal, &vecEMCal[0]);
1288 fMedianDCal = TMath::Median(nBkgPatchesDCal, &vecDCal[0]);
1290 histname =
"TriggerSimHistograms/hPatchMedianE";
1294 histname =
"TriggerSimHistograms/hNPatches";
1302 for(
auto p : *fTriggerPatchInfo){
1303 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1306 if(!recpatch->IsJetHighSimple())
continue;
1308 if (recpatch->IsEMCal()) {
1309 if ((recpatch->GetPatchE() -
fMedianDCal) > threshold) {
1314 if ((recpatch->GetPatchE() -
fMedianEMCal) > threshold) {
1362 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1363 TString jetContName = jets->GetName();
1368 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1372 for (
auto jet : jets->
all()) {
1386 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1395 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1405 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1407 else if (type ==
kDCal) {
1408 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1410 TLorentzVector leadPart;
1413 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
1422 UInt_t rejectionReason = 0;
1423 if (!jets->
AcceptJet(jet, rejectionReason)) {
1424 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1429 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), corrPt);
1436 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
1438 else if (type ==
kDCal) {
1439 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
1450 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1456 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1458 else if (type ==
kDCal) {
1459 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1461 const AliVTrack* track;
1462 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1463 track =
static_cast<AliVTrack*
>(jet->Track(i));
1464 z = track->Pt() / TMath::Abs(corrPt);
1475 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1477 else if (type ==
kDCal) {
1478 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1490 if (jet->Eta() > 0) {
1491 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
1494 else if (jet->Eta() < 0) {
1495 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
1504 const AliVCluster* clus =
nullptr;
1505 Int_t nClusters = jet->GetNumberOfClusters();
1506 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1507 clus = jet->Cluster(iClus);
1508 deltaEhadcorr += (clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy());
1511 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
1518 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
1539 const AliVCluster* clus;
1543 Double_t clusPhi = it.first.Phi_0_2pi();
1547 if (!clus->IsEMCAL()) {
1553 Int_t nTracksMatched = 0;
1554 const AliVTrack* track =
nullptr;
1555 for (
Int_t itrack=0; itrack < clus->GetNTracksMatched(); itrack++) {
1556 track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(itrack));
1561 Double_t trackPhi = TVector2::Phi_0_2pi(track->GetTrackPhiOnEMCal());
1562 Double_t trackEta = track->GetTrackEtaOnEMCal();
1563 Double_t deta = TMath::Abs(clusEta - trackEta);
1564 Double_t dphi = TMath::Abs(clusPhi - trackPhi);
1567 trackPSum += track->P();
1573 if (trackPSum > 1e-3) {
1574 EoverP = clus->GetNonLinCorrEnergy() / trackPSum;
1577 Double_t deltaE = clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy();
1579 if (trackPSum > 1e-3) {
1580 Rcorr = deltaE / trackPSum;
1582 Double_t RcorrClus = deltaE / clus->GetNonLinCorrEnergy();
1588 histname =
"ClusterHistograms/hM02";
1592 if (clus->GetM02() > 0.4) {
1593 histname =
"ClusterHistograms/hNcellsM02G04";
1596 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1597 histname =
"ClusterHistograms/hNcellsM02L04";
1605 histname =
"ClusterHistograms/hMatchedTrackPt";
1608 if (clus->GetM02() > 0.4) {
1609 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
1612 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1613 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
1618 histname =
"ClusterHistograms/hMatchedTrackN";
1621 if (clus->GetM02() > 0.4) {
1622 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
1625 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1626 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
1631 histname =
"ClusterHistograms/hM02Matched";
1632 if (nTracksMatched > 0) {
1637 histname =
"ClusterHistograms/hM02Unmatched";
1638 if (nTracksMatched == 0) {
1643 if (nTracksMatched == 1) {
1645 const AliVTrack* track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(0));
1647 Double_t trackEta = track->GetTrackEtaOnEMCal();
1648 Double_t deta = trackEta - clusEta;
1651 histname =
"ClusterHistograms/hDeltaEtaCentral";
1656 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
1667 histname =
"ClusterHistograms/hEoverPM02Central";
1671 histname =
"ClusterHistograms/hEoverPM02Peripheral";
1679 histname =
"ClusterHistograms/hRcorrVsCent";
1684 histname =
"ClusterHistograms/hRcorr0-10";
1690 histname =
"ClusterHistograms/hRcorr50-90";
1695 histname =
"ClusterHistograms/hRcorrClusVsCent";
1700 histname =
"ClusterHistograms/hRcorrClus0-10";
1706 histname =
"ClusterHistograms/hRcorrClus50-90";
1713 histname =
"ClusterHistograms/hTrackMultiplicity";
1726 const AliMCEvent* mcevent =
nullptr;
1728 mcevent = MCEvent();
1751 const AliVCluster* clus;
1752 std::vector<ContributorType> vecContributorTypes;
1753 std::vector<Int_t> vecContributorLabels;
1759 if (!clus->IsEMCAL()) {
1766 const Int_t nLabels = clus->GetNLabels();
1769 vecContributorTypes.clear();
1770 vecContributorLabels.clear();
1771 for (
Int_t iLabel=0; iLabel<nLabels; iLabel++) {
1773 Int_t label = clus->GetLabels()[iLabel];
1774 if (TMath::Abs(label) > 0) {
1777 vecContributorTypes.push_back(contributorType);
1778 vecContributorLabels.push_back(label);
1783 Int_t nLabelsPhysPrim = vecContributorTypes.size();
1785 if (nLabelsPhysPrim == 1) {
1787 contributorType = vecContributorTypes[0];
1789 if (contributorType ==
kPhoton) {
1792 else if (contributorType ==
kElectron) {
1798 else if (contributorType ==
kProton) {
1807 else if (contributorType ==
kK0L) {
1810 else if (contributorType ==
kNeutron) {
1821 else if (nLabelsPhysPrim == 2) {
1829 Double_t frac1 = clus->GetClusterMCEdepFraction(1);
1837 if (isHadron1 && isHadron2) {
1840 else if (isPhoton1 && isHadron2) {
1844 Double_t photonEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
1845 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
1848 else if (isHadron1 && isPhoton2) {
1852 Double_t hadronEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
1853 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
1856 else if (isPhoton1 && isPhoton2) {
1864 if (part1 && part2) {
1865 Int_t iMother1 = part1->GetMother();
1866 Int_t iMother2 = part2->GetMother();
1867 AliVParticle *mother1 = mcevent->GetTrack(iMother1);
1868 AliVParticle *mother2 = mcevent->GetTrack(iMother2);
1870 if (mother1 && mother2) {
1871 if ( (mother1->PdgCode() == 111) && (mother2->PdgCode() == 111) ) {
1872 if (iMother1 == iMother2) {
1884 else if (nLabelsPhysPrim > 2) {
1890 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
1891 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
1894 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
1895 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
1908 const AliVCluster* clus;
1910 for (
const auto jet : jets->
accepted()) {
1915 Double_t hadCaloEnergyUnmatched = 0;
1916 Double_t hadCaloEnergyMatchedNonlincorr = 0;
1917 Double_t hadCaloEnergyMatchedHadCorr = 0;
1920 Int_t nClusters = jet->GetNumberOfClusters();
1921 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1923 clus = jet->Cluster(iClus);
1927 Int_t label = TMath::Abs(clus->GetLabel());
1933 histname =
"JetPerformanceMC/hM02VsContributorTypeJets";
1934 Double_t x[4] = {clus->GetM02(), clus->GetNonLinCorrEnergy(), contributorType, jetPt};
1940 Bool_t hasMatchedTrack = (clus->GetNTracksMatched() > 0);
1942 if (hasMatchedTrack) {
1943 hadCaloEnergyMatchedNonlincorr += clus->GetNonLinCorrEnergy();
1944 hadCaloEnergyMatchedHadCorr += clus->GetHadCorrEnergy();
1947 hadCaloEnergyUnmatched += clus->GetNonLinCorrEnergy();
1956 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
1960 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
1964 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
1968 histname =
"JetPerformanceMC/hJetComposition";
1969 for (
Int_t type = 0; type < 8; type++) {
1976 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1978 clus = jet->Cluster(iClus);
1980 Int_t label = TMath::Abs(clus->GetLabel());
1985 if (type == contributorType) {
1987 pTsum += clus->GetNonLinCorrEnergy();
1992 Double_t x[4] = {jetPt, 1.*type, nSum, pTsum};
2012 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
2013 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
2014 Double_t phiMinDCal =
fGeom->GetDCALPhiMin() * TMath::DegToRad();
2015 Double_t phiMaxDCal =
fGeom->GetDCALPhiMax() * TMath::DegToRad();
2017 Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
2018 Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
2019 Double_t accDCal = 2 * (etaEMCal - etaMinDCal) * (phiMaxDCal - phiMinDCal);
2024 while ((jetCont = static_cast<AliJetContainer*>(nextJetColl()))) {
2027 TRandom3* r =
new TRandom3(0);
2029 Double_t etaEMCalfid = etaEMCal - jetR;
2030 Double_t etaMinDCalfid = etaMinDCal + jetR;
2031 Double_t phiMinEMCalfid = phiMinEMCal + jetR;
2032 Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
2033 Double_t phiMinDCalfid = phiMinDCal + jetR;
2034 Double_t phiMaxDCalfid = phiMaxDCal - jetR;
2035 Double_t accEMCalfid = 2 * etaEMCalfid * (phiMaxEMCalfid - phiMinEMCalfid);
2036 Double_t accDCalfid = 2 * (etaEMCalfid - etaMinDCalfid) * (phiMaxDCalfid - phiMinDCalfid);
2037 if ( (etaEMCalfid - etaMinDCalfid) < 0) {
2042 Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
2043 Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
2046 Double_t etaDCalRC = r->Uniform(etaMinDCalfid, etaEMCalfid);
2047 Double_t sign = r->Uniform(-1., 1.);
2049 etaDCalRC = -1*etaDCalRC;
2051 Double_t phiDCalRC = r->Uniform(phiMinDCalfid, phiMaxDCalfid);
2078 while ((partCont = static_cast<AliParticleContainer*>(nextPartCont()))) {
2080 TString partContName = partCont->GetName();
2081 if (!partContName.CompareTo(
"tracks")) {
2087 track = trackIterator.first;
2088 trackEta = track.Eta();
2090 trackPt = track.Pt();
2093 if (TMath::Abs(trackEta) < etaTPC) {
2094 trackPtSumTPC += trackPt;
2098 if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
2099 trackPtSumEMCal += trackPt;
2103 if (TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinEMCalfid && trackPhi < phiMaxEMCalfid) {
2104 trackPtSumEMCalfid += trackPt;
2109 if (TMath::Abs(trackEta) > etaMinDCal && TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinDCal && trackPhi < phiMaxDCal) {
2110 trackPtSumDCal += trackPt;
2116 if (TMath::Abs(trackEta) > etaMinDCalfid && TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinDCalfid && trackPhi < phiMaxDCalfid) {
2117 trackPtSumDCalfid += trackPt;
2122 deltaR =
GetDeltaR(&track, etaEMCalRC, phiEMCalRC);
2123 if (deltaR < jetR) {
2124 trackPtSumEMCalRC += trackPt;
2129 deltaR =
GetDeltaR(&track, etaDCalRC, phiDCalRC);
2130 if (deltaR < jetR) {
2131 trackPtSumDCalRC += trackPt;
2150 clus = clusIterator.first;
2151 clusEta = clus.Eta();
2156 if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
2157 clusPtSumEMCal += clusPt;
2161 if (TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinEMCalfid && clusPhi < phiMaxEMCalfid) {
2162 clusPtSumEMCalfid += clusPt;
2167 if (TMath::Abs(clusEta) > etaMinDCal && TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinDCal && clusPhi < phiMaxDCal) {
2168 clusPtSumDCal += clusPt;
2174 if (TMath::Abs(clusEta) > etaMinDCalfid && TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinDCalfid && clusPhi < phiMaxDCalfid) {
2175 clusPtSumDCalfid += clusPt;
2180 deltaR =
GetDeltaR(&clus, etaEMCalRC, phiEMCalRC);
2181 if (deltaR < jetR) {
2182 clusPtSumEMCalRC += clusPt;
2187 deltaR =
GetDeltaR(&clus, etaDCalRC, phiDCalRC);
2188 if (deltaR < jetR) {
2189 clusPtSumDCalRC += clusPt;
2198 Double_t numerator = (trackPtSumEMCal + clusPtSumEMCal) / accEMCal;
2199 Double_t denominator = trackPtSumTPC / accTPC;
2200 Double_t scaleFactor = numerator / denominator;
2201 TString histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
2205 if (accEMCalfid > 1e-3) {
2206 numerator = (trackPtSumEMCalfid + clusPtSumEMCalfid) / accEMCalfid;
2207 scaleFactor = numerator / denominator;
2208 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jetCont->GetArrayName().Data());
2214 numerator = (trackPtSumDCal + clusPtSumDCal) / accDCal;
2215 scaleFactor = numerator / denominator;
2216 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jetCont->GetArrayName().Data());
2222 if (accDCalfid > 1e-3) {
2223 numerator = (trackPtSumDCalfid + clusPtSumDCalfid) / accDCalfid;
2224 scaleFactor = numerator / denominator;
2225 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jetCont->GetArrayName().Data());
2234 Double_t deltaPt = trackPtSumEMCalRC + clusPtSumEMCalRC - rho * TMath::Pi() * jetR * jetR;
2235 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
2240 if (accDCalfid > 1e-3) {
2241 deltaPt = trackPtSumDCalRC + clusPtSumDCalRC - rho * TMath::Pi() * jetR * jetR;
2242 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jetCont->GetArrayName().Data());
2262 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2263 TString jetContName = jets->GetName();
2268 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
2272 for (
auto jet : jets->
all()) {
2278 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
2282 UInt_t rejectionReason = 0;
2283 if (!jets->
AcceptJet(jet, rejectionReason)) {
2284 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
2285 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
2299 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
2301 else if (type ==
kDCal) {
2302 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
2307 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
2312 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
2314 else if (type ==
kDCal) {
2315 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
2317 TLorentzVector leadPart;
2320 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2325 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
2327 else if (type ==
kDCal) {
2328 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
2330 const AliVTrack* track;
2331 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
2332 track =
static_cast<AliVTrack*
>(jet->Track(i));
2333 z = track->Pt() / TMath::Abs(corrPt);
2339 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
2341 else if (type ==
kDCal) {
2342 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
2361 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2362 TString jetContName = jets->GetName();
2365 if (jetContName.Contains(
"mcparticles")) {
2374 for (
auto jet : jets->
accepted()) {
2386 if (!matchedPartLevelJet) {
2389 UInt_t rejectionReason = 0;
2403 Float_t truthPt = matchedPartLevelJet->
Pt();
2407 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
2409 else if (type ==
kDCal) {
2410 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
2421 histname =
"MatchedJetHistograms/hJESshiftEMCal";
2423 else if (type ==
kDCal) {
2424 histname =
"MatchedJetHistograms/hJESshiftDCal";
2434 histname =
"MatchedJetHistograms/hNEFVsPt";
2443 histname =
"MatchedJetHistograms/hZLeadingVsPt";
2444 TLorentzVector leadPart;
2447 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2456 histname =
"MatchedJetHistograms/hMatchingDistance";
2466 histname =
"MatchedJetHistograms/hMatchingDistancepp";
2484 TString histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
2485 UInt_t rejectionReason = 0;
2488 return contributorType;
2491 if (part->GetGeneratorIndex() == 0) {
2499 else if (TMath::Abs(pdg) == 211) {
2502 else if (pdg == 2212) {
2505 else if (pdg == -2212) {
2508 else if (TMath::Abs(pdg) == 321) {
2511 else if (pdg == 130) {
2512 contributorType =
kK0L;
2514 else if (pdg == 2112) {
2517 else if (pdg == -2112) {
2520 else if (TMath::Abs(pdg) == 11) {
2523 else if (TMath::Abs(pdg) == 13) {
2524 contributorType =
kMuon;
2527 contributorType =
kOther;
2531 return contributorType;
2540 Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
2541 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
2600 bool returnValue =
false;
2607 AliDebugStream(4) <<
"Jet is matched!\nJet: " << jet->
toString() <<
"\n";
2613 AliDebugStream(4) <<
"Jet rejected due to shared momentum fraction of " << sharedFraction <<
", which is smaller than the min momentum fraction of " <<
fMinSharedMomentumFraction <<
"\n";
2614 returnValue =
false;
2617 AliDebugStream(4) <<
"Passed shared momentum fraction with value of " << sharedFraction <<
"\n";
2624 if (!partLevelJet) {
2625 AliDebugStream(4) <<
"Jet rejected due to no matching part level jet.\n";
2626 returnValue =
false;
2629 AliDebugStream(4) <<
"Det level jet has a required match to a part level jet.\n" <<
"Part level jet: " << partLevelJet->
toString() <<
"\n";
2637 AliDebugStream(4) <<
"Jet rejected due to matching distance of " << matchedJetDistance <<
", which is larger than the max distance of " <<
fMaxMatchedJetDistance <<
"\n";
2638 returnValue =
false;
2641 AliDebugStream(4) <<
"Jet passed distance cut with distance of " << matchedJetDistance <<
"\n";
2647 if (returnValue ==
true) {
2652 AliDebugStream(5) <<
"Rejected jet because it was not matched to a external event jet.\n";
2654 returnValue =
false;
2658 return partLevelJet;
2667 const char *ntracks,
2668 const char *nclusters,
2669 const char *nGenLev,
2679 ::Error(
"AddTaskEmcalJetPerformance",
"No analysis manager to connect to.");
2685 AliVEventHandler* handler = mgr->GetInputEventHandler();
2688 ::Error(
"AddTaskEmcalJetPerformance",
"This task requires an input event handler");
2700 if (handler->InheritsFrom(
"AliESDInputHandler")) {
2703 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
2714 if (trackName ==
"usedefault") {
2715 if (dataType ==
kESD) {
2716 trackName =
"Tracks";
2718 else if (dataType == kAOD) {
2719 trackName =
"tracks";
2726 if (clusName ==
"usedefault") {
2727 if (dataType ==
kESD) {
2728 clusName =
"CaloClusters";
2730 else if (dataType == kAOD) {
2731 clusName =
"caloClusters";
2738 TString name(
"AliAnalysisTaskEmcalJetPerformance");
2739 if (!trackName.IsNull()) {
2743 if (!clusName.IsNull()) {
2747 if (strcmp(suffix,
"") != 0) {
2760 if (trackName ==
"mcparticles") {
2762 partCont = mcpartCont;
2764 else if (trackName ==
"tracks" || trackName ==
"Tracks") {
2766 partCont = trackCont;
2772 if (nGenLev && strcmp(nGenLev,
"")!=0) {
2780 if (!clusName.IsNull()) {
2794 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
2796 contname +=
"_histos";
2797 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
2798 TList::Class(),AliAnalysisManager::kOutputContainer,
2799 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
2800 mgr->ConnectInput (task, 0, cinput1 );
2801 mgr->ConnectOutput (task, 1, coutput1 );
TObjArray fClusterCollArray
cluster collection array
void SetParticlePtCut(Double_t cut)
Double_t GetRhoVal() const
const TString & GetRhoName() const
AliEmcalJet * ClosestJet() const
AliJetContainer * GetJetContainer(Int_t i=0) const
Double_t ClosestJetDistance() const
UInt_t fOffTrigger
offline trigger for event selection
void AdoptParticleContainer(AliParticleContainer *cont)
const AliClusterIterableMomentumContainer accepted_momentum() const
Container with name, TClonesArray and cuts for particles.
void FillTH2(const char *hname, double x, double y, double weight=1., Option_t *opt="")
Fill a 2D histogram within the container.
AliEmcalJet * MatchedJet() const
Declaration of class AliTLorentzVector.
static AliEmcalDownscaleFactorsOCDB * Instance()
AliClusterContainer * GetClusterContainer() const
void FillTH3(const char *hname, double x, double y, double z, double weight=1., Option_t *opt="")
Fill a 3D histogram within the container.
Declaration of class AliAnalysisTaskEmcalEmbeddingHelper.
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
Double_t GetDownscaleFactorForTriggerClass(const TString &trigger) const
TString part
use mixed event to constrain combinatorial background
Container for particles within the EMCAL framework.
void SetCaloTriggerPatchInfoName(const char *n)
void AdoptClusterContainer(AliClusterContainer *cont)
TObjArray fParticleCollArray
particle/track collection array
virtual Bool_t AcceptMCParticle(const AliAODMCParticle *vp, UInt_t &rejectionReason) const
bool AddQAPlotsToList(TList *list)
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
void GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
void SetRun(int runnumber)
void FillTHnSparse(const char *name, const double *x, double weight=1., Option_t *opt="")
bool IsInitialized() const
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Create a new TH2 within the container.
THashList * GetListOfHistograms() const
Get the list of histograms.
Double_t GetLeadingHadronPt(const AliEmcalJet *jet) const
AliEMCALGeometry * fGeom
!emcal geometry
UInt_t GetJetAcceptanceType() const
Double_t Phi_0_2pi() const
Implementation of task to embed external events.
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
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
AliRhoParameter * GetRhoParameter()
void RecordEmbeddedEventProperties()
virtual Bool_t IsEventSelected()
Performing event selection.
static Double_t * GenerateFixedBinArray(Int_t n, Double_t min, Double_t max)
std::vector< TString > GetTriggerClasses() const
Float_t GetJetRadius() const
AliEmcalList * fOutput
!output list
Handler for downscale factors for various triggers obtained from the OCDB.
AliMCParticleContainer * GetMCParticleContainer(Int_t i=0) const
void SelectPhysicalPrimaries(Bool_t s)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Double_t GetFractionSharedPt(const AliEmcalJet *jet, AliParticleContainer *cont2=0x0) const
const AliTrackIterableMomentumContainer accepted_momentum() const
Int_t GetRunNumber(TString)
void SetClusPtCut(Double_t cut)
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
Main initialization function on the worker.
const AliJetIterableContainer accepted() const
EDataType_t
Switch for the data type.
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()