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 %";
705 title[dim] =
"cluster type";
712 title[dim] =
"#it{E}_{clus} (GeV)";
719 title[dim] =
"#it{E}_{clus, hadcorr} (GeV)";
726 title[dim] =
"Matched track";
740 title[dim] =
"Ncells";
747 TString thnname = TString::Format(
"%s/clusterObservables", cont->GetArrayName().Data());
749 for (
Int_t i = 0; i < dim; i++) {
750 hn->GetAxis(i)->SetTitle(title[i]);
751 hn->SetBinEdges(i, binEdges[i]);
758 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
761 Int_t nbinsJet[30] = {0};
768 axisTitle[dimJet] =
"Centrality (%)";
776 axisTitle[dimJet] =
"#eta_{jet}";
777 nbinsJet[dimJet] = 28;
778 minJet[dimJet] = -0.7;
779 maxJet[dimJet] = 0.7;
783 axisTitle[dimJet] =
"#phi_{jet} (rad)";
784 nbinsJet[dimJet] = 100;
790 axisTitle[dimJet] =
"#it{E}_{T} (GeV)";
797 axisTitle[dimJet] =
"N_{clusters}";
798 nbinsJet[dimJet] = 20;
799 minJet[dimJet] = -0.5;
800 maxJet[dimJet] = 19.5;
804 TString thnname = TString::Format(
"%s/hClusterJetObservables", jets->GetArrayName().Data());
806 for (
Int_t i = 0; i < dimJet; i++) {
807 hn->GetAxis(i)->SetTitle(axisTitle[i]);
808 hn->SetBinEdges(i, binEdgesJet[i]);
814 histname = TString::Format(
"Cells/hCellEnergy");
815 htitle = histname +
";#it{E}_{cell} (GeV);Centrality (%), Cluster type";
827 if (fname.BeginsWith(
"alien://")) {
828 TGrid::Connect(
"alien://");
831 TFile*
file = TFile::Open(path);
833 if (!file || file->IsZombie()) {
834 ::Error(
"AliAnalysisTaskEmcalDijetImbalance",
"Could not open background scaling histogram");
838 TH1D* h =
dynamic_cast<TH1D*
>(file->Get(name));
841 ::Info(
"AliAnalysisTaskEmcalDijetImbalance::LoadBackgroundScalingHistogram",
"Background histogram %s loaded from file %s.", name, path);
844 ::Error(
"AliAnalysisTaskEmcalDijetImbalance::LoadBackgroundScalingHistogram",
"Background histogram %s not found in file %s.", name, path);
867 fPHOSGeo = AliPHOSGeometry::GetInstance();
869 AliInfo(
"Found instance of PHOS geometry!");
872 AliInfo(
"Creating PHOS geometry!");
873 Int_t runNum = InputEvent()->GetRunNumber();
875 fPHOSGeo = AliPHOSGeometry::GetInstance(
"IHEP");
877 fPHOSGeo = AliPHOSGeometry::GetInstance(
"Run2");
880 AliOADBContainer geomContainer(
"phosGeo");
881 geomContainer.InitFromFile(
"$ALICE_PHYSICS/OADB/PHOS/PHOSMCGeometry.root",
"PHOSMCRotationMatrixes");
882 TObjArray* matrixes = (
TObjArray*)geomContainer.GetObject(runNum,
"PHOSRotationMatrixes");
883 for(
Int_t mod=0; mod<6; mod++) {
884 if(!matrixes->At(mod))
continue;
885 fPHOSGeo->SetMisalMatrix(((TGeoHMatrix*)matrixes->At(mod)),mod);
886 printf(
".........Adding Matrix(%d), geo=%p\n",mod,
fPHOSGeo);
887 ((TGeoHMatrix*)matrixes->At(mod))->
Print();
914 TString triggerNameMB1 =
"CINT7-B-NOPF-CENT";
915 TString triggerNameMB2 =
"CV0L7-B-NOPF-CENT";
916 TString triggerNameJE =
"CINT7EJ1-B-NOPF-CENTNOPMD";
921 for (
auto i : runtriggers) {
922 if (i.EqualTo(triggerNameMB1) || i.EqualTo(triggerNameMB2)) {
931 TString histname =
"Trigger/hMBDownscaleFactor";
968 while ((jetCont = static_cast<AliJetContainer*>(next()))) {
969 TString jetContName = jetCont->GetName();
970 if (jetContName.Contains(
"HardCore"))
continue;
978 for (
Int_t leadingHadronCutType=0; leadingHadronCutType<2; leadingHadronCutType++) {
981 FindDijet(jetCont, leadingHadronCutType);
985 TString histname = TString::Format(
"%s/DijetCandObservables", jetCont->GetArrayName().Data());
999 TString histname = TString::Format(
"%s/DijetImbalanceObservables", jetCont->GetArrayName().Data());
1005 histname = TString::Format(
"%s/MomentumBalance", jetCont->GetArrayName().Data());
1033 if(!trigJet)
return;
1050 for(
auto assJetCand : jetCont->
accepted()) {
1051 if (!assJetCand)
continue;
1053 if ( TMath::Abs(trigJet->
Phi() - assJetCand->Phi()) <
fDeltaPhiMin )
continue;
1056 if ( assJetCandPt < assJetPt )
continue;
1058 assJet = assJetCand;
1060 if (!assJet)
return;
1088 track = trackIterator.second;
1098 Double_t deltaPhiTrigJet = TMath::Abs(trackPhi - trigJetPhi);
1099 Double_t deltaPhiAssJet = TMath::Abs(trackPhi - assJetPhi);
1100 Bool_t isNearside = deltaPhiTrigJet < deltaPhiAssJet;
1105 deltaPhi = trackPhi - trigJetPhi;
1106 balancePt = trackPt * TMath::Cos(deltaPhi);
1109 deltaPhi = trackPhi - assJetPhi;
1110 balancePt = -trackPt * TMath::Cos(deltaPhi);
1124 TString jetContAllName = Form(
"Jet_AKTFullR0%d0_tracks_pT0150_caloClusters_E0300_pt_scheme", (
int) (
fMatchingJetR*10) );
1130 TString jetContHardCoreName = Form(
"JetHardCore_AKTFullR0%d0_tracks_pT%d_caloClusters_E%d_pt_scheme", (
int) (
fMatchingJetR*10), trackThreshold, clusThreshold);
1151 for(
auto matchingTrigJetCand : jetCont->
accepted()) {
1152 if (!matchingTrigJetCand)
continue;
1154 if (matchingTrigJet) {
1155 if (
GetJetPt(jetCont, matchingTrigJetCand) <
GetJetPt(jetCont, matchingTrigJet) )
continue;
1157 matchingTrigJet = matchingTrigJetCand;
1159 if (!matchingTrigJet)
return;
1163 for(
auto matchingAssJetCand : jetCont->
accepted()) {
1164 if (!matchingAssJetCand)
continue;
1166 if (matchingAssJet) {
1167 if (
GetJetPt(jetCont, matchingAssJetCand) <
GetJetPt(jetCont, matchingAssJet) )
continue;
1169 matchingAssJet = matchingAssJetCand;
1173 if (matchingAssJet) {
1176 if (
GetJetPt(jetCont, matchingTrigJet) <
GetJetPt(jetCont, matchingAssJet) ) {
1217 Double_t phiMinEMCal =
fGeom->GetArm1PhiMin() * TMath::DegToRad();
1218 Double_t phiMaxEMCal =
fGeom->GetEMCALPhiMax() * TMath::DegToRad();
1219 Double_t phiMinDCal =
fGeom->GetDCALPhiMin() * TMath::DegToRad();
1220 Double_t phiMaxDCal =
fGeom->GetDCALPhiMax() * TMath::DegToRad();
1221 Double_t phiMinPHOS = 250 * TMath::DegToRad();
1222 Double_t phiMaxPHOS = 320 * TMath::DegToRad();
1224 Double_t accTPC = 2 * etaTPC * 2 * TMath::Pi();
1225 Double_t accEMCal = 2 * etaEMCal * (phiMaxEMCal - phiMinEMCal);
1226 Double_t accDCalRegion = 2 * etaEMCal * (phiMaxDCal - phiMinDCal);
1229 TRandom3* r =
new TRandom3(0);
1231 Double_t accRC = TMath::Pi() * jetR * jetR;
1232 Double_t etaEMCalfid = etaEMCal - jetR;
1233 Double_t phiMinEMCalfid = phiMinEMCal + jetR;
1234 Double_t phiMaxEMCalfid = phiMaxEMCal - jetR;
1235 Double_t phiMinDCalRegionfid = phiMinDCal + jetR;
1236 Double_t phiMaxDCalRegionfid = phiMaxDCal - jetR;
1239 Double_t etaEMCalRC = r->Uniform(-etaEMCalfid, etaEMCalfid);
1240 Double_t phiEMCalRC = r->Uniform(phiMinEMCalfid, phiMaxEMCalfid);
1248 etaMin = -etaEMCalfid + etaBin*etaStep;
1249 etaMax = etaMin + etaStep;
1250 etaDCalRC[etaBin] = r->Uniform(etaMin, etaMax);
1258 phiMin = 1 + phiBin*phiStep;
1259 phiMax = phiMin + phiStep;
1260 phiDCalRC[phiBin] = r->Uniform(phiMin, phiMax);
1271 std::vector<std::vector<Double_t>> trackPtSumDCalRC(fNEtaBins, std::vector<Double_t>(fNPhiBins));
1272 std::vector<std::vector<Double_t>> clusESumDCalRC(fNEtaBins, std::vector<Double_t>(fNPhiBins));
1286 track = trackIterator.first;
1287 trackEta = track.Eta();
1289 trackPt = track.Pt();
1292 if (TMath::Abs(trackEta) < etaTPC) {
1293 trackPtSumTPC += trackPt;
1297 if (TMath::Abs(trackEta) < etaEMCal && trackPhi > phiMinEMCal && trackPhi < phiMaxEMCal) {
1298 trackPtSumEMCal += trackPt;
1302 deltaR =
GetDeltaR(&track, etaEMCalRC, phiEMCalRC);
1303 if (deltaR < jetR) {
1304 trackPtSumEMCalRC += trackPt;
1310 deltaR =
GetDeltaR(&track, etaDCalRC[etaBin], phiDCalRC[phiBin]);
1311 if (deltaR < jetR) {
1312 trackPtSumDCalRC[etaBin][phiBin] += trackPt;
1329 clus = clusIterator.first;
1330 clusEta = clus.Eta();
1335 if (TMath::Abs(clusEta) < etaEMCal && clusPhi > phiMinEMCal && clusPhi < phiMaxEMCal) {
1336 clusESumEMCal += clusE;
1340 deltaR =
GetDeltaR(&clus, etaEMCalRC, phiEMCalRC);
1341 if (deltaR < jetR) {
1342 clusESumEMCalRC += clusE;
1348 deltaR =
GetDeltaR(&clus, etaDCalRC[etaBin], phiDCalRC[phiBin]);
1349 if (deltaR < jetR) {
1350 clusESumDCalRC[etaBin][phiBin] += clusE;
1358 Double_t numerator = (trackPtSumEMCal + clusESumEMCal) / accEMCal;
1359 Double_t denominator = trackPtSumTPC / accTPC;
1360 Double_t scaleFactor = numerator / denominator;
1361 TString histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEMCal", jetCont->GetArrayName().Data());
1367 numerator = (trackPtSumDCalRC[etaBin][phiBin] + clusESumDCalRC[etaBin][phiBin]) / accRC;
1368 scaleFactor = numerator / denominator;
1369 histname = TString::Format(
"%s/BackgroundHistograms/hScaleFactorEtaPhi", jetCont->GetArrayName().Data());
1370 Double_t x[4] = {etaDCalRC[etaBin], phiDCalRC[phiBin],
fCent, scaleFactor};
1377 Double_t deltaPt = trackPtSumEMCalRC + clusESumEMCalRC - rho * TMath::Pi() * jetR * jetR;
1378 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEMCal", jetCont->GetArrayName().Data());
1389 deltaPt = trackPtSumDCalRC[etaBin][phiBin] + clusESumDCalRC[etaBin][phiBin] - rho * accRC;
1390 histname = TString::Format(
"%s/BackgroundHistograms/hDeltaPtEtaPhi", jetCont->GetArrayName().Data());
1391 Double_t x[4] = {etaDCalRC[etaBin], phiDCalRC[phiBin],
fCent, deltaPt};
1418 TString jetContName = jetCont->GetName();
1419 if (jetContName.Contains(
"HardCore")) pT = jet->
Pt();
1432 for(
auto jetCand : jetCont->
accepted()) {
1433 if (!jetCand)
continue;
1437 if ( jetCandPt < leadingJetPt )
continue;
1439 leadingJet = jetCand;
1456 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
1466 Double_t deltaEta = TMath::Abs(part->Eta() - etaRef);
1467 Double_t deltaR = TMath::Sqrt( deltaPhi*deltaPhi + deltaEta*deltaEta );
1494 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1495 TString jetContName = jets->GetName();
1496 if (jetContName.Contains(
"HardCore"))
continue;
1500 histname = TString::Format(
"%s/JetHistograms/hRhoVsCent", jets->GetArrayName().Data());
1504 for (
auto jet : jets->
all()) {
1510 histname = TString::Format(
"%s/JetHistograms/hAreaVsPt", jets->GetArrayName().Data());
1515 UInt_t rejectionReason = 0;
1516 if (!jets->
AcceptJet(jet, rejectionReason)) {
1517 histname = TString::Format(
"%s/JetHistograms/hJetRejectionReason", jets->GetArrayName().Data());
1518 fHistManager.
FillTH2(histname.Data(), jets->GetRejectionReasonBitPosition(rejectionReason), jet->Pt());
1523 histname = TString::Format(
"%s/JetHistograms/hCentVsPt", jets->GetArrayName().Data());
1527 histname = TString::Format(
"%s/JetHistograms/hNEFVsPtVsEtaVsPhi", jets->GetArrayName().Data());
1528 Double_t x[4] = {jet->Eta(), jet->Phi_0_2pi(), corrPt, jet->NEF()};
1532 histname = TString::Format(
"%s/JetHistograms/hPtUpscaledMB", jets->GetArrayName().Data());
1536 histname = TString::Format(
"%s/JetHistograms/hPtLeadingVsPt", jets->GetArrayName().Data());
1540 TLorentzVector leadPart;
1543 if (z == 1 || (z > 1 && z - 1 < 1e-3)) z = 0.999;
1544 histname = TString::Format(
"%s/JetHistograms/hZLeadingVsPt", jets->GetArrayName().Data());
1548 histname = TString::Format(
"%s/JetHistograms/hZVsPt", jets->GetArrayName().Data());
1550 for (
Int_t i=0; i<jet->GetNumberOfTracks(); i++) {
1551 track =
static_cast<AliVTrack*
>(jet->Track(i));
1552 z = track->Pt() / TMath::Abs(corrPt);
1557 histname = TString::Format(
"%s/JetHistograms/hNConstVsPt", jets->GetArrayName().Data());
1575 if (!histJetObservables)
return;
1576 for (
Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
1577 TString title(histJetObservables->GetAxis(n)->GetTitle());
1578 if (
title==
"Centrality (%)")
1579 contents[n] =
fCent;
1580 else if (
title==
"LeadingHadronRequired")
1582 else if (
title==
"#it{p}_{T,trig jet} (GeV/#it{c})")
1584 else if (
title==
"#it{p}_{T,ass jet} (GeV/#it{c})")
1586 else if (
title==
"#phi_{trig jet}")
1588 else if (
title==
"#phi_{ass jet}")
1590 else if (
title==
"#eta_{trig jet}")
1592 else if (
title==
"#eta_{ass jet}")
1595 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1597 histJetObservables->Fill(contents);
1607 if (!histJetObservables)
return;
1608 for (
Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
1609 TString title(histJetObservables->GetAxis(n)->GetTitle());
1610 if (
title==
"Centrality (%)")
1611 contents[n] =
fCent;
1612 else if (
title==
"#Delta#phi")
1614 else if (
title==
"#Delta#eta")
1616 else if (
title==
"A_{J}")
1618 else if (
title==
"x_{J}")
1620 else if (
title==
"k_{Ty} (GeV)")
1622 else if (
title==
"N_{tracks, trig jet}")
1624 else if (
title==
"N_{tracks, ass jet}")
1627 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1629 histJetObservables->Fill(contents);
1639 if (!histJetObservables)
return;
1640 for (
Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
1641 TString title(histJetObservables->GetAxis(n)->GetTitle());
1644 else if (
title==
"#Delta#phi")
1645 contents[n] = deltaPhi;
1646 else if (
title==
"#it{p}_{T,particle} (GeV/#it{c})")
1647 contents[n] = trackPt;
1648 else if (
title==
"#it{p}_{T}#parallel (GeV/#it{c})")
1649 contents[n] = balancePt;
1651 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1653 histJetObservables->Fill(contents);
1662 TString histname =
"GeometricalMatchingEfficiency";
1672 TString thnname =
"GeometricalMatching";
1675 if (!histJetObservables)
return;
1676 for (
Int_t n = 0; n < histJetObservables->GetNdimensions(); n++) {
1677 TString title(histJetObservables->GetAxis(n)->GetTitle());
1678 if (
title==
"Centrality (%)")
1679 contents[n] =
fCent;
1680 else if (
title==
"isSwitched")
1681 contents[n] = isSwitched;
1682 else if (
title==
"#DeltaR_{trig}")
1683 contents[n] = trigDeltaR;
1684 else if (
title==
"#DeltaR_{ass}")
1685 contents[n] = assDeltaR;
1686 else if (
title==
"trig #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}")
1688 else if (
title==
"ass #it{p}_{T,low-thresh} - #it{p}_{T,hard-core}")
1690 else if (
title==
"A_{J} low-threshold")
1692 else if (
title==
"A_{J} hard-core")
1695 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1697 histJetObservables->Fill(contents);
1714 AliVCaloCells* phosCaloCells = InputEvent()->GetPHOSCells();
1723 while ((clusters = static_cast<AliClusterContainer*>(nextClusColl()))) {
1729 if (it->second->IsEMCAL()) {
1730 Double_t phi = it->first.Phi_0_2pi();
1734 }
else if (isDcal == 1) {
1737 }
else if (it->second->GetType() == AliVCluster::kPHOSNeutral){
1742 if (it->second->IsEMCAL()) {
1743 histname = TString::Format(
"%s/hClusterRejectionReasonEMCal", clusters->GetArrayName().Data());
1744 UInt_t rejectionReason = 0;
1745 if (!clusters->
AcceptCluster(it.current_index(), rejectionReason)) {
1746 fHistManager.
FillTH2(histname, clusters->GetRejectionReasonBitPosition(rejectionReason), it->first.E());
1749 }
else if (it->second->GetType() == AliVCluster::kPHOSNeutral){
1750 histname = TString::Format(
"%s/hClusterRejectionReasonPHOS", clusters->GetArrayName().Data());
1751 UInt_t rejectionReason = 0;
1752 if (!clusters->
AcceptCluster(it.current_index(), rejectionReason)) {
1753 fHistManager.
FillTH2(histname, clusters->GetRejectionReasonBitPosition(rejectionReason), it->first.E());
1764 if (it->second->IsEMCAL()) {
1766 Ehadcorr = it->second->GetHadCorrEnergy();
1767 Enonlin = it->second->GetNonLinCorrEnergy();
1769 Int_t sm =
fGeom->GetSuperModuleNumber(it->second->GetCellAbsId(0));
1770 if (sm >=0 && sm < 20) {
1771 histname = TString::Format(
"%s/BySM/hEmcalClusEnergy_SM%d", clusters->GetArrayName().Data(), sm);
1775 AliError(Form(
"Supermodule %d does not exist!", sm));
1779 histname = TString::Format(
"Cells/hCellEnergy");
1780 for (
Int_t iCell = 0; iCell < it->second->GetNCells(); iCell++){
1781 absId = it->second->GetCellAbsId(iCell);
1786 }
else if (it->second->GetType() == AliVCluster::kPHOSNeutral){
1788 Ehadcorr = it->second->E();
1789 Enonlin = it->second->E();
1793 fPHOSGeo->AbsToRelNumbering(it->second->GetCellAbsId(0), relid);
1794 Int_t sm = relid[0];
1795 if (sm >=1 && sm < 5) {
1796 histname = TString::Format(
"%s/BySM/hPhosClusEnergy_SM%d", clusters->GetArrayName().Data(), sm);
1800 AliError(Form(
"Supermodule %d does not exist!", sm));
1805 histname = TString::Format(
"Cells/hCellEnergy");
1806 for (
Int_t iCell = 0; iCell < it->second->GetNCells(); iCell++){
1807 absId = it->second->GetCellAbsId(iCell);
1808 ecell = phosCaloCells->GetCellAmplitude(absId);
1814 Int_t hasMatchedTrack = -1;
1815 Int_t nMatchedTracks = it->second->GetNTracksMatched();
1816 if (nMatchedTracks == 0) {
1817 hasMatchedTrack = 0;
1818 }
else if (nMatchedTracks > 0) {
1819 hasMatchedTrack = 1;
1823 histname = TString::Format(
"%s/clusterObservables", clusters->GetArrayName().Data());
1825 if (!histClusterObservables)
return;
1826 for (
Int_t i = 0; i < histClusterObservables->GetNdimensions(); i++) {
1827 TString title(histClusterObservables->GetAxis(i)->GetTitle());
1828 if (
title==
"Centrality %")
1829 contents[i] =
fCent;
1830 else if (
title==
"cluster type")
1831 contents[i] = clusType;
1832 else if (
title==
"#it{E}_{clus} (GeV)")
1833 contents[i] = Enonlin;
1834 else if (
title==
"#it{E}_{clus, hadcorr} (GeV)")
1835 contents[i] = Ehadcorr;
1836 else if (
title==
"Matched track")
1837 contents[i] = hasMatchedTrack;
1838 else if (
title==
"M02")
1839 contents[i] = it->second->GetM02();
1840 else if (
title==
"Ncells")
1841 contents[i] = it->second->GetNCells();
1843 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1845 histClusterObservables->Fill(contents);
1854 while ((jets = static_cast<AliJetContainer*>(nextJetColl()))) {
1856 for (
auto jet : jets->
accepted()) {
1859 histname = TString::Format(
"%s/hClusterJetObservables", jets->GetArrayName().Data());
1861 if (!histJetObservables)
return;
1862 for (
Int_t i = 0; i < histJetObservables->GetNdimensions(); i++) {
1863 TString title(histJetObservables->GetAxis(i)->GetTitle());
1864 if (
title==
"Centrality (%)")
1865 contents[i] =
fCent;
1866 else if (
title==
"#eta_{jet}")
1867 contents[i] = jet->Eta();
1868 else if (
title==
"#phi_{jet} (rad)")
1869 contents[i] = jet->Phi_0_2pi();
1870 else if (
title==
"#it{E}_{T} (GeV)")
1871 contents[i] = jet->Pt();
1872 else if (
title==
"N_{clusters}")
1873 contents[i] = jet->GetNumberOfClusters();
1875 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1877 histJetObservables->Fill(contents);
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