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),
101 fPlotJetMatchCandThresh(1.),
102 fUseAliEventCuts(kTRUE),
105 fUseManualEventCuts(kFALSE),
226 fEventCuts.fUseVariablesCorrelationCuts =
true;
237 for (
Int_t i=0; i<2; i++) {
239 TString jetContName = jetCont->GetName();
240 if (jetContName.Contains(
"mcparticles")) {
248 Printf(
"No MC jet container found!");
252 Printf(
"No det-level jet container found!");
279 if (embeddingHelper) {
288 while ((obj = next())) {
310 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
317 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
319 title = histname +
";Centrality (%);Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
320 TH3* hist =
fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, 32, 0, 32, nPtBins5,
fMinPt,
fMaxPt);
323 title = histname +
";Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
330 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
332 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
342 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
344 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
345 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
348 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});NEF";
353 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
355 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
356 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
359 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});NEF";
366 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
367 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
368 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, 0, 100, nPtBins2,
fMinPt,
fMaxPt, 2, -0.5, 1.5,
"s");
372 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
374 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
375 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, nPtBins2,
fMinPt,
fMaxPt,
fMaxPt, 0,
fMaxPt);
378 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
383 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
385 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
386 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, nPtBins2,
fMinPt,
fMaxPt, 50, 0, 0.5);
389 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
394 nbinsx = 20; minx = 0; maxx = 100;
396 nbinsz = 50; minz = 0; maxz = 1.;
398 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
400 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
401 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
404 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
409 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
411 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
412 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
415 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
421 nbinsx = 20; minx = 0; maxx = 100;
423 nbinsz = 50; minz = 0; maxz = 1.;
425 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
427 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
428 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
431 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
436 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
438 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
439 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
442 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
448 nbinsx = 20; minx = 0; maxx = 100;
450 nbinsz = 50; minz = 0; maxz =
fMaxPt;
452 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
454 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
455 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
458 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
463 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
465 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
466 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
469 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
476 nbinsx = 20; minx = 0; maxx = 100;
479 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
480 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
483 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
484 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
490 nbinsx = 20; minx = 0; maxx = 100;
494 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
495 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#sum#it{E}_{nonlincorr} - #it{E}_{hadcorr}";
496 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
501 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
502 title = histname +
";#it{E}_{patch,med};type;#it{p}_{T}^{corr} (GeV/#it{c});Centrality (%)";
503 Int_t nbins5[4] = {100, 2, nPtBins2, 50};
513 histname =
"Trigger/hMBDownscaleFactor";
514 title = histname +
";Downscale factor;counts";
528 const Int_t nRcorrBins = 50;
530 const Int_t nCellBins = 30;
532 const Int_t nMatchedTrackBins = 5;
534 const Int_t nDeltaEtaBins = 60;
541 histname =
"ClusterHistograms/hM02";
542 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
546 histname =
"ClusterHistograms/hNcellsM02G04";
547 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
550 histname =
"ClusterHistograms/hNcellsM02L04";
551 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
558 histname =
"ClusterHistograms/hMatchedTrackPt";
559 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
562 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
563 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
566 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
567 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
571 histname =
"ClusterHistograms/hMatchedTrackN";
572 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
575 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
576 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
579 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
580 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
584 histname =
"ClusterHistograms/hM02Matched";
585 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
589 histname =
"ClusterHistograms/hM02Unmatched";
590 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
594 histname =
"ClusterHistograms/hDeltaEtaCentral";
595 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
598 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
599 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
606 histname =
"ClusterHistograms/hEoverPM02Central";
607 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
610 histname =
"ClusterHistograms/hEoverPM02Peripheral";
611 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
618 histname =
"ClusterHistograms/hRcorrVsCent";
619 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
623 histname =
"ClusterHistograms/hRcorr0-10";
624 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
628 histname =
"ClusterHistograms/hRcorr50-90";
629 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
633 histname =
"ClusterHistograms/hRcorrClusVsCent";
634 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
638 histname =
"ClusterHistograms/hRcorrClus0-10";
639 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
643 histname =
"ClusterHistograms/hRcorrClus50-90";
644 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
648 histname =
"ClusterHistograms/hTrackMultiplicity";
649 htitle = histname +
";N_{tracks};Centrality (%)";
662 const Int_t nRejBins = 32;
665 const Int_t nContributorTypes = 11;
667 const Int_t nParticleTypes = 17;
670 AliEmcalContainer* cont = 0;
672 while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) {
674 histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
675 htitle = histname +
";Rejection reason;#it{E}_{clus} (GeV/)";
681 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
682 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
686 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
687 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
692 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
693 htitle = histname +
";Centrality (%);M02;#it{E}_{photon} (GeV)";
697 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
698 htitle = histname +
";Centrality (%);M02;#it{E}_{hadron} (GeV)";
714 min[dim] = fM02HistBins[0];
718 title[dim] =
"#it{E}_{clus} (GeV)";
721 min[dim] = fPtHistBins[0];
725 title[dim] =
"Contributor type";
726 nbins[dim] = nContributorTypes;
729 binEdges[dim] = contributorTypeBins;
732 title[dim] =
"#it{p}_{T,jet}^{corr}";
739 TString thnname =
"JetPerformanceMC/hM02VsContributorTypeJets";
741 for (
Int_t i = 0; i < dim; i++) {
742 hn->GetAxis(i)->SetTitle(title[i]);
743 hn->SetBinEdges(i, binEdges[i]);
750 title[dim] =
"#it{p}_{T,jet}^{corr}";
757 title[dim] =
"Contributor type";
758 nbins[dim] = nContributorTypes;
761 binEdges[dim] = contributorTypeBins;
771 title[dim] =
"#it{p}_{T,sum} (GeV)";
774 min[dim] = fPtHistBins[0];
778 thnname =
"JetPerformanceMC/hJetComposition";
780 for (
Int_t i = 0; i < dim; i++) {
781 thn->GetAxis(i)->SetTitle(title[i]);
782 thn->SetBinEdges(i, binEdges[i]);
788 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
789 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
793 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
794 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
798 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
799 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
811 axis->SetBinLabel(1,
"SinglePhoton");
812 axis->SetBinLabel(2,
"SingleElectron");
813 axis->SetBinLabel(3,
"SingleChargedPion");
814 axis->SetBinLabel(4,
"SingleProton");
815 axis->SetBinLabel(5,
"SingleAntiProton");
816 axis->SetBinLabel(6,
"SingleChargedKaon");
817 axis->SetBinLabel(7,
"SingleK0L");
818 axis->SetBinLabel(8,
"SingleNeutron");
819 axis->SetBinLabel(9,
"SingleAntiNeutron");
820 axis->SetBinLabel(10,
"SingleOther");
821 axis->SetBinLabel(11,
"PhotonHadron");
822 axis->SetBinLabel(12,
"HadronPhoton");
823 axis->SetBinLabel(13,
"MergedPi0");
824 axis->SetBinLabel(14,
"PhotonPhotonOther");
825 axis->SetBinLabel(15,
"HadronHadron");
826 axis->SetBinLabel(16,
"TwoContributorsOther");
827 axis->SetBinLabel(17,
"MoreThanTwoContributors");
841 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
844 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
845 title = histname +
";Centrality;Scale factor;counts";
848 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
849 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
852 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jets->GetArrayName().Data());
853 title = histname +
";Centrality;Scale factor;counts";
858 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jets->GetArrayName().Data());
859 title = histname +
";Centrality;Scale factor;counts";
862 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jets->GetArrayName().Data());
863 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
866 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jets->GetArrayName().Data());
867 title = histname +
";Centrality;Scale factor;counts";
890 histname =
"TriggerSimHistograms/hEtaVsPhi";
891 title = histname +
";#eta_{patch} (rad);#phi_{patch} (rad)";
895 histname =
"TriggerSimHistograms/hNPatches";
896 title = histname +
";#it{N}_{patches};type";
900 histname =
"TriggerSimHistograms/hPatchE";
901 title = histname +
";Centrality (%);#it{E}_{patch} (GeV)";
905 histname =
"TriggerSimHistograms/hPatchMedianE";
906 title = histname +
";Centrality (%);#it{E}_{patch,med} (GeV);type";
907 fHistManager.
CreateTH3(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 50, 2, -0.5, 1.5);
910 histname =
"TriggerSimHistograms/hMaxPatchResponseMatrix";
911 title = histname +
";#it{E}_{maxpatch,det} (GeV);#it{E}_{maxpatch,truth} (GeV)";
914 histname =
"TriggerSimHistograms/hEMCalEnergyResponseMatrix";
915 title = histname +
";#Sigma#it{E}_{clus,EMCal} (GeV);#it{E}_{EMCal,truth} (GeV)";
923 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
926 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
927 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
933 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
934 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
943 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
944 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
945 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
948 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
949 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
950 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
954 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
955 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
959 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
960 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
964 nbinsx = 20; minx = 0; maxx = 100;
966 nbinsz = 50; minz = 0; maxz = 1.;
968 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
969 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
970 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
973 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
974 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
975 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
979 nbinsx = 20; minx = 0; maxx = 100;
981 nbinsz = 50; minz = 0; maxz = 1.;
983 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
984 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
985 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
988 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
989 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
990 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
994 nbinsx = 20; minx = 0; maxx = 100;
996 nbinsz = 50; minz = 0; maxz =
fMaxPt;
998 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
999 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
1000 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1003 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1004 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
1005 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1026 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
1028 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1029 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1032 title = histname +
";#it{p}_{T,corr}^{det} (GeV/#it{c});#it{p}_{T}^{truth} (GeV/#it{c})";
1037 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
1039 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1040 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1043 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1049 nbinsx = 20; minx = 0; maxx = 100;
1050 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1051 nbinsz = 250; minz = -5.; maxz = 5.;
1053 histname =
"MatchedJetHistograms/hJESshiftEMCal";
1055 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1056 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1059 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1064 histname =
"MatchedJetHistograms/hJESshiftDCal";
1066 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1067 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1070 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1076 nbinsx = 20; minx = 0; maxx = 100;
1078 nbinsz = 50; minz = 0; maxz = 1.;
1080 histname =
"MatchedJetHistograms/hNEFVsPt";
1082 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});Calo energy fraction";
1083 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1086 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});Calo energy fraction";
1091 nbinsx = 20; minx = 0; maxx = 100;
1092 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1093 nbinsz = 50; minz = 0; maxz = 1.;
1095 histname =
"MatchedJetHistograms/hZLeadingVsPt";
1097 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{z}_{leading}";
1098 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1101 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#it{z}_{leading}";
1106 nbinsx = 20; minx = 0; maxx = 100;
1107 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1108 nbinsz = 50; minz = 0; maxz = 1.;
1110 histname =
"MatchedJetHistograms/hMatchingDistance";
1112 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});R";
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});R";
1121 nbinsx = nPtBinsTruth2; minx = 0; maxx =
fMaxPt;
1122 histname =
"MatchedJetHistograms/hNumberMatchingCandidates";
1123 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});N_{truth} matches; N_{det} matches";
1124 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx, 11, -1.5, 9.5, 11, -1.5, 9.5);
1148 TClass cls(objname);
1149 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1150 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1151 GetName(), cls.GetName(),
"EmcalTriggers"));
1156 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1176 TString triggerNameMB1 =
"CINT7-B-NOPF-CENT";
1177 TString triggerNameMB2 =
"CV0L7-B-NOPF-CENT";
1178 TString triggerNameJE =
"CINT7EJ1-B-NOPF-CENTNOPMD";
1183 for (
auto i : runtriggers) {
1184 if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
1193 TString histname =
"Trigger/hMBDownscaleFactor";
1230 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
1231 TString jetContName = jetCont->GetName();
1266 TClass cls(objname);
1267 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1268 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1269 GetName(), cls.GetName(),
"EmcalTriggers"));
1274 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1279 std::vector<Double_t> vecEMCal;
1280 std::vector<Double_t> vecDCal;
1283 AliEMCALTriggerPatchInfo *maxPatch =
nullptr;
1285 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1288 if(!recpatch->IsJetHighSimple())
continue;
1290 patchE = recpatch->GetPatchE();
1292 histname =
"TriggerSimHistograms/hEtaVsPhi";
1295 histname =
"TriggerSimHistograms/hPatchE";
1298 if (recpatch->IsEMCal()) {
1299 vecEMCal.push_back(patchE);
1300 if (patchE > maxPatchEnergy) {
1301 maxPatchEnergy = patchE;
1302 maxPatch = recpatch;
1305 vecDCal.push_back(patchE);
1312 const Int_t nBkgPatchesEMCal = vecEMCal.size();
1313 const Int_t nBkgPatchesDCal = vecDCal.size();
1314 fMedianEMCal = TMath::Median(nBkgPatchesEMCal, &vecEMCal[0]);
1315 fMedianDCal = TMath::Median(nBkgPatchesDCal, &vecDCal[0]);
1317 histname =
"TriggerSimHistograms/hPatchMedianE";
1321 histname =
"TriggerSimHistograms/hNPatches";
1328 Double_t phiMinMaxPatch = maxPatch->GetPhiMin();
1329 Double_t phiMaxMaxPatch = maxPatch->GetPhiMax();
1330 Double_t etaMinMaxPatch = maxPatch->GetEtaMin();
1331 Double_t etaMaxMaxPatch = maxPatch->GetEtaMax();
1334 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
1335 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
1345 part = mcpart.first;
1346 partEta = part.Eta();
1349 if (partPhi < phiMaxMaxPatch && partPhi > phiMinMaxPatch) {
1350 if (partEta < etaMaxMaxPatch && partEta > etaMinMaxPatch) {
1351 truthEnergyPatch += partE;
1354 if (partPhi < phiMaxEMCal && partPhi > phiMinEMCal) {
1355 if (partEta < 0.7 && partEta > -0.7) {
1356 truthEnergyEMCal += partE;
1362 const AliVCluster* clus;
1367 clusFourVec.Clear();
1368 clusFourVec = clusIterator.first;
1369 clusEta = clusFourVec.Eta();
1371 clus = clusIterator.second;
1372 if (clus->IsEMCAL()) {
1373 if (clusPhi < phiMaxEMCal && clusPhi > phiMinEMCal) {
1374 if (clusEta < 0.7 && clusEta > -0.7) {
1375 detEnergyEMCal += clusFourVec.E();
1381 histname =
"TriggerSimHistograms/hMaxPatchResponseMatrix";
1384 histname =
"TriggerSimHistograms/hEMCalEnergyResponseMatrix";
1393 for(
auto p : *fTriggerPatchInfo){
1394 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1397 if(!recpatch->IsJetHighSimple())
continue;
1399 if (recpatch->IsEMCal()) {
1400 if ((recpatch->GetPatchE() -
fMedianDCal) > threshold) {
1405 if ((recpatch->GetPatchE() -
fMedianEMCal) > threshold) {
1453 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1454 TString jetContName = jets->GetName();
1463 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1467 for (
auto jet : jets->
all()) {
1481 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1490 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1500 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1502 else if (type ==
kDCal) {
1503 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1505 TLorentzVector leadPart;
1508 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
1517 UInt_t rejectionReason = 0;
1518 if (!jets->
AcceptJet(jet, rejectionReason)) {
1519 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1524 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), corrPt);
1531 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
1533 else if (type ==
kDCal) {
1534 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
1545 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1551 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1553 else if (type ==
kDCal) {
1554 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1556 const AliVTrack* track;
1557 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1558 track =
static_cast<AliVTrack*
>(jet->Track(i));
1559 z = track->Pt() / TMath::Abs(corrPt);
1570 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1572 else if (type ==
kDCal) {
1573 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1585 if (jet->Eta() > 0) {
1586 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
1589 else if (jet->Eta() < 0) {
1590 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
1599 const AliVCluster* clus =
nullptr;
1600 Int_t nClusters = jet->GetNumberOfClusters();
1601 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1602 clus = jet->Cluster(iClus);
1603 deltaEhadcorr += (clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy());
1606 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
1613 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
1634 const AliVCluster* clus;
1638 Double_t clusPhi = it.first.Phi_0_2pi();
1642 if (!clus->IsEMCAL()) {
1648 Int_t nTracksMatched = 0;
1649 const AliVTrack* track =
nullptr;
1650 for (
Int_t itrack=0; itrack < clus->GetNTracksMatched(); itrack++) {
1651 track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(itrack));
1656 Double_t trackPhi = TVector2::Phi_0_2pi(track->GetTrackPhiOnEMCal());
1657 Double_t trackEta = track->GetTrackEtaOnEMCal();
1658 Double_t deta = TMath::Abs(clusEta - trackEta);
1659 Double_t dphi = TMath::Abs(clusPhi - trackPhi);
1662 trackPSum += track->P();
1668 if (trackPSum > 1e-3) {
1669 EoverP = clus->GetNonLinCorrEnergy() / trackPSum;
1672 Double_t deltaE = clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy();
1674 if (trackPSum > 1e-3) {
1675 Rcorr = deltaE / trackPSum;
1677 Double_t RcorrClus = deltaE / clus->GetNonLinCorrEnergy();
1683 histname =
"ClusterHistograms/hM02";
1687 if (clus->GetM02() > 0.4) {
1688 histname =
"ClusterHistograms/hNcellsM02G04";
1691 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1692 histname =
"ClusterHistograms/hNcellsM02L04";
1700 histname =
"ClusterHistograms/hMatchedTrackPt";
1703 if (clus->GetM02() > 0.4) {
1704 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
1707 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1708 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
1713 histname =
"ClusterHistograms/hMatchedTrackN";
1716 if (clus->GetM02() > 0.4) {
1717 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
1720 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1721 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
1726 histname =
"ClusterHistograms/hM02Matched";
1727 if (nTracksMatched > 0) {
1732 histname =
"ClusterHistograms/hM02Unmatched";
1733 if (nTracksMatched == 0) {
1738 if (nTracksMatched == 1) {
1740 const AliVTrack* track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(0));
1742 Double_t trackEta = track->GetTrackEtaOnEMCal();
1743 Double_t deta = trackEta - clusEta;
1746 histname =
"ClusterHistograms/hDeltaEtaCentral";
1751 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
1762 histname =
"ClusterHistograms/hEoverPM02Central";
1766 histname =
"ClusterHistograms/hEoverPM02Peripheral";
1774 histname =
"ClusterHistograms/hRcorrVsCent";
1779 histname =
"ClusterHistograms/hRcorr0-10";
1785 histname =
"ClusterHistograms/hRcorr50-90";
1790 histname =
"ClusterHistograms/hRcorrClusVsCent";
1795 histname =
"ClusterHistograms/hRcorrClus0-10";
1801 histname =
"ClusterHistograms/hRcorrClus50-90";
1808 histname =
"ClusterHistograms/hTrackMultiplicity";
1821 const AliMCEvent* mcevent =
nullptr;
1823 mcevent = MCEvent();
1846 const AliVCluster* clus;
1847 std::vector<ContributorType> vecContributorTypes;
1848 std::vector<Int_t> vecContributorLabels;
1854 if (!clus->IsEMCAL()) {
1861 const Int_t nLabels = clus->GetNLabels();
1864 vecContributorTypes.clear();
1865 vecContributorLabels.clear();
1866 for (
Int_t iLabel=0; iLabel<nLabels; iLabel++) {
1868 Int_t label = clus->GetLabels()[iLabel];
1869 if (TMath::Abs(label) > 0) {
1872 vecContributorTypes.push_back(contributorType);
1873 vecContributorLabels.push_back(label);
1878 Int_t nLabelsPhysPrim = vecContributorTypes.size();
1880 if (nLabelsPhysPrim == 1) {
1882 contributorType = vecContributorTypes[0];
1884 if (contributorType ==
kPhoton) {
1887 else if (contributorType ==
kElectron) {
1893 else if (contributorType ==
kProton) {
1902 else if (contributorType ==
kK0L) {
1905 else if (contributorType ==
kNeutron) {
1916 else if (nLabelsPhysPrim == 2) {
1924 Double_t frac1 = clus->GetClusterMCEdepFraction(1);
1932 if (isHadron1 && isHadron2) {
1935 else if (isPhoton1 && isHadron2) {
1939 Double_t photonEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
1940 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
1943 else if (isHadron1 && isPhoton2) {
1947 Double_t hadronEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
1948 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
1951 else if (isPhoton1 && isPhoton2) {
1959 if (part1 && part2) {
1960 Int_t iMother1 = part1->GetMother();
1961 Int_t iMother2 = part2->GetMother();
1962 AliVParticle *mother1 = mcevent->GetTrack(iMother1);
1963 AliVParticle *mother2 = mcevent->GetTrack(iMother2);
1965 if (mother1 && mother2) {
1966 if ( (mother1->PdgCode() == 111) && (mother2->PdgCode() == 111) ) {
1967 if (iMother1 == iMother2) {
1979 else if (nLabelsPhysPrim > 2) {
1985 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
1986 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
1989 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
1990 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
2003 const AliVCluster* clus;
2005 for (
const auto jet : jets->
accepted()) {
2010 Double_t hadCaloEnergyUnmatched = 0;
2011 Double_t hadCaloEnergyMatchedNonlincorr = 0;
2012 Double_t hadCaloEnergyMatchedHadCorr = 0;
2015 Int_t nClusters = jet->GetNumberOfClusters();
2016 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
2018 clus = jet->Cluster(iClus);
2022 Int_t label = TMath::Abs(clus->GetLabel());
2028 histname =
"JetPerformanceMC/hM02VsContributorTypeJets";
2029 Double_t x[4] = {clus->GetM02(), clus->GetNonLinCorrEnergy(), contributorType, jetPt};
2035 Bool_t hasMatchedTrack = (clus->GetNTracksMatched() > 0);
2037 if (hasMatchedTrack) {
2038 hadCaloEnergyMatchedNonlincorr += clus->GetNonLinCorrEnergy();
2039 hadCaloEnergyMatchedHadCorr += clus->GetHadCorrEnergy();
2042 hadCaloEnergyUnmatched += clus->GetNonLinCorrEnergy();
2051 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
2055 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
2059 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
2063 histname =
"JetPerformanceMC/hJetComposition";
2064 for (
Int_t type = 0; type < 8; type++) {
2071 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
2073 clus = jet->Cluster(iClus);
2075 Int_t label = TMath::Abs(clus->GetLabel());
2080 if (type == contributorType) {
2082 pTsum += clus->GetNonLinCorrEnergy();
2087 Double_t x[4] = {jetPt, 1.*type, nSum, pTsum};
2107 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
2108 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
2109 Double_t phiMinDCal =
fGeom->GetDCALPhiMin() * TMath::DegToRad();
2110 Double_t phiMaxDCal =
fGeom->GetDCALPhiMax() * TMath::DegToRad();
2112 Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
2113 Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
2114 Double_t accDCal = 2 * (etaEMCal - etaMinDCal) * (phiMaxDCal - phiMinDCal);
2119 while ((jetCont = static_cast<AliJetContainer*>(nextJetColl()))) {
2122 TRandom3* r =
new TRandom3(0);
2124 Double_t etaEMCalfid = etaEMCal - jetR;
2125 Double_t etaMinDCalfid = etaMinDCal + jetR;
2126 Double_t phiMinEMCalfid = phiMinEMCal + jetR;
2127 Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
2128 Double_t phiMinDCalfid = phiMinDCal + jetR;
2129 Double_t phiMaxDCalfid = phiMaxDCal - jetR;
2130 Double_t accEMCalfid = 2 * etaEMCalfid * (phiMaxEMCalfid - phiMinEMCalfid);
2131 Double_t accDCalfid = 2 * (etaEMCalfid - etaMinDCalfid) * (phiMaxDCalfid - phiMinDCalfid);
2132 if ( (etaEMCalfid - etaMinDCalfid) < 0) {
2137 Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
2138 Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
2141 Double_t etaDCalRC = r->Uniform(etaMinDCalfid, etaEMCalfid);
2142 Double_t sign = r->Uniform(-1., 1.);
2144 etaDCalRC = -1*etaDCalRC;
2146 Double_t phiDCalRC = r->Uniform(phiMinDCalfid, phiMaxDCalfid);
2173 while ((partCont = static_cast<AliParticleContainer*>(nextPartCont()))) {
2175 TString partContName = partCont->GetName();
2176 if (!partContName.CompareTo(
"tracks")) {
2182 track = trackIterator.first;
2183 trackEta = track.Eta();
2185 trackPt = track.Pt();
2188 if (TMath::Abs(trackEta) < etaTPC) {
2189 trackPtSumTPC += trackPt;
2193 if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
2194 trackPtSumEMCal += trackPt;
2198 if (TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinEMCalfid && trackPhi < phiMaxEMCalfid) {
2199 trackPtSumEMCalfid += trackPt;
2204 if (TMath::Abs(trackEta) > etaMinDCal && TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinDCal && trackPhi < phiMaxDCal) {
2205 trackPtSumDCal += trackPt;
2211 if (TMath::Abs(trackEta) > etaMinDCalfid && TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinDCalfid && trackPhi < phiMaxDCalfid) {
2212 trackPtSumDCalfid += trackPt;
2217 deltaR =
GetDeltaR(&track, etaEMCalRC, phiEMCalRC);
2218 if (deltaR < jetR) {
2219 trackPtSumEMCalRC += trackPt;
2224 deltaR =
GetDeltaR(&track, etaDCalRC, phiDCalRC);
2225 if (deltaR < jetR) {
2226 trackPtSumDCalRC += trackPt;
2245 clus = clusIterator.first;
2246 clusEta = clus.Eta();
2251 if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
2252 clusPtSumEMCal += clusPt;
2256 if (TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinEMCalfid && clusPhi < phiMaxEMCalfid) {
2257 clusPtSumEMCalfid += clusPt;
2262 if (TMath::Abs(clusEta) > etaMinDCal && TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinDCal && clusPhi < phiMaxDCal) {
2263 clusPtSumDCal += clusPt;
2269 if (TMath::Abs(clusEta) > etaMinDCalfid && TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinDCalfid && clusPhi < phiMaxDCalfid) {
2270 clusPtSumDCalfid += clusPt;
2275 deltaR =
GetDeltaR(&clus, etaEMCalRC, phiEMCalRC);
2276 if (deltaR < jetR) {
2277 clusPtSumEMCalRC += clusPt;
2282 deltaR =
GetDeltaR(&clus, etaDCalRC, phiDCalRC);
2283 if (deltaR < jetR) {
2284 clusPtSumDCalRC += clusPt;
2293 Double_t numerator = (trackPtSumEMCal + clusPtSumEMCal) / accEMCal;
2294 Double_t denominator = trackPtSumTPC / accTPC;
2295 Double_t scaleFactor = numerator / denominator;
2296 TString histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
2300 if (accEMCalfid > 1e-3) {
2301 numerator = (trackPtSumEMCalfid + clusPtSumEMCalfid) / accEMCalfid;
2302 scaleFactor = numerator / denominator;
2303 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jetCont->GetArrayName().Data());
2309 numerator = (trackPtSumDCal + clusPtSumDCal) / accDCal;
2310 scaleFactor = numerator / denominator;
2311 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jetCont->GetArrayName().Data());
2317 if (accDCalfid > 1e-3) {
2318 numerator = (trackPtSumDCalfid + clusPtSumDCalfid) / accDCalfid;
2319 scaleFactor = numerator / denominator;
2320 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jetCont->GetArrayName().Data());
2329 Double_t deltaPt = trackPtSumEMCalRC + clusPtSumEMCalRC - rho * TMath::Pi() * jetR * jetR;
2330 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
2335 if (accDCalfid > 1e-3) {
2336 deltaPt = trackPtSumDCalRC + clusPtSumDCalRC - rho * TMath::Pi() * jetR * jetR;
2337 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jetCont->GetArrayName().Data());
2357 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2358 TString jetContName = jets->GetName();
2363 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
2367 for (
auto jet : jets->
all()) {
2373 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
2377 UInt_t rejectionReason = 0;
2378 if (!jets->
AcceptJet(jet, rejectionReason)) {
2379 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
2380 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
2394 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
2396 else if (type ==
kDCal) {
2397 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
2402 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
2407 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
2409 else if (type ==
kDCal) {
2410 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
2412 TLorentzVector leadPart;
2415 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2420 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
2422 else if (type ==
kDCal) {
2423 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
2425 const AliVTrack* track;
2426 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
2427 track =
static_cast<AliVTrack*
>(jet->Track(i));
2428 z = track->Pt() / TMath::Abs(corrPt);
2434 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
2436 else if (type ==
kDCal) {
2437 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
2471 if (!matchedPartLevelJet) {
2474 UInt_t rejectionReason = 0;
2488 Float_t truthPt = matchedPartLevelJet->
Pt();
2492 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
2494 else if (type ==
kDCal) {
2495 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
2506 histname =
"MatchedJetHistograms/hJESshiftEMCal";
2508 else if (type ==
kDCal) {
2509 histname =
"MatchedJetHistograms/hJESshiftDCal";
2519 histname =
"MatchedJetHistograms/hNEFVsPt";
2528 histname =
"MatchedJetHistograms/hZLeadingVsPt";
2529 TLorentzVector leadPart;
2532 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2551 truthJet->ResetMatching();
2554 detJet->ResetMatching();
2557 deltaR = detJet->DeltaR(truthJet);
2560 if (deltaR < detJet->ClosestJetDistance()) {
2561 detJet->SetClosestJet(truthJet, deltaR);
2563 if (deltaR < truthJet->ClosestJetDistance()) {
2564 truthJet->SetClosestJet(detJet, deltaR);
2581 Int_t nTruthMatches = 0;
2585 deltaR = leadDetJet->
DeltaR(truthJet);
2596 Int_t nDetMatches = 0;
2600 deltaR = leadTruthJet->
DeltaR(detJet);
2607 TString histname =
"MatchedJetHistograms/hNumberMatchingCandidates";
2621 if (!matchedTruthJetCand) {
2624 if (matchedTruthJetCand->
ClosestJet() != detJet) {
2629 TString histname =
"MatchedJetHistograms/hMatchingDistance";
2643 return matchedTruthJetCand;
2657 TString histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
2658 UInt_t rejectionReason = 0;
2661 return contributorType;
2664 if (part->GetGeneratorIndex() == 0) {
2672 else if (TMath::Abs(pdg) == 211) {
2675 else if (pdg == 2212) {
2678 else if (pdg == -2212) {
2681 else if (TMath::Abs(pdg) == 321) {
2684 else if (pdg == 130) {
2685 contributorType =
kK0L;
2687 else if (pdg == 2112) {
2690 else if (pdg == -2112) {
2693 else if (TMath::Abs(pdg) == 11) {
2696 else if (TMath::Abs(pdg) == 13) {
2697 contributorType =
kMuon;
2700 contributorType =
kOther;
2704 return contributorType;
2713 Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
2714 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
2756 const char *ntracks,
2757 const char *nclusters,
2758 const char *nGenLev,
2768 ::Error(
"AddTaskEmcalJetPerformance",
"No analysis manager to connect to.");
2774 AliVEventHandler* handler = mgr->GetInputEventHandler();
2777 ::Error(
"AddTaskEmcalJetPerformance",
"This task requires an input event handler");
2789 if (handler->InheritsFrom(
"AliESDInputHandler")) {
2792 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
2803 if (trackName ==
"usedefault") {
2804 if (dataType ==
kESD) {
2805 trackName =
"Tracks";
2807 else if (dataType == kAOD) {
2808 trackName =
"tracks";
2815 if (clusName ==
"usedefault") {
2816 if (dataType ==
kESD) {
2817 clusName =
"CaloClusters";
2819 else if (dataType == kAOD) {
2820 clusName =
"caloClusters";
2827 TString name(
"AliAnalysisTaskEmcalJetPerformance");
2828 if (!trackName.IsNull()) {
2832 if (!clusName.IsNull()) {
2836 if (strcmp(suffix,
"") != 0) {
2849 if (trackName ==
"mcparticles") {
2851 partCont = mcpartCont;
2853 else if (trackName ==
"tracks" || trackName ==
"Tracks") {
2855 partCont = trackCont;
2861 if (nGenLev && strcmp(nGenLev,
"")!=0) {
2869 if (!clusName.IsNull()) {
2883 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
2885 contname +=
"_histos";
2886 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
2887 TList::Class(),AliAnalysisManager::kOutputContainer,
2888 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
2889 mgr->ConnectInput (task, 0, cinput1 );
2890 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.
AliEmcalJet * GetLeadingJet(const char *opt="")
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.
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.
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()