30 #include <TClonesArray.h> 35 #include <THnSparse.h> 40 #include <AliVCluster.h> 41 #include <AliVParticle.h> 44 #include "AliAnalysisManager.h" 45 #include <AliVEventHandler.h> 52 #include "AliEMCALGeometry.h" 53 #include "AliOADBContainer.h" 55 #include "AliEMCALTriggerPatchInfo.h" 57 #include "AliMCEvent.h" 70 fPlotJetHistograms(kFALSE),
71 fPlotClusterHistograms(kFALSE),
72 fPlotParticleCompositionHistograms(kFALSE),
73 fComputeBackground(kFALSE),
74 fDoTriggerSimulation(kFALSE),
75 fPlotMatchedJetHistograms(kFALSE),
76 fComputeMBDownscaling(kFALSE),
90 fTrackMatchingDeltaEtaMax(0.015),
91 fTrackMatchingDeltaPhiMax(0.030),
100 fPlotJetMatchCandThresh(1.),
101 fUseAliEventCuts(kTRUE),
104 fUseManualEventCuts(kFALSE),
224 fEventCuts.fUseVariablesCorrelationCuts =
true;
235 for (
Int_t i=0; i<2; i++) {
237 TString jetContName = jetCont->GetName();
238 if (jetContName.Contains(
"mcparticles")) {
246 Printf(
"No MC jet container found!");
250 Printf(
"No det-level jet container found!");
277 if (embeddingHelper) {
286 while ((obj = next())) {
308 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
315 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
317 title = histname +
";Centrality (%);Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
318 TH3* hist =
fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, 32, 0, 32, nPtBins5,
fMinPt,
fMaxPt);
321 title = histname +
";Rejection reason;#it{p}_{T,corr} (GeV/#it{c});counts";
328 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
330 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
340 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
342 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
343 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
346 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});NEF";
351 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
353 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
354 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
357 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});NEF";
364 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
365 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
366 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, 0, 100, nPtBins2,
fMinPt,
fMaxPt, 2, -0.5, 1.5,
"s");
370 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
372 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
373 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, nPtBins2,
fMinPt,
fMaxPt,
fMaxPt, 0,
fMaxPt);
376 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
381 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
383 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
384 fHistManager.
CreateTH3(histname.Data(), title.Data(), 10, 0, 100, nPtBins2,
fMinPt,
fMaxPt, 50, 0, 0.5);
387 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
392 nbinsx = 20; minx = 0; maxx = 100;
394 nbinsz = 50; minz = 0; maxz = 1.;
396 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
398 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
399 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
402 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
407 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
409 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
410 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
413 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
419 nbinsx = 20; minx = 0; maxx = 100;
421 nbinsz = 50; minz = 0; maxz = 1.;
423 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
425 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
426 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
429 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
434 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
436 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
437 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
440 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
446 nbinsx = 20; minx = 0; maxx = 100;
448 nbinsz = 50; minz = 0; maxz =
fMaxPt;
450 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
452 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
453 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
456 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
461 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
463 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
464 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
467 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
474 nbinsx = 20; minx = 0; maxx = 100;
477 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
478 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
481 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
482 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c})";
488 nbinsx = 20; minx = 0; maxx = 100;
492 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
493 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#sum#it{E}_{nonlincorr} - #it{E}_{hadcorr}";
494 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
499 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
500 title = histname +
";#it{E}_{patch,med};type;#it{p}_{T}^{corr} (GeV/#it{c});Centrality (%)";
501 Int_t nbins5[4] = {100, 2, nPtBins2, 50};
511 histname =
"Trigger/hMBDownscaleFactor";
512 title = histname +
";Downscale factor;counts";
526 const Int_t nRcorrBins = 50;
528 const Int_t nCellBins = 30;
530 const Int_t nMatchedTrackBins = 5;
532 const Int_t nDeltaEtaBins = 60;
539 histname =
"ClusterHistograms/hM02";
540 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
544 histname =
"ClusterHistograms/hNcellsM02G04";
545 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
548 histname =
"ClusterHistograms/hNcellsM02L04";
549 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); Ncells";
556 histname =
"ClusterHistograms/hMatchedTrackPt";
557 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
560 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
561 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
564 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
565 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); #Sigma#it{p}_{track} (GeV/c)";
569 histname =
"ClusterHistograms/hMatchedTrackN";
570 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
573 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
574 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
577 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
578 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); N_{tracks}";
582 histname =
"ClusterHistograms/hM02Matched";
583 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
587 histname =
"ClusterHistograms/hM02Unmatched";
588 htitle = histname +
";Centrality (%);#it{E}_{clus} (GeV); M02";
592 histname =
"ClusterHistograms/hDeltaEtaCentral";
593 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
596 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
597 htitle = histname +
";#eta_{track} - #eta_{clus};#it{E}_{clus} (GeV); M02";
604 histname =
"ClusterHistograms/hEoverPM02Central";
605 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
608 histname =
"ClusterHistograms/hEoverPM02Peripheral";
609 htitle = histname +
";#it{E}_{clus} (GeV); #it{E}_{clus} / #Sigma#it{p}_{track} (GeV); M02";
616 histname =
"ClusterHistograms/hRcorrVsCent";
617 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
621 histname =
"ClusterHistograms/hRcorr0-10";
622 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
626 histname =
"ClusterHistograms/hRcorr50-90";
627 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); R_{corr} = #frac{#DeltaE_{clus}}{#Sigmap_{track}}";
631 histname =
"ClusterHistograms/hRcorrClusVsCent";
632 htitle = histname +
";Centrality (%);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
636 histname =
"ClusterHistograms/hRcorrClus0-10";
637 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
641 histname =
"ClusterHistograms/hRcorrClus50-90";
642 htitle = histname +
";#it{E}_{clus} (GeV);#Sigma#it{p}_{track} (GeV); #frac{#DeltaE_{clus}}{E_{clus}}";
646 histname =
"ClusterHistograms/hTrackMultiplicity";
647 htitle = histname +
";N_{tracks};Centrality (%)";
660 const Int_t nRejBins = 32;
663 const Int_t nContributorTypes = 11;
665 const Int_t nParticleTypes = 17;
668 AliEmcalContainer* cont = 0;
670 while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) {
672 histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
673 htitle = histname +
";Rejection reason;#it{E}_{clus} (GeV/)";
679 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
680 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
684 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
685 htitle = histname +
";M02;#it{E}_{clus} (GeV); Particle type";
690 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
691 htitle = histname +
";Centrality (%);M02;#it{E}_{photon} (GeV)";
695 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
696 htitle = histname +
";Centrality (%);M02;#it{E}_{hadron} (GeV)";
712 min[dim] = fM02HistBins[0];
716 title[dim] =
"#it{E}_{clus} (GeV)";
719 min[dim] = fPtHistBins[0];
723 title[dim] =
"Contributor type";
724 nbins[dim] = nContributorTypes;
727 binEdges[dim] = contributorTypeBins;
730 title[dim] =
"#it{p}_{T,jet}^{corr}";
737 TString thnname =
"JetPerformanceMC/hM02VsContributorTypeJets";
739 for (
Int_t i = 0; i < dim; i++) {
740 hn->GetAxis(i)->SetTitle(title[i]);
741 hn->SetBinEdges(i, binEdges[i]);
748 title[dim] =
"#it{p}_{T,jet}^{corr}";
755 title[dim] =
"Contributor type";
756 nbins[dim] = nContributorTypes;
759 binEdges[dim] = contributorTypeBins;
769 title[dim] =
"#it{p}_{T,sum} (GeV)";
772 min[dim] = fPtHistBins[0];
776 thnname =
"JetPerformanceMC/hJetComposition";
778 for (
Int_t i = 0; i < dim; i++) {
779 thn->GetAxis(i)->SetTitle(title[i]);
780 thn->SetBinEdges(i, binEdges[i]);
786 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
787 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
791 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
792 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
796 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
797 htitle = histname +
";#it{p}_{T,jet} (GeV);#it{p}_{T,had} (GeV)";
809 axis->SetBinLabel(1,
"SinglePhoton");
810 axis->SetBinLabel(2,
"SingleElectron");
811 axis->SetBinLabel(3,
"SingleChargedPion");
812 axis->SetBinLabel(4,
"SingleProton");
813 axis->SetBinLabel(5,
"SingleAntiProton");
814 axis->SetBinLabel(6,
"SingleChargedKaon");
815 axis->SetBinLabel(7,
"SingleK0L");
816 axis->SetBinLabel(8,
"SingleNeutron");
817 axis->SetBinLabel(9,
"SingleAntiNeutron");
818 axis->SetBinLabel(10,
"SingleOther");
819 axis->SetBinLabel(11,
"PhotonHadron");
820 axis->SetBinLabel(12,
"HadronPhoton");
821 axis->SetBinLabel(13,
"MergedPi0");
822 axis->SetBinLabel(14,
"PhotonPhotonOther");
823 axis->SetBinLabel(15,
"HadronHadron");
824 axis->SetBinLabel(16,
"TwoContributorsOther");
825 axis->SetBinLabel(17,
"MoreThanTwoContributors");
839 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
842 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
843 title = histname +
";Centrality;Scale factor;counts";
846 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
847 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
850 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jets->GetArrayName().Data());
851 title = histname +
";Centrality;Scale factor;counts";
856 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jets->GetArrayName().Data());
857 title = histname +
";Centrality;Scale factor;counts";
860 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jets->GetArrayName().Data());
861 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
864 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jets->GetArrayName().Data());
865 title = histname +
";Centrality;Scale factor;counts";
888 histname =
"TriggerSimHistograms/hEtaVsPhi";
889 title = histname +
";#eta_{patch} (rad);#phi_{patch} (rad)";
893 histname =
"TriggerSimHistograms/hNPatches";
894 title = histname +
";#it{N}_{patches};type";
898 histname =
"TriggerSimHistograms/hPatchE";
899 title = histname +
";Centrality (%);#it{E}_{patch} (GeV)";
903 histname =
"TriggerSimHistograms/hPatchMedianE";
904 title = histname +
";Centrality (%);#it{E}_{patch,med} (GeV);type";
905 fHistManager.
CreateTH3(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 50, 2, -0.5, 1.5);
911 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
914 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
915 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
921 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
922 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
931 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
932 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
933 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
936 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
937 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
938 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
942 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
943 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
947 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
948 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
952 nbinsx = 20; minx = 0; maxx = 100;
954 nbinsz = 50; minz = 0; maxz = 1.;
956 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
957 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
958 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
961 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
962 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
963 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
967 nbinsx = 20; minx = 0; maxx = 100;
969 nbinsz = 50; minz = 0; maxz = 1.;
971 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
972 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
973 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
976 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
977 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
978 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
982 nbinsx = 20; minx = 0; maxx = 100;
984 nbinsz = 50; minz = 0; maxz =
fMaxPt;
986 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
987 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
988 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
991 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
992 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
993 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1014 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
1016 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1017 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1020 title = histname +
";#it{p}_{T,corr}^{det} (GeV/#it{c});#it{p}_{T}^{truth} (GeV/#it{c})";
1025 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
1027 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1028 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1031 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#it{p}_{T,corr}^{det} (GeV/#it{c})";
1037 nbinsx = 20; minx = 0; maxx = 100;
1038 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1039 nbinsz = 250; minz = -5.; maxz = 5.;
1041 histname =
"MatchedJetHistograms/hJESshiftEMCal";
1043 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1044 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1047 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1052 histname =
"MatchedJetHistograms/hJESshiftDCal";
1054 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1055 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1058 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#frac{#it{p}_{T,corr}^{det} - #it{p}_{T}^{truth}}{#it{p}_{T}^{truth}}";
1064 nbinsx = 20; minx = 0; maxx = 100;
1066 nbinsz = 50; minz = 0; maxz = 1.;
1068 histname =
"MatchedJetHistograms/hNEFVsPt";
1070 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});Calo energy fraction";
1071 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1074 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});Calo energy fraction";
1079 nbinsx = 20; minx = 0; maxx = 100;
1080 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1081 nbinsz = 50; minz = 0; maxz = 1.;
1083 histname =
"MatchedJetHistograms/hZLeadingVsPt";
1085 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});#it{z}_{leading}";
1086 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1089 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});#it{z}_{leading}";
1094 nbinsx = 20; minx = 0; maxx = 100;
1095 nbinsy = nPtBinsTruth2; miny = 0; maxy =
fMaxPt;
1096 nbinsz = 50; minz = 0; maxz = 1.;
1098 histname =
"MatchedJetHistograms/hMatchingDistance";
1100 title = histname +
";Centrality (%);#it{p}_{T}^{truth} (GeV/#it{c});R";
1101 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx,
nbinsy, miny, maxy, nbinsz, minz, maxz);
1104 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});R";
1109 nbinsx = nPtBinsTruth2; minx = 0; maxx =
fMaxPt;
1110 histname =
"MatchedJetHistograms/hNumberMatchingCandidates";
1111 title = histname +
";#it{p}_{T}^{truth} (GeV/#it{c});N_{truth} matches; N_{det} matches";
1112 fHistManager.
CreateTH3(histname.Data(), title.Data(),
nbinsx, minx, maxx, 11, -1.5, 9.5, 11, -1.5, 9.5);
1136 TClass cls(objname);
1137 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1138 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1139 GetName(), cls.GetName(),
"EmcalTriggers"));
1144 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1164 TString triggerNameMB1 =
"CINT7-B-NOPF-CENT";
1165 TString triggerNameMB2 =
"CV0L7-B-NOPF-CENT";
1166 TString triggerNameJE =
"CINT7EJ1-B-NOPF-CENTNOPMD";
1171 for (
auto i : runtriggers) {
1172 if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
1181 TString histname =
"Trigger/hMBDownscaleFactor";
1218 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
1219 TString jetContName = jetCont->GetName();
1254 TClass cls(objname);
1255 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1256 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1257 GetName(), cls.GetName(),
"EmcalTriggers"));
1262 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1267 std::vector<Double_t> vecEMCal;
1268 std::vector<Double_t> vecDCal;
1270 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1273 if(!recpatch->IsJetHighSimple())
continue;
1275 histname =
"TriggerSimHistograms/hEtaVsPhi";
1278 histname =
"TriggerSimHistograms/hPatchE";
1281 if (recpatch->IsEMCal()) {
1282 vecEMCal.push_back(recpatch->GetPatchE());
1284 vecDCal.push_back(recpatch->GetPatchE());
1291 const Int_t nBkgPatchesEMCal = vecEMCal.size();
1292 const Int_t nBkgPatchesDCal = vecDCal.size();
1293 fMedianEMCal = TMath::Median(nBkgPatchesEMCal, &vecEMCal[0]);
1294 fMedianDCal = TMath::Median(nBkgPatchesDCal, &vecDCal[0]);
1296 histname =
"TriggerSimHistograms/hPatchMedianE";
1300 histname =
"TriggerSimHistograms/hNPatches";
1308 for(
auto p : *fTriggerPatchInfo){
1309 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1312 if(!recpatch->IsJetHighSimple())
continue;
1314 if (recpatch->IsEMCal()) {
1315 if ((recpatch->GetPatchE() -
fMedianDCal) > threshold) {
1320 if ((recpatch->GetPatchE() -
fMedianEMCal) > threshold) {
1368 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1369 TString jetContName = jets->GetName();
1378 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1382 for (
auto jet : jets->
all()) {
1396 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1405 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1415 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
1417 else if (type ==
kDCal) {
1418 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
1420 TLorentzVector leadPart;
1423 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
1432 UInt_t rejectionReason = 0;
1433 if (!jets->
AcceptJet(jet, rejectionReason)) {
1434 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1439 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), corrPt);
1446 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
1448 else if (type ==
kDCal) {
1449 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
1460 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1466 histname = TString::Format(
"%s/JetHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
1468 else if (type ==
kDCal) {
1469 histname = TString::Format(
"%s/JetHistograms/hZVsPtDCal", jets->GetArrayName().Data());
1471 const AliVTrack* track;
1472 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1473 track =
static_cast<AliVTrack*
>(jet->Track(i));
1474 z = track->Pt() / TMath::Abs(corrPt);
1485 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
1487 else if (type ==
kDCal) {
1488 histname = TString::Format(
"%s/JetHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
1500 if (jet->Eta() > 0) {
1501 histname = TString::Format(
"%s/JetHistograms/hEtaPosVsPtEMCal", jets->GetArrayName().Data());
1504 else if (jet->Eta() < 0) {
1505 histname = TString::Format(
"%s/JetHistograms/hEtaNegVsPtEMCal", jets->GetArrayName().Data());
1514 const AliVCluster* clus =
nullptr;
1515 Int_t nClusters = jet->GetNumberOfClusters();
1516 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1517 clus = jet->Cluster(iClus);
1518 deltaEhadcorr += (clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy());
1521 histname = TString::Format(
"%s/JetHistograms/hDeltaEHadCorr", jets->GetArrayName().Data());
1528 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
1549 const AliVCluster* clus;
1553 Double_t clusPhi = it.first.Phi_0_2pi();
1557 if (!clus->IsEMCAL()) {
1563 Int_t nTracksMatched = 0;
1564 const AliVTrack* track =
nullptr;
1565 for (
Int_t itrack=0; itrack < clus->GetNTracksMatched(); itrack++) {
1566 track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(itrack));
1571 Double_t trackPhi = TVector2::Phi_0_2pi(track->GetTrackPhiOnEMCal());
1572 Double_t trackEta = track->GetTrackEtaOnEMCal();
1573 Double_t deta = TMath::Abs(clusEta - trackEta);
1574 Double_t dphi = TMath::Abs(clusPhi - trackPhi);
1577 trackPSum += track->P();
1583 if (trackPSum > 1e-3) {
1584 EoverP = clus->GetNonLinCorrEnergy() / trackPSum;
1587 Double_t deltaE = clus->GetNonLinCorrEnergy() - clus->GetHadCorrEnergy();
1589 if (trackPSum > 1e-3) {
1590 Rcorr = deltaE / trackPSum;
1592 Double_t RcorrClus = deltaE / clus->GetNonLinCorrEnergy();
1598 histname =
"ClusterHistograms/hM02";
1602 if (clus->GetM02() > 0.4) {
1603 histname =
"ClusterHistograms/hNcellsM02G04";
1606 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1607 histname =
"ClusterHistograms/hNcellsM02L04";
1615 histname =
"ClusterHistograms/hMatchedTrackPt";
1618 if (clus->GetM02() > 0.4) {
1619 histname =
"ClusterHistograms/hMatchedTrackPtM02G04";
1622 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1623 histname =
"ClusterHistograms/hMatchedTrackPtM02L04";
1628 histname =
"ClusterHistograms/hMatchedTrackN";
1631 if (clus->GetM02() > 0.4) {
1632 histname =
"ClusterHistograms/hMatchedTrackNM02G04";
1635 if (clus->GetM02() > 0.1 && clus->GetM02() < 0.4) {
1636 histname =
"ClusterHistograms/hMatchedTrackNM02L04";
1641 histname =
"ClusterHistograms/hM02Matched";
1642 if (nTracksMatched > 0) {
1647 histname =
"ClusterHistograms/hM02Unmatched";
1648 if (nTracksMatched == 0) {
1653 if (nTracksMatched == 1) {
1655 const AliVTrack* track =
dynamic_cast<AliVTrack*
>(clus->GetTrackMatched(0));
1657 Double_t trackEta = track->GetTrackEtaOnEMCal();
1658 Double_t deta = trackEta - clusEta;
1661 histname =
"ClusterHistograms/hDeltaEtaCentral";
1666 histname =
"ClusterHistograms/hDeltaEtaPeripheral";
1677 histname =
"ClusterHistograms/hEoverPM02Central";
1681 histname =
"ClusterHistograms/hEoverPM02Peripheral";
1689 histname =
"ClusterHistograms/hRcorrVsCent";
1694 histname =
"ClusterHistograms/hRcorr0-10";
1700 histname =
"ClusterHistograms/hRcorr50-90";
1705 histname =
"ClusterHistograms/hRcorrClusVsCent";
1710 histname =
"ClusterHistograms/hRcorrClus0-10";
1716 histname =
"ClusterHistograms/hRcorrClus50-90";
1723 histname =
"ClusterHistograms/hTrackMultiplicity";
1736 const AliMCEvent* mcevent =
nullptr;
1738 mcevent = MCEvent();
1761 const AliVCluster* clus;
1762 std::vector<ContributorType> vecContributorTypes;
1763 std::vector<Int_t> vecContributorLabels;
1769 if (!clus->IsEMCAL()) {
1776 const Int_t nLabels = clus->GetNLabels();
1779 vecContributorTypes.clear();
1780 vecContributorLabels.clear();
1781 for (
Int_t iLabel=0; iLabel<nLabels; iLabel++) {
1783 Int_t label = clus->GetLabels()[iLabel];
1784 if (TMath::Abs(label) > 0) {
1787 vecContributorTypes.push_back(contributorType);
1788 vecContributorLabels.push_back(label);
1793 Int_t nLabelsPhysPrim = vecContributorTypes.size();
1795 if (nLabelsPhysPrim == 1) {
1797 contributorType = vecContributorTypes[0];
1799 if (contributorType ==
kPhoton) {
1802 else if (contributorType ==
kElectron) {
1808 else if (contributorType ==
kProton) {
1817 else if (contributorType ==
kK0L) {
1820 else if (contributorType ==
kNeutron) {
1831 else if (nLabelsPhysPrim == 2) {
1839 Double_t frac1 = clus->GetClusterMCEdepFraction(1);
1847 if (isHadron1 && isHadron2) {
1850 else if (isPhoton1 && isHadron2) {
1854 Double_t photonEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
1855 histname =
"ClusterHistogramsMC/hPhotonHadronPhotonEnergy";
1858 else if (isHadron1 && isPhoton2) {
1862 Double_t hadronEnergy = clus->GetNonLinCorrEnergy() * (1 - frac1);
1863 histname =
"ClusterHistogramsMC/hHadronPhotonHadronEnergy";
1866 else if (isPhoton1 && isPhoton2) {
1874 if (part1 && part2) {
1875 Int_t iMother1 = part1->GetMother();
1876 Int_t iMother2 = part2->GetMother();
1877 AliVParticle *mother1 = mcevent->GetTrack(iMother1);
1878 AliVParticle *mother2 = mcevent->GetTrack(iMother2);
1880 if (mother1 && mother2) {
1881 if ( (mother1->PdgCode() == 111) && (mother2->PdgCode() == 111) ) {
1882 if (iMother1 == iMother2) {
1894 else if (nLabelsPhysPrim > 2) {
1900 histname =
"ClusterHistogramsMC/hM02VsParticleTypeCentral";
1901 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
1904 histname =
"ClusterHistogramsMC/hM02VsParticleTypePeripheral";
1905 fHistManager.
FillTH3(histname, clus->GetM02(), clus->GetNonLinCorrEnergy(), particleType);
1918 const AliVCluster* clus;
1920 for (
const auto jet : jets->
accepted()) {
1925 Double_t hadCaloEnergyUnmatched = 0;
1926 Double_t hadCaloEnergyMatchedNonlincorr = 0;
1927 Double_t hadCaloEnergyMatchedHadCorr = 0;
1930 Int_t nClusters = jet->GetNumberOfClusters();
1931 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1933 clus = jet->Cluster(iClus);
1937 Int_t label = TMath::Abs(clus->GetLabel());
1943 histname =
"JetPerformanceMC/hM02VsContributorTypeJets";
1944 Double_t x[4] = {clus->GetM02(), clus->GetNonLinCorrEnergy(), contributorType, jetPt};
1950 Bool_t hasMatchedTrack = (clus->GetNTracksMatched() > 0);
1952 if (hasMatchedTrack) {
1953 hadCaloEnergyMatchedNonlincorr += clus->GetNonLinCorrEnergy();
1954 hadCaloEnergyMatchedHadCorr += clus->GetHadCorrEnergy();
1957 hadCaloEnergyUnmatched += clus->GetNonLinCorrEnergy();
1966 histname =
"JetPerformance/hHadCaloEnergyUnmatched";
1970 histname =
"JetPerformance/hHadCaloEnergyMatchedNonlincorr";
1974 histname =
"JetPerformance/hHadCaloEnergyMatchedHadCorr";
1978 histname =
"JetPerformanceMC/hJetComposition";
1979 for (
Int_t type = 0; type < 8; type++) {
1986 for (
Int_t iClus = 0; iClus < nClusters; iClus++) {
1988 clus = jet->Cluster(iClus);
1990 Int_t label = TMath::Abs(clus->GetLabel());
1995 if (type == contributorType) {
1997 pTsum += clus->GetNonLinCorrEnergy();
2002 Double_t x[4] = {jetPt, 1.*type, nSum, pTsum};
2022 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
2023 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
2024 Double_t phiMinDCal =
fGeom->GetDCALPhiMin() * TMath::DegToRad();
2025 Double_t phiMaxDCal =
fGeom->GetDCALPhiMax() * TMath::DegToRad();
2027 Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
2028 Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
2029 Double_t accDCal = 2 * (etaEMCal - etaMinDCal) * (phiMaxDCal - phiMinDCal);
2034 while ((jetCont = static_cast<AliJetContainer*>(nextJetColl()))) {
2037 TRandom3* r =
new TRandom3(0);
2039 Double_t etaEMCalfid = etaEMCal - jetR;
2040 Double_t etaMinDCalfid = etaMinDCal + jetR;
2041 Double_t phiMinEMCalfid = phiMinEMCal + jetR;
2042 Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
2043 Double_t phiMinDCalfid = phiMinDCal + jetR;
2044 Double_t phiMaxDCalfid = phiMaxDCal - jetR;
2045 Double_t accEMCalfid = 2 * etaEMCalfid * (phiMaxEMCalfid - phiMinEMCalfid);
2046 Double_t accDCalfid = 2 * (etaEMCalfid - etaMinDCalfid) * (phiMaxDCalfid - phiMinDCalfid);
2047 if ( (etaEMCalfid - etaMinDCalfid) < 0) {
2052 Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
2053 Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
2056 Double_t etaDCalRC = r->Uniform(etaMinDCalfid, etaEMCalfid);
2057 Double_t sign = r->Uniform(-1., 1.);
2059 etaDCalRC = -1*etaDCalRC;
2061 Double_t phiDCalRC = r->Uniform(phiMinDCalfid, phiMaxDCalfid);
2088 while ((partCont = static_cast<AliParticleContainer*>(nextPartCont()))) {
2090 TString partContName = partCont->GetName();
2091 if (!partContName.CompareTo(
"tracks")) {
2097 track = trackIterator.first;
2098 trackEta = track.Eta();
2100 trackPt = track.Pt();
2103 if (TMath::Abs(trackEta) < etaTPC) {
2104 trackPtSumTPC += trackPt;
2108 if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
2109 trackPtSumEMCal += trackPt;
2113 if (TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinEMCalfid && trackPhi < phiMaxEMCalfid) {
2114 trackPtSumEMCalfid += trackPt;
2119 if (TMath::Abs(trackEta) > etaMinDCal && TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinDCal && trackPhi < phiMaxDCal) {
2120 trackPtSumDCal += trackPt;
2126 if (TMath::Abs(trackEta) > etaMinDCalfid && TMath::Abs(trackEta) < etaEMCalfid && trackPhi > phiMinDCalfid && trackPhi < phiMaxDCalfid) {
2127 trackPtSumDCalfid += trackPt;
2132 deltaR =
GetDeltaR(&track, etaEMCalRC, phiEMCalRC);
2133 if (deltaR < jetR) {
2134 trackPtSumEMCalRC += trackPt;
2139 deltaR =
GetDeltaR(&track, etaDCalRC, phiDCalRC);
2140 if (deltaR < jetR) {
2141 trackPtSumDCalRC += trackPt;
2160 clus = clusIterator.first;
2161 clusEta = clus.Eta();
2166 if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
2167 clusPtSumEMCal += clusPt;
2171 if (TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinEMCalfid && clusPhi < phiMaxEMCalfid) {
2172 clusPtSumEMCalfid += clusPt;
2177 if (TMath::Abs(clusEta) > etaMinDCal && TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinDCal && clusPhi < phiMaxDCal) {
2178 clusPtSumDCal += clusPt;
2184 if (TMath::Abs(clusEta) > etaMinDCalfid && TMath::Abs(clusEta) < etaEMCalfid && clusPhi > phiMinDCalfid && clusPhi < phiMaxDCalfid) {
2185 clusPtSumDCalfid += clusPt;
2190 deltaR =
GetDeltaR(&clus, etaEMCalRC, phiEMCalRC);
2191 if (deltaR < jetR) {
2192 clusPtSumEMCalRC += clusPt;
2197 deltaR =
GetDeltaR(&clus, etaDCalRC, phiDCalRC);
2198 if (deltaR < jetR) {
2199 clusPtSumDCalRC += clusPt;
2208 Double_t numerator = (trackPtSumEMCal + clusPtSumEMCal) / accEMCal;
2209 Double_t denominator = trackPtSumTPC / accTPC;
2210 Double_t scaleFactor = numerator / denominator;
2211 TString histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
2215 if (accEMCalfid > 1e-3) {
2216 numerator = (trackPtSumEMCalfid + clusPtSumEMCalfid) / accEMCalfid;
2217 scaleFactor = numerator / denominator;
2218 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCalFid", jetCont->GetArrayName().Data());
2224 numerator = (trackPtSumDCal + clusPtSumDCal) / accDCal;
2225 scaleFactor = numerator / denominator;
2226 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCal", jetCont->GetArrayName().Data());
2232 if (accDCalfid > 1e-3) {
2233 numerator = (trackPtSumDCalfid + clusPtSumDCalfid) / accDCalfid;
2234 scaleFactor = numerator / denominator;
2235 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorDCalFid", jetCont->GetArrayName().Data());
2244 Double_t deltaPt = trackPtSumEMCalRC + clusPtSumEMCalRC - rho * TMath::Pi() * jetR * jetR;
2245 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
2250 if (accDCalfid > 1e-3) {
2251 deltaPt = trackPtSumDCalRC + clusPtSumDCalRC - rho * TMath::Pi() * jetR * jetR;
2252 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtDCal", jetCont->GetArrayName().Data());
2272 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
2273 TString jetContName = jets->GetName();
2278 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
2282 for (
auto jet : jets->
all()) {
2288 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
2292 UInt_t rejectionReason = 0;
2293 if (!jets->
AcceptJet(jet, rejectionReason)) {
2294 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
2295 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
2309 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtEMCal", jets->GetArrayName().Data());
2311 else if (type ==
kDCal) {
2312 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtDCal", jets->GetArrayName().Data());
2317 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
2322 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtEMCal", jets->GetArrayName().Data());
2324 else if (type ==
kDCal) {
2325 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPtDCal", jets->GetArrayName().Data());
2327 TLorentzVector leadPart;
2330 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2335 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtEMCal", jets->GetArrayName().Data());
2337 else if (type ==
kDCal) {
2338 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPtDCal", jets->GetArrayName().Data());
2340 const AliVTrack* track;
2341 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
2342 track =
static_cast<AliVTrack*
>(jet->Track(i));
2343 z = track->Pt() / TMath::Abs(corrPt);
2349 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtEMCal", jets->GetArrayName().Data());
2351 else if (type ==
kDCal) {
2352 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPtDCal", jets->GetArrayName().Data());
2386 if (!matchedPartLevelJet) {
2389 UInt_t rejectionReason = 0;
2403 Float_t truthPt = matchedPartLevelJet->
Pt();
2407 histname =
"MatchedJetHistograms/hResponseMatrixEMCal";
2409 else if (type ==
kDCal) {
2410 histname =
"MatchedJetHistograms/hResponseMatrixDCal";
2421 histname =
"MatchedJetHistograms/hJESshiftEMCal";
2423 else if (type ==
kDCal) {
2424 histname =
"MatchedJetHistograms/hJESshiftDCal";
2434 histname =
"MatchedJetHistograms/hNEFVsPt";
2443 histname =
"MatchedJetHistograms/hZLeadingVsPt";
2444 TLorentzVector leadPart;
2447 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
2466 truthJet->ResetMatching();
2469 detJet->ResetMatching();
2472 deltaR = detJet->DeltaR(truthJet);
2475 if (deltaR < detJet->ClosestJetDistance()) {
2476 detJet->SetClosestJet(truthJet, deltaR);
2478 if (deltaR < truthJet->ClosestJetDistance()) {
2479 truthJet->SetClosestJet(detJet, deltaR);
2496 Int_t nTruthMatches = 0;
2500 deltaR = leadDetJet->
DeltaR(truthJet);
2511 Int_t nDetMatches = 0;
2515 deltaR = leadTruthJet->
DeltaR(detJet);
2522 TString histname =
"MatchedJetHistograms/hNumberMatchingCandidates";
2536 if (!matchedTruthJetCand) {
2539 if (matchedTruthJetCand->
ClosestJet() != detJet) {
2544 TString histname =
"MatchedJetHistograms/hMatchingDistance";
2558 return matchedTruthJetCand;
2572 TString histname =
"ClusterHistogramsMC/hClusterRejectionReasonMC";
2573 UInt_t rejectionReason = 0;
2576 return contributorType;
2579 if (part->GetGeneratorIndex() == 0) {
2587 else if (TMath::Abs(pdg) == 211) {
2590 else if (pdg == 2212) {
2593 else if (pdg == -2212) {
2596 else if (TMath::Abs(pdg) == 321) {
2599 else if (pdg == 130) {
2600 contributorType =
kK0L;
2602 else if (pdg == 2112) {
2605 else if (pdg == -2112) {
2608 else if (TMath::Abs(pdg) == 11) {
2611 else if (TMath::Abs(pdg) == 13) {
2612 contributorType =
kMuon;
2615 contributorType =
kOther;
2619 return contributorType;
2628 Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
2629 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
2671 const char *ntracks,
2672 const char *nclusters,
2673 const char *nGenLev,
2683 ::Error(
"AddTaskEmcalJetPerformance",
"No analysis manager to connect to.");
2689 AliVEventHandler* handler = mgr->GetInputEventHandler();
2692 ::Error(
"AddTaskEmcalJetPerformance",
"This task requires an input event handler");
2704 if (handler->InheritsFrom(
"AliESDInputHandler")) {
2707 else if (handler->InheritsFrom(
"AliAODInputHandler")) {
2718 if (trackName ==
"usedefault") {
2719 if (dataType ==
kESD) {
2720 trackName =
"Tracks";
2722 else if (dataType == kAOD) {
2723 trackName =
"tracks";
2730 if (clusName ==
"usedefault") {
2731 if (dataType ==
kESD) {
2732 clusName =
"CaloClusters";
2734 else if (dataType == kAOD) {
2735 clusName =
"caloClusters";
2742 TString name(
"AliAnalysisTaskEmcalJetPerformance");
2743 if (!trackName.IsNull()) {
2747 if (!clusName.IsNull()) {
2751 if (strcmp(suffix,
"") != 0) {
2764 if (trackName ==
"mcparticles") {
2766 partCont = mcpartCont;
2768 else if (trackName ==
"tracks" || trackName ==
"Tracks") {
2770 partCont = trackCont;
2776 if (nGenLev && strcmp(nGenLev,
"")!=0) {
2784 if (!clusName.IsNull()) {
2798 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
2800 contname +=
"_histos";
2801 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
2802 TList::Class(),AliAnalysisManager::kOutputContainer,
2803 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
2804 mgr->ConnectInput (task, 0, cinput1 );
2805 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.
Declaration of class AliTLorentzVector.
static AliEmcalDownscaleFactorsOCDB * Instance()
AliClusterContainer * GetClusterContainer() const
void FillTH3(const char *hname, double x, double y, double z, double weight=1., Option_t *opt="")
Fill a 3D histogram within the container.
Declaration of class AliAnalysisTaskEmcalEmbeddingHelper.
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
Double_t GetDownscaleFactorForTriggerClass(const TString &trigger) const
Container for particles within the EMCAL framework.
void SetCaloTriggerPatchInfoName(const char *n)
void AdoptClusterContainer(AliClusterContainer *cont)
TObjArray fParticleCollArray
particle/track collection array
virtual Bool_t AcceptMCParticle(const AliAODMCParticle *vp, UInt_t &rejectionReason) const
bool AddQAPlotsToList(TList *list)
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
AliEmcalJet * GetLeadingJet(const char *opt="")
void GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
void SetRun(int runnumber)
void FillTHnSparse(const char *name, const double *x, double weight=1., Option_t *opt="")
bool IsInitialized() const
TH2 * CreateTH2(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, Option_t *opt="")
Create a new TH2 within the container.
THashList * GetListOfHistograms() const
Get the list of histograms.
Double_t GetLeadingHadronPt(const AliEmcalJet *jet) const
AliEMCALGeometry * fGeom
!emcal geometry
UInt_t GetJetAcceptanceType() const
Double_t Phi_0_2pi() const
Implementation of task to embed external events.
TH1 * CreateTH1(const char *name, const char *title, int nbins, double xmin, double xmax, Option_t *opt="")
Create a new TH1 within the container.
BeamType fForceBeamType
forced beam type
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
Double_t fCent
!event centrality
Int_t GetNAcceptedTracks()
AliMCParticleContainer * AddMCParticleContainer(const char *n)
Create new container for MC particles and attach it to the task.
static Double_t GetParallelFraction(AliVParticle *part1, AliVParticle *part2)
Calculates the fraction of momentum z of part 1 w.r.t. part 2 in the direction of part 2...
void FillTH1(const char *hname, double x, double weight=1., Option_t *opt="")
Fill a 1D histogram within the container.
TObjArray fJetCollArray
jet collection array
Double_t DeltaR(const AliVParticle *part) const
AliRhoParameter * GetRhoParameter()
void RecordEmbeddedEventProperties()
virtual Bool_t IsEventSelected()
Performing event selection.
static Double_t * GenerateFixedBinArray(Int_t n, Double_t min, Double_t max)
std::vector< TString > GetTriggerClasses() const
Float_t GetJetRadius() const
AliEmcalList * fOutput
!output list
Handler for downscale factors for various triggers obtained from the OCDB.
AliMCParticleContainer * GetMCParticleContainer(Int_t i=0) const
void SelectPhysicalPrimaries(Bool_t s)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
const AliTrackIterableMomentumContainer accepted_momentum() const
Int_t GetRunNumber(TString)
void SetClusPtCut(Double_t cut)
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
Main initialization function on the worker.
const AliJetIterableContainer accepted() const
EDataType_t
Switch for the data type.
void SetClusECut(Double_t cut)
THnSparse * CreateTHnSparse(const char *name, const char *title, int ndim, const int *nbins, const double *min, const double *max, Option_t *opt="")
Create a new THnSparse within the container.
Container structure for EMCAL clusters.
DCal fiducial acceptance (each eta, phi edge narrowed by jet R)
Container for MC-true particles within the EMCAL framework.
virtual AliAODMCParticle * GetMCParticleWithLabel(Int_t lab) const
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
EMCal fiducial acceptance (each eta, phi edge narrowed by jet R)
Container for jet within the EMCAL jet framework.
TH3 * CreateTH3(const char *name, const char *title, int nbinsx, double xmin, double xmax, int nbinsy, double ymin, double ymax, int nbinsz, double zmin, double zmax, Option_t *opt="")
Create a new TH2 within the container.
const AliJetIterableContainer all() const
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()