18 #include <TClonesArray.h>
23 #include <THnSparse.h>
28 #include <AliVCluster.h>
29 #include <AliVParticle.h>
38 #include "AliEMCALGeometry.h"
40 #include "AliPHOSGeometry.h"
41 #include "AliOADBContainer.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),
102 fUseManualEventCuts(kFALSE),
103 fUseAliEventCuts(kTRUE),
107 fDijetLeadingHadronPt(0),
113 fPlotJetHistograms(kFALSE),
114 fPlotDijetCandHistograms(kFALSE),
115 fPlotDijetImbalanceHistograms(kFALSE),
116 fComputeBackground(kFALSE),
117 fDoMomentumBalance(kFALSE),
118 fDoGeometricalMatching(kFALSE),
120 fTrackConstituentThreshold(0),
121 fClusterConstituentThreshold(0),
122 fMBUpscaleFactor(1.),
125 fLoadBackgroundScalingWeights(kTRUE),
126 fBackgroundScalingWeights(0),
127 fGapJetScalingWeights(0),
128 fComputeMBDownscaling(kFALSE),
129 fDoCaloStudy(kFALSE),
185 while ((obj = next())) {
227 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
230 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
231 title = histname +
";Rejection reason;#it{p}_{T,jet} (GeV/#it{c});counts";
237 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
238 title = histname +
";Centrality (%);#rho (GeV/#it{c});counts";
243 histname = TString::Format(
"%s/JetHistograms/hCentVsPt", jets->GetArrayName().Data());
244 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});Centrality (%);counts";
248 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtVsEtaVsPhi", jets->GetArrayName().Data());
249 title = histname +
";#eta_{jet} (rad);#phi_{jet} (rad);#it{p}_{T}^{corr} (GeV/#it{c});NEF";
256 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
257 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c})";
261 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
262 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{p}_{T,particle}^{leading} (GeV/#it{c})";
266 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
267 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{A}_{jet}";
271 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
272 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}_{leading}";
276 histname = TString::Format(
"%s/JetHistograms/hZVsPt", jets->GetArrayName().Data());
277 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});#it{z}";
281 histname = TString::Format(
"%s/JetHistograms/hNConstVsPt", jets->GetArrayName().Data());
282 title = histname +
";#it{p}_{T}^{corr} (GeV/#it{c});No. of constituents";
288 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jets->GetArrayName().Data());
289 title = histname +
";Centrality;Scale factor;counts";
292 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jets->GetArrayName().Data());
293 title = histname +
";Centrality (%);#delta#it{p}_{T} (GeV/#it{c});counts";
296 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEtaPhi", jets->GetArrayName().Data());
297 title = histname +
";#eta;#phi;Centrality;Scale factor;";
300 Double_t max[4] = {0.5,6., 100, 20};
303 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEtaPhi", jets->GetArrayName().Data());
304 title = histname +
";#eta;#phi;Centrality;#delta#it{p}_{T} (GeV/#it{c})";
306 Double_t minDpT[4] = {-0.5,1., 0, -50};
307 Double_t maxDpT[4] = {0.5,6., 100, 150};
316 histname =
"Trigger/hMBDownscaleFactor";
317 title = histname +
";Downscale factor;counts";
333 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
342 axisTitle[dim] =
"Centrality (%)";
350 axisTitle[dim] =
"LeadingHadronRequired";
357 axisTitle[dim] =
"#it{p}_{T,trig jet} (GeV/#it{c})";
358 nbins[dim] = TMath::CeilNint(
fMaxPt/2);
364 axisTitle[dim] =
"#it{p}_{T,ass jet} (GeV/#it{c})";
365 nbins[dim] = TMath::CeilNint(
fMaxPt/2);
371 axisTitle[dim] =
"#phi_{trig jet}";
372 nbins[dim] = TMath::CeilNint(
fMaxPt/2);
374 max[dim] = TMath::TwoPi();
378 axisTitle[dim] =
"#phi_{ass jet}";
379 nbins[dim] = TMath::CeilNint(
fMaxPt/2);
381 max[dim] = TMath::TwoPi();
385 axisTitle[dim] =
"#eta_{trig jet}";
386 nbins[dim] = TMath::CeilNint(
fMaxPt/2);
392 axisTitle[dim] =
"#eta_{ass jet}";
393 nbins[dim] = TMath::CeilNint(
fMaxPt/2);
399 TString thnname = TString::Format(
"%s/DijetCandObservables", jets->GetArrayName().Data());
401 for (
Int_t i = 0; i < dim; i++) {
402 hn->GetAxis(i)->SetTitle(axisTitle[i]);
403 hn->SetBinEdges(i, binEdges[i]);
417 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
426 axisTitle[dim] =
"Centrality (%)";
434 axisTitle[dim] =
"#Delta#phi";
441 axisTitle[dim] =
"#Delta#eta";
448 axisTitle[dim] =
"A_{J}";
455 axisTitle[dim] =
"x_{J}";
462 axisTitle[dim] =
"k_{Ty} (GeV)";
469 axisTitle[dim] =
"N_{tracks, trig jet}";
476 axisTitle[dim] =
"N_{tracks, ass jet}";
483 TString thnname = TString::Format(
"%s/DijetImbalanceObservables", jets->GetArrayName().Data());
485 for (
Int_t i = 0; i < dim; i++) {
486 hn->GetAxis(i)->SetTitle(axisTitle[i]);
487 hn->SetBinEdges(i, binEdges[i]);
499 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
509 axisTitle[dim] =
"A_{J}";
516 axisTitle[dim] =
"#Delta#phi";
523 axisTitle[dim] =
"#it{p}_{T,particle} (GeV/#it{c})";
533 max[dim] = pTParticleBins[nbins[dim]];
534 binEdges[dim] = pTParticleBins;
537 axisTitle[dim] =
"#it{p}_{T}#parallel (GeV/#it{c})";
546 max[dim] = pTParallelBins[nbins[dim]];
547 binEdges[dim] = pTParallelBins;
550 TString thnname = TString::Format(
"%s/MomentumBalance", jets->GetArrayName().Data());
552 for (
Int_t i = 0; i < dim; i++) {
553 hn->GetAxis(i)->SetTitle(axisTitle[i]);
554 hn->SetBinEdges(i, binEdges[i]);
573 axisTitle[dim] =
"Centrality (%)";
581 axisTitle[dim] =
"isSwitched";
588 axisTitle[dim] =
"#DeltaR_{trig}";
595 axisTitle[dim] =
"#DeltaR_{ass}";
602 axisTitle[dim] =
"trig #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}";
609 axisTitle[dim] =
"ass #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}";
616 axisTitle[dim] =
"A_{J} low-threshold";
623 axisTitle[dim] =
"A_{J} hard-core";
630 TString thnname =
"GeometricalMatching";
632 for (
Int_t i = 0; i < dim; i++) {
633 hn->GetAxis(i)->SetTitle(axisTitle[i]);
634 hn->SetBinEdges(i, binEdges[i]);
640 histname =
"GeometricalMatchingEfficiency";
641 title = histname +
";isMatched;counts";
655 const Int_t nRejBins = 32;
659 AliEmcalContainer* cont = 0;
661 while ((cont = static_cast<AliEmcalContainer*>(nextClusColl()))) {
664 histname = TString::Format(
"%s/hClusterRejectionReasonEMCal", cont->GetArrayName().Data());
665 htitle = histname +
";Rejection reason;#it{E}_{clus} (GeV/)";
669 histname = TString::Format(
"%s/hClusterRejectionReasonPHOS", cont->GetArrayName().Data());
670 htitle = histname +
";Rejection reason;#it{E}_{clus} (GeV/)";
675 const Int_t nEmcalSM = 20;
676 for (
Int_t sm = 0; sm < nEmcalSM; sm++) {
677 histname = TString::Format(
"%s/BySM/hEmcalClusEnergy_SM%d", cont->GetArrayName().Data(), sm);
678 htitle = histname +
";#it{E}_{cluster} (GeV);counts";
682 for (
Int_t sm = 1; sm < 5; sm++) {
683 histname = TString::Format(
"%s/BySM/hPhosClusEnergy_SM%d", cont->GetArrayName().Data(), sm);
684 htitle = histname +
";#it{E}_{cluster} (GeV);counts";
697 title[dim] =
"Centrality %";
719 title[dim] =
"#it{E}_{clus} (GeV)";
726 title[dim] =
"#it{E}_{clus, hadcorr} (GeV)";
733 title[dim] =
"#it{E}_{core} (GeV)";
740 title[dim] =
"Matched track";
754 title[dim] =
"Ncells";
761 TString thnname = TString::Format(
"%s/clusterObservables", cont->GetArrayName().Data());
763 for (
Int_t i = 0; i < dim; i++) {
764 hn->GetAxis(i)->SetTitle(title[i]);
765 hn->SetBinEdges(i, binEdges[i]);
772 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
775 Int_t nbinsJet[30] = {0};
782 axisTitle[dimJet] =
"Centrality (%)";
790 axisTitle[dimJet] =
"#eta_{jet}";
791 nbinsJet[dimJet] = 28;
792 minJet[dimJet] = -0.7;
793 maxJet[dimJet] = 0.7;
797 axisTitle[dimJet] =
"#phi_{jet} (rad)";
798 nbinsJet[dimJet] = 100;
804 axisTitle[dimJet] =
"#it{E}_{T} (GeV)";
811 axisTitle[dimJet] =
"#rho (GeV/#it{c})";
812 nbinsJet[dimJet] = 100;
814 maxJet[dimJet] = 1000.;
818 axisTitle[dimJet] =
"N_{clusters}";
819 nbinsJet[dimJet] = 20;
820 minJet[dimJet] = -0.5;
821 maxJet[dimJet] = 19.5;
825 TString thnname = TString::Format(
"%s/hClusterJetObservables", jets->GetArrayName().Data());
827 for (
Int_t i = 0; i < dimJet; i++) {
828 hn->GetAxis(i)->SetTitle(axisTitle[i]);
829 hn->SetBinEdges(i, binEdgesJet[i]);
837 histname = TString::Format(
"Cells/hCellEnergyAll");
838 htitle = histname +
";#it{E}_{cell} (GeV);Centrality (%); Cluster type";
842 histname = TString::Format(
"Cells/hCellEnergyAccepted");
843 htitle = histname +
";#it{E}_{cell} (GeV);Centrality (%); Cluster type";
847 histname = TString::Format(
"Cells/hCellEnergyLeading");
848 htitle = histname +
";#it{E}_{cell} (GeV);Centrality (%); Cluster type";
852 const Int_t nEmcalSM = 20;
853 for (
Int_t sm = 0; sm < nEmcalSM; sm++) {
854 histname = TString::Format(
"Cells/BySM/hEmcalPatchEnergy_SM%d", sm);
855 htitle = histname +
";#it{E}_{cell patch} (GeV);Centrality (%)";
859 for (
Int_t sm = 1; sm < 5; sm++) {
860 histname = TString::Format(
"Cells/BySM/hPhosPatchEnergy_SM%d", sm);
861 htitle = histname +
";#it{E}_{cell patch} (GeV);Centrality (%)";
874 if (fname.BeginsWith(
"alien://")) {
875 TGrid::Connect(
"alien://");
878 TFile*
file = TFile::Open(path);
880 if (!file || file->IsZombie()) {
881 ::Error(
"AliAnalysisTaskEmcalDijetImbalance",
"Could not open background scaling histogram");
885 TH1D* h =
dynamic_cast<TH1D*
>(file->Get(name));
888 ::Info(
"AliAnalysisTaskEmcalDijetImbalance::LoadBackgroundScalingHistogram",
"Background histogram %s loaded from file %s.", name, path);
891 ::Error(
"AliAnalysisTaskEmcalDijetImbalance::LoadBackgroundScalingHistogram",
"Background histogram %s not found in file %s.", name, path);
914 fPHOSGeo = AliPHOSGeometry::GetInstance();
916 AliInfo(
"Found instance of PHOS geometry!");
919 AliInfo(
"Creating PHOS geometry!");
920 Int_t runNum = InputEvent()->GetRunNumber();
922 fPHOSGeo = AliPHOSGeometry::GetInstance(
"IHEP");
924 fPHOSGeo = AliPHOSGeometry::GetInstance(
"Run2");
927 AliOADBContainer geomContainer(
"phosGeo");
928 geomContainer.InitFromFile(
"$ALICE_PHYSICS/OADB/PHOS/PHOSMCGeometry.root",
"PHOSMCRotationMatrixes");
929 TObjArray* matrixes = (
TObjArray*)geomContainer.GetObject(runNum,
"PHOSRotationMatrixes");
930 for(
Int_t mod=0; mod<6; mod++) {
931 if(!matrixes->At(mod))
continue;
932 fPHOSGeo->SetMisalMatrix(((TGeoHMatrix*)matrixes->At(mod)),mod);
933 printf(
".........Adding Matrix(%d), geo=%p\n",mod,
fPHOSGeo);
934 ((TGeoHMatrix*)matrixes->At(mod))->
Print();
961 TString triggerNameMB1 =
"CINT7-B-NOPF-CENT";
962 TString triggerNameMB2 =
"CV0L7-B-NOPF-CENT";
963 TString triggerNameJE =
"CINT7EJ1-B-NOPF-CENTNOPMD";
968 for (
auto i : runtriggers) {
969 if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
978 TString histname =
"Trigger/hMBDownscaleFactor";
1015 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
1016 TString jetContName = jetCont->GetName();
1017 if (jetContName.Contains(
"HardCore"))
continue;
1025 for (
Int_t leadingHadronCutType=0; leadingHadronCutType<2; leadingHadronCutType++) {
1028 FindDijet(jetCont, leadingHadronCutType);
1032 TString histname = TString::Format(
"%s/DijetCandObservables", jetCont->GetArrayName().Data());
1046 TString histname = TString::Format(
"%s/DijetImbalanceObservables", jetCont->GetArrayName().Data());
1052 histname = TString::Format(
"%s/MomentumBalance", jetCont->GetArrayName().Data());
1080 if(!trigJet)
return;
1097 for(
auto assJetCand : jetCont->
accepted()) {
1098 if (!assJetCand)
continue;
1100 if ( TMath::Abs(trigJet->
Phi() - assJetCand->Phi()) <
fDeltaPhiMin )
continue;
1103 if ( assJetCandPt < assJetPt )
continue;
1105 assJet = assJetCand;
1107 if (!assJet)
return;
1135 track = trackIterator.second;
1145 Double_t deltaPhiTrigJet = TMath::Abs(trackPhi - trigJetPhi);
1146 Double_t deltaPhiAssJet = TMath::Abs(trackPhi - assJetPhi);
1147 Bool_t isNearside = deltaPhiTrigJet < deltaPhiAssJet;
1152 deltaPhi = trackPhi - trigJetPhi;
1153 balancePt = trackPt * TMath::Cos(deltaPhi);
1156 deltaPhi = trackPhi - assJetPhi;
1157 balancePt = -trackPt * TMath::Cos(deltaPhi);
1171 TString jetContAllName = Form(
"Jet_AKTFullR0%d0_tracks_pT0150_caloClusters_E0300_pt_scheme", (
int) (
fMatchingJetR*10) );
1177 TString jetContHardCoreName = Form(
"JetHardCore_AKTFullR0%d0_tracks_pT%d_caloClusters_E%d_pt_scheme", (
int) (
fMatchingJetR*10), trackThreshold, clusThreshold);
1198 for(
auto matchingTrigJetCand : jetCont->
accepted()) {
1199 if (!matchingTrigJetCand)
continue;
1201 if (matchingTrigJet) {
1202 if (
GetJetPt(jetCont, matchingTrigJetCand) <
GetJetPt(jetCont, matchingTrigJet) )
continue;
1204 matchingTrigJet = matchingTrigJetCand;
1206 if (!matchingTrigJet)
return;
1210 for(
auto matchingAssJetCand : jetCont->
accepted()) {
1211 if (!matchingAssJetCand)
continue;
1213 if (matchingAssJet) {
1214 if (
GetJetPt(jetCont, matchingAssJetCand) <
GetJetPt(jetCont, matchingAssJet) )
continue;
1216 matchingAssJet = matchingAssJetCand;
1220 if (matchingAssJet) {
1223 if (
GetJetPt(jetCont, matchingTrigJet) <
GetJetPt(jetCont, matchingAssJet) ) {
1264 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
1265 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
1266 Double_t phiMinDCal =
fGeom->GetDCALPhiMin() * TMath::DegToRad();
1267 Double_t phiMaxDCal =
fGeom->GetDCALPhiMax() * TMath::DegToRad();
1268 Double_t phiMinPHOS = 250 * TMath::DegToRad();
1269 Double_t phiMaxPHOS = 320 * TMath::DegToRad();
1271 Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
1272 Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
1273 Double_t accDCalRegion = 2 * etaEMCal * (phiMaxDCal - phiMinDCal);
1276 TRandom3* r =
new TRandom3(0);
1278 Double_t accRC = TMath::Pi() * jetR * jetR;
1279 Double_t etaEMCalfid = etaEMCal - jetR;
1280 Double_t phiMinEMCalfid = phiMinEMCal + jetR;
1281 Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
1282 Double_t phiMinDCalRegionfid = phiMinDCal + jetR;
1283 Double_t phiMaxDCalRegionfid = phiMaxDCal - jetR;
1286 Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
1287 Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
1295 etaMin = -etaEMCalfid + etaBin*etaStep;
1296 etaMax = etaMin + etaStep;
1297 etaDCalRC[etaBin] = r->Uniform(etaMin, etaMax);
1305 phiMin = 1 + phiBin*phiStep;
1306 phiMax = phiMin + phiStep;
1307 phiDCalRC[phiBin] = r->Uniform(phiMin, phiMax);
1318 std::vector<std::vector<Double_t>> trackPtSumDCalRC(fNEtaBins, std::vector<Double_t>(fNPhiBins));
1319 std::vector<std::vector<Double_t>> clusESumDCalRC(fNEtaBins, std::vector<Double_t>(fNPhiBins));
1333 track = trackIterator.first;
1334 trackEta = track.Eta();
1336 trackPt = track.Pt();
1339 if (TMath::Abs(trackEta) < etaTPC) {
1340 trackPtSumTPC += trackPt;
1344 if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
1345 trackPtSumEMCal += trackPt;
1349 deltaR =
GetDeltaR(&track, etaEMCalRC, phiEMCalRC);
1350 if (deltaR < jetR) {
1351 trackPtSumEMCalRC += trackPt;
1357 deltaR =
GetDeltaR(&track, etaDCalRC[etaBin], phiDCalRC[phiBin]);
1358 if (deltaR < jetR) {
1359 trackPtSumDCalRC[etaBin][phiBin] += trackPt;
1376 clus = clusIterator.first;
1377 clusEta = clus.Eta();
1382 if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
1383 clusESumEMCal += clusE;
1387 deltaR =
GetDeltaR(&clus, etaEMCalRC, phiEMCalRC);
1388 if (deltaR < jetR) {
1389 clusESumEMCalRC += clusE;
1395 deltaR =
GetDeltaR(&clus, etaDCalRC[etaBin], phiDCalRC[phiBin]);
1396 if (deltaR < jetR) {
1397 clusESumDCalRC[etaBin][phiBin] += clusE;
1405 Double_t numerator = (trackPtSumEMCal + clusESumEMCal) / accEMCal;
1406 Double_t denominator = trackPtSumTPC / accTPC;
1407 Double_t scaleFactor = numerator / denominator;
1408 TString histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
1414 numerator = (trackPtSumDCalRC[etaBin][phiBin] + clusESumDCalRC[etaBin][phiBin]) / accRC;
1415 scaleFactor = numerator / denominator;
1416 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEtaPhi", jetCont->GetArrayName().Data());
1417 Double_t x[4] = {etaDCalRC[etaBin], phiDCalRC[phiBin],
fCent, scaleFactor};
1424 Double_t deltaPt = trackPtSumEMCalRC + clusESumEMCalRC - rho * TMath::Pi() * jetR * jetR;
1425 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
1436 deltaPt = trackPtSumDCalRC[etaBin][phiBin] + clusESumDCalRC[etaBin][phiBin] - rho * accRC;
1437 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEtaPhi", jetCont->GetArrayName().Data());
1438 Double_t x[4] = {etaDCalRC[etaBin], phiDCalRC[phiBin],
fCent, deltaPt};
1465 TString jetContName = jetCont->GetName();
1466 if (jetContName.Contains(
"HardCore")) pT = jet->
Pt();
1479 for(
auto jetCand : jetCont->
accepted()) {
1480 if (!jetCand)
continue;
1484 if ( jetCandPt < leadingJetPt )
continue;
1486 leadingJet = jetCand;
1503 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
1513 Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
1514 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
1541 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1542 TString jetContName = jets->GetName();
1543 if (jetContName.Contains(
"HardCore"))
continue;
1547 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1551 for (
auto jet : jets->
all()) {
1557 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1562 UInt_t rejectionReason = 0;
1563 if (!jets->
AcceptJet(jet, rejectionReason)) {
1564 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1565 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
1570 histname = TString::Format(
"%s/JetHistograms/hCentVsPt", jets->GetArrayName().Data());
1574 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtVsEtaVsPhi", jets->GetArrayName().Data());
1575 Double_t x[4] = {jet->Eta(), jet->Phi_0_2pi(), corrPt, jet->NEF()};
1579 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1583 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1587 TLorentzVector leadPart;
1590 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
1591 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
1595 histname = TString::Format(
"%s/JetHistograms/hZVsPt", jets->GetArrayName().Data());
1597 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1598 track =
static_cast<AliVTrack*
>(jet->Track(i));
1599 z = track->Pt() / TMath::Abs(corrPt);
1604 histname = TString::Format(
"%s/JetHistograms/hNConstVsPt", jets->GetArrayName().Data());
1622 if (!histJetObservables)
return;
1623 for (
Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
1624 TString title(histJetObservables->GetAxis(n)->GetTitle());
1625 if (
title==
"Centrality (%)")
1626 contents[n] =
fCent;
1627 else if (
title==
"LeadingHadronRequired")
1629 else if (
title==
"#it{p}_{T,trig jet} (GeV/#it{c})")
1631 else if (
title==
"#it{p}_{T,ass jet} (GeV/#it{c})")
1633 else if (
title==
"#phi_{trig jet}")
1635 else if (
title==
"#phi_{ass jet}")
1637 else if (
title==
"#eta_{trig jet}")
1639 else if (
title==
"#eta_{ass jet}")
1642 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1644 histJetObservables->Fill(contents);
1654 if (!histJetObservables)
return;
1655 for (
Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
1656 TString title(histJetObservables->GetAxis(n)->GetTitle());
1657 if (
title==
"Centrality (%)")
1658 contents[n] =
fCent;
1659 else if (
title==
"#Delta#phi")
1661 else if (
title==
"#Delta#eta")
1663 else if (
title==
"A_{J}")
1665 else if (
title==
"x_{J}")
1667 else if (
title==
"k_{Ty} (GeV)")
1669 else if (
title==
"N_{tracks, trig jet}")
1671 else if (
title==
"N_{tracks, ass jet}")
1674 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1676 histJetObservables->Fill(contents);
1686 if (!histJetObservables)
return;
1687 for (
Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
1688 TString title(histJetObservables->GetAxis(n)->GetTitle());
1691 else if (
title==
"#Delta#phi")
1692 contents[n] = deltaPhi;
1693 else if (
title==
"#it{p}_{T,particle} (GeV/#it{c})")
1694 contents[n] = trackPt;
1695 else if (
title==
"#it{p}_{T}#parallel (GeV/#it{c})")
1696 contents[n] = balancePt;
1698 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1700 histJetObservables->Fill(contents);
1709 TString histname =
"GeometricalMatchingEfficiency";
1719 TString thnname =
"GeometricalMatching";
1722 if (!histJetObservables)
return;
1723 for (
Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
1724 TString title(histJetObservables->GetAxis(n)->GetTitle());
1725 if (
title==
"Centrality (%)")
1726 contents[n] =
fCent;
1727 else if (
title==
"isSwitched")
1728 contents[n] = isSwitched;
1729 else if (
title==
"#DeltaR_{trig}")
1730 contents[n] = trigDeltaR;
1731 else if (
title==
"#DeltaR_{ass}")
1732 contents[n] = assDeltaR;
1733 else if (
title==
"trig #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}")
1735 else if (
title==
"ass #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}")
1737 else if (
title==
"A_{J} low-threshold")
1739 else if (
title==
"A_{J} hard-core")
1742 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1744 histJetObservables->Fill(contents);
1767 AliVCaloCells* phosCaloCells = InputEvent()->GetPHOSCells();
1772 while ((clusters = static_cast<AliClusterContainer*>(nextClusColl()))) {
1778 if (it->second->IsEMCAL()) {
1779 Double_t phi = it->first.Phi_0_2pi();
1783 }
else if (isDcal == 1) {
1786 }
else if (it->second->GetType() == AliVCluster::kPHOSNeutral){
1791 if (it->second->IsEMCAL()) {
1792 histname = TString::Format(
"%s/hClusterRejectionReasonEMCal", clusters->GetArrayName().Data());
1793 UInt_t rejectionReason = 0;
1794 if (!clusters->
AcceptCluster(it.current_index(), rejectionReason)) {
1795 fHistManager.
FillTH2(histname, clusters->GetRejectionReasonBitPosition(rejectionReason), it->first.E());
1798 }
else if (it->second->GetType() == AliVCluster::kPHOSNeutral){
1799 histname = TString::Format(
"%s/hClusterRejectionReasonPHOS", clusters->GetArrayName().Data());
1800 UInt_t rejectionReason = 0;
1801 if (!clusters->
AcceptCluster(it.current_index(), rejectionReason)) {
1802 fHistManager.
FillTH2(histname, clusters->GetRejectionReasonBitPosition(rejectionReason), it->first.E());
1813 if (it->second->IsEMCAL()) {
1815 Ehadcorr = it->second->GetHadCorrEnergy();
1816 Enonlin = it->second->GetNonLinCorrEnergy();
1819 Int_t sm =
fGeom->GetSuperModuleNumber(it->second->GetCellAbsId(0));
1820 if (sm >=0 && sm < 20) {
1821 histname = TString::Format(
"%s/BySM/hEmcalClusEnergy_SM%d", clusters->GetArrayName().Data(), sm);
1825 AliError(Form(
"Supermodule %d does not exist!", sm));
1829 histname = TString::Format(
"Cells/hCellEnergyAccepted");
1831 for (
Int_t iCell = 0; iCell < it->second->GetNCells(); iCell++){
1832 absId = it->second->GetCellAbsId(iCell);
1835 if (ecell > leadEcell) {
1840 histname = TString::Format(
"Cells/hCellEnergyLeading");
1843 }
else if (it->second->GetType() == AliVCluster::kPHOSNeutral){
1845 Ehadcorr = it->second->E();
1846 Enonlin = it->second->E();
1847 Ecore = it->second->GetCoreEnergy();
1851 fPHOSGeo->AbsToRelNumbering(it->second->GetCellAbsId(0), relid);
1852 Int_t sm = relid[0];
1853 if (sm >=1 && sm < 5) {
1854 histname = TString::Format(
"%s/BySM/hPhosClusEnergy_SM%d", clusters->GetArrayName().Data(), sm);
1858 AliError(Form(
"Supermodule %d does not exist!", sm));
1863 histname = TString::Format(
"Cells/hCellEnergyAccepted");
1865 for (
Int_t iCell = 0; iCell < it->second->GetNCells(); iCell++){
1866 absId = it->second->GetCellAbsId(iCell);
1867 ecell = phosCaloCells->GetCellAmplitude(absId);
1869 if (ecell > leadEcell) {
1874 histname = TString::Format(
"Cells/hCellEnergyLeading");
1879 Int_t hasMatchedTrack = -1;
1880 Int_t nMatchedTracks = it->second->GetNTracksMatched();
1881 if (nMatchedTracks == 0) {
1882 hasMatchedTrack = 0;
1883 }
else if (nMatchedTracks > 0) {
1884 hasMatchedTrack = 1;
1888 histname = TString::Format(
"%s/clusterObservables", clusters->GetArrayName().Data());
1890 if (!histClusterObservables)
return;
1891 for (
Int_t i = 0; i < histClusterObservables->GetNdimensions(); i++) {
1892 TString title(histClusterObservables->GetAxis(i)->GetTitle());
1893 if (
title==
"Centrality %")
1894 contents[i] =
fCent;
1895 else if (
title==
"#eta")
1896 contents[i] = it->first.Eta();
1897 else if (
title==
"#phi")
1898 contents[i] = it->first.Phi_0_2pi();
1899 else if (
title==
"#it{E}_{clus} (GeV)")
1900 contents[i] = Enonlin;
1901 else if (
title==
"#it{E}_{clus, hadcorr} (GeV)")
1902 contents[i] = Ehadcorr;
1903 else if (
title==
"#it{E}_{core} (GeV)")
1904 contents[i] = Ecore;
1905 else if (
title==
"Matched track")
1906 contents[i] = hasMatchedTrack;
1907 else if (
title==
"M02")
1908 contents[i] = it->second->GetM02();
1909 else if (
title==
"Ncells")
1910 contents[i] = it->second->GetNCells();
1912 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1914 histClusterObservables->Fill(contents);
1923 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1925 for (
auto jet : jets->
accepted()) {
1928 histname = TString::Format(
"%s/hClusterJetObservables", jets->GetArrayName().Data());
1930 if (!histJetObservables)
return;
1931 for (
Int_t i = 0; i < histJetObservables->GetNdimensions(); i++) {
1932 TString title(histJetObservables->GetAxis(i)->GetTitle());
1933 if (
title==
"Centrality (%)")
1934 contents[i] =
fCent;
1935 else if (
title==
"#eta_{jet}")
1936 contents[i] = jet->Eta();
1937 else if (
title==
"#phi_{jet} (rad)")
1938 contents[i] = jet->Phi_0_2pi();
1939 else if (
title==
"#it{E}_{T} (GeV)")
1940 contents[i] = jet->Pt();
1941 else if (
title==
"#rho (GeV/#it{c})")
1942 contents[i] = jet->Pt() / jet->Area();
1943 else if (
title==
"N_{clusters}")
1944 contents[i] = jet->GetNumberOfClusters();
1946 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1948 histJetObservables->Fill(contents);
1965 histname = TString::Format(
"Cells/hCellEnergyAll");
1969 sm =
fGeom->GetSuperModuleNumber(absId);
1970 if (sm >=0 && sm < 20) {
1971 patchSumEMCal[sm] += ecell;
1976 for (
Int_t i=0; i<phosCaloCells->GetNumberOfCells(); i++) {
1978 absId = phosCaloCells->GetCellNumber(i);
1979 ecell = phosCaloCells->GetCellAmplitude(absId);
1982 histname = TString::Format(
"Cells/hCellEnergyAll");
1986 fPHOSGeo->AbsToRelNumbering(absId, relid);
1988 if (sm >=1 && sm < 5) {
1989 patchSumPHOS[sm-1] += ecell;
1994 for (
Int_t sm = 0; sm < 20; sm++) {
1995 histname = TString::Format(
"Cells/BySM/hEmcalPatchEnergy_SM%d", sm);
1999 for (
Int_t sm = 1; sm < 5; sm++) {
2000 histname = TString::Format(
"Cells/BySM/hPhosPatchEnergy_SM%d", sm);
Double_t fMatchingJetR
jet R for matching study
void AllocateDijetImbalanceHistograms()
AliEmcalJet * GetLeadingJet(AliJetContainer *jetCont)
void Print(std::ostream &o, const char *name, Double_t dT, Double_t dVM, Double_t alldT, Double_t alldVM)
TObjArray fClusterCollArray
cluster collection array
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 FillCaloHistograms()
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)
bidirectional stl iterator over the EMCAL iterable container
void AllocateCaloHistograms()
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.
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(TString histname)
AliAnalysisTaskEmcalDijetImbalance()
Double_t GetDownscaleFactorForTriggerClass(const TString &trigger) const
void FillGeometricalMatchingHistograms()
Double_t fMinAssJetPt
subleading jet min pT in a dijet pair, for it to be accepted
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.
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="")
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.
TObject * FindObject(const char *name) const
Find an object inside the container.
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
Double_t Phi_0_2pi() const
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.
virtual Bool_t AcceptCluster(Int_t i, UInt_t &rejectionReason) const
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
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.
void FillDijetImbalanceHistograms(TString histname)
AliVCaloCells * fCaloCells
!cells
AliRhoParameter * GetRhoParameter()
Bool_t fComputeMBDownscaling
Set whether to compute and plot MB downscaling factors.
const AliClusterIterableMomentumContainer all_momentum() const
virtual Bool_t IsEventSelected()
Performing event selection.
static Double_t * GenerateFixedBinArray(Int_t n, Double_t min, Double_t max)
Float_t GetJetRadius() const
AliEmcalList * fOutput
!output list
Bool_t fLoadBackgroundScalingWeights
Flag to load eta-phi weights for full-jet background scale factors.
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
Handler for downscale factors for various triggers obtained from the OCDB.
TFile * file
TList with histograms for a given trigger.
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
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
Main initialization function on the worker.
const AliJetIterableContainer accepted() const
Double_t fTrackConstituentThreshold
constituent threshold for matching study
Double_t * fCentHistBins
! cent bins
TH1D * fBackgroundScalingWeights
Histogram storing eta-phi weights for full-jet background scale factors.
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
void ComputeBackground(AliJetContainer *jetCont)
Container structure for EMCAL clusters.
Bool_t fNeedEmcalGeom
whether or not the task needs the emcal geometry
AliPHOSGeometry * fPHOSGeo
! phos 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 LoadBackgroundScalingHistogram(const char *path="alien:///alice/cern.ch/user/j/jmulliga/BackgroundScalingWeights.root", const char *name="hBackgroundScalingWeights")
Bool_t fDoCaloStudy
Set whether to perform calorimeter detector study.
const AliJetIterableContainer all() const
static Double_t fgkEMCalDCalPhiDivide
phi value used to distinguish between DCal and EMCal