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());
301 title = histname +
";Centrality (%);Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
302 TH3* hist =
fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, 32, 0, 32, 50, 0,
fMaxPt);
307 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
308 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
317 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
318 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
319 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
322 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
323 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
324 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
329 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
330 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
331 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, 0, 100,
nPtBins, 0,
fMaxPt, 2, -0.5, 1.5,
"s");
335 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
336 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
337 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100,
nPtBins, 0,
fMaxPt,
fMaxPt, 0,
fMaxPt);
340 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
341 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
342 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100,
nPtBins, 0,
fMaxPt, 50, 0, 0.5);
345 nbinsx = 20; minx = 0; maxx = 100;
347 nbinsz = 50; minz = 0; maxz = 1.;
349 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
350 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
351 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
354 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
355 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
356 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
360 nbinsx = 20; minx = 0; maxx = 100;
362 nbinsz = 50; minz = 0; maxz = 1.;
364 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
365 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
366 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
369 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
370 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
371 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
375 nbinsx = 20; minx = 0; maxx = 100;
377 nbinsz = 50; minz = 0; maxz =
fMaxPt;
379 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
380 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
381 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
384 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
385 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
386 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
390 nbinsx = 20; minx = 0; maxx = 100;
393 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
394 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
397 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
398 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
402 nbinsx = 20; minx = 0; maxx = 100;
406 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
407 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#sum#it{E}_{nonlincorr} - #it{E}_{hadcorr}";
408 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
412 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
413 title = histname +
";#it{E}_{patch,med};type;#it{p}_{T}^{corr} (GeV/#it{c});Centrality (%)";
424 histname =
"Trigger/hMBDownscaleFactor";
425 title = histname +
";Downscale factor;counts";
439 const Int_t nRcorrBins = 50;
441 const Int_t nCellBins = 30;
443 const Int_t nMatchedTrackBins = 5;
445 const Int_t nDeltaEtaBins = 60;
452 histname =
"ClusterHistograms/hM02";
453 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
457 histname =
"ClusterHistograms/hNcellsM02G04";
458 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
461 histname =
"ClusterHistograms/hNcellsM02L04";
462 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
469 histname =
"ClusterHistograms/hMatchedTrackPt";
470 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
473 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
474 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
477 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
478 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
482 histname =
"ClusterHistograms/hMatchedTrackN";
483 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
486 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
487 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
490 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
491 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
495 histname =
"ClusterHistograms/hM02Matched";
496 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
500 histname =
"ClusterHistograms/hM02Unmatched";
501 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
505 histname =
"ClusterHistograms/hDeltaEtaCentral";
506 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
509 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
510 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
517 histname =
"ClusterHistograms/hEoverPM02Central";
518 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
521 histname =
"ClusterHistograms/hEoverPM02Peripheral";
522 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
529 histname =
"ClusterHistograms/hRcorrVsCent";
530 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
534 histname =
"ClusterHistograms/hRcorr0-10";
535 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
539 histname =
"ClusterHistograms/hRcorr50-90";
540 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
544 histname =
"ClusterHistograms/hRcorrClusVsCent";
545 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
549 histname =
"ClusterHistograms/hRcorrClus0-10";
550 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
554 histname =
"ClusterHistograms/hRcorrClus50-90";
555 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
559 histname =
"ClusterHistograms/hTrackMultiplicity";
560 htitle = histname +
";N_{tracks};Centrality (%)";
573 const Int_t nRejBins = 32;
576 const Int_t nContributorTypes = 11;
578 const Int_t nParticleTypes = 17;
581 AliEmcalContainer* cont = 0;
583 while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) {
585 histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
586 htitle = histname +
";Rejection reason;#it{E}_{clus} (GeV/)";
592 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
593 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
597 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
598 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
603 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
604 htitle = histname +
";Centrality (%);M02;#it{E}_{photon} (GeV)";
608 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
609 htitle = histname +
";Centrality (%);M02;#it{E}_{hadron} (GeV)";
625 min[dim] = fM02HistBins[0];
629 title[dim] =
"#it{E}_{clus} (GeV)";
632 min[dim] = fPtHistBins[0];
636 title[dim] =
"Contributor type";
637 nbins[dim] = nContributorTypes;
640 binEdges[dim] = contributorTypeBins;
643 title[dim] =
"#it{p}_{T,jet}^{corr}";
650 TString thnname =
"JetPerformanceMC/hM02VsContributorTypeJets";
652 for (
Int_t i = 0; i < dim; i++) {
653 hn->GetAxis(i)->SetTitle(title[i]);
654 hn->SetBinEdges(i, binEdges[i]);
661 title[dim] =
"#it{p}_{T,jet}^{corr}";
668 title[dim] =
"Contributor type";
669 nbins[dim] = nContributorTypes;
672 binEdges[dim] = contributorTypeBins;
682 title[dim] =
"#it{p}_{T,sum} (GeV)";
685 min[dim] = fPtHistBins[0];
689 thnname =
"JetPerformanceMC/hJetComposition";
691 for (
Int_t i = 0; i < dim; i++) {
692 thn->GetAxis(i)->SetTitle(title[i]);
693 thn->SetBinEdges(i, binEdges[i]);
699 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
700 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
704 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
705 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
709 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
710 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
722 axis->SetBinLabel(1,
"SinglePhoton");
723 axis->SetBinLabel(2,
"SingleElectron");
724 axis->SetBinLabel(3,
"SingleChargedPion");
725 axis->SetBinLabel(4,
"SingleProton");
726 axis->SetBinLabel(5,
"SingleAntiProton");
727 axis->SetBinLabel(6,
"SingleChargedKaon");
728 axis->SetBinLabel(7,
"SingleK0L");
729 axis->SetBinLabel(8,
"SingleNeutron");
730 axis->SetBinLabel(9,
"SingleAntiNeutron");
731 axis->SetBinLabel(10,
"SingleOther");
732 axis->SetBinLabel(11,
"PhotonHadron");
733 axis->SetBinLabel(12,
"HadronPhoton");
734 axis->SetBinLabel(13,
"MergedPi0");
735 axis->SetBinLabel(14,
"PhotonPhotonOther");
736 axis->SetBinLabel(15,
"HadronHadron");
737 axis->SetBinLabel(16,
"TwoContributorsOther");
738 axis->SetBinLabel(17,
"MoreThanTwoContributors");
752 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
755 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
756 title = histname +
";Centrality;Scale factor;counts";
759 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
760 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
763 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jets->GetArrayName().Data());
764 title = histname +
";Centrality;Scale factor;counts";
769 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jets->GetArrayName().Data());
770 title = histname +
";Centrality;Scale factor;counts";
773 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jets->GetArrayName().Data());
774 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
777 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jets->GetArrayName().Data());
778 title = histname +
";Centrality;Scale factor;counts";
799 histname =
"TriggerSimHistograms/hEtaVsPhi";
800 title = histname +
";#eta_{patch} (rad);#phi_{patch} (rad)";
804 histname =
"TriggerSimHistograms/hNPatches";
805 title = histname +
";#it{N}_{patches};type";
809 histname =
"TriggerSimHistograms/hPatchE";
810 title = histname +
";Centrality (%);#it{E}_{patch} (GeV)";
814 histname =
"TriggerSimHistograms/hPatchMedianE";
815 title = histname +
";Centrality (%);#it{E}_{patch,med} (GeV);type";
816 fHistManager.
CreateTH3(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 50, 2, -0.5, 1.5);
822 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
825 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
826 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
832 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
833 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
842 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
843 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
844 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
847 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
848 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
849 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
853 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
854 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
858 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
859 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
863 nbinsx = 20; minx = 0; maxx = 100;
865 nbinsz = 50; minz = 0; maxz = 1.;
867 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
868 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
869 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
872 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
873 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
874 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
878 nbinsx = 20; minx = 0; maxx = 100;
880 nbinsz = 50; minz = 0; maxz = 1.;
882 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
883 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
884 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
887 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
888 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
889 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
893 nbinsx = 20; minx = 0; maxx = 100;
895 nbinsz = 50; minz = 0; maxz =
fMaxPt;
897 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
898 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
899 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
902 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
903 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
904 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
925 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
926 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
927 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
930 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
931 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
932 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
936 nbinsx = 20; minx = 0; maxx = 100;
938 nbinsz = 250; minz = -5.; maxz = 5.;
940 histname =
"MatchedJetHistograms/hJESshiftEMCal";
941 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
942 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
945 histname =
"MatchedJetHistograms/hJESshiftDCal";
946 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
947 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
951 nbinsx = 20; minx = 0; maxx = 100;
953 nbinsz = 50; minz = 0; maxz = 1.;
955 histname =
"MatchedJetHistograms/hNEFVsPt";
956 title = histname +
";Centrality (%);#it{p}_{T,corr}^{det} (GeV/#it{c});Calo energy fraction";
957 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
960 nbinsx = 20; minx = 0; maxx = 100;
962 nbinsz = 50; minz = 0; maxz = 1.;
964 histname =
"MatchedJetHistograms/hZLeadingVsPt";
965 title = histname +
";Centrality (%);#it{p}_{T,corr}^{det} (GeV/#it{c});#it{z}_{leading}";
966 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
969 nbinsx = 20; minx = 0; maxx = 100;
971 nbinsz = 50; minz = 0; maxz = 1.;
973 histname =
"MatchedJetHistograms/hMatchingDistance";
974 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});R";
975 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
977 histname =
"MatchedJetHistograms/hMatchingDistancepp";
978 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});R";
979 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
982 histname =
"MatchedJetHistograms/fHistJetMatchingQA";
984 std::vector<std::string> binLabels = {
"noMatch",
"matchedJet",
"sharedMomentumFraction",
"partLevelMatchedJet",
"jetDistance",
"passedAllCuts"};
985 auto histMatchedJetCuts =
fHistManager.
CreateTH1(histname.Data(), title.Data(), binLabels.size(), 0, binLabels.size());
987 for (
unsigned int i = 1; i <= binLabels.size(); i++) {
988 histMatchedJetCuts->GetXaxis()->SetBinLabel(i, binLabels.at(i-1).c_str());
990 histMatchedJetCuts->GetYaxis()->SetTitle(
"Number of jets");
1014 TClass cls(objname);
1015 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1016 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1017 GetName(), cls.GetName(),
"EmcalTriggers"));
1022 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1042 TString triggerNameMB1 =
"CINT7-B-NOPF-CENT";
1043 TString triggerNameMB2 =
"CV0L7-B-NOPF-CENT";
1044 TString triggerNameJE =
"CINT7EJ1-B-NOPF-CENTNOPMD";
1049 for (
auto i : runtriggers) {
1050 if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
1059 TString histname =
"Trigger/hMBDownscaleFactor";
1096 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
1097 TString jetContName = jetCont->GetName();
1132 TClass cls(objname);
1133 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1134 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1135 GetName(), cls.GetName(),
"EmcalTriggers"));
1140 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1145 std::vector<Double_t> vecEMCal;
1146 std::vector<Double_t> vecDCal;
1148 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1151 if(!recpatch->IsJetHighSimple())
continue;
1153 histname =
"TriggerSimHistograms/hEtaVsPhi";
1156 histname =
"TriggerSimHistograms/hPatchE";
1159 if (recpatch->IsEMCal()) {
1160 vecEMCal.push_back(recpatch->GetPatchE());
1162 vecDCal.push_back(recpatch->GetPatchE());
1169 const Int_t nBkgPatchesEMCal = vecEMCal.size();
1170 const Int_t nBkgPatchesDCal = vecDCal.size();
1171 fMedianEMCal = TMath::Median(nBkgPatchesEMCal, &vecEMCal[0]);
1172 fMedianDCal = TMath::Median(nBkgPatchesDCal, &vecDCal[0]);
1174 histname =
"TriggerSimHistograms/hPatchMedianE";
1178 histname =
"TriggerSimHistograms/hNPatches";
1186 for(
auto p : *fTriggerPatchInfo){
1187 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1190 if(!recpatch->IsJetHighSimple())
continue;
1192 if (recpatch->IsEMCal()) {
1193 if ((recpatch->GetPatchE() -
fMedianDCal) > threshold) {
1198 if ((recpatch->GetPatchE() -
fMedianEMCal) > threshold) {
1246 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1247 TString jetContName = jets->GetName();
1252 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1256 for (
auto jet : jets->
all()) {
1270 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1274 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1279 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1281 else if (type ==
kDCal) {
1282 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1284 TLorentzVector leadPart;
1287 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
1291 UInt_t rejectionReason = 0;
1292 if (!jets->
AcceptJet(jet, rejectionReason)) {
1293 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1300 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
1302 else if (type ==
kDCal) {
1303 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
1309 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1315 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1317 else if (type ==
kDCal) {
1318 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1320 const AliVTrack* track;
1321 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1322 track =
static_cast<AliVTrack*
>(jet->Track(i));
1323 z = track->Pt() / TMath::Abs(corrPt);
1329 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1331 else if (type ==
kDCal) {
1332 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1338 if (jet->Eta() > 0) {
1339 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
1342 else if (jet->Eta() < 0) {
1343 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
1350 const AliVCluster* clus =
nullptr;
1351 Int_t nClusters = jet->GetNumberOfClusters();
1352 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1353 clus = jet->Cluster(iClus);
1354 deltaEhadcorr += (clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy());
1357 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
1363 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
1384 const AliVCluster* clus;
1388 Double_t clusPhi = it.first.Phi_0_2pi();
1392 if (!clus->IsEMCAL()) {
1398 Int_t nTracksMatched = 0;
1399 const AliVTrack* track =
nullptr;
1400 for (
Int_t itrack=0; itrack < clus->GetNTracksMatched(); itrack++) {
1401 track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(itrack));
1406 Double_t trackPhi = TVector2::Phi_0_2pi(track->GetTrackPhiOnEMCal());
1407 Double_t trackEta = track->GetTrackEtaOnEMCal();
1408 Double_t deta = TMath::Abs(clusEta - trackEta);
1409 Double_t dphi = TMath::Abs(clusPhi - trackPhi);
1412 trackPSum += track->P();
1418 if (trackPSum > 1e-3) {
1419 EoverP = clus->GetNonLinCorrEnergy() / trackPSum;
1422 Double_t deltaE = clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy();
1424 if (trackPSum > 1e-3) {
1425 Rcorr = deltaE / trackPSum;
1427 Double_t RcorrClus = deltaE / clus->GetNonLinCorrEnergy();
1433 histname =
"ClusterHistograms/hM02";
1437 if (clus->GetM02() > 0.4) {
1438 histname =
"ClusterHistograms/hNcellsM02G04";
1441 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1442 histname =
"ClusterHistograms/hNcellsM02L04";
1450 histname =
"ClusterHistograms/hMatchedTrackPt";
1453 if (clus->GetM02() > 0.4) {
1454 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
1457 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1458 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
1463 histname =
"ClusterHistograms/hMatchedTrackN";
1466 if (clus->GetM02() > 0.4) {
1467 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
1470 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1471 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
1476 histname =
"ClusterHistograms/hM02Matched";
1477 if (nTracksMatched > 0) {
1482 histname =
"ClusterHistograms/hM02Unmatched";
1483 if (nTracksMatched == 0) {
1488 if (nTracksMatched == 1) {
1490 const AliVTrack* track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(0));
1492 Double_t trackEta = track->GetTrackEtaOnEMCal();
1493 Double_t deta = trackEta - clusEta;
1496 histname =
"ClusterHistograms/hDeltaEtaCentral";
1501 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
1512 histname =
"ClusterHistograms/hEoverPM02Central";
1516 histname =
"ClusterHistograms/hEoverPM02Peripheral";
1524 histname =
"ClusterHistograms/hRcorrVsCent";
1529 histname =
"ClusterHistograms/hRcorr0-10";
1535 histname =
"ClusterHistograms/hRcorr50-90";
1540 histname =
"ClusterHistograms/hRcorrClusVsCent";
1545 histname =
"ClusterHistograms/hRcorrClus0-10";
1551 histname =
"ClusterHistograms/hRcorrClus50-90";
1558 histname =
"ClusterHistograms/hTrackMultiplicity";
1571 const AliMCEvent* mcevent =
nullptr;
1573 mcevent = MCEvent();
1596 const AliVCluster* clus;
1597 std::vector<ContributorType> vecContributorTypes;
1598 std::vector<Int_t> vecContributorLabels;
1604 if (!clus->IsEMCAL()) {
1611 const Int_t nLabels = clus->GetNLabels();
1614 vecContributorTypes.clear();
1615 vecContributorLabels.clear();
1616 for (
Int_t iLabel=0; iLabel<nLabels; iLabel++) {
1618 Int_t label = clus->GetLabels()[iLabel];
1619 if (TMath::Abs(label) > 0) {
1622 vecContributorTypes.push_back(contributorType);
1623 vecContributorLabels.push_back(label);
1628 Int_t nLabelsPhysPrim = vecContributorTypes.size();
1630 if (nLabelsPhysPrim == 1) {
1632 contributorType = vecContributorTypes[0];
1634 if (contributorType ==
kPhoton) {
1637 else if (contributorType ==
kElectron) {
1643 else if (contributorType ==
kProton) {
1652 else if (contributorType ==
kK0L) {
1655 else if (contributorType ==
kNeutron) {
1666 else if (nLabelsPhysPrim == 2) {
1674 Double_t frac1 = clus->GetClusterMCEdepFraction(1);
1682 if (isHadron1 && isHadron2) {
1685 else if (isPhoton1 && isHadron2) {
1689 Double_t photonEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
1690 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
1693 else if (isHadron1 && isPhoton2) {
1697 Double_t hadronEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
1698 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
1701 else if (isPhoton1 && isPhoton2) {
1709 if (part1 && part2) {
1710 Int_t iMother1 = part1->GetMother();
1711 Int_t iMother2 = part2->GetMother();
1712 AliVParticle *mother1 = mcevent->GetTrack(iMother1);
1713 AliVParticle *mother2 = mcevent->GetTrack(iMother2);
1715 if (mother1 && mother2) {
1716 if ( (mother1->PdgCode() == 111) && (mother2->PdgCode() == 111) ) {
1717 if (iMother1 == iMother2) {
1729 else if (nLabelsPhysPrim > 2) {
1735 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
1736 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
1739 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
1740 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
1753 const AliVCluster* clus;
1755 for (
const auto jet : jets->
accepted()) {
1760 Double_t hadCaloEnergyUnmatched = 0;
1761 Double_t hadCaloEnergyMatchedNonlincorr = 0;
1762 Double_t hadCaloEnergyMatchedHadCorr = 0;
1765 Int_t nClusters = jet->GetNumberOfClusters();
1766 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1768 clus = jet->Cluster(iClus);
1772 Int_t label = TMath::Abs(clus->GetLabel());
1778 histname =
"JetPerformanceMC/hM02VsContributorTypeJets";
1779 Double_t x[4] = {clus->GetM02(), clus->GetNonLinCorrEnergy(), contributorType, jetPt};
1785 Bool_t hasMatchedTrack = (clus->GetNTracksMatched() > 0);
1787 if (hasMatchedTrack) {
1788 hadCaloEnergyMatchedNonlincorr += clus->GetNonLinCorrEnergy();
1789 hadCaloEnergyMatchedHadCorr += clus->GetHadCorrEnergy();
1792 hadCaloEnergyUnmatched += clus->GetNonLinCorrEnergy();
1801 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
1805 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
1809 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
1813 histname =
"JetPerformanceMC/hJetComposition";
1814 for (
Int_t type = 0; type < 8; type++) {
1821 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1823 clus = jet->Cluster(iClus);
1825 Int_t label = TMath::Abs(clus->GetLabel());
1830 if (type == contributorType) {
1832 pTsum += clus->GetNonLinCorrEnergy();
1837 Double_t x[4] = {jetPt, 1.*type, nSum, pTsum};
1857 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
1858 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
1859 Double_t phiMinDCal =
fGeom->GetDCALPhiMin() * TMath::DegToRad();
1860 Double_t phiMaxDCal =
fGeom->GetDCALPhiMax() * TMath::DegToRad();
1862 Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
1863 Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
1864 Double_t accDCal = 2 * (etaEMCal - etaMinDCal) * (phiMaxDCal - phiMinDCal);
1869 while ((jetCont = static_cast<AliJetContainer*>(nextJetColl()))) {
1872 TRandom3* r =
new TRandom3(0);
1874 Double_t etaEMCalfid = etaEMCal - jetR;
1875 Double_t etaMinDCalfid = etaMinDCal + jetR;
1876 Double_t phiMinEMCalfid = phiMinEMCal + jetR;
1877 Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
1878 Double_t phiMinDCalfid = phiMinDCal + jetR;
1879 Double_t phiMaxDCalfid = phiMaxDCal - jetR;
1880 Double_t accEMCalfid = 2 * etaEMCalfid * (phiMaxEMCalfid - phiMinEMCalfid);
1881 Double_t accDCalfid = 2 * (etaEMCalfid - etaMinDCalfid) * (phiMaxDCalfid - phiMinDCalfid);
1882 if ( (etaEMCalfid - etaMinDCalfid) < 0) {
1887 Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
1888 Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
1891 Double_t etaDCalRC = r->Uniform(etaMinDCalfid, etaEMCalfid);
1892 Double_t sign = r->Uniform(-1., 1.);
1894 etaDCalRC = -1*etaDCalRC;
1896 Double_t phiDCalRC = r->Uniform(phiMinDCalfid, phiMaxDCalfid);
1923 while ((partCont = static_cast<AliParticleContainer*>(nextPartCont()))) {
1925 TString partContName = partCont->GetName();
1926 if (!partContName.CompareTo(
"tracks")) {
1932 track = trackIterator.first;
1933 trackEta = track.Eta();
1935 trackPt = track.Pt();
1938 if (TMath::Abs(trackEta) < etaTPC) {
1939 trackPtSumTPC += trackPt;
1943 if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
1944 trackPtSumEMCal += trackPt;
1948 if (TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinEMCalfid && trackPhi < phiMaxEMCalfid) {
1949 trackPtSumEMCalfid += trackPt;
1954 if (TMath::Abs(trackEta) > etaMinDCal && TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinDCal && trackPhi < phiMaxDCal) {
1955 trackPtSumDCal += trackPt;
1961 if (TMath::Abs(trackEta) > etaMinDCalfid && TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinDCalfid && trackPhi < phiMaxDCalfid) {
1962 trackPtSumDCalfid += trackPt;
1967 deltaR =
GetDeltaR(&track, etaEMCalRC, phiEMCalRC);
1968 if (deltaR < jetR) {
1969 trackPtSumEMCalRC += trackPt;
1974 deltaR =
GetDeltaR(&track, etaDCalRC, phiDCalRC);
1975 if (deltaR < jetR) {
1976 trackPtSumDCalRC += trackPt;
1995 clus = clusIterator.first;
1996 clusEta = clus.Eta();
2001 if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
2002 clusPtSumEMCal += clusPt;
2006 if (TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinEMCalfid && clusPhi < phiMaxEMCalfid) {
2007 clusPtSumEMCalfid += clusPt;
2012 if (TMath::Abs(clusEta) > etaMinDCal && TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinDCal && clusPhi < phiMaxDCal) {
2013 clusPtSumDCal += clusPt;
2019 if (TMath::Abs(clusEta) > etaMinDCalfid && TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinDCalfid && clusPhi < phiMaxDCalfid) {
2020 clusPtSumDCalfid += clusPt;
2025 deltaR =
GetDeltaR(&clus, etaEMCalRC, phiEMCalRC);
2026 if (deltaR < jetR) {
2027 clusPtSumEMCalRC += clusPt;
2032 deltaR =
GetDeltaR(&clus, etaDCalRC, phiDCalRC);
2033 if (deltaR < jetR) {
2034 clusPtSumDCalRC += clusPt;
2043 Double_t numerator = (trackPtSumEMCal + clusPtSumEMCal) / accEMCal;
2044 Double_t denominator = trackPtSumTPC / accTPC;
2045 Double_t scaleFactor = numerator / denominator;
2046 TString histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
2050 if (accEMCalfid > 1e-3) {
2051 numerator = (trackPtSumEMCalfid + clusPtSumEMCalfid) / accEMCalfid;
2052 scaleFactor = numerator / denominator;
2053 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jetCont->GetArrayName().Data());
2059 numerator = (trackPtSumDCal + clusPtSumDCal) / accDCal;
2060 scaleFactor = numerator / denominator;
2061 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jetCont->GetArrayName().Data());
2067 if (accDCalfid > 1e-3) {
2068 numerator = (trackPtSumDCalfid + clusPtSumDCalfid) / accDCalfid;
2069 scaleFactor = numerator / denominator;
2070 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jetCont->GetArrayName().Data());
2079 Double_t deltaPt = trackPtSumEMCalRC + clusPtSumEMCalRC - rho * TMath::Pi() * jetR * jetR;
2080 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
2085 if (accDCalfid > 1e-3) {
2086 deltaPt = trackPtSumDCalRC + clusPtSumDCalRC - rho * TMath::Pi() * jetR * jetR;
2087 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jetCont->GetArrayName().Data());
2107 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2108 TString jetContName = jets->GetName();
2113 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
2117 for (
auto jet : jets->
all()) {
2123 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
2127 UInt_t rejectionReason = 0;
2128 if (!jets->
AcceptJet(jet, rejectionReason)) {
2129 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
2130 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
2144 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
2146 else if (type ==
kDCal) {
2147 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
2152 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
2157 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
2159 else if (type ==
kDCal) {
2160 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
2162 TLorentzVector leadPart;
2165 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2170 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
2172 else if (type ==
kDCal) {
2173 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
2175 const AliVTrack* track;
2176 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
2177 track =
static_cast<AliVTrack*
>(jet->Track(i));
2178 z = track->Pt() / TMath::Abs(corrPt);
2184 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
2186 else if (type ==
kDCal) {
2187 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
2206 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2207 TString jetContName = jets->GetName();
2210 if (jetContName.Contains(
"mcparticles")) {
2219 for (
auto jet : jets->
accepted()) {
2231 if (!matchedPartLevelJet) {
2234 UInt_t rejectionReason = 0;
2248 Float_t truthPt = matchedPartLevelJet->
Pt();
2252 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
2254 else if (type ==
kDCal) {
2255 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
2261 histname =
"MatchedJetHistograms/hJESshiftEMCal";
2263 else if (type ==
kDCal) {
2264 histname =
"MatchedJetHistograms/hJESshiftDCal";
2269 histname =
"MatchedJetHistograms/hNEFVsPt";
2273 histname =
"MatchedJetHistograms/hZLeadingVsPt";
2274 TLorentzVector leadPart;
2277 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2281 histname =
"MatchedJetHistograms/hMatchingDistance";
2285 histname =
"MatchedJetHistograms/hMatchingDistancepp";
2302 TString histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
2303 UInt_t rejectionReason = 0;
2306 return contributorType;
2309 if (part->GetGeneratorIndex() == 0) {
2317 else if (TMath::Abs(pdg) == 211) {
2320 else if (pdg == 2212) {
2323 else if (pdg == -2212) {
2326 else if (TMath::Abs(pdg) == 321) {
2329 else if (pdg == 130) {
2330 contributorType =
kK0L;
2332 else if (pdg == 2112) {
2335 else if (pdg == -2112) {
2338 else if (TMath::Abs(pdg) == 11) {
2341 else if (TMath::Abs(pdg) == 13) {
2342 contributorType =
kMuon;
2345 contributorType =
kOther;
2349 return contributorType;
2358 Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
2359 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
2418 bool returnValue =
false;
2425 AliDebugStream(4) <<
"Jet is matched!\nJet: " << jet->
toString() <<
"\n";
2431 AliDebugStream(4) <<
"Jet rejected due to shared momentum fraction of " << sharedFraction <<
", which is smaller than the min momentum fraction of " <<
fMinSharedMomentumFraction <<
"\n";
2432 returnValue =
false;
2435 AliDebugStream(4) <<
"Passed shared momentum fraction with value of " << sharedFraction <<
"\n";
2442 if (!partLevelJet) {
2443 AliDebugStream(4) <<
"Jet rejected due to no matching part level jet.\n";
2444 returnValue =
false;
2447 AliDebugStream(4) <<
"Det level jet has a required match to a part level jet.\n" <<
"Part level jet: " << partLevelJet->
toString() <<
"\n";
2455 AliDebugStream(4) <<
"Jet rejected due to matching distance of " << matchedJetDistance <<
", which is larger than the max distance of " <<
fMaxMatchedJetDistance <<
"\n";
2456 returnValue =
false;
2459 AliDebugStream(4) <<
"Jet passed distance cut with distance of " << matchedJetDistance <<
"\n";
2465 if (returnValue ==
true) {
2470 AliDebugStream(5) <<
"Rejected jet because it was not matched to a external event jet.\n";
2472 returnValue =
false;
2476 return partLevelJet;
2485 const char *ntracks,
2486 const char *nclusters,
2487 const char *nGenLev,
2497 ::Error(
"AddTaskEmcalJetPerformance",
"No analysis manager to connect to.");
2503 AliVEventHandler* handler = mgr->GetInputEventHandler();
2506 ::Error(
"AddTaskEmcalJetPerformance",
"This task requires an input event handler");
2518 if (handler->InheritsFrom(
"AliESDInputHandler")) {
2521 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
2532 if (trackName ==
"usedefault") {
2533 if (dataType ==
kESD) {
2534 trackName =
"Tracks";
2536 else if (dataType == kAOD) {
2537 trackName =
"tracks";
2544 if (clusName ==
"usedefault") {
2545 if (dataType ==
kESD) {
2546 clusName =
"CaloClusters";
2548 else if (dataType == kAOD) {
2549 clusName =
"caloClusters";
2556 TString name(
"AliAnalysisTaskEmcalJetPerformance");
2557 if (!trackName.IsNull()) {
2561 if (!clusName.IsNull()) {
2565 if (strcmp(suffix,
"") != 0) {
2578 if (trackName ==
"mcparticles") {
2580 partCont = mcpartCont;
2582 else if (trackName ==
"tracks" || trackName ==
"Tracks") {
2584 partCont = trackCont;
2590 if (nGenLev && strcmp(nGenLev,
"")!=0) {
2598 if (!clusName.IsNull()) {
2612 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
2614 contname +=
"_histos";
2615 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
2616 TList::Class(),AliAnalysisManager::kOutputContainer,
2617 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
2618 mgr->ConnectInput (task, 0, cinput1 );
2619 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.
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.
DCal acceptance – spans ONLY DCal (no PHOS or gap)
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.
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
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()