22 #include <TClonesArray.h>
24 #include <THnSparse.h>
27 #include "AliAnalysisManager.h"
28 #include "AliVCluster.h"
29 #include "AliVTrack.h"
43 fMatching(kNoMatching),
46 fUseCellsToMatch(kFALSE),
50 fDeltaEtaDeltaPhiAxis(0),
59 fJetRelativeEPAngle(0),
62 fHistRejectionReason1(0),
63 fHistRejectionReason2(0),
69 fHistJets1CorrPtArea(0),
71 fHistJets1CEFvsCEFPt(0),
75 fHistJets2CorrPtArea(0),
77 fHistJets2CEFvsCEFPt(0),
79 fHistCommonEnergy1vsJet1Pt(0),
80 fHistCommonEnergy2vsJet2Pt(0),
81 fHistDistancevsJet1Pt(0),
82 fHistDistancevsJet2Pt(0),
83 fHistDistancevsCommonEnergy1(0),
84 fHistDistancevsCommonEnergy2(0),
85 fHistCommonEnergy1vsCommonEnergy2(0),
86 fHistDeltaEtaDeltaPhi(0),
87 fHistJet2PtOverJet1PtvsJet2Pt(0),
88 fHistJet1PtOverJet2PtvsJet1Pt(0),
89 fHistDeltaPtvsJet1Pt(0),
90 fHistDeltaPtvsJet2Pt(0),
91 fHistDeltaPtOverJet1PtvsJet1Pt(0),
92 fHistDeltaPtOverJet2PtvsJet2Pt(0),
93 fHistDeltaPtvsDistance(0),
94 fHistDeltaPtvsCommonEnergy1(0),
95 fHistDeltaPtvsCommonEnergy2(0),
96 fHistDeltaPtvsArea1(0),
97 fHistDeltaPtvsArea2(0),
98 fHistDeltaPtvsDeltaArea(0),
99 fHistJet1PtvsJet2Pt(0),
100 fHistDeltaCorrPtOverJet1CorrPtvsJet1CorrPt(0),
101 fHistDeltaCorrPtOverJet2CorrPtvsJet2CorrPt(0),
102 fHistDeltaCorrPtvsJet1CorrPt(0),
103 fHistDeltaCorrPtvsJet2CorrPt(0),
104 fHistDeltaCorrPtvsDistance(0),
105 fHistDeltaCorrPtvsCommonEnergy1(0),
106 fHistDeltaCorrPtvsCommonEnergy2(0),
107 fHistDeltaCorrPtvsArea1(0),
108 fHistDeltaCorrPtvsArea2(0),
109 fHistDeltaCorrPtvsDeltaArea(0),
110 fHistJet1CorrPtvsJet2CorrPt(0),
111 fHistDeltaMCPtOverJet1MCPtvsJet1MCPt(0),
112 fHistDeltaMCPtOverJet2PtvsJet2Pt(0),
113 fHistDeltaMCPtvsJet1MCPt(0),
114 fHistDeltaMCPtvsJet2Pt(0),
115 fHistDeltaMCPtvsDistance(0),
116 fHistDeltaMCPtvsCommonEnergy1(0),
117 fHistDeltaMCPtvsCommonEnergy2(0),
118 fHistDeltaMCPtvsArea1(0),
119 fHistDeltaMCPtvsArea2(0),
120 fHistDeltaMCPtvsDeltaArea(0),
121 fHistJet1MCPtvsJet2Pt(0)
125 SetMakeGeneralHistograms(kTRUE);
131 fMatching(kNoMatching),
134 fUseCellsToMatch(kFALSE),
138 fDeltaEtaDeltaPhiAxis(0),
147 fJetRelativeEPAngle(0),
150 fHistRejectionReason1(0),
151 fHistRejectionReason2(0),
157 fHistJets1CorrPtArea(0),
158 fHistJets1NEFvsPt(0),
159 fHistJets1CEFvsCEFPt(0),
163 fHistJets2CorrPtArea(0),
164 fHistJets2NEFvsPt(0),
165 fHistJets2CEFvsCEFPt(0),
167 fHistCommonEnergy1vsJet1Pt(0),
168 fHistCommonEnergy2vsJet2Pt(0),
169 fHistDistancevsJet1Pt(0),
170 fHistDistancevsJet2Pt(0),
171 fHistDistancevsCommonEnergy1(0),
172 fHistDistancevsCommonEnergy2(0),
173 fHistCommonEnergy1vsCommonEnergy2(0),
174 fHistDeltaEtaDeltaPhi(0),
175 fHistJet2PtOverJet1PtvsJet2Pt(0),
176 fHistJet1PtOverJet2PtvsJet1Pt(0),
177 fHistDeltaPtvsJet1Pt(0),
178 fHistDeltaPtvsJet2Pt(0),
179 fHistDeltaPtOverJet1PtvsJet1Pt(0),
180 fHistDeltaPtOverJet2PtvsJet2Pt(0),
181 fHistDeltaPtvsDistance(0),
182 fHistDeltaPtvsCommonEnergy1(0),
183 fHistDeltaPtvsCommonEnergy2(0),
184 fHistDeltaPtvsArea1(0),
185 fHistDeltaPtvsArea2(0),
186 fHistDeltaPtvsDeltaArea(0),
187 fHistJet1PtvsJet2Pt(0),
188 fHistDeltaCorrPtOverJet1CorrPtvsJet1CorrPt(0),
189 fHistDeltaCorrPtOverJet2CorrPtvsJet2CorrPt(0),
190 fHistDeltaCorrPtvsJet1CorrPt(0),
191 fHistDeltaCorrPtvsJet2CorrPt(0),
192 fHistDeltaCorrPtvsDistance(0),
193 fHistDeltaCorrPtvsCommonEnergy1(0),
194 fHistDeltaCorrPtvsCommonEnergy2(0),
195 fHistDeltaCorrPtvsArea1(0),
196 fHistDeltaCorrPtvsArea2(0),
197 fHistDeltaCorrPtvsDeltaArea(0),
198 fHistJet1CorrPtvsJet2CorrPt(0),
199 fHistDeltaMCPtOverJet1MCPtvsJet1MCPt(0),
200 fHistDeltaMCPtOverJet2PtvsJet2Pt(0),
201 fHistDeltaMCPtvsJet1MCPt(0),
202 fHistDeltaMCPtvsJet2Pt(0),
203 fHistDeltaMCPtvsDistance(0),
204 fHistDeltaMCPtvsCommonEnergy1(0),
205 fHistDeltaMCPtvsCommonEnergy2(0),
206 fHistDeltaMCPtvsArea1(0),
207 fHistDeltaMCPtvsArea2(0),
208 fHistDeltaMCPtvsDeltaArea(0),
209 fHistJet1MCPtvsJet2Pt(0)
228 fHistJets1PhiEta =
new TH2F(
"fHistJets1PhiEta",
"fHistJets1PhiEta", 40, -1, 1, 40, 0, TMath::Pi()*2);
268 fHistJets2PhiEta =
new TH2F(
"fHistJets2PhiEta",
"fHistJets2PhiEta", 40, -1, 1, 40, 0, TMath::Pi()*2);
635 max[dim] = 2*TMath::Pi()*(1 + 1./(nbins[dim]-1));
644 title[dim] =
"p_{T}";
650 title[dim] =
"A_{jet}";
673 title[dim] =
"z_{flavour}";
681 title[dim] =
"p_{T}^{D}";
689 title[dim] =
"#theta_{jet}^{EP}";
692 max[dim] = TMath::Pi()/2;
696 title[dim] =
"p_{T,particle}^{leading} (GeV/c)";
702 Int_t dim1 = dim, dim2 = dim;
705 title[dim1] =
"p_{T}^{corr}";
713 title[dim1] =
"p_{T}^{MC}";
720 fHistJets1 =
new THnSparseD(
"fHistJets1",
"fHistJets1",dim1,nbins,min,max);
721 for (
Int_t i = 0; i < dim1; i++)
726 title[dim2] =
"p_{T}^{corr}";
733 fHistJets2 =
new THnSparseD(
"fHistJets2",
"fHistJets2",dim2,nbins,min,max);
734 for (
Int_t i = 0; i < dim2; i++)
742 title[dim] =
"p_{T,1}";
748 title[dim] =
"p_{T,2}";
754 title[dim] =
"A_{jet,1}";
760 title[dim] =
"A_{jet,2}";
766 title[dim] =
"distance";
784 title[dim] =
"p_{T,particle,1}^{leading} (GeV/c)";
790 title[dim] =
"p_{T,particle,2}^{leading} (GeV/c)";
797 title[dim] =
"#deltaA_{jet}";
803 title[dim] =
"#deltap_{T}";
810 title[dim] =
"p_{T,1}^{corr}";
817 title[dim] =
"p_{T,2}^{corr}";
824 title[dim] =
"#deltap_{T}^{corr}";
831 title[dim] =
"#delta#eta";
837 title[dim] =
"#delta#phi";
839 min[dim] = -TMath::Pi()/2;
840 max[dim] = TMath::Pi()*3/2;
844 title[dim] =
"p_{T,1}^{MC}";
851 title[dim] =
"#deltap_{T}^{MC}";
860 title[dim] =
"NEF_{1}";
866 title[dim] =
"NEF_{2}";
874 title[dim] =
"Z_{1}";
880 title[dim] =
"Z_{2}";
888 title[dim] =
"z_{flavour,1}";
894 title[dim] =
"z_{flavour,2}";
902 title[dim] =
"p_{T,1}^{D}";
908 title[dim] =
"p_{T,2}^{D}";
916 title[dim] =
"Z_{g,1}";
921 title[dim] =
"Z_{g,2}";
929 title[dim] =
"dR_{1}";
934 title[dim] =
"dR_{2}";
942 title[dim] =
"p_{T,g,1}";
947 title[dim] =
"p_{T,g,2}";
955 title[dim] =
"DBC_{1}";
960 title[dim] =
"DBC_{2}";
968 title[dim] =
"#theta_{jet,1}^{EP}";
971 max[dim] = TMath::Pi()/2;
974 title[dim] =
"#theta_{jet,2}^{EP}";
977 max[dim] = TMath::Pi()/2;
981 fHistMatching =
new THnSparseD(
"fHistMatching",
"fHistMatching",dim,nbins,min,max);
983 for (
Int_t i = 0; i < dim; i++)
999 if (!jets1 || !jets2)
return;
1036 if (zleading == 1 || (zleading > 1 && zleading - 1 < 1e-3)) zleading = 0.999;
1044 ptflavour = hftrack->Pt();
1046 if (zflavour == 1 || (zflavour > 1 && zflavour - 1 < 1e-3)) zflavour = 0.999;
1051 THnSparse *histo = 0;
1063 for (
Int_t i = 0; i < histo->GetNdimensions(); i++) {
1066 contents[i] = jet->
Phi();
1067 else if (
title==
"#eta")
1068 contents[i] = jet->
Eta();
1069 else if (
title==
"p_{T}")
1070 contents[i] = jet->
Pt();
1071 else if (
title==
"A_{jet}")
1072 contents[i] = jet->
Area();
1073 else if (
title==
"NEF")
1074 contents[i] = jet->
NEF();
1075 else if (
title==
"Z")
1076 contents[i] = zleading;
1077 else if (
title==
"p_{T}^{corr}")
1078 contents[i] = corrpt;
1079 else if (
title==
"p_{T}^{MC}")
1080 contents[i] = jet->
MCPt();
1081 else if (
title==
"p_{T,particle}^{leading} (GeV/c)")
1082 contents[i] = leadPart.Pt();
1083 else if (
title==
"z_{flavour}")
1084 contents[i] = zflavour;
1085 else if (
title==
"p_{T}^{D}")
1086 contents[i] = ptflavour;
1087 else if (
title==
"#theta_{jet}^{EP}")
1088 contents[i] = jetRelativeEPAngle;
1090 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1093 histo->Fill(contents);
1105 else if (Set == 2) {
1139 if (zleading1 == 1 || (zleading1 > 1 && zleading1 - 1 < 1e-3)) zleading1 = 0.999;
1147 ptflavour1 = hftrack1->Pt();
1149 if (zflavour1 == 1 || (zflavour1 > 1 && zflavour1 - 1 < 1e-3)) zflavour1 = 0.999;
1157 if (zleading2 == 1 || (zleading2 > 1 && zleading2 - 1 < 1e-3)) zleading2 = 0.999;
1165 ptflavour2 = hftrack2->Pt();
1167 if (zflavour2 == 1 || (zflavour2 > 1 && zflavour2 - 1 < 1e-3)) zflavour2 = 0.999;
1176 if (
title==
"p_{T,1}")
1177 contents[i] = jet1->
Pt();
1178 else if (
title==
"p_{T,2}")
1179 contents[i] = jet2->
Pt();
1180 else if (
title==
"A_{jet,1}")
1181 contents[i] = jet1->
Area();
1182 else if (
title==
"A_{jet,2}")
1183 contents[i] = jet2->
Area();
1184 else if (
title==
"distance")
1186 else if (
title==
"CE1")
1188 else if (
title==
"CE2")
1190 else if (
title==
"#deltaA_{jet}")
1191 contents[i] = jet1->
Area()-jet2->
Area();
1192 else if (
title==
"#deltap_{T}")
1193 contents[i] = jet1->
Pt()-jet2->
Pt();
1194 else if (
title==
"#delta#eta")
1195 contents[i] = jet1->
Eta()-jet2->
Eta();
1196 else if (
title==
"#delta#phi")
1197 contents[i] = jet1->
Phi()-jet2->
Phi();
1198 else if (
title==
"p_{T,1}^{corr}")
1199 contents[i] = corrpt1;
1200 else if (
title==
"p_{T,2}^{corr}")
1201 contents[i] = corrpt2;
1202 else if (
title==
"#deltap_{T}^{corr}")
1203 contents[i] = corrpt1-corrpt2;
1204 else if (
title==
"p_{T,1}^{MC}")
1205 contents[i] = jet1->
MCPt();
1206 else if (
title==
"#deltap_{T}^{MC}")
1207 contents[i] = jet1->
MCPt()-jet2->
Pt();
1208 else if (
title==
"NEF_{1}")
1209 contents[i] = jet1->
NEF();
1210 else if (
title==
"NEF_{2}")
1211 contents[i] = jet2->
NEF();
1212 else if (
title==
"Z_{1}")
1213 contents[i] = zleading1;
1214 else if (
title==
"Z_{2}")
1215 contents[i] = zleading2;
1216 else if (
title==
"p_{T,particle,1}^{leading} (GeV/c)")
1217 contents[i] = leadPart1.Pt();
1218 else if (
title==
"p_{T,particle,2}^{leading} (GeV/c)")
1219 contents[i] = leadPart2.Pt();
1220 else if (
title==
"z_{flavour,1}")
1221 contents[i] = zflavour1;
1222 else if (
title==
"z_{flavour,2}")
1223 contents[i] = zflavour2;
1224 else if (
title==
"p_{T,1}^{D}")
1225 contents[i] = ptflavour1;
1226 else if (
title==
"p_{T,2}^{D}")
1227 contents[i] = ptflavour2;
1228 else if (
title==
"Z_{g,1}")
1230 else if (
title==
"Z_{g,2}")
1232 else if (
title==
"dR_{1}")
1234 else if (
title==
"dR_{2}")
1236 else if (
title==
"p_{T,g,1}")
1238 else if (
title==
"p_{T,g,2}")
1240 else if (
title==
"DBC_{1}")
1242 else if (
title==
"DBC_{2}")
1244 else if (
title==
"#theta_{jet,1}^{EP}")
1245 contents[i] = jetRelativeEPAngle1;
1246 else if (
title==
"#theta_{jet,2}^{EP}")
1247 contents[i] = jetRelativeEPAngle2;
1249 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1289 Double_t dcorrpt = corrpt1 - corrpt2;
1330 if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray())
return;
1332 if (
fMatching ==
kMCLabel && (!jets2->GetIsParticleLevel() || jets1->GetIsParticleLevel())) {
1333 if (jets1->GetIsParticleLevel() == jets2->GetIsParticleLevel()) {
1334 AliWarning(
"Changing matching type from MC label to same collection...");
1338 AliWarning(
"Changing matching type from MC label to geometrical...");
1343 if (jets2->GetIsParticleLevel() && !jets1->GetIsParticleLevel()) {
1344 AliWarning(
"Changing matching type from same collection to MC label...");
1348 AliWarning(
"Changing matching type from same collection to geometrical...");
1371 if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray())
return kFALSE;
1377 jets1->ResetCurrentID();
1382 if (!jet2)
continue;
1389 AliDebug(2,Form(
"Found matching: jet1 pt = %f, eta = %f, phi = %f, jet2 pt = %f, eta = %f, phi = %f",
1390 jet1->
Pt(), jet1->
Eta(), jet1->
Phi(),
1391 jet2->
Pt(), jet2->
Eta(), jet2->
Phi()));
1405 if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray())
return;
1410 jets2->ResetCurrentID();
1413 jets1->ResetCurrentID();
1419 jets2->ResetCurrentID();
1438 if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray())
return;
1452 if (tracks1 && tracks1->GetArray()) {
1454 AliVParticle *track = jet1->
Track(iTrack);
1456 AliWarning(Form(
"Could not find track %d!", iTrack));
1460 Int_t MClabel = TMath::Abs(track->GetLabel());
1462 if (MClabel != 0)
continue;
1465 AliDebug(3,Form(
"Track %d (pT = %f) is not a MC particle (MClabel = %d)!",iTrack,track->Pt(),MClabel));
1466 totalPt1 -= track->Pt();
1474 AliVCluster *clus = jet1->
Cluster(iClus);
1476 AliWarning(Form(
"Could not find cluster %d!", iClus));
1480 clus->GetMomentum(part,
fVertex);
1482 for (
Int_t iCell = 0; iCell < clus->GetNCells(); iCell++) {
1483 Int_t cellId = clus->GetCellAbsId(iCell);
1484 Double_t cellFrac = clus->GetCellAmplitudeFraction(iCell);
1488 if (MClabel != 0)
continue;
1491 AliDebug(3,Form(
"Cell %d (frac = %f) is not a MC particle (MClabel = %d)!",iCell,cellFrac,MClabel));
1492 totalPt1 -= part.Pt() * cellFrac;
1493 d1 -= part.Pt() * cellFrac;
1499 AliVCluster *clus = jet1->
Cluster(iClus);
1501 AliWarning(Form(
"Could not find cluster %d!", iClus));
1504 TLorentzVector part;
1505 clus->GetMomentum(part,
fVertex);
1507 Int_t MClabel = TMath::Abs(clus->GetLabel());
1509 if (MClabel != 0)
continue;
1512 AliDebug(3,Form(
"Cluster %d (pT = %f) is not a MC particle (MClabel = %d)!",iClus,part.Pt(),MClabel));
1513 totalPt1 -= part.Pt();
1519 Bool_t track2Found = kFALSE;
1524 AliVParticle *track = jet1->
Track(iTrack);
1526 AliWarning(Form(
"Could not find track %d!", iTrack));
1529 Int_t MClabel = TMath::Abs(track->GetLabel());
1531 if (MClabel <= 0)
continue;
1534 index = tracks2->GetIndexFromLabel(MClabel);
1536 AliDebug(2,Form(
"Track %d (pT = %f) does not have an associated MC particle (MClabel = %d)!",iTrack,track->Pt(),MClabel));
1540 if (index2 != index)
continue;
1546 AliVParticle *MCpart = jet2->
Track(index2);
1547 AliDebug(3,Form(
"Track %d (pT = %f, eta = %f, phi = %f) is associated with the MC particle %d (pT = %f, eta = %f, phi = %f)!",
1548 iTrack,track->Pt(),track->Eta(),track->Phi(),MClabel,MCpart->Pt(),MCpart->Eta(),MCpart->Phi()));
1552 track2Found = kTRUE;
1558 AliVCluster *clus = jet1->
Cluster(iClus);
1560 AliWarning(Form(
"Could not find cluster %d!", iClus));
1564 clus->GetMomentum(part,
fVertex);
1566 for (
Int_t iCell = 0; iCell < clus->GetNCells(); iCell++) {
1567 Int_t cellId = clus->GetCellAbsId(iCell);
1568 Double_t cellFrac = clus->GetCellAmplitudeFraction(iCell);
1572 if (MClabel <= 0)
continue;
1575 index1 = tracks2->GetIndexFromLabel(MClabel);
1577 AliDebug(3,Form(
"Cell %d (frac = %f) does not have an associated MC particle (MClabel = %d)!",iCell,cellFrac,MClabel));
1581 if (index2 != index1)
continue;
1584 d1 -= part.Pt() * cellFrac;
1587 AliVParticle *MCpart = jet2->
Track(index2);
1588 AliDebug(3,Form(
"Cell %d belonging to cluster %d (pT = %f, eta = %f, phi = %f) is associated with the MC particle %d (pT = %f, eta = %f, phi = %f)!",
1589 iCell,iClus,part.Pt(),part.Eta(),part.
Phi_0_2pi(),MClabel,MCpart->Pt(),MCpart->Eta(),MCpart->Phi()));
1590 d2 -= MCpart->Pt() * cellFrac;
1593 track2Found = kTRUE;
1599 AliVCluster *clus = jet1->
Cluster(iClus);
1601 AliWarning(Form(
"Could not find cluster %d!", iClus));
1605 clus->GetMomentum(part,
fVertex);
1607 Int_t MClabel = TMath::Abs(clus->GetLabel());
1609 if (MClabel <= 0)
continue;
1612 index = tracks2->GetIndexFromLabel(MClabel);
1615 AliDebug(3,Form(
"Cluster %d (pT = %f) does not have an associated MC particle (MClabel = %d)!",iClus,part.Pt(),MClabel));
1619 if (index2 != index)
continue;
1625 AliVParticle *MCpart = jet2->
Track(index2);
1626 AliDebug(3,Form(
"Cluster %d (pT = %f, eta = %f, phi = %f) is associated with the MC particle %d (pT = %f, eta = %f, phi = %f)!",
1627 iClus,part.Pt(),part.Eta(),part.
Phi_0_2pi(),MClabel,MCpart->Pt(),MCpart->Eta(),MCpart->Phi()));
1632 track2Found = kTRUE;
1660 if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray())
return;
1672 if (tracks1 && tracks2) {
1678 if (index2 == index1) {
1679 AliVParticle *part1 = jet1->
Track(iTrack1);
1681 AliWarning(Form(
"Could not find track %d!", index1));
1684 AliVParticle *part2 = jet2->
Track(iTrack2);
1686 AliWarning(Form(
"Could not find track %d!", index2));
1699 if (clusters1 && clusters2) {
1708 AliWarning(
"ATTENTION ATTENTION ATTENTION: this section of the AliJetResponseMaker code needs to be revised and tested before using it for physics!!!");
1711 Int_t ncells1[nClus1];
1715 Int_t *sortedIndexes1[nClus1];
1717 for (
Int_t iClus1 = 0; iClus1 < nClus1; iClus1++) {
1719 AliVCluster *clus1 = clusters1->
GetCluster(index1);
1721 AliWarning(Form(
"Could not find cluster %d!", index1));
1722 ncells1[iClus1] = 0;
1723 cellsId1[iClus1] = 0;
1724 cellsFrac1[iClus1] = 0;
1725 cellsClusFrac1[iClus1] = 0;
1726 sortedIndexes1[iClus1] = 0;
1727 ptClus1[iClus1] = 0;
1730 TLorentzVector part1;
1731 clus1->GetMomentum(part1,
fVertex);
1733 ncells1[iClus1] = clus1->GetNCells();
1734 cellsId1[iClus1] = clus1->GetCellsAbsId();
1735 cellsFrac1[iClus1] = clus1->GetCellsAmplitudeFraction();
1736 cellsClusFrac1[iClus1] =
new Double_t[ncells1[iClus1]];
1737 sortedIndexes1[iClus1] =
new Int_t[ncells1[iClus1]];
1738 ptClus1[iClus1] = part1.Pt();
1740 for (
Int_t iCell = 0; iCell < ncells1[iClus1]; iCell++) {
1741 cellsClusFrac1[iClus1][iCell] =
fCaloCells->GetCellAmplitude(cellsId1[iClus1][iCell]) / clus1->E();
1744 TMath::Sort(ncells1[iClus1], cellsId1[iClus1], sortedIndexes1[iClus1], kFALSE);
1749 const Int_t maxNcells2 = 11520;
1750 Int_t sortedIndexes2[maxNcells2];
1751 for (
Int_t iClus2 = 0; iClus2 < nClus2; iClus2++) {
1753 AliVCluster *clus2 = clusters2->
GetCluster(index2);
1755 AliWarning(Form(
"Could not find cluster %d!", index2));
1758 Int_t ncells2 = clus2->GetNCells();
1759 if (ncells2 >= maxNcells2) {
1760 AliError(Form(
"Number of cells in the cluster %d >= %d",ncells2,maxNcells2));
1763 UShort_t *cellsId2 = clus2->GetCellsAbsId();
1764 Double_t *cellsFrac2 = clus2->GetCellsAmplitudeFraction();
1767 for (
Int_t iCell = 0; iCell < ncells2; iCell++) {
1768 cellsClusFrac2[iCell] =
fCaloCells->GetCellAmplitude(cellsId2[iCell]) / clus2->E();
1771 TLorentzVector part2;
1772 clus2->GetMomentum(part2,
fVertex);
1775 TMath::Sort(ncells2, cellsId2, sortedIndexes2, kFALSE);
1777 for (
Int_t iClus1 = 0; iClus1 < nClus1; iClus1++) {
1778 if (sortedIndexes1[iClus1] == 0)
1780 Int_t iCell1 = 0, iCell2 = 0;
1781 while (iCell1 < ncells1[iClus1] && iCell2 < ncells2) {
1782 if (cellsId1[iClus1][sortedIndexes1[iClus1][iCell1]] == cellsId2[sortedIndexes2[iCell2]]) {
1783 d1 -= cellsFrac1[iClus1][sortedIndexes1[iClus1][iCell1]] * cellsClusFrac1[iClus1][sortedIndexes1[iClus1][iCell1]] * ptClus1[iClus1];
1784 d2 -= cellsFrac2[sortedIndexes2[iCell2]] * cellsClusFrac2[sortedIndexes2[iCell2]] * ptClus2;
1788 else if (cellsId1[iClus1][sortedIndexes1[iClus1][iCell1]] > cellsId2[sortedIndexes2[iCell2]]) {
1796 delete[] cellsClusFrac2;
1798 for (
Int_t iClus1 = 0; iClus1 < nClus1; iClus1++) {
1799 delete[] cellsClusFrac1[iClus1];
1800 delete[] sortedIndexes1[iClus1];
1808 if (index2 == index1) {
1809 AliVCluster *clus1 = jet1->
Cluster(iClus1);
1811 AliWarning(Form(
"Could not find cluster %d!", index1));
1814 AliVCluster *clus2 = jet2->
Cluster(iClus2);
1816 AliWarning(Form(
"Could not find cluster %d!", index2));
1819 TLorentzVector part1, part2;
1820 clus1->GetMomentum(part1,
fVertex);
1821 clus2->GetMomentum(part2,
fVertex);
1872 if (d1 < jet1->ClosestJetDistance()) {
1876 else if (d1 < jet1->SecondClosestJetDistance()) {
1883 if (d2 < jet2->ClosestJetDistance()) {
1887 else if (d2 < jet2->SecondClosestJetDistance()) {
1901 if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray())
return kFALSE;
1906 jets2->ResetCurrentID();
1909 AliDebug(2,Form(
"Processing jet (2) %d", jets2->GetCurrentID()));
1913 UInt_t rejectionReason = 0;
1914 if (jets2->
AcceptJet(jet2, rejectionReason))
1921 if (!jet1)
continue;
1922 rejectionReason = 0;
1923 if (!jets1->
AcceptJet(jet1, rejectionReason))
continue;
1928 if (jets2->GetIsParticleLevel() && !jets1->GetIsParticleLevel())
1930 else if (jets1->GetIsParticleLevel() == jets2->GetIsParticleLevel())
1945 jets1->ResetCurrentID();
1947 UInt_t rejectionReason = 0;
1948 if (!jets1->
AcceptJet(jet1, rejectionReason)) {
1953 AliDebug(2,Form(
"Processing jet (1) %d", jets1->GetCurrentID()));
1971 Double_t dphi = (epAngle - jetAngle);
1974 if( dphi<-1*TMath::Pi() ){
1975 dphi = dphi + 1*TMath::Pi();
1978 if( (dphi>0) && (dphi<1*TMath::Pi()/2) ){
1980 }
else if( (dphi>1*TMath::Pi()/2) && (dphi<1*TMath::Pi()) ){
1981 dphi = 1*TMath::Pi() - dphi;
1982 }
else if( (dphi<0) && (dphi>-1*TMath::Pi()/2) ){
1984 }
else if( (dphi<-1*TMath::Pi()/2) && (dphi>-1*TMath::Pi()) ){
1985 dphi = dphi + 1*TMath::Pi();
1989 if( dphi < 0 || dphi > TMath::Pi()/2 )
1990 AliWarning(Form(
"%s: dPHI not in range [0, 0.5*Pi]!", GetName()));
void SetSecondClosestJet(AliEmcalJet *j, Double_t d)
TH2 * fHistJets2PtArea
phi-eta distribution of jets 2
TH2 * fHistRejectionReason1
whether the jet2 collection has to be average subtracted
TH2 * fHistJets2CorrPtArea
inclusive jet pt vs. area histogram 2
Double_t GetRhoVal() const
const TString & GetRhoName() const
TH2 * fHistDeltaPtvsCommonEnergy1
delta pt between matched jets vs distance
TH2 * fHistJet2PtOverJet1PtvsJet2Pt
delta eta vs delta phi of matched jets
Bool_t FillHistograms()
Function filling histograms.
TH2 * fHistDeltaPtvsDeltaArea
delta pt between matched jets vs jet 2 area
AliEmcalJet * ClosestJet() const
AliJetContainer * GetJetContainer(Int_t i=0) const
Double_t ClosestJetDistance() const
TH2 * fHistJets2PhiEta
Constituent Pt over Jet Pt ratio vs. jet pt 1.
TH2 * fHistDeltaCorrPtvsArea2
delta pt corr between matched jets vs jet 1 area
void FillJetHisto(AliEmcalJet *jet, Int_t Set)
Int_t fJetRelativeEPAngle
add jet angle relative to the EP in matching THnSparse (default=0)
AliEmcalJet * MatchedJet() const
Declaration of class AliTLorentzVector.
void GetSameCollectionsMatchingLevel(AliEmcalJet *jet1, AliEmcalJet *jet2, Double_t &d1, Double_t &d2) const
Int_t fDeltaEtaDeltaPhiAxis
Double_t fMinBinPt
min pt in histograms
Double_t fEPV0
!event plane V0
Int_t ClusterAt(Int_t idx) const
TH2 * fHistDeltaMCPtvsCommonEnergy2
jet 1 MC pt - jet2 pt vs common energy 1 (%)
AliClusterContainer * GetClusterContainer() const
TH2 * fHistJets1ZvsPt
Jet charged energy fraction vs. charged jet pt 1.
AliVParticle * Track(Int_t idx) const
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
Double_t GetRelativeEPAngle(Double_t jetAngle, Double_t epAngle) const
THnSparse * fHistMatching
jet2 THnSparse
TH2 * fHistDeltaEtaDeltaPhi
common energy 1 (%) vs common energy 2 (%)
ClassImp(AliJetResponseMaker) AliJetResponseMaker
TH2 * fHistDeltaMCPtvsCommonEnergy1
jet 1 MC pt - jet2 pt vs distance
TH2 * fHistDeltaCorrPtOverJet2CorrPtvsJet2CorrPt
delta pt corr / jet 1 corr pt between matched jets vs jet 1 corr pt
TH2 * fHistCommonEnergy1vsCommonEnergy2
distance vs common energy 2 (%)
TH2 * fHistDeltaPtvsCommonEnergy2
delta pt between matched jets vs common energy 1 (%)
TH2 * fHistDeltaMCPtvsDistance
jet 1 MC pt - jet2 pt vs jet 2 pt
AliVParticle * GetFlavourTrack(Int_t i=0) const
Container for particles within the EMCAL framework.
TH2 * fHistJets1NEFvsPt
inclusive jet pt vs. area histogram 1
Int_t TrackAt(Int_t idx) const
TH2 * fHistJets2ZvsPt
Jet charged energy fraction vs. charged jet pt 2.
Bool_t fIsEmbedded
trigger, embedded signal
UShort_t GetNumberOfTracks() const
Bool_t fIsJet2Rho
whether the jet1 collection has to be average subtracted
TH2 * fHistDeltaPtvsJet1Pt
jet 1 pt over jet 2 pt vs jet 1 pt
TH2 * fHistDeltaCorrPtvsCommonEnergy2
delta pt corr between matched jets vs common energy 1 (%)
AliParticleContainer * GetParticleContainer() const
void GetLeadingHadronMomentum(TLorentzVector &mom, const AliEmcalJet *jet) const
TH2 * fHistDeltaPtvsJet2Pt
delta pt between matched jets vs jet 1 pt
TH2 * fHistJets1PhiEta
matching THnSparse
UShort_t GetNumberOfClusters() const
THnSparse * fHistJets1
Rejection reason vs. jet pt.
UShort_t GetMatchingType() const
TH2 * fHistJet1PtOverJet2PtvsJet1Pt
jet 2 pt over jet 1 pt vs jet 2 pt
Double_t Phi_0_2pi() const
TH2 * fHistDeltaCorrPtvsDistance
delta pt corr between matched jets vs jet 2 corr pt
void FillMatchingHistos(AliEmcalJet *jet1, AliEmcalJet *jet2, Double_t d, Double_t CE1, Double_t CE2)
Double_t GetSoftDropZg() const
Double_t GetSoftDropdR() const
void ExecOnce()
Perform steps needed to initialize the analysis.
TH2 * fHistJet1PtvsJet2Pt
delta pt between matched jets vs delta area
TH2 * fHistDeltaCorrPtvsJet1CorrPt
delta pt corr / jet 2 corr pt between matched jets vs jet 2 corr pt
Double_t GetSoftDropPtfrac() const
TH2 * fHistDeltaMCPtOverJet2PtvsJet2Pt
jet 1 MC pt - jet2 pt / jet 1 MC pt vs jet 1 pt
TH2 * fHistDistancevsCommonEnergy2
distance vs common energy 1 (%)
Double_t GetJetPtCut() const
TH2 * fHistRejectionReason2
Rejection reason vs. jet pt.
Int_t fMCLabelShift
if MC label > fMCLabelShift, MC label -= fMCLabelShift
TH2 * fHistDistancevsJet1Pt
common energy 2 (%) vs jet 2 pt
TH2 * fHistDeltaMCPtOverJet1MCPtvsJet1MCPt
correlation jet 1 corr pt vs jet 2 corr pt
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...
AliVCluster * GetCluster(Int_t i) const
Int_t GetSoftDropDropCount() const
TH2 * fHistDeltaPtOverJet1PtvsJet1Pt
delta pt between matched jets vs jet 2 pt
TObjArray fJetCollArray
jet collection array
Double_t DeltaR(const AliVParticle *part) const
TH2 * fHistDeltaCorrPtvsArea1
delta pt corr between matched jets vs common energy 2 (%)
void UserCreateOutputObjects()
AliVCaloCells * fCaloCells
!cells
Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
TH2 * fHistCommonEnergy1vsJet1Pt
Constituent Pt over Jet Pt ratio vs. jet pt 2.
void SetMatchingLevel(AliEmcalJet *jet1, AliEmcalJet *jet2, MatchingType matching)
TH2 * fHistJets1CorrPtArea
inclusive jet pt vs. area histogram 1
AliEmcalJet * GetNextJet()
AliEmcalList * fOutput
!output list
Double_t fMaxBinPt
max pt in histograms
TH2 * fHistDeltaMCPtvsJet1MCPt
jet 1 MC pt - jet2 pt / jet 2 pt vs jet 2 pt
void SetClosestJet(AliEmcalJet *j, Double_t d)
TH2 * fHistDeltaMCPtvsArea2
jet 1 MC pt - jet2 pt vs jet 1 area
TH2 * fHistDeltaMCPtvsJet2Pt
jet 1 MC pt - jet2 pt vs jet 1 MC pt
TH2 * fHistDistancevsJet2Pt
distance vs jet 1 pt
TH2 * fHistDeltaPtvsArea1
delta pt between matched jets vs common energy 2 (%)
Double_t fVertex[3]
!event vertex
TH2 * fHistDeltaCorrPtvsJet2CorrPt
delta pt corr between matched jets vs jet 1 corr pt
void GetGeometricalMatchingLevel(AliEmcalJet *jet1, AliEmcalJet *jet2, Double_t &d) const
THnSparse * fHistJets2
jet1 THnSparse
TH2 * fHistDeltaPtOverJet2PtvsJet2Pt
delta pt / jet 1 pt between matched jets vs jet 1 pt
AliVCluster * Cluster(Int_t idx) const
TH2 * fHistDeltaPtvsArea2
delta pt between matched jets vs jet 1 area
void SetMakeGeneralHistograms(Bool_t g)
TH2 * fHistJets2NEFvsPt
inclusive jet pt vs. area histogram 2
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
TH2 * fHistCommonEnergy2vsJet2Pt
common energy 1 (%) vs jet 1 pt
TH2 * fHistDeltaPtvsDistance
delta pt / jet 2 pt between matched jets vs jet 2 pt
TH2 * fHistJet1MCPtvsJet2Pt
jet 1 MC pt - jet2 pt vs delta area
virtual ~AliJetResponseMaker()
TH2 * fHistJets2CEFvsCEFPt
Jet neutral energy fraction vs. jet pt 2.
void SetRejectionReasonLabels(TAxis *axis)
void UserCreateOutputObjects()
Main initialization function on the worker.
TH2 * fHistDistancevsCommonEnergy1
distance vs jet 2 pt
TH2 * fHistJets1CEFvsCEFPt
Jet neutral energy fraction vs. jet pt 1.
TH2 * fHistDeltaMCPtvsArea1
jet 1 MC pt - jet2 pt vs common energy 2 (%)
AliEmcalJetShapeProperties * GetShapeProperties() const
TH2 * fHistDeltaCorrPtOverJet1CorrPtvsJet1CorrPt
correlation jet 1 pt vs jet 2 pt
TH2 * fHistJets1PtArea
phi-eta distribution of jets 1
TH2 * fHistDeltaMCPtvsDeltaArea
jet 1 MC pt - jet2 pt vs jet 2 area
Container structure for EMCAL clusters.
TH2 * fHistDeltaCorrPtvsCommonEnergy1
delta pt corr between matched jets vs distance
void GetMCLabelMatchingLevel(AliEmcalJet *jet1, AliEmcalJet *jet2, Double_t &d1, Double_t &d2) const
Container for jet within the EMCAL jet framework.
void SetMatchedToClosest(UShort_t m)
Int_t fNbins
no. of pt bins
TH2 * fHistJet1CorrPtvsJet2CorrPt
delta pt corr between matched jets vs delta area
TH2 * fHistDeltaCorrPtvsDeltaArea
delta pt corr between matched jets vs jet 2 area