18 #include <TClonesArray.h>
23 #include <THnSparse.h>
28 #include <AliVCluster.h>
29 #include <AliVParticle.h>
38 #include "AliEMCALGeometry.h"
40 #include "AliEMCALTriggerPatchInfo.h"
57 fUseManualEventCuts(kFALSE),
58 fUseAliEventCuts(kTRUE),
62 fDijetLeadingHadronPt(0),
68 fPlotJetHistograms(kFALSE),
69 fPlotDijetCandHistograms(kFALSE),
70 fPlotDijetImbalanceHistograms(kFALSE),
71 fComputeBackground(kFALSE),
72 fDoMomentumBalance(kFALSE),
73 fDoGeometricalMatching(kFALSE),
75 fTrackConstituentThreshold(0),
76 fClusterConstituentThreshold(0),
80 fLoadBackgroundScalingWeights(kTRUE),
81 fBackgroundScalingWeights(0),
82 fGapJetScalingWeights(0),
83 fComputeMBDownscaling(kFALSE),
84 fDoTriggerSimulation(kFALSE),
105 fUseManualEventCuts(kFALSE),
106 fUseAliEventCuts(kTRUE),
110 fDijetLeadingHadronPt(0),
116 fPlotJetHistograms(kFALSE),
117 fPlotDijetCandHistograms(kFALSE),
118 fPlotDijetImbalanceHistograms(kFALSE),
119 fComputeBackground(kFALSE),
120 fDoMomentumBalance(kFALSE),
121 fDoGeometricalMatching(kFALSE),
123 fTrackConstituentThreshold(0),
124 fClusterConstituentThreshold(0),
125 fMBUpscaleFactor(1.),
128 fLoadBackgroundScalingWeights(kTRUE),
129 fBackgroundScalingWeights(0),
130 fGapJetScalingWeights(0),
131 fComputeMBDownscaling(kFALSE),
132 fDoTriggerSimulation(kFALSE),
206 while ((obj = next())) {
234 if (embeddingHelper) {
257 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
260 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
261 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
267 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
268 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
273 histname = TString::Format(
"%s/JetHistograms/hCentVsPt", jets->GetArrayName().Data());
274 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
275 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, 0, 100,
nPtBins, 0,
fMaxPt, 3, -0.5, 2.5);
278 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtVsEtaVsPhi", jets->GetArrayName().Data());
279 title = histname +
";Centrality (%);#eta_{jet} (rad);#phi_{jet} (rad);#it{p}_{T}^{corr} (GeV/#it{c});NEF;type";
281 Double_t min1[6] = {0, -0.5,1., 0, 0, -0.5};
286 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
287 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
288 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, 0, 100,
nPtBins, 0,
fMaxPt, 3, -0.5, 2.5,
"s");
291 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
292 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
296 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
297 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
301 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
302 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading};type";
309 histname = TString::Format(
"%s/JetHistograms/hZVsPt", jets->GetArrayName().Data());
310 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z};type";
317 histname = TString::Format(
"%s/JetHistograms/hNConstVsPt", jets->GetArrayName().Data());
318 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents;type";
326 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
327 title = histname +
";#it{E}_{patch,med};type;#it{p}_{T}^{corr} (GeV/#it{c});Centrality (%)";
338 histname =
"Trigger/hMBDownscaleFactor";
339 title = histname +
";Downscale factor;counts";
358 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
360 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
361 title = histname +
";Centrality;Scale factor;counts";
364 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
365 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
368 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEtaPhi", jets->GetArrayName().Data());
369 title = histname +
";#eta;#phi;Centrality;Scale factor;";
372 Double_t max[4] = {0.5,6., 100, 20};
375 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEtaPhi", jets->GetArrayName().Data());
376 title = histname +
";#eta;#phi;Centrality;#delta#it{p}_{T} (GeV/#it{c})";
378 Double_t minDpT[4] = {-0.5,1., 0, -50};
379 Double_t maxDpT[4] = {0.5,6., 100, 150};
395 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
404 axisTitle[dim] =
"Centrality (%)";
412 axisTitle[dim] =
"LeadingHadronRequired";
419 axisTitle[dim] =
"#it{p}_{T,trig jet} (GeV/#it{c})";
420 nbins[dim] = TMath::CeilNint(
fMaxPt/2);
426 axisTitle[dim] =
"#it{p}_{T,ass jet} (GeV/#it{c})";
427 nbins[dim] = TMath::CeilNint(
fMaxPt/2);
433 axisTitle[dim] =
"#phi_{trig jet}";
434 nbins[dim] = TMath::CeilNint(
fMaxPt/2);
436 max[dim] = TMath::TwoPi();
440 axisTitle[dim] =
"#phi_{ass jet}";
441 nbins[dim] = TMath::CeilNint(
fMaxPt/2);
443 max[dim] = TMath::TwoPi();
447 axisTitle[dim] =
"#eta_{trig jet}";
448 nbins[dim] = TMath::CeilNint(
fMaxPt/2);
454 axisTitle[dim] =
"#eta_{ass jet}";
455 nbins[dim] = TMath::CeilNint(
fMaxPt/2);
461 TString thnname = TString::Format(
"%s/DijetCandObservables", jets->GetArrayName().Data());
463 for (
Int_t i = 0; i < dim; i++) {
464 hn->GetAxis(i)->SetTitle(axisTitle[i]);
465 hn->SetBinEdges(i, binEdges[i]);
478 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
490 axisTitle[dim] =
"Centrality (%)";
498 axisTitle[dim] =
"#Delta#phi";
505 axisTitle[dim] =
"#Delta#eta";
512 axisTitle[dim] =
"A_{J}";
519 axisTitle[dim] =
"x_{J}";
526 axisTitle[dim] =
"k_{Ty} (GeV)";
533 axisTitle[dim] =
"N_{tracks, trig jet}";
540 axisTitle[dim] =
"N_{tracks, ass jet}";
547 TString thnname = TString::Format(
"%s/DijetImbalanceObservables", jets->GetArrayName().Data());
549 for (
Int_t i = 0; i < dim; i++) {
550 hn->GetAxis(i)->SetTitle(axisTitle[i]);
551 hn->SetBinEdges(i, binEdges[i]);
559 TString histname = TString::Format(
"%s/DijetJetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
560 TString title = histname +
";Centrality (%);#it{p}_{T,1}^{corr} (GeV/#it{c});#it{p}_{T,2}^{corr} (GeV/#it{c})";
561 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, 0, 100,
nPtBins, 0,
fMaxPt,
nPtBins, 0,
fMaxPt,
"s");
566 histname = TString::Format(
"%s/DijetJetHistograms/hNEFVsPt", jets->GetArrayName().Data());
567 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});NEF;type";
574 histname = TString::Format(
"%s/DijetJetHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
575 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading};type";
582 histname = TString::Format(
"%s/DijetJetHistograms/hZVsPt", jets->GetArrayName().Data());
583 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z};type";
590 histname = TString::Format(
"%s/DijetJetHistograms/hNConstVsPt", jets->GetArrayName().Data());
591 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents;type";
606 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
616 axisTitle[dim] =
"A_{J}";
623 axisTitle[dim] =
"#Delta#phi";
630 axisTitle[dim] =
"#it{p}_{T,particle} (GeV/#it{c})";
640 max[dim] = pTParticleBins[nbins[dim]];
641 binEdges[dim] = pTParticleBins;
644 axisTitle[dim] =
"#it{p}_{T}#parallel (GeV/#it{c})";
653 max[dim] = pTParallelBins[nbins[dim]];
654 binEdges[dim] = pTParallelBins;
657 TString thnname = TString::Format(
"%s/MomentumBalance", jets->GetArrayName().Data());
659 for (
Int_t i = 0; i < dim; i++) {
660 hn->GetAxis(i)->SetTitle(axisTitle[i]);
661 hn->SetBinEdges(i, binEdges[i]);
680 axisTitle[dim] =
"Centrality (%)";
688 axisTitle[dim] =
"isSwitched";
695 axisTitle[dim] =
"#DeltaR_{trig}";
702 axisTitle[dim] =
"#DeltaR_{ass}";
709 axisTitle[dim] =
"trig #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}";
716 axisTitle[dim] =
"ass #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}";
723 axisTitle[dim] =
"A_{J} low-threshold";
730 axisTitle[dim] =
"A_{J} hard-core";
737 TString thnname =
"GeometricalMatching";
739 for (
Int_t i = 0; i < dim; i++) {
740 hn->GetAxis(i)->SetTitle(axisTitle[i]);
741 hn->SetBinEdges(i, binEdges[i]);
747 histname =
"GeometricalMatchingEfficiency";
748 title = histname +
";isMatched;counts";
766 histname =
"TriggerSimHistograms/hEtaVsPhi";
767 title = histname +
";#eta_{patch} (rad);#phi_{patch} (rad)";
771 histname =
"TriggerSimHistograms/hNPatches";
772 title = histname +
";#it{N}_{patches};type";
776 histname =
"TriggerSimHistograms/hPatchE";
777 title = histname +
";Centrality (%);#it{E}_{patch} (GeV)";
781 histname =
"TriggerSimHistograms/hPatchMedianE";
782 title = histname +
";Centrality (%);#it{E}_{patch,med} (GeV);type";
783 fHistManager.
CreateTH3(histname.Data(), title.Data(), 50, 0, 100, 100, 0, 50, 2, -0.5, 1.5);
786 histname =
"TriggerSimHistograms/hMedPatchDijet";
787 title = histname +
";Centrality (%);#it{p}_{T,trig}^{corr} (GeV/#it{c});#it{E}_{patch,med} (GeV);type";
788 Int_t nbinsD[4] = {50, 40, 100, 2};
790 Double_t maxD[4] = {100, 200, 50, 1.5};
797 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
800 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
801 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
807 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
808 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
813 histname = TString::Format(
"%s/TriggerSimHistograms/hCentVsPt", jets->GetArrayName().Data());
814 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});type";
815 fHistManager.
CreateTH3(histname.Data(), title.Data(), 20, 0, 100,
nPtBins, 0,
fMaxPt, 3, -0.5, 2.5);
818 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtVsEtaVsPhi", jets->GetArrayName().Data());
819 title = histname +
";Centrality (%);#eta_{jet} (rad);#phi_{jet} (rad);#it{p}_{T}^{corr} (GeV/#it{c});NEF;type";
821 Double_t min1[6] = {0, -0.5,1., 0, 0, -0.5};
826 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
827 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
831 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
832 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
836 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
837 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading};type";
844 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPt", jets->GetArrayName().Data());
845 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});#it{z};type";
852 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPt", jets->GetArrayName().Data());
853 title = histname +
";Centrality (%);#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents;type";
870 if (fname.BeginsWith(
"alien://")) {
871 TGrid::Connect(
"alien://");
874 TFile*
file = TFile::Open(path);
876 if (!file || file->IsZombie()) {
877 ::Error(
"AliAnalysisTaskEmcalDijetImbalance",
"Could not open background scaling histogram");
882 TH2D* h1 =
dynamic_cast<TH2D*
>(file->Get(name1));
885 ::Info(
"AliAnalysisTaskEmcalDijetImbalance::LoadBackgroundScalingHistogram",
"Background histogram %s loaded from file %s.", name1, path);
888 ::Error(
"AliAnalysisTaskEmcalDijetImbalance::LoadBackgroundScalingHistogram",
"Background histogram %s not found in file %s.", name1, path);
895 TH2D* h2 =
dynamic_cast<TH2D*
>(file->Get(name2));
898 ::Info(
"AliAnalysisTaskEmcalDijetImbalance::LoadBackgroundScalingHistogram",
"Jet pT scaling histogram %s loaded from file %s.", name2, path);
901 ::Error(
"AliAnalysisTaskEmcalDijetImbalance::LoadBackgroundScalingHistogram",
"Jet pT scaling histogram %s not found in file %s.", name2, path);
934 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
935 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
936 GetName(), cls.GetName(),
"EmcalTriggers"));
941 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
967 TString triggerNameMB1 =
"CINT7-B-NOPF-CENT";
968 TString triggerNameMB2 =
"CV0L7-B-NOPF-CENT";
969 TString triggerNameJE =
"CINT7EJ1-B-NOPF-CENTNOPMD";
974 for (
auto i : runtriggers) {
975 if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
984 TString histname =
"Trigger/hMBDownscaleFactor";
1021 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
1022 TString jetContName = jetCont->GetName();
1023 if (jetContName.Contains(
"HardCore"))
continue;
1031 for (
Int_t leadingHadronCutType=0; leadingHadronCutType<2; leadingHadronCutType++) {
1034 FindDijet(jetCont, leadingHadronCutType);
1055 histname = TString::Format(
"%s/MomentumBalance", jetCont->GetArrayName().Data());
1098 if(!trigJet)
return;
1115 for(
auto assJetCand : jetCont->
accepted()) {
1116 if (!assJetCand)
continue;
1118 if ( TMath::Abs(trigJet->
Phi() - assJetCand->Phi()) <
fDeltaPhiMin )
continue;
1121 if ( assJetCandPt < assJetPt )
continue;
1123 assJet = assJetCand;
1125 if (!assJet)
return;
1153 track = trackIterator.second;
1163 Double_t deltaPhiTrigJet = TMath::Abs(trackPhi - trigJetPhi);
1164 Double_t deltaPhiAssJet = TMath::Abs(trackPhi - assJetPhi);
1165 Bool_t isNearside = deltaPhiTrigJet < deltaPhiAssJet;
1170 deltaPhi = trackPhi - trigJetPhi;
1171 balancePt = trackPt * TMath::Cos(deltaPhi);
1174 deltaPhi = trackPhi - assJetPhi;
1175 balancePt = -trackPt * TMath::Cos(deltaPhi);
1189 TString jetContAllName = Form(
"Jet_AKTFullR0%d0_tracks_pT0150_caloClusters_E0300_pt_scheme", (
int) (
fMatchingJetR*10) );
1195 TString jetContHardCoreName = Form(
"JetHardCore_AKTFullR0%d0_tracks_pT%d_caloClusters_E%d_pt_scheme", (
int) (
fMatchingJetR*10), trackThreshold, clusThreshold);
1216 TClass cls(objname);
1217 if (!cls.InheritsFrom(
"AliEMCALTriggerPatchInfo")) {
1218 AliError(Form(
"%s: Objects of type %s in %s are not inherited from AliEMCALTriggerPatchInfo!",
1219 GetName(), cls.GetName(),
"EmcalTriggers"));
1224 AliError(Form(
"%s: Unable to get trigger patch container with name %s. Aborting", GetName(),
"EmcalTriggers"));
1229 std::vector<Double_t> vecEMCal;
1230 std::vector<Double_t> vecDCal;
1232 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1235 if(!recpatch->IsJetHighSimple())
continue;
1237 histname =
"TriggerSimHistograms/hEtaVsPhi";
1240 histname =
"TriggerSimHistograms/hPatchE";
1243 if (recpatch->IsEMCal()) {
1244 vecEMCal.push_back(recpatch->GetPatchE());
1246 vecDCal.push_back(recpatch->GetPatchE());
1253 const Int_t nBkgPatchesEMCal = vecEMCal.size();
1254 const Int_t nBkgPatchesDCal = vecDCal.size();
1255 fMedianEMCal = TMath::Median(nBkgPatchesEMCal, &vecEMCal[0]);
1256 fMedianDCal = TMath::Median(nBkgPatchesDCal, &vecDCal[0]);
1258 histname =
"TriggerSimHistograms/hPatchMedianE";
1262 histname =
"TriggerSimHistograms/hNPatches";
1268 histname =
"TriggerSimHistograms/hMedPatchDijet";
1279 for(
auto p : *fTriggerPatchInfo){
1280 AliEMCALTriggerPatchInfo *recpatch =
static_cast<AliEMCALTriggerPatchInfo *
>(p);
1283 if(!recpatch->IsJetHighSimple())
continue;
1285 if (recpatch->IsEMCal()) {
1286 if ((recpatch->GetPatchE() -
fMedianDCal) > threshold) {
1291 if ((recpatch->GetPatchE() -
fMedianEMCal) > threshold) {
1315 for(
auto matchingTrigJetCand : jetCont->
accepted()) {
1316 if (!matchingTrigJetCand)
continue;
1318 if (matchingTrigJet) {
1319 if (
GetJetPt(jetCont, matchingTrigJetCand) <
GetJetPt(jetCont, matchingTrigJet) )
continue;
1321 matchingTrigJet = matchingTrigJetCand;
1323 if (!matchingTrigJet)
return;
1327 for(
auto matchingAssJetCand : jetCont->
accepted()) {
1328 if (!matchingAssJetCand)
continue;
1330 if (matchingAssJet) {
1331 if (
GetJetPt(jetCont, matchingAssJetCand) <
GetJetPt(jetCont, matchingAssJet) )
continue;
1333 matchingAssJet = matchingAssJetCand;
1337 if (matchingAssJet) {
1340 if (
GetJetPt(jetCont, matchingTrigJet) <
GetJetPt(jetCont, matchingAssJet) ) {
1381 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
1382 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
1383 Double_t phiMinDCal =
fGeom->GetDCALPhiMin() * TMath::DegToRad();
1384 Double_t phiMaxDCal =
fGeom->GetDCALPhiMax() * TMath::DegToRad();
1385 Double_t phiMinPHOS = 250 * TMath::DegToRad();
1386 Double_t phiMaxPHOS = 320 * TMath::DegToRad();
1388 Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
1389 Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
1390 Double_t accDCalRegion = 2 * etaEMCal * (phiMaxDCal - phiMinDCal);
1395 while ((jetCont = static_cast<AliJetContainer*>(nextJetColl()))) {
1398 TRandom3* r =
new TRandom3(0);
1399 Double_t jetR = jetCont->GetJetRadius();
1400 Double_t accRC = TMath::Pi() * jetR * jetR;
1401 Double_t etaEMCalfid = etaEMCal - jetR;
1402 Double_t phiMinEMCalfid = phiMinEMCal + jetR;
1403 Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
1404 Double_t phiMinDCalRegionfid = phiMinDCal + jetR;
1405 Double_t phiMaxDCalRegionfid = phiMaxDCal - jetR;
1408 Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
1409 Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
1417 etaMin = -etaEMCalfid + etaBin*etaStep;
1418 etaMax = etaMin + etaStep;
1419 etaDCalRC[etaBin] = r->Uniform(etaMin, etaMax);
1427 phiMin = 1 + phiBin*phiStep;
1428 phiMax = phiMin + phiStep;
1429 phiDCalRC[phiBin] = r->Uniform(phiMin, phiMax);
1440 std::vector<std::vector<Double_t>> trackPtSumDCalRC(fNEtaBins, std::vector<Double_t>(fNPhiBins));
1441 std::vector<std::vector<Double_t>> clusESumDCalRC(fNEtaBins, std::vector<Double_t>(fNPhiBins));
1455 track = trackIterator.first;
1456 trackEta = track.Eta();
1458 trackPt = track.Pt();
1461 if (TMath::Abs(trackEta) < etaTPC) {
1462 trackPtSumTPC += trackPt;
1466 if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
1467 trackPtSumEMCal += trackPt;
1471 deltaR =
GetDeltaR(&track, etaEMCalRC, phiEMCalRC);
1472 if (deltaR < jetR) {
1473 trackPtSumEMCalRC += trackPt;
1479 deltaR =
GetDeltaR(&track, etaDCalRC[etaBin], phiDCalRC[phiBin]);
1480 if (deltaR < jetR) {
1481 trackPtSumDCalRC[etaBin][phiBin] += trackPt;
1498 clus = clusIterator.first;
1499 clusEta = clus.Eta();
1504 if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
1505 clusESumEMCal += clusE;
1509 deltaR =
GetDeltaR(&clus, etaEMCalRC, phiEMCalRC);
1510 if (deltaR < jetR) {
1511 clusESumEMCalRC += clusE;
1517 deltaR =
GetDeltaR(&clus, etaDCalRC[etaBin], phiDCalRC[phiBin]);
1518 if (deltaR < jetR) {
1519 clusESumDCalRC[etaBin][phiBin] += clusE;
1527 Double_t numerator = (trackPtSumEMCal + clusESumEMCal) / accEMCal;
1528 Double_t denominator = trackPtSumTPC / accTPC;
1529 Double_t scaleFactor = numerator / denominator;
1530 TString histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
1536 numerator = (trackPtSumDCalRC[etaBin][phiBin] + clusESumDCalRC[etaBin][phiBin]) / accRC;
1537 scaleFactor = numerator / denominator;
1538 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEtaPhi", jetCont->GetArrayName().Data());
1539 Double_t x[4] = {etaDCalRC[etaBin], phiDCalRC[phiBin],
fCent, scaleFactor};
1545 Double_t rho = jetCont->GetRhoVal();
1546 Double_t deltaPt = trackPtSumEMCalRC + clusESumEMCalRC - rho * TMath::Pi() * jetR * jetR;
1547 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
1556 rho = sf * jetCont->GetRhoVal();
1558 deltaPt = trackPtSumDCalRC[etaBin][phiBin] + clusESumDCalRC[etaBin][phiBin] - rho * accRC;
1559 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEtaPhi", jetCont->GetArrayName().Data());
1560 Double_t x[4] = {etaDCalRC[etaBin], phiDCalRC[phiBin],
fCent, deltaPt};
1581 jetPt = jetPt * (1 + sf * jet->
NEF());
1589 TString jetContName = jetCont->GetName();
1590 if (jetContName.Contains(
"HardCore")) pT = jet->
Pt();
1603 for(
auto jetCand : jetCont->
accepted()) {
1604 if (!jetCand)
continue;
1608 if ( jetCandPt < leadingJetPt )
continue;
1610 leadingJet = jetCand;
1627 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
1637 Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
1638 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
1690 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1691 TString jetContName = jets->GetName();
1692 if (jetContName.Contains(
"HardCore"))
continue;
1696 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1700 for (
auto jet : jets->
all()) {
1706 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1711 UInt_t rejectionReason = 0;
1712 if (!jets->
AcceptJet(jet, rejectionReason)) {
1713 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1714 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
1722 histname = TString::Format(
"%s/JetHistograms/hCentVsPt", jets->GetArrayName().Data());
1726 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtVsEtaVsPhi", jets->GetArrayName().Data());
1727 Double_t x[6] = {
fCent, jet->Eta(), jet->Phi_0_2pi(), corrPt, jet->NEF(), type};
1731 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1735 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1739 TLorentzVector leadPart;
1742 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
1743 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
1748 histname = TString::Format(
"%s/JetHistograms/hZVsPt", jets->GetArrayName().Data());
1750 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1751 track =
static_cast<AliVTrack*
>(jet->Track(i));
1752 z = track->Pt() / TMath::Abs(corrPt);
1758 histname = TString::Format(
"%s/JetHistograms/hNConstVsPt", jets->GetArrayName().Data());
1759 Double_t a[4] = {
fCent, corrPt, 1.*jet->GetNumberOfConstituents(), type};
1764 histname = TString::Format(
"%s/JetHistograms/hMedPatchJet", jets->GetArrayName().Data());
1785 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1786 TString jetContName = jets->GetName();
1787 if (jetContName.Contains(
"HardCore"))
continue;
1791 histname = TString::Format(
"%s/TriggerSimHistograms/hRhoVsCent", jets->GetArrayName().Data());
1795 for (
auto jet : jets->
all()) {
1801 histname = TString::Format(
"%s/TriggerSimHistograms/hAreaVsPt", jets->GetArrayName().Data());
1806 UInt_t rejectionReason = 0;
1807 if (!jets->
AcceptJet(jet, rejectionReason)) {
1808 histname = TString::Format(
"%s/TriggerSimHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1809 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
1817 histname = TString::Format(
"%s/TriggerSimHistograms/hCentVsPt", jets->GetArrayName().Data());
1821 histname = TString::Format(
"%s/TriggerSimHistograms/hNEFVsPtVsEtaVsPhi", jets->GetArrayName().Data());
1822 Double_t x[6] = {
fCent, jet->Eta(), jet->Phi_0_2pi(), corrPt, jet->NEF(), type};
1826 histname = TString::Format(
"%s/TriggerSimHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1830 TLorentzVector leadPart;
1833 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
1834 histname = TString::Format(
"%s/TriggerSimHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
1839 histname = TString::Format(
"%s/TriggerSimHistograms/hZVsPt", jets->GetArrayName().Data());
1841 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1842 track =
static_cast<AliVTrack*
>(jet->Track(i));
1843 z = track->Pt() / TMath::Abs(corrPt);
1849 histname = TString::Format(
"%s/TriggerSimHistograms/hNConstVsPt", jets->GetArrayName().Data());
1850 Double_t a[4] = {
fCent, corrPt, 1.*jet->GetNumberOfConstituents(), type};
1864 TString histname = TString::Format(
"%s/DijetCandObservables", jets->GetArrayName().Data());
1866 if (!histJetObservables)
return;
1867 for (
Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
1868 TString title(histJetObservables->GetAxis(n)->GetTitle());
1869 if (
title==
"Centrality (%)")
1870 contents[n] =
fCent;
1871 else if (
title==
"LeadingHadronRequired")
1873 else if (
title==
"#it{p}_{T,trig jet} (GeV/#it{c})")
1875 else if (
title==
"#it{p}_{T,ass jet} (GeV/#it{c})")
1877 else if (
title==
"#phi_{trig jet}")
1879 else if (
title==
"#phi_{ass jet}")
1881 else if (
title==
"#eta_{trig jet}")
1883 else if (
title==
"#eta_{ass jet}")
1886 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1888 histJetObservables->Fill(contents);
1899 TString histname = TString::Format(
"%s/DijetImbalanceObservables", jets->GetArrayName().Data());
1901 if (!histJetObservables)
return;
1902 for (
Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
1903 TString title(histJetObservables->GetAxis(n)->GetTitle());
1904 if (
title==
"Centrality (%)")
1905 contents[n] =
fCent;
1906 else if (
title==
"#Delta#phi")
1908 else if (
title==
"#Delta#eta")
1910 else if (
title==
"A_{J}")
1912 else if (
title==
"x_{J}")
1914 else if (
title==
"k_{Ty} (GeV)")
1916 else if (
title==
"N_{tracks, trig jet}")
1918 else if (
title==
"N_{tracks, ass jet}")
1921 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1923 histJetObservables->Fill(contents);
1927 TString histname = TString::Format(
"%s/DijetJetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1935 histname = TString::Format(
"%s/DijetJetHistograms/hNEFVsPt", jets->GetArrayName().Data());
1940 histname = TString::Format(
"%s/DijetJetHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
1941 TLorentzVector leadPart;
1944 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
1949 histname = TString::Format(
"%s/DijetJetHistograms/hZVsPt", jets->GetArrayName().Data());
1952 track =
static_cast<AliVTrack*
>(trigJet->
Track(i));
1959 histname = TString::Format(
"%s/DijetJetHistograms/hNConstVsPt", jets->GetArrayName().Data());
1972 if (!histJetObservables)
return;
1973 for (
Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
1974 TString title(histJetObservables->GetAxis(n)->GetTitle());
1977 else if (
title==
"#Delta#phi")
1978 contents[n] = deltaPhi;
1979 else if (
title==
"#it{p}_{T,particle} (GeV/#it{c})")
1980 contents[n] = trackPt;
1981 else if (
title==
"#it{p}_{T}#parallel (GeV/#it{c})")
1982 contents[n] = balancePt;
1984 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1986 histJetObservables->Fill(contents);
1995 TString histname =
"GeometricalMatchingEfficiency";
2005 TString thnname =
"GeometricalMatching";
2008 if (!histJetObservables)
return;
2009 for (
Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
2010 TString title(histJetObservables->GetAxis(n)->GetTitle());
2011 if (
title==
"Centrality (%)")
2012 contents[n] =
fCent;
2013 else if (
title==
"isSwitched")
2014 contents[n] = isSwitched;
2015 else if (
title==
"#DeltaR_{trig}")
2016 contents[n] = trigDeltaR;
2017 else if (
title==
"#DeltaR_{ass}")
2018 contents[n] = assDeltaR;
2019 else if (
title==
"trig #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}")
2021 else if (
title==
"ass #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}")
2023 else if (
title==
"A_{J} low-threshold")
2025 else if (
title==
"A_{J} hard-core")
2028 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
2030 histJetObservables->Fill(contents);
Double_t fMatchingJetR
jet R for matching study
void AllocateDijetImbalanceHistograms()
AliEmcalJet * GetLeadingJet(AliJetContainer *jetCont)
Double_t GetRhoVal() const
Int_t fNPhiBins
Number of phi bins in DCal region (for background/correction)
const TString & GetRhoName() const
Int_t fNPtHistBins
! number of variable pt bins
void UserCreateOutputObjects()
void AllocateJetHistograms()
Float_t fMaxPt
Histogram pt limit.
AliJetContainer * GetJetContainer(Int_t i=0) const
Double_t * fPtHistBins
! variable pt bins
Bool_t fUseManualEventCuts
Flag to use manual event cuts.
UInt_t fOffTrigger
offline trigger for event selection
Bool_t fUseAliEventCuts
Flag to use AliEventCuts (otherwise AliAnalysisTaskEmcal will be used)
static AliEmcalDownscaleFactorsOCDB * Instance()
const AliClusterIterableMomentumContainer accepted_momentum() const
Int_t fNEtaBins
Number of eta bins in DCal region (for background/correction)
void AllocateGeometricalMatchingHistograms()
void DoMomentumBalance(TString histname)
Container with name, TClonesArray and cuts for particles.
Bool_t fPlotJetHistograms
Set whether to enable inclusive jet histograms.
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.
void SetRun(int runnumber)
TList * fEventCutList
! Output list for event cut histograms
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.
TH2D * fGapJetScalingWeights
Histogram storing eta-phi weights scaling jets near the gap region.
AliVParticle * Track(Int_t idx) const
Double_t fDijetLeadingHadronPt
leading hadron pT threshold for leading jet in dijet
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
void FillDijetCandHistograms(AliJetContainer *jets)
void AllocateBackgroundHistograms()
AliAnalysisTaskEmcalDijetImbalance()
Bool_t fkEMCEJE
! flag telling whether the event is "triggered" or not in "simulation"
Double_t GetDownscaleFactorForTriggerClass(const TString &trigger) const
Double_t fMedianEMCal
! median patch energy in EMCal, per event
Double_t fMedianDCal
! median patch energy in DCal, per event
void FillGeometricalMatchingHistograms()
Double_t fMinAssJetPt
subleading jet min pT in a dijet pair, for it to be accepted
UShort_t GetNumberOfConstituents() const
void SetCaloTriggerPatchInfoName(const char *n)
UShort_t GetNumberOfTracks() const
Bool_t fDoMomentumBalance
Set whether to enable momentum balance study.
void FindDijet(AliJetContainer *jetCont, Int_t leadingHadronCutBin)
Bool_t fPlotDijetImbalanceHistograms
Set whether to enable dijet imbalance histograms.
bool AddQAPlotsToList(TList *list)
AliEventCuts fEventCuts
event selection utility
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
Dijet_t fDijet
! dijet candidate (per event)
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.
void FillDijetImbalanceHistograms(AliJetContainer *jets)
TObject * FindObject(const char *name) const
Find an object inside the container.
Double_t GetJetType(AliEmcalJet *jet)
THashList * GetListOfHistograms() const
Get the list of histograms.
Double_t GetDeltaR(AliEmcalJet *jet1, AliEmcalJet *jet2)
Double_t GetLeadingHadronPt(const AliEmcalJet *jet) const
Double_t fClusterConstituentThreshold
constituent threshold for matching study
Di-jet imbalance analysis with full jets.
AliEMCALGeometry * fGeom
!emcal geometry
UInt_t GetJetAcceptanceType() const
void DoTriggerSimulation()
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.
Bool_t fDoTriggerSimulation
Set whether to perform a simple trigger simulation.
BeamType fForceBeamType
forced beam type
AliClusterContainer * GetClusterContainer(Int_t i=0) const
Get cluster container attached to this task.
Int_t leadingHadronCutType
Double_t fDeltaPhiMin
minimum delta phi between di-jets
Double_t fMBUpscaleFactor
! inverse of downscale factor, for MB trigger
Bool_t fComputeBackground
Set whether to enable study of background.
Double_t Phi_0_2pi() const
std::vector< TString > GetTriggerClasses() const
Double_t fCent
!event centrality
void LoadBackgroundScalingHistogram(const char *path="alien:///alice/cern.ch/user/j/jmulliga/scaleFactorEMCalLHC15o.root", const char *name1="hEtaPhiSFCorrection", const char *name2="hEtaPhiJetPtCorrection")
Double_t GetJetPt(AliJetContainer *jetCont, AliEmcalJet *jet)
void AllocateDijetCandHistograms()
void RunChanged(Int_t run)
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 FillMomentumBalanceHistograms(TString histname, Double_t deltaPhi, Double_t trackPt, Double_t balancePt)
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
THistManager fHistManager
Histogram manager.
AliRhoParameter * GetRhoParameter()
Bool_t fComputeMBDownscaling
Set whether to compute and plot MB downscaling factors.
void RecordEmbeddedEventProperties()
virtual Bool_t IsEventSelected()
Performing event selection.
static Double_t * GenerateFixedBinArray(Int_t n, Double_t min, Double_t max)
void FillTriggerSimHistograms()
AliEmcalList * fOutput
!output list
Bool_t fLoadBackgroundScalingWeights
Flag to load eta-phi weights for full-jet background scale factors.
Handler for downscale factors for various triggers obtained from the OCDB.
TFile * file
TList with histograms for a given trigger.
TClonesArray * fTriggerPatchInfo
!trigger patch info array
Base task in the EMCAL jet framework.
Bool_t fDoGeometricalMatching
Set whether to enable constituent study with geometrical matching.
Represent a jet reconstructed using the EMCal jet framework.
const AliTrackIterableMomentumContainer accepted_momentum() const
Int_t GetRunNumber(TString)
Dijet_t fMatchingDijet
! low-threshold matching dijet, for matching study
TH2D * fBackgroundScalingWeights
Histogram storing eta-phi weights for full-jet background scale factors.
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
Main initialization function on the worker.
AliEmcalEmbeddingQA fEmbeddingQA
! QA hists for embedding (will only be added if embedding)
const AliJetIterableContainer accepted() const
Double_t fTrackConstituentThreshold
constituent threshold for matching study
Double_t * fCentHistBins
! cent bins
DCal acceptance – spans ONLY DCal (no PHOS or gap)
void FindMatchingDijet(AliJetContainer *jetCont)
Int_t fNCentHistBins
! number of cent bins
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.
Double_t fMinTrigJetPt
leading jet min pT in a dijet pair
Container structure for EMCAL clusters.
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
virtual ~AliAnalysisTaskEmcalDijetImbalance()
Container for jet within the EMCAL jet framework.
void DoGeometricalMatching()
Bool_t fPlotDijetCandHistograms
Set whether to enable dijet pair histograms.
void AllocateMomentumBalanceHistograms()
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.
void AllocateTriggerSimHistograms()
const AliJetIterableContainer all() const
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()