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),
99 fUseAliEventCuts(kTRUE),
102 fUseManualEventCuts(kFALSE),
250 if (embeddingHelper) {
259 while ((obj = next())) {
279 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
282 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
283 title = histname +
";Centrality (%);Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
284 TH3* hist =
fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, 32, 0, 32, 50, 0,
fMaxPt);
289 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
290 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
299 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
300 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
301 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
304 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
305 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
306 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
311 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
312 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
313 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, 0, 100,
nPtBins, 0,
fMaxPt, 2, -0.5, 1.5,
"s");
317 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
318 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
319 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100,
nPtBins, 0,
fMaxPt,
fMaxPt, 0,
fMaxPt);
322 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
323 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
324 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100,
nPtBins, 0,
fMaxPt, 50, 0, 0.5);
327 nbinsx = 20; minx = 0; maxx = 100;
329 nbinsz = 50; minz = 0; maxz = 1.;
331 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
332 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
333 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
336 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
337 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
338 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
342 nbinsx = 20; minx = 0; maxx = 100;
344 nbinsz = 50; minz = 0; maxz = 1.;
346 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
347 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
348 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
351 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
352 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
353 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
357 nbinsx = 20; minx = 0; maxx = 100;
359 nbinsz = 50; minz = 0; maxz =
fMaxPt;
361 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
362 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
363 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
366 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
367 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
368 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
372 nbinsx = 20; minx = 0; maxx = 100;
376 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
377 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#sum#it{E}_{nonlincorr} - #it{E}_{hadcorr}";
378 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
382 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
383 title = histname +
";#it{E}_{patch,med};type;#it{p}_{T}^{corr} (GeV/#it{c});Centrality (%)";
394 histname =
"Trigger/hMBDownscaleFactor";
395 title = histname +
";Downscale factor;counts";
409 const Int_t nRcorrBins = 50;
411 const Int_t nCellBins = 30;
413 const Int_t nMatchedTrackBins = 5;
415 const Int_t nDeltaEtaBins = 60;
422 histname =
"ClusterHistograms/hM02";
423 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
427 histname =
"ClusterHistograms/hNcellsM02G04";
428 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
431 histname =
"ClusterHistograms/hNcellsM02L04";
432 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
439 histname =
"ClusterHistograms/hMatchedTrackPt";
440 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
443 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
444 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
447 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
448 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
452 histname =
"ClusterHistograms/hMatchedTrackN";
453 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
456 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
457 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
460 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
461 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
465 histname =
"ClusterHistograms/hM02Matched";
466 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
470 histname =
"ClusterHistograms/hM02Unmatched";
471 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
475 histname =
"ClusterHistograms/hDeltaEtaCentral";
476 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
479 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
480 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
487 histname =
"ClusterHistograms/hEoverPM02Central";
488 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
491 histname =
"ClusterHistograms/hEoverPM02Peripheral";
492 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
499 histname =
"ClusterHistograms/hRcorrVsCent";
500 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
504 histname =
"ClusterHistograms/hRcorr0-10";
505 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
509 histname =
"ClusterHistograms/hRcorr50-90";
510 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
514 histname =
"ClusterHistograms/hRcorrClusVsCent";
515 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
519 histname =
"ClusterHistograms/hRcorrClus0-10";
520 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
524 histname =
"ClusterHistograms/hRcorrClus50-90";
525 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
529 histname =
"ClusterHistograms/hTrackMultiplicity";
530 htitle = histname +
";N_{tracks};Centrality (%)";
543 const Int_t nRejBins = 32;
546 const Int_t nContributorTypes = 11;
548 const Int_t nParticleTypes = 17;
551 AliEmcalContainer* cont = 0;
553 while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) {
555 histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
556 htitle = histname +
";Rejection reason;#it{E}_{clus} (GeV/)";
562 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
563 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
567 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
568 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
573 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
574 htitle = histname +
";Centrality (%);M02;#it{E}_{photon} (GeV)";
578 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
579 htitle = histname +
";Centrality (%);M02;#it{E}_{hadron} (GeV)";
595 min[dim] = fM02HistBins[0];
599 title[dim] =
"#it{E}_{clus} (GeV)";
602 min[dim] = fPtHistBins[0];
606 title[dim] =
"Contributor type";
607 nbins[dim] = nContributorTypes;
610 binEdges[dim] = contributorTypeBins;
613 title[dim] =
"#it{p}_{T,jet}^{corr}";
620 TString thnname =
"JetPerformanceMC/hM02VsContributorTypeJets";
622 for (
Int_t i = 0; i < dim; i++) {
623 hn->GetAxis(i)->SetTitle(title[i]);
624 hn->SetBinEdges(i, binEdges[i]);
631 title[dim] =
"#it{p}_{T,jet}^{corr}";
638 title[dim] =
"Contributor type";
639 nbins[dim] = nContributorTypes;
642 binEdges[dim] = contributorTypeBins;
652 title[dim] =
"#it{p}_{T,sum} (GeV)";
655 min[dim] = fPtHistBins[0];
659 thnname =
"JetPerformanceMC/hJetComposition";
661 for (
Int_t i = 0; i < dim; i++) {
662 thn->GetAxis(i)->SetTitle(title[i]);
663 thn->SetBinEdges(i, binEdges[i]);
669 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
670 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
674 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
675 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
679 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
680 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
692 axis->SetBinLabel(1,
"SinglePhoton");
693 axis->SetBinLabel(2,
"SingleElectron");
694 axis->SetBinLabel(3,
"SingleChargedPion");
695 axis->SetBinLabel(4,
"SingleProton");
696 axis->SetBinLabel(5,
"SingleAntiProton");
697 axis->SetBinLabel(6,
"SingleChargedKaon");
698 axis->SetBinLabel(7,
"SingleK0L");
699 axis->SetBinLabel(8,
"SingleNeutron");
700 axis->SetBinLabel(9,
"SingleAntiNeutron");
701 axis->SetBinLabel(10,
"SingleOther");
702 axis->SetBinLabel(11,
"PhotonHadron");
703 axis->SetBinLabel(12,
"HadronPhoton");
704 axis->SetBinLabel(13,
"MergedPi0");
705 axis->SetBinLabel(14,
"PhotonPhotonOther");
706 axis->SetBinLabel(15,
"HadronHadron");
707 axis->SetBinLabel(16,
"TwoContributorsOther");
708 axis->SetBinLabel(17,
"MoreThanTwoContributors");
722 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
725 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
726 title = histname +
";Centrality;Scale factor;counts";
729 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
730 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
733 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jets->GetArrayName().Data());
734 title = histname +
";Centrality;Scale factor;counts";
739 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jets->GetArrayName().Data());
740 title = histname +
";Centrality;Scale factor;counts";
743 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jets->GetArrayName().Data());
744 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
747 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jets->GetArrayName().Data());
748 title = histname +
";Centrality;Scale factor;counts";
769 histname =
"TriggerSimHistograms/hEtaVsPhi";
770 title = histname +
";#eta_{patch} (rad);#phi_{patch} (rad)";
774 histname =
"TriggerSimHistograms/hNPatches";
775 title = histname +
";#it{N}_{patches};type";
779 histname =
"TriggerSimHistograms/hPatchE";
780 title = histname +
";Centrality (%);#it{E}_{patch} (GeV)";
784 histname =
"TriggerSimHistograms/hPatchMedianE";
785 title = histname +
";Centrality (%);#it{E}_{patch,med} (GeV);type";
786 fHistManager.
CreateTH3(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 50, 2, -0.5, 1.5);
792 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
795 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
796 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
802 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
803 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
812 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
813 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
814 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
817 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
818 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
819 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
823 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
824 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
828 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
829 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
833 nbinsx = 20; minx = 0; maxx = 100;
835 nbinsz = 50; minz = 0; maxz = 1.;
837 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
838 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
839 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
842 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
843 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
844 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
848 nbinsx = 20; minx = 0; maxx = 100;
850 nbinsz = 50; minz = 0; maxz = 1.;
852 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
853 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
854 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
857 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
858 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
859 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
863 nbinsx = 20; minx = 0; maxx = 100;
865 nbinsz = 50; minz = 0; maxz =
fMaxPt;
867 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
868 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
869 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
872 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
873 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
874 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
895 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
896 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
897 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
900 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
901 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
902 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
906 nbinsx = 20; minx = 0; maxx = 100;
908 nbinsz = 250; minz = -5.; maxz = 5.;
910 histname =
"MatchedJetHistograms/hJESshiftEMCal";
911 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
912 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
915 histname =
"MatchedJetHistograms/hJESshiftDCal";
916 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
917 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
921 nbinsx = 20; minx = 0; maxx = 100;
923 nbinsz = 50; minz = 0; maxz = 1.;
925 histname =
"MatchedJetHistograms/hNEFVsPt";
926 title = histname +
";Centrality (%);#it{p}_{T,corr}^{det} (GeV/#it{c});Calo energy fraction";
927 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
930 nbinsx = 20; minx = 0; maxx = 100;
932 nbinsz = 50; minz = 0; maxz = 1.;
934 histname =
"MatchedJetHistograms/hZLeadingVsPt";
935 title = histname +
";Centrality (%);#it{p}_{T,corr}^{det} (GeV/#it{c});#it{z}_{leading}";
936 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
939 nbinsx = 20; minx = 0; maxx = 100;
941 nbinsz = 50; minz = 0; maxz = 1.;
943 histname =
"MatchedJetHistograms/hMatchingDistance";
944 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});R";
945 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
947 histname =
"MatchedJetHistograms/hMatchingDistancepp";
948 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});R";
949 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
952 histname =
"MatchedJetHistograms/fHistJetMatchingQA";
954 std::vector<std::string> binLabels = {
"noMatch",
"matchedJet",
"sharedMomentumFraction",
"partLevelMatchedJet",
"jetDistance",
"passedAllCuts"};
955 auto histMatchedJetCuts =
fHistManager.
CreateTH1(histname.Data(), title.Data(), binLabels.size(), 0, binLabels.size());
957 for (
unsigned int i = 1; i <= binLabels.size(); i++) {
958 histMatchedJetCuts->GetXaxis()->SetBinLabel(i, binLabels.at(i-1).c_str());
960 histMatchedJetCuts->GetYaxis()->SetTitle(
"Number of jets");
985 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
986 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
987 GetName(), cls.GetName(),
"EmcalTriggers"));
992 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1012 TString triggerNameMB1 =
"CINT7-B-NOPF-CENT";
1013 TString triggerNameMB2 =
"CV0L7-B-NOPF-CENT";
1014 TString triggerNameJE =
"CINT7EJ1-B-NOPF-CENTNOPMD";
1019 for (
auto i : runtriggers) {
1020 if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
1029 TString histname =
"Trigger/hMBDownscaleFactor";
1066 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
1067 TString jetContName = jetCont->GetName();
1102 TClass cls(objname);
1103 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1104 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1105 GetName(), cls.GetName(),
"EmcalTriggers"));
1110 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1115 std::vector<Double_t> vecEMCal;
1116 std::vector<Double_t> vecDCal;
1118 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1121 if(!recpatch->IsJetHighSimple())
continue;
1123 histname =
"TriggerSimHistograms/hEtaVsPhi";
1126 histname =
"TriggerSimHistograms/hPatchE";
1129 if (recpatch->IsEMCal()) {
1130 vecEMCal.push_back(recpatch->GetPatchE());
1132 vecDCal.push_back(recpatch->GetPatchE());
1139 const Int_t nBkgPatchesEMCal = vecEMCal.size();
1140 const Int_t nBkgPatchesDCal = vecDCal.size();
1141 fMedianEMCal = TMath::Median(nBkgPatchesEMCal, &vecEMCal[0]);
1142 fMedianDCal = TMath::Median(nBkgPatchesDCal, &vecDCal[0]);
1144 histname =
"TriggerSimHistograms/hPatchMedianE";
1148 histname =
"TriggerSimHistograms/hNPatches";
1156 for(
auto p : *fTriggerPatchInfo){
1157 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1160 if(!recpatch->IsJetHighSimple())
continue;
1162 if (recpatch->IsEMCal()) {
1163 if ((recpatch->GetPatchE() -
fMedianDCal) > threshold) {
1168 if ((recpatch->GetPatchE() -
fMedianEMCal) > threshold) {
1216 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1217 TString jetContName = jets->GetName();
1222 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1226 for (
auto jet : jets->
all()) {
1240 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1244 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1249 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1251 else if (type ==
kDCal) {
1252 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1254 TLorentzVector leadPart;
1257 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
1261 UInt_t rejectionReason = 0;
1262 if (!jets->
AcceptJet(jet, rejectionReason)) {
1263 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1270 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
1272 else if (type ==
kDCal) {
1273 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
1279 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1285 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1287 else if (type ==
kDCal) {
1288 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1290 const AliVTrack* track;
1291 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1292 track =
static_cast<AliVTrack*
>(jet->Track(i));
1293 z = track->Pt() / TMath::Abs(corrPt);
1299 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1301 else if (type ==
kDCal) {
1302 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1308 const AliVCluster* clus =
nullptr;
1309 Int_t nClusters = jet->GetNumberOfClusters();
1310 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1311 clus = jet->Cluster(iClus);
1312 deltaEhadcorr += (clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy());
1315 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
1321 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
1342 const AliVCluster* clus;
1346 Double_t clusPhi = it.first.Phi_0_2pi();
1350 if (!clus->IsEMCAL()) {
1356 Int_t nTracksMatched = 0;
1357 const AliVTrack* track =
nullptr;
1358 for (
Int_t itrack=0; itrack < clus->GetNTracksMatched(); itrack++) {
1359 track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(itrack));
1364 Double_t trackPhi = TVector2::Phi_0_2pi(track->GetTrackPhiOnEMCal());
1365 Double_t trackEta = track->GetTrackEtaOnEMCal();
1366 Double_t deta = TMath::Abs(clusEta - trackEta);
1367 Double_t dphi = TMath::Abs(clusPhi - trackPhi);
1370 trackPSum += track->P();
1376 if (trackPSum > 1e-3) {
1377 EoverP = clus->GetNonLinCorrEnergy() / trackPSum;
1380 Double_t deltaE = clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy();
1382 if (trackPSum > 1e-3) {
1383 Rcorr = deltaE / trackPSum;
1385 Double_t RcorrClus = deltaE / clus->GetNonLinCorrEnergy();
1391 histname =
"ClusterHistograms/hM02";
1395 if (clus->GetM02() > 0.4) {
1396 histname =
"ClusterHistograms/hNcellsM02G04";
1399 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1400 histname =
"ClusterHistograms/hNcellsM02L04";
1408 histname =
"ClusterHistograms/hMatchedTrackPt";
1411 if (clus->GetM02() > 0.4) {
1412 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
1415 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1416 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
1421 histname =
"ClusterHistograms/hMatchedTrackN";
1424 if (clus->GetM02() > 0.4) {
1425 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
1428 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1429 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
1434 histname =
"ClusterHistograms/hM02Matched";
1435 if (nTracksMatched > 0) {
1440 histname =
"ClusterHistograms/hM02Unmatched";
1441 if (nTracksMatched == 0) {
1446 if (nTracksMatched == 1) {
1448 const AliVTrack* track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(0));
1450 Double_t trackEta = track->GetTrackEtaOnEMCal();
1451 Double_t deta = trackEta - clusEta;
1454 histname =
"ClusterHistograms/hDeltaEtaCentral";
1459 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
1470 histname =
"ClusterHistograms/hEoverPM02Central";
1474 histname =
"ClusterHistograms/hEoverPM02Peripheral";
1482 histname =
"ClusterHistograms/hRcorrVsCent";
1487 histname =
"ClusterHistograms/hRcorr0-10";
1493 histname =
"ClusterHistograms/hRcorr50-90";
1498 histname =
"ClusterHistograms/hRcorrClusVsCent";
1503 histname =
"ClusterHistograms/hRcorrClus0-10";
1509 histname =
"ClusterHistograms/hRcorrClus50-90";
1516 histname =
"ClusterHistograms/hTrackMultiplicity";
1529 const AliMCEvent* mcevent =
nullptr;
1531 mcevent = MCEvent();
1554 const AliVCluster* clus;
1555 std::vector<ContributorType> vecContributorTypes;
1556 std::vector<Int_t> vecContributorLabels;
1562 if (!clus->IsEMCAL()) {
1569 const Int_t nLabels = clus->GetNLabels();
1572 vecContributorTypes.clear();
1573 vecContributorLabels.clear();
1574 for (
Int_t iLabel=0; iLabel<nLabels; iLabel++) {
1576 Int_t label = clus->GetLabels()[iLabel];
1577 if (TMath::Abs(label) > 0) {
1580 vecContributorTypes.push_back(contributorType);
1581 vecContributorLabels.push_back(label);
1586 Int_t nLabelsPhysPrim = vecContributorTypes.size();
1588 if (nLabelsPhysPrim == 1) {
1590 contributorType = vecContributorTypes[0];
1592 if (contributorType ==
kPhoton) {
1595 else if (contributorType ==
kElectron) {
1601 else if (contributorType ==
kProton) {
1610 else if (contributorType ==
kK0L) {
1613 else if (contributorType ==
kNeutron) {
1624 else if (nLabelsPhysPrim == 2) {
1632 Double_t frac1 = clus->GetClusterMCEdepFraction(1);
1640 if (isHadron1 && isHadron2) {
1643 else if (isPhoton1 && isHadron2) {
1647 Double_t photonEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
1648 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
1651 else if (isHadron1 && isPhoton2) {
1655 Double_t hadronEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
1656 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
1659 else if (isPhoton1 && isPhoton2) {
1667 if (part1 && part2) {
1668 Int_t iMother1 = part1->GetMother();
1669 Int_t iMother2 = part2->GetMother();
1670 AliVParticle *mother1 = mcevent->GetTrack(iMother1);
1671 AliVParticle *mother2 = mcevent->GetTrack(iMother2);
1673 if (mother1 && mother2) {
1674 if ( (mother1->PdgCode() == 111) && (mother2->PdgCode() == 111) ) {
1675 if (iMother1 == iMother2) {
1687 else if (nLabelsPhysPrim > 2) {
1693 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
1694 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
1697 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
1698 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
1711 const AliVCluster* clus;
1713 for (
const auto jet : jets->
accepted()) {
1718 Double_t hadCaloEnergyUnmatched = 0;
1719 Double_t hadCaloEnergyMatchedNonlincorr = 0;
1720 Double_t hadCaloEnergyMatchedHadCorr = 0;
1723 Int_t nClusters = jet->GetNumberOfClusters();
1724 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1726 clus = jet->Cluster(iClus);
1730 Int_t label = TMath::Abs(clus->GetLabel());
1736 histname =
"JetPerformanceMC/hM02VsContributorTypeJets";
1737 Double_t x[4] = {clus->GetM02(), clus->GetNonLinCorrEnergy(), contributorType, jetPt};
1743 Bool_t hasMatchedTrack = (clus->GetNTracksMatched() > 0);
1745 if (hasMatchedTrack) {
1746 hadCaloEnergyMatchedNonlincorr += clus->GetNonLinCorrEnergy();
1747 hadCaloEnergyMatchedHadCorr += clus->GetHadCorrEnergy();
1750 hadCaloEnergyUnmatched += clus->GetNonLinCorrEnergy();
1759 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
1763 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
1767 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
1771 histname =
"JetPerformanceMC/hJetComposition";
1772 for (
Int_t type = 0; type < 8; type++) {
1779 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1781 clus = jet->Cluster(iClus);
1783 Int_t label = TMath::Abs(clus->GetLabel());
1788 if (type == contributorType) {
1790 pTsum += clus->GetNonLinCorrEnergy();
1795 Double_t x[4] = {jetPt, 1.*type, nSum, pTsum};
1815 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
1816 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
1817 Double_t phiMinDCal =
fGeom->GetDCALPhiMin() * TMath::DegToRad();
1818 Double_t phiMaxDCal =
fGeom->GetDCALPhiMax() * TMath::DegToRad();
1820 Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
1821 Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
1822 Double_t accDCal = 2 * (etaEMCal - etaMinDCal) * (phiMaxDCal - phiMinDCal);
1827 while ((jetCont = static_cast<AliJetContainer*>(nextJetColl()))) {
1830 TRandom3* r =
new TRandom3(0);
1832 Double_t etaEMCalfid = etaEMCal - jetR;
1833 Double_t etaMinDCalfid = etaMinDCal + jetR;
1834 Double_t phiMinEMCalfid = phiMinEMCal + jetR;
1835 Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
1836 Double_t phiMinDCalfid = phiMinDCal + jetR;
1837 Double_t phiMaxDCalfid = phiMaxDCal - jetR;
1838 Double_t accEMCalfid = 2 * etaEMCalfid * (phiMaxEMCalfid - phiMinEMCalfid);
1839 Double_t accDCalfid = 2 * (etaEMCalfid - etaMinDCalfid) * (phiMaxDCalfid - phiMinDCalfid);
1840 if ( (etaEMCalfid - etaMinDCalfid) < 0) {
1845 Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
1846 Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
1849 Double_t etaDCalRC = r->Uniform(etaMinDCalfid, etaEMCalfid);
1850 Double_t sign = r->Uniform(-1., 1.);
1852 etaDCalRC = -1*etaDCalRC;
1854 Double_t phiDCalRC = r->Uniform(phiMinDCalfid, phiMaxDCalfid);
1881 while ((partCont = static_cast<AliParticleContainer*>(nextPartCont()))) {
1883 TString partContName = partCont->GetName();
1884 if (!partContName.CompareTo(
"tracks")) {
1890 track = trackIterator.first;
1891 trackEta = track.Eta();
1893 trackPt = track.Pt();
1896 if (TMath::Abs(trackEta) < etaTPC) {
1897 trackPtSumTPC += trackPt;
1901 if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
1902 trackPtSumEMCal += trackPt;
1906 if (TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinEMCalfid && trackPhi < phiMaxEMCalfid) {
1907 trackPtSumEMCalfid += trackPt;
1912 if (TMath::Abs(trackEta) > etaMinDCal && TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinDCal && trackPhi < phiMaxDCal) {
1913 trackPtSumDCal += trackPt;
1919 if (TMath::Abs(trackEta) > etaMinDCalfid && TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinDCalfid && trackPhi < phiMaxDCalfid) {
1920 trackPtSumDCalfid += trackPt;
1925 deltaR =
GetDeltaR(&track, etaEMCalRC, phiEMCalRC);
1926 if (deltaR < jetR) {
1927 trackPtSumEMCalRC += trackPt;
1932 deltaR =
GetDeltaR(&track, etaDCalRC, phiDCalRC);
1933 if (deltaR < jetR) {
1934 trackPtSumDCalRC += trackPt;
1953 clus = clusIterator.first;
1954 clusEta = clus.Eta();
1959 if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
1960 clusPtSumEMCal += clusPt;
1964 if (TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinEMCalfid && clusPhi < phiMaxEMCalfid) {
1965 clusPtSumEMCalfid += clusPt;
1970 if (TMath::Abs(clusEta) > etaMinDCal && TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinDCal && clusPhi < phiMaxDCal) {
1971 clusPtSumDCal += clusPt;
1977 if (TMath::Abs(clusEta) > etaMinDCalfid && TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinDCalfid && clusPhi < phiMaxDCalfid) {
1978 clusPtSumDCalfid += clusPt;
1983 deltaR =
GetDeltaR(&clus, etaEMCalRC, phiEMCalRC);
1984 if (deltaR < jetR) {
1985 clusPtSumEMCalRC += clusPt;
1990 deltaR =
GetDeltaR(&clus, etaDCalRC, phiDCalRC);
1991 if (deltaR < jetR) {
1992 clusPtSumDCalRC += clusPt;
2001 Double_t numerator = (trackPtSumEMCal + clusPtSumEMCal) / accEMCal;
2002 Double_t denominator = trackPtSumTPC / accTPC;
2003 Double_t scaleFactor = numerator / denominator;
2004 TString histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
2008 if (accEMCalfid > 1e-3) {
2009 numerator = (trackPtSumEMCalfid + clusPtSumEMCalfid) / accEMCalfid;
2010 scaleFactor = numerator / denominator;
2011 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jetCont->GetArrayName().Data());
2017 numerator = (trackPtSumDCal + clusPtSumDCal) / accDCal;
2018 scaleFactor = numerator / denominator;
2019 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jetCont->GetArrayName().Data());
2025 if (accDCalfid > 1e-3) {
2026 numerator = (trackPtSumDCalfid + clusPtSumDCalfid) / accDCalfid;
2027 scaleFactor = numerator / denominator;
2028 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jetCont->GetArrayName().Data());
2037 Double_t deltaPt = trackPtSumEMCalRC + clusPtSumEMCalRC - rho * TMath::Pi() * jetR * jetR;
2038 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
2043 if (accDCalfid > 1e-3) {
2044 deltaPt = trackPtSumDCalRC + clusPtSumDCalRC - rho * TMath::Pi() * jetR * jetR;
2045 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jetCont->GetArrayName().Data());
2065 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2066 TString jetContName = jets->GetName();
2071 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
2075 for (
auto jet : jets->
all()) {
2081 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
2085 UInt_t rejectionReason = 0;
2086 if (!jets->
AcceptJet(jet, rejectionReason)) {
2087 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
2088 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
2102 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
2104 else if (type ==
kDCal) {
2105 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
2110 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
2115 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
2117 else if (type ==
kDCal) {
2118 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
2120 TLorentzVector leadPart;
2123 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2128 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
2130 else if (type ==
kDCal) {
2131 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
2133 const AliVTrack* track;
2134 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
2135 track =
static_cast<AliVTrack*
>(jet->Track(i));
2136 z = track->Pt() / TMath::Abs(corrPt);
2142 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
2144 else if (type ==
kDCal) {
2145 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
2164 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2165 TString jetContName = jets->GetName();
2168 if (jetContName.Contains(
"mcparticles")) {
2177 for (
auto jet : jets->
accepted()) {
2187 if (!matchedPartLevelJet) {
2200 Float_t truthPt = matchedPartLevelJet->
Pt();
2204 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
2206 else if (type ==
kDCal) {
2207 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
2213 histname =
"MatchedJetHistograms/hJESshiftEMCal";
2215 else if (type ==
kDCal) {
2216 histname =
"MatchedJetHistograms/hJESshiftDCal";
2221 histname =
"MatchedJetHistograms/hNEFVsPt";
2225 histname =
"MatchedJetHistograms/hZLeadingVsPt";
2226 TLorentzVector leadPart;
2229 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2233 histname =
"MatchedJetHistograms/hMatchingDistance";
2237 histname =
"MatchedJetHistograms/hMatchingDistancepp";
2254 TString histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
2255 UInt_t rejectionReason = 0;
2258 return contributorType;
2261 if (part->GetGeneratorIndex() == 0) {
2269 else if (TMath::Abs(pdg) == 211) {
2272 else if (pdg == 2212) {
2275 else if (pdg == -2212) {
2278 else if (TMath::Abs(pdg) == 321) {
2281 else if (pdg == 130) {
2282 contributorType =
kK0L;
2284 else if (pdg == 2112) {
2287 else if (pdg == -2112) {
2290 else if (TMath::Abs(pdg) == 11) {
2293 else if (TMath::Abs(pdg) == 13) {
2294 contributorType =
kMuon;
2297 contributorType =
kOther;
2301 return contributorType;
2310 Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
2311 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
2370 bool returnValue =
false;
2377 AliDebugStream(4) <<
"Jet is matched!\nJet: " << jet->
toString() <<
"\n";
2383 AliDebugStream(4) <<
"Jet rejected due to shared momentum fraction of " << sharedFraction <<
", which is smaller than the min momentum fraction of " <<
fMinSharedMomentumFraction <<
"\n";
2384 returnValue =
false;
2387 AliDebugStream(4) <<
"Passed shared momentum fraction with value of " << sharedFraction <<
"\n";
2394 if (!partLevelJet) {
2395 AliDebugStream(4) <<
"Jet rejected due to no matching part level jet.\n";
2396 returnValue =
false;
2399 AliDebugStream(4) <<
"Det level jet has a required match to a part level jet.\n" <<
"Part level jet: " << partLevelJet->
toString() <<
"\n";
2407 AliDebugStream(4) <<
"Jet rejected due to matching distance of " << matchedJetDistance <<
", which is larger than the max distance of " <<
fMaxMatchedJetDistance <<
"\n";
2408 returnValue =
false;
2411 AliDebugStream(4) <<
"Jet passed distance cut with distance of " << matchedJetDistance <<
"\n";
2417 if (returnValue ==
true) {
2422 AliDebugStream(5) <<
"Rejected jet because it was not matched to a external event jet.\n";
2424 returnValue =
false;
2428 return partLevelJet;
2437 const char *ntracks,
2438 const char *nclusters,
2439 const char *nGenLev,
2449 ::Error(
"AddTaskEmcalJetPerformance",
"No analysis manager to connect to.");
2455 AliVEventHandler* handler = mgr->GetInputEventHandler();
2458 ::Error(
"AddTaskEmcalJetPerformance",
"This task requires an input event handler");
2470 if (handler->InheritsFrom(
"AliESDInputHandler")) {
2473 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
2484 if (trackName ==
"usedefault") {
2485 if (dataType ==
kESD) {
2486 trackName =
"Tracks";
2488 else if (dataType == kAOD) {
2489 trackName =
"tracks";
2496 if (clusName ==
"usedefault") {
2497 if (dataType ==
kESD) {
2498 clusName =
"CaloClusters";
2500 else if (dataType == kAOD) {
2501 clusName =
"caloClusters";
2508 TString name(
"AliAnalysisTaskEmcalJetPerformance");
2509 if (!trackName.IsNull()) {
2513 if (!clusName.IsNull()) {
2517 if (strcmp(suffix,
"") != 0) {
2530 if (trackName ==
"mcparticles") {
2532 partCont = mcpartCont;
2534 else if (trackName ==
"tracks" || trackName ==
"Tracks") {
2536 partCont = trackCont;
2542 if (nGenLev && strcmp(nGenLev,
"")!=0) {
2550 if (!clusName.IsNull()) {
2564 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
2566 contname +=
"_histos";
2567 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
2568 TList::Class(),AliAnalysisManager::kOutputContainer,
2569 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
2570 mgr->ConnectInput (task, 0, cinput1 );
2571 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()