22 #include <TClonesArray.h> 24 #include <THnSparse.h> 27 #include "AliAnalysisManager.h" 28 #include "AliVCluster.h" 29 #include "AliVTrack.h" 44 fMatching(kNoMatching),
47 fUseCellsToMatch(kFALSE),
52 fDeltaEtaDeltaPhiAxis(0),
61 fJetRelativeEPAngle(0),
64 fHistRejectionReason1(0),
65 fHistRejectionReason2(0),
71 fHistJets1CorrPtArea(0),
73 fHistJets1CEFvsCEFPt(0),
77 fHistJets2CorrPtArea(0),
79 fHistJets2CEFvsCEFPt(0),
81 fHistCommonEnergy1vsJet1Pt(0),
82 fHistCommonEnergy2vsJet2Pt(0),
83 fHistDistancevsJet1Pt(0),
84 fHistDistancevsJet2Pt(0),
85 fHistDistancevsCommonEnergy1(0),
86 fHistDistancevsCommonEnergy2(0),
87 fHistCommonEnergy1vsCommonEnergy2(0),
88 fHistDeltaEtaDeltaPhi(0),
89 fHistJet2PtOverJet1PtvsJet2Pt(0),
90 fHistJet1PtOverJet2PtvsJet1Pt(0),
91 fHistDeltaPtvsJet1Pt(0),
92 fHistDeltaPtvsJet2Pt(0),
93 fHistDeltaPtOverJet1PtvsJet1Pt(0),
94 fHistDeltaPtOverJet2PtvsJet2Pt(0),
95 fHistDeltaPtvsDistance(0),
96 fHistDeltaPtvsCommonEnergy1(0),
97 fHistDeltaPtvsCommonEnergy2(0),
98 fHistDeltaPtvsArea1(0),
99 fHistDeltaPtvsArea2(0),
100 fHistDeltaPtvsDeltaArea(0),
101 fHistJet1PtvsJet2Pt(0),
102 fHistDeltaCorrPtOverJet1CorrPtvsJet1CorrPt(0),
103 fHistDeltaCorrPtOverJet2CorrPtvsJet2CorrPt(0),
104 fHistDeltaCorrPtvsJet1CorrPt(0),
105 fHistDeltaCorrPtvsJet2CorrPt(0),
106 fHistDeltaCorrPtvsDistance(0),
107 fHistDeltaCorrPtvsCommonEnergy1(0),
108 fHistDeltaCorrPtvsCommonEnergy2(0),
109 fHistDeltaCorrPtvsArea1(0),
110 fHistDeltaCorrPtvsArea2(0),
111 fHistDeltaCorrPtvsDeltaArea(0),
112 fHistJet1CorrPtvsJet2CorrPt(0),
113 fHistDeltaMCPtOverJet1MCPtvsJet1MCPt(0),
114 fHistDeltaMCPtOverJet2PtvsJet2Pt(0),
115 fHistDeltaMCPtvsJet1MCPt(0),
116 fHistDeltaMCPtvsJet2Pt(0),
117 fHistDeltaMCPtvsDistance(0),
118 fHistDeltaMCPtvsCommonEnergy1(0),
119 fHistDeltaMCPtvsCommonEnergy2(0),
120 fHistDeltaMCPtvsArea1(0),
121 fHistDeltaMCPtvsArea2(0),
122 fHistDeltaMCPtvsDeltaArea(0),
123 fHistJet1MCPtvsJet2Pt(0)
127 SetMakeGeneralHistograms(kTRUE);
133 fMatching(kNoMatching),
136 fUseCellsToMatch(kFALSE),
141 fDeltaEtaDeltaPhiAxis(0),
150 fJetRelativeEPAngle(0),
153 fHistRejectionReason1(0),
154 fHistRejectionReason2(0),
160 fHistJets1CorrPtArea(0),
161 fHistJets1NEFvsPt(0),
162 fHistJets1CEFvsCEFPt(0),
166 fHistJets2CorrPtArea(0),
167 fHistJets2NEFvsPt(0),
168 fHistJets2CEFvsCEFPt(0),
170 fHistCommonEnergy1vsJet1Pt(0),
171 fHistCommonEnergy2vsJet2Pt(0),
172 fHistDistancevsJet1Pt(0),
173 fHistDistancevsJet2Pt(0),
174 fHistDistancevsCommonEnergy1(0),
175 fHistDistancevsCommonEnergy2(0),
176 fHistCommonEnergy1vsCommonEnergy2(0),
177 fHistDeltaEtaDeltaPhi(0),
178 fHistJet2PtOverJet1PtvsJet2Pt(0),
179 fHistJet1PtOverJet2PtvsJet1Pt(0),
180 fHistDeltaPtvsJet1Pt(0),
181 fHistDeltaPtvsJet2Pt(0),
182 fHistDeltaPtOverJet1PtvsJet1Pt(0),
183 fHistDeltaPtOverJet2PtvsJet2Pt(0),
184 fHistDeltaPtvsDistance(0),
185 fHistDeltaPtvsCommonEnergy1(0),
186 fHistDeltaPtvsCommonEnergy2(0),
187 fHistDeltaPtvsArea1(0),
188 fHistDeltaPtvsArea2(0),
189 fHistDeltaPtvsDeltaArea(0),
190 fHistJet1PtvsJet2Pt(0),
191 fHistDeltaCorrPtOverJet1CorrPtvsJet1CorrPt(0),
192 fHistDeltaCorrPtOverJet2CorrPtvsJet2CorrPt(0),
193 fHistDeltaCorrPtvsJet1CorrPt(0),
194 fHistDeltaCorrPtvsJet2CorrPt(0),
195 fHistDeltaCorrPtvsDistance(0),
196 fHistDeltaCorrPtvsCommonEnergy1(0),
197 fHistDeltaCorrPtvsCommonEnergy2(0),
198 fHistDeltaCorrPtvsArea1(0),
199 fHistDeltaCorrPtvsArea2(0),
200 fHistDeltaCorrPtvsDeltaArea(0),
201 fHistJet1CorrPtvsJet2CorrPt(0),
202 fHistDeltaMCPtOverJet1MCPtvsJet1MCPt(0),
203 fHistDeltaMCPtOverJet2PtvsJet2Pt(0),
204 fHistDeltaMCPtvsJet1MCPt(0),
205 fHistDeltaMCPtvsJet2Pt(0),
206 fHistDeltaMCPtvsDistance(0),
207 fHistDeltaMCPtvsCommonEnergy1(0),
208 fHistDeltaMCPtvsCommonEnergy2(0),
209 fHistDeltaMCPtvsArea1(0),
210 fHistDeltaMCPtvsArea2(0),
211 fHistDeltaMCPtvsDeltaArea(0),
212 fHistJet1MCPtvsJet2Pt(0)
231 fHistJets1PhiEta =
new TH2F(
"fHistJets1PhiEta",
"fHistJets1PhiEta", 40, -1, 1, 40, 0, TMath::Pi()*2);
271 fHistJets2PhiEta =
new TH2F(
"fHistJets2PhiEta",
"fHistJets2PhiEta", 40, -1, 1, 40, 0, TMath::Pi()*2);
638 max[dim] = 2*TMath::Pi()*(1 + 1./(nbins[dim]-1));
647 title[dim] =
"p_{T}";
653 title[dim] =
"A_{jet}";
676 title[dim] =
"z_{flavour}";
684 title[dim] =
"p_{T}^{D}";
692 title[dim] =
"#theta_{jet}^{EP}";
695 max[dim] = TMath::Pi()/2;
699 title[dim] =
"p_{T,particle}^{leading} (GeV/c)";
705 Int_t dim1 = dim, dim2 = dim;
708 title[dim1] =
"p_{T}^{corr}";
716 title[dim1] =
"p_{T}^{MC}";
723 fHistJets1 =
new THnSparseD(
"fHistJets1",
"fHistJets1",dim1,nbins,min,max);
724 for (
Int_t i = 0; i < dim1; i++)
729 title[dim2] =
"p_{T}^{corr}";
736 fHistJets2 =
new THnSparseD(
"fHistJets2",
"fHistJets2",dim2,nbins,min,max);
737 for (
Int_t i = 0; i < dim2; i++)
745 title[dim] =
"p_{T,1}";
751 title[dim] =
"p_{T,2}";
757 title[dim] =
"A_{jet,1}";
763 title[dim] =
"A_{jet,2}";
769 title[dim] =
"distance";
787 title[dim] =
"p_{T,particle,1}^{leading} (GeV/c)";
793 title[dim] =
"p_{T,particle,2}^{leading} (GeV/c)";
800 title[dim] =
"#deltaA_{jet}";
806 title[dim] =
"#deltap_{T}";
813 title[dim] =
"p_{T,1}^{corr}";
820 title[dim] =
"p_{T,2}^{corr}";
827 title[dim] =
"#deltap_{T}^{corr}";
834 title[dim] =
"#delta#eta";
840 title[dim] =
"#delta#phi";
842 min[dim] = -TMath::Pi()/2;
843 max[dim] = TMath::Pi()*3/2;
847 title[dim] =
"p_{T,1}^{MC}";
854 title[dim] =
"#deltap_{T}^{MC}";
863 title[dim] =
"NEF_{1}";
869 title[dim] =
"NEF_{2}";
877 title[dim] =
"Z_{1}";
883 title[dim] =
"Z_{2}";
891 title[dim] =
"z_{flavour,1}";
897 title[dim] =
"z_{flavour,2}";
905 title[dim] =
"p_{T,1}^{D}";
911 title[dim] =
"p_{T,2}^{D}";
919 title[dim] =
"Z_{g,1}";
924 title[dim] =
"Z_{g,2}";
932 title[dim] =
"dR_{1}";
937 title[dim] =
"dR_{2}";
945 title[dim] =
"p_{T,g,1}";
950 title[dim] =
"p_{T,g,2}";
958 title[dim] =
"DBC_{1}";
963 title[dim] =
"DBC_{2}";
971 title[dim] =
"#theta_{jet,1}^{EP}";
974 max[dim] = TMath::Pi()/2;
977 title[dim] =
"#theta_{jet,2}^{EP}";
980 max[dim] = TMath::Pi()/2;
984 fHistMatching =
new THnSparseD(
"fHistMatching",
"fHistMatching",dim,nbins,min,max);
986 for (
Int_t i = 0; i < dim; i++)
1002 if (!jets1 || !jets2)
return;
1030 if (embeddingHelper) {
1048 if (zleading == 1 || (zleading > 1 && zleading - 1 < 1e-3)) zleading = 0.999;
1056 ptflavour = hftrack->Pt();
1058 if (zflavour == 1 || (zflavour > 1 && zflavour - 1 < 1e-3)) zflavour = 0.999;
1063 THnSparse *histo = 0;
1075 for (
Int_t i = 0; i < histo->GetNdimensions(); i++) {
1078 contents[i] = jet->
Phi();
1079 else if (
title==
"#eta")
1080 contents[i] = jet->
Eta();
1081 else if (
title==
"p_{T}")
1082 contents[i] = jet->
Pt();
1083 else if (
title==
"A_{jet}")
1084 contents[i] = jet->
Area();
1085 else if (
title==
"NEF")
1086 contents[i] = jet->
NEF();
1087 else if (
title==
"Z")
1088 contents[i] = zleading;
1089 else if (
title==
"p_{T}^{corr}")
1090 contents[i] = corrpt;
1091 else if (
title==
"p_{T}^{MC}")
1092 contents[i] = jet->
MCPt();
1093 else if (
title==
"p_{T,particle}^{leading} (GeV/c)")
1094 contents[i] = leadPart.Pt();
1095 else if (
title==
"z_{flavour}")
1096 contents[i] = zflavour;
1097 else if (
title==
"p_{T}^{D}")
1098 contents[i] = ptflavour;
1099 else if (
title==
"#theta_{jet}^{EP}")
1100 contents[i] = jetRelativeEPAngle;
1102 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1105 histo->Fill(contents);
1117 else if (Set == 2) {
1151 if (zleading1 == 1 || (zleading1 > 1 && zleading1 - 1 < 1e-3)) zleading1 = 0.999;
1159 ptflavour1 = hftrack1->Pt();
1161 if (zflavour1 == 1 || (zflavour1 > 1 && zflavour1 - 1 < 1e-3)) zflavour1 = 0.999;
1169 if (zleading2 == 1 || (zleading2 > 1 && zleading2 - 1 < 1e-3)) zleading2 = 0.999;
1177 ptflavour2 = hftrack2->Pt();
1179 if (zflavour2 == 1 || (zflavour2 > 1 && zflavour2 - 1 < 1e-3)) zflavour2 = 0.999;
1188 if (
title==
"p_{T,1}")
1189 contents[i] = jet1->
Pt();
1190 else if (
title==
"p_{T,2}")
1191 contents[i] = jet2->
Pt();
1192 else if (
title==
"A_{jet,1}")
1193 contents[i] = jet1->
Area();
1194 else if (
title==
"A_{jet,2}")
1195 contents[i] = jet2->
Area();
1196 else if (
title==
"distance")
1198 else if (
title==
"CE1")
1200 else if (
title==
"CE2")
1202 else if (
title==
"#deltaA_{jet}")
1203 contents[i] = jet1->
Area()-jet2->
Area();
1204 else if (
title==
"#deltap_{T}")
1205 contents[i] = jet1->
Pt()-jet2->
Pt();
1206 else if (
title==
"#delta#eta")
1207 contents[i] = jet1->
Eta()-jet2->
Eta();
1208 else if (
title==
"#delta#phi")
1209 contents[i] = jet1->
Phi()-jet2->
Phi();
1210 else if (
title==
"p_{T,1}^{corr}")
1211 contents[i] = corrpt1;
1212 else if (
title==
"p_{T,2}^{corr}")
1213 contents[i] = corrpt2;
1214 else if (
title==
"#deltap_{T}^{corr}")
1215 contents[i] = corrpt1-corrpt2;
1216 else if (
title==
"p_{T,1}^{MC}")
1217 contents[i] = jet1->
MCPt();
1218 else if (
title==
"#deltap_{T}^{MC}")
1219 contents[i] = jet1->
MCPt()-jet2->
Pt();
1220 else if (
title==
"NEF_{1}")
1221 contents[i] = jet1->
NEF();
1222 else if (
title==
"NEF_{2}")
1223 contents[i] = jet2->
NEF();
1224 else if (
title==
"Z_{1}")
1225 contents[i] = zleading1;
1226 else if (
title==
"Z_{2}")
1227 contents[i] = zleading2;
1228 else if (
title==
"p_{T,particle,1}^{leading} (GeV/c)")
1229 contents[i] = leadPart1.Pt();
1230 else if (
title==
"p_{T,particle,2}^{leading} (GeV/c)")
1231 contents[i] = leadPart2.Pt();
1232 else if (
title==
"z_{flavour,1}")
1233 contents[i] = zflavour1;
1234 else if (
title==
"z_{flavour,2}")
1235 contents[i] = zflavour2;
1236 else if (
title==
"p_{T,1}^{D}")
1237 contents[i] = ptflavour1;
1238 else if (
title==
"p_{T,2}^{D}")
1239 contents[i] = ptflavour2;
1240 else if (
title==
"Z_{g,1}")
1242 else if (
title==
"Z_{g,2}")
1244 else if (
title==
"dR_{1}")
1246 else if (
title==
"dR_{2}")
1248 else if (
title==
"p_{T,g,1}")
1250 else if (
title==
"p_{T,g,2}")
1252 else if (
title==
"DBC_{1}")
1254 else if (
title==
"DBC_{2}")
1256 else if (
title==
"#theta_{jet,1}^{EP}")
1257 contents[i] = jetRelativeEPAngle1;
1258 else if (
title==
"#theta_{jet,2}^{EP}")
1259 contents[i] = jetRelativeEPAngle2;
1261 AliWarning(Form(
"Unable to fill dimension %s!",
title.Data()));
1301 Double_t dcorrpt = corrpt1 - corrpt2;
1342 if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray())
return;
1344 if (
fMatching ==
kMCLabel && (!jets2->GetIsParticleLevel() || jets1->GetIsParticleLevel())) {
1345 if (jets1->GetIsParticleLevel() == jets2->GetIsParticleLevel()) {
1346 AliWarning(
"Changing matching type from MC label to same collection...");
1350 AliWarning(
"Changing matching type from MC label to geometrical...");
1355 if (jets2->GetIsParticleLevel() && !jets1->GetIsParticleLevel()) {
1356 AliWarning(
"Changing matching type from same collection to MC label...");
1360 AliWarning(
"Changing matching type from same collection to geometrical...");
1382 if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray())
return kFALSE;
1396 jets1->ResetCurrentID();
1401 if (!jet2)
continue;
1408 AliDebug(2,Form(
"Found matching: jet1 pt = %f, eta = %f, phi = %f, jet2 pt = %f, eta = %f, phi = %f",
1409 jet1->
Pt(), jet1->
Eta(), jet1->
Phi(),
1410 jet2->
Pt(), jet2->
Eta(), jet2->
Phi()));
1424 if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray())
return;
1429 jets2->ResetCurrentID();
1432 jets1->ResetCurrentID();
1438 jets2->ResetCurrentID();
1457 if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray())
return;
1471 if (tracks1 && tracks1->GetArray()) {
1473 AliVParticle *track = jet1->
Track(iTrack);
1475 AliWarning(Form(
"Could not find track %d!", iTrack));
1479 Int_t MClabel = TMath::Abs(track->GetLabel());
1481 if (MClabel != 0)
continue;
1484 AliDebug(3,Form(
"Track %d (pT = %f) is not a MC particle (MClabel = %d)!",iTrack,track->Pt(),MClabel));
1485 totalPt1 -= track->Pt();
1493 AliVCluster *clus = jet1->
Cluster(iClus);
1495 AliWarning(Form(
"Could not find cluster %d!", iClus));
1499 clus->GetMomentum(part,
fVertex);
1501 for (
Int_t iCell = 0; iCell < clus->GetNCells(); iCell++) {
1502 Int_t cellId = clus->GetCellAbsId(iCell);
1503 Double_t cellFrac = clus->GetCellAmplitudeFraction(iCell);
1507 if (MClabel != 0)
continue;
1510 AliDebug(3,Form(
"Cell %d (frac = %f) is not a MC particle (MClabel = %d)!",iCell,cellFrac,MClabel));
1511 totalPt1 -= part.Pt() * cellFrac;
1512 d1 -= part.Pt() * cellFrac;
1518 AliVCluster *clus = jet1->
Cluster(iClus);
1520 AliWarning(Form(
"Could not find cluster %d!", iClus));
1523 TLorentzVector
part;
1524 clus->GetMomentum(part,
fVertex);
1526 Int_t MClabel = TMath::Abs(clus->GetLabel());
1528 if (MClabel != 0)
continue;
1531 AliDebug(3,Form(
"Cluster %d (pT = %f) is not a MC particle (MClabel = %d)!",iClus,part.Pt(),MClabel));
1532 totalPt1 -= part.Pt();
1538 Bool_t track2Found = kFALSE;
1543 AliVParticle *track = jet1->
Track(iTrack);
1545 AliWarning(Form(
"Could not find track %d!", iTrack));
1548 Int_t MClabel = TMath::Abs(track->GetLabel());
1550 if (MClabel <= 0)
continue;
1553 index = tracks2->GetIndexFromLabel(MClabel);
1555 AliDebug(2,Form(
"Track %d (pT = %f) does not have an associated MC particle (MClabel = %d)!",iTrack,track->Pt(),MClabel));
1559 if (index2 != index)
continue;
1565 AliVParticle *MCpart = jet2->
Track(iTrack2);
1566 AliDebug(3,Form(
"Track %d (pT = %f, eta = %f, phi = %f) is associated with the MC particle %d (pT = %f, eta = %f, phi = %f)!",
1567 iTrack,track->Pt(),track->Eta(),track->Phi(),MClabel,MCpart->Pt(),MCpart->Eta(),MCpart->Phi()));
1571 track2Found = kTRUE;
1577 AliVCluster *clus = jet1->
Cluster(iClus);
1579 AliWarning(Form(
"Could not find cluster %d!", iClus));
1583 clus->GetMomentum(part,
fVertex);
1585 for (
Int_t iCell = 0; iCell < clus->GetNCells(); iCell++) {
1586 Int_t cellId = clus->GetCellAbsId(iCell);
1587 Double_t cellFrac = clus->GetCellAmplitudeFraction(iCell);
1591 if (MClabel <= 0)
continue;
1594 index1 = tracks2->GetIndexFromLabel(MClabel);
1596 AliDebug(3,Form(
"Cell %d (frac = %f) does not have an associated MC particle (MClabel = %d)!",iCell,cellFrac,MClabel));
1600 if (index2 != index1)
continue;
1603 d1 -= part.Pt() * cellFrac;
1606 AliVParticle *MCpart = jet2->
Track(iTrack2);
1607 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)!",
1608 iCell,iClus,part.Pt(),part.Eta(),part.
Phi_0_2pi(),MClabel,MCpart->Pt(),MCpart->Eta(),MCpart->Phi()));
1609 d2 -= MCpart->Pt() * cellFrac;
1612 track2Found = kTRUE;
1618 AliVCluster *clus = jet1->
Cluster(iClus);
1620 AliWarning(Form(
"Could not find cluster %d!", iClus));
1624 clus->GetMomentum(part,
fVertex);
1626 Int_t MClabel = TMath::Abs(clus->GetLabel());
1628 if (MClabel <= 0)
continue;
1631 index = tracks2->GetIndexFromLabel(MClabel);
1634 AliDebug(3,Form(
"Cluster %d (pT = %f) does not have an associated MC particle (MClabel = %d)!",iClus,part.Pt(),MClabel));
1638 if (index2 != index)
continue;
1644 AliVParticle *MCpart = jet2->
Track(iTrack2);
1645 AliDebug(3,Form(
"Cluster %d (pT = %f, eta = %f, phi = %f) is associated with the MC particle %d (pT = %f, eta = %f, phi = %f)!",
1646 iClus,part.Pt(),part.Eta(),part.
Phi_0_2pi(),MClabel,MCpart->Pt(),MCpart->Eta(),MCpart->Phi()));
1651 track2Found = kTRUE;
1679 if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray())
return;
1691 if (tracks1 && tracks2) {
1697 if (index2 == index1) {
1698 AliVParticle *part1 = jet1->
Track(iTrack1);
1700 AliWarning(Form(
"Could not find track %d!", index1));
1703 AliVParticle *part2 = jet2->
Track(iTrack2);
1705 AliWarning(Form(
"Could not find track %d!", index2));
1718 if (clusters1 && clusters2) {
1727 AliWarning(
"ATTENTION ATTENTION ATTENTION: this section of the AliJetResponseMaker code needs to be revised and tested before using it for physics!!!");
1730 Int_t ncells1[nClus1];
1734 Int_t *sortedIndexes1[nClus1];
1736 for (
Int_t iClus1 = 0; iClus1 < nClus1; iClus1++) {
1738 AliVCluster *clus1 = clusters1->
GetCluster(index1);
1740 AliWarning(Form(
"Could not find cluster %d!", index1));
1741 ncells1[iClus1] = 0;
1742 cellsId1[iClus1] = 0;
1743 cellsFrac1[iClus1] = 0;
1744 cellsClusFrac1[iClus1] = 0;
1745 sortedIndexes1[iClus1] = 0;
1746 ptClus1[iClus1] = 0;
1749 TLorentzVector part1;
1750 clus1->GetMomentum(part1,
fVertex);
1752 ncells1[iClus1] = clus1->GetNCells();
1753 cellsId1[iClus1] = clus1->GetCellsAbsId();
1754 cellsFrac1[iClus1] = clus1->GetCellsAmplitudeFraction();
1755 cellsClusFrac1[iClus1] =
new Double_t[ncells1[iClus1]];
1756 sortedIndexes1[iClus1] =
new Int_t[ncells1[iClus1]];
1757 ptClus1[iClus1] = part1.Pt();
1759 for (
Int_t iCell = 0; iCell < ncells1[iClus1]; iCell++) {
1760 cellsClusFrac1[iClus1][iCell] =
fCaloCells->GetCellAmplitude(cellsId1[iClus1][iCell]) / clus1->E();
1763 TMath::Sort(ncells1[iClus1], cellsId1[iClus1], sortedIndexes1[iClus1], kFALSE);
1768 const Int_t maxNcells2 = 11520;
1769 Int_t sortedIndexes2[maxNcells2];
1770 for (
Int_t iClus2 = 0; iClus2 < nClus2; iClus2++) {
1772 AliVCluster *clus2 = clusters2->
GetCluster(index2);
1774 AliWarning(Form(
"Could not find cluster %d!", index2));
1777 Int_t ncells2 = clus2->GetNCells();
1778 if (ncells2 >= maxNcells2) {
1779 AliError(Form(
"Number of cells in the cluster %d >= %d",ncells2,maxNcells2));
1782 UShort_t *cellsId2 = clus2->GetCellsAbsId();
1783 Double_t *cellsFrac2 = clus2->GetCellsAmplitudeFraction();
1786 for (
Int_t iCell = 0; iCell < ncells2; iCell++) {
1787 cellsClusFrac2[iCell] =
fCaloCells->GetCellAmplitude(cellsId2[iCell]) / clus2->E();
1790 TLorentzVector part2;
1791 clus2->GetMomentum(part2,
fVertex);
1794 TMath::Sort(ncells2, cellsId2, sortedIndexes2, kFALSE);
1796 for (
Int_t iClus1 = 0; iClus1 < nClus1; iClus1++) {
1797 if (sortedIndexes1[iClus1] == 0)
1799 Int_t iCell1 = 0, iCell2 = 0;
1800 while (iCell1 < ncells1[iClus1] && iCell2 < ncells2) {
1801 if (cellsId1[iClus1][sortedIndexes1[iClus1][iCell1]] == cellsId2[sortedIndexes2[iCell2]]) {
1802 d1 -= cellsFrac1[iClus1][sortedIndexes1[iClus1][iCell1]] * cellsClusFrac1[iClus1][sortedIndexes1[iClus1][iCell1]] * ptClus1[iClus1];
1803 d2 -= cellsFrac2[sortedIndexes2[iCell2]] * cellsClusFrac2[sortedIndexes2[iCell2]] * ptClus2;
1807 else if (cellsId1[iClus1][sortedIndexes1[iClus1][iCell1]] > cellsId2[sortedIndexes2[iCell2]]) {
1815 delete[] cellsClusFrac2;
1817 for (
Int_t iClus1 = 0; iClus1 < nClus1; iClus1++) {
1818 delete[] cellsClusFrac1[iClus1];
1819 delete[] sortedIndexes1[iClus1];
1827 if (index2 == index1) {
1828 AliVCluster *clus1 = jet1->
Cluster(iClus1);
1830 AliWarning(Form(
"Could not find cluster %d!", index1));
1833 AliVCluster *clus2 = jet2->
Cluster(iClus2);
1835 AliWarning(Form(
"Could not find cluster %d!", index2));
1838 TLorentzVector part1, part2;
1839 clus1->GetMomentum(part1,
fVertex);
1840 clus2->GetMomentum(part2,
fVertex);
1891 if (d1 < jet1->ClosestJetDistance()) {
1895 else if (d1 < jet1->SecondClosestJetDistance()) {
1902 if (d2 < jet2->ClosestJetDistance()) {
1906 else if (d2 < jet2->SecondClosestJetDistance()) {
1920 if (!jets1 || !jets1->GetArray() || !jets2 || !jets2->GetArray())
return kFALSE;
1925 jets2->ResetCurrentID();
1928 AliDebug(2,Form(
"Processing jet (2) %d", jets2->GetCurrentID()));
1932 UInt_t rejectionReason = 0;
1933 if (jets2->
AcceptJet(jet2, rejectionReason))
1940 if (!jet1)
continue;
1941 rejectionReason = 0;
1942 if (!jets1->
AcceptJet(jet1, rejectionReason))
continue;
1947 if (jets2->GetIsParticleLevel() && !jets1->GetIsParticleLevel())
1949 else if (jets1->GetIsParticleLevel() == jets2->GetIsParticleLevel())
1964 jets1->ResetCurrentID();
1966 UInt_t rejectionReason = 0;
1967 if (!jets1->
AcceptJet(jet1, rejectionReason)) {
1972 AliDebug(2,Form(
"Processing jet (1) %d", jets1->GetCurrentID()));
1990 Double_t dphi = (epAngle - jetAngle);
1993 if( dphi<-1*TMath::Pi() ){
1994 dphi = dphi + 1*TMath::Pi();
1997 if( (dphi>0) && (dphi<1*TMath::Pi()/2) ){
1999 }
else if( (dphi>1*TMath::Pi()/2) && (dphi<1*TMath::Pi()) ){
2000 dphi = 1*TMath::Pi() - dphi;
2001 }
else if( (dphi<0) && (dphi>-1*TMath::Pi()/2) ){
2003 }
else if( (dphi<-1*TMath::Pi()/2) && (dphi>-1*TMath::Pi()) ){
2004 dphi = dphi + 1*TMath::Pi();
2008 if( dphi < 0 || dphi > TMath::Pi()/2 )
2009 AliWarning(Form(
"%s: dPHI not in range [0, 0.5*Pi]!", GetName()));
2018 const char *ntracks1,
2019 const char *nclusters1,
2023 const char *ntracks2,
2024 const char *nclusters2,
2031 const Int_t biasType,
2035 const char *cutType,
2036 const Int_t ptHardBin,
2039 const char *taskname,
2040 const Bool_t biggerMatrix,
2044 const Int_t jetTagging,
2052 ::Error(
"AddTaskJetResponseMaker",
"No analysis manager to connect to.");
2058 if (!mgr->GetInputEventHandler())
2060 ::Error(
"AddTaskJetResponseMaker",
"This task requires an input event handler");
2068 TString name(Form(
"%s_%s_%s_Bias%d_BiasType%d_%s",taskname,njets1,njets2,(
Int_t)floor(jetBias),biasType,cutType));
2070 if (minCent != -999 && maxCent != -999)
2071 name += Form(
"_Cent%d_%d", (
Int_t)floor(minCent), (
Int_t)floor(maxCent));
2073 if (ptHardBin != -999)
2074 name += Form(
"_PtHard%d", ptHardBin);
2076 name += Form(
"_NEF%d", (
Int_t)(100*nefmaxcut));
2095 jetCont1->SetIsParticleLevel(kFALSE);
2098 jetCont1->
SetNEFCut(nefmincut,nefmaxcut);
2113 jetCont2->SetIsParticleLevel(kTRUE);
2120 jetTask->
SetMatching(matching, maxDistance1, maxDistance2);
2133 mgr->AddTask(jetTask);
2136 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
2138 contname +=
"_histos";
2139 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
2140 TList::Class(),AliAnalysisManager::kOutputContainer,
2141 Form(
"%s", AliAnalysisManager::GetCommonFileName()));
2142 mgr->ConnectInput (jetTask, 0, cinput1 );
2143 mgr->ConnectOutput (jetTask, 1, coutput1 );
void SetSecondClosestJet(AliEmcalJet *j, Double_t d)
void SetCentRange(Double_t min, Double_t max)
TH2 * fHistJets2PtArea
phi-eta distribution of jets 2
TH2 * fHistRejectionReason1
whether the jet2 collection has to be average subtracted
void SetParticlePtCut(Double_t cut)
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.
void SetLeadingHadronType(Int_t t)
TH2 * fHistDeltaCorrPtvsArea2
delta pt corr between matched jets vs jet 1 area
void FillJetHisto(AliEmcalJet *jet, Int_t Set)
void SetPtBiasJetTrack(Float_t b)
Int_t fJetRelativeEPAngle
add jet angle relative to the EP in matching THnSparse (default=0)
AliEmcalEmbeddingQA fEmbeddingQA
! Embedding QA hists (will only be added if embedding)
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.
Declaration of class AliAnalysisTaskEmcalEmbeddingHelper.
AliVParticle * Track(Int_t idx) const
virtual Bool_t AcceptJet(Int_t i, UInt_t &rejectionReason) const
AliJetContainer * AddJetContainer(const char *n, TString defaultCutType, Float_t jetRadius=0.4)
Double_t GetRelativeEPAngle(Double_t jetAngle, Double_t epAngle) const
THnSparse * fHistMatching
jet2 THnSparse
TH2 * fHistDeltaEtaDeltaPhi
common energy 1 (%) vs common energy 2 (%)
void SetPercAreaCut(Float_t p)
TH2 * fHistDeltaMCPtvsCommonEnergy1
jet 1 MC pt - jet2 pt vs distance
void SetVzRange(Double_t min, Double_t max)
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
void SetPtBiasJetClus(Float_t b)
AliClusterContainer * AddClusterContainer(const char *n)
Create new cluster container and attach it to the task.
TString part
use mixed event to constrain combinatorial background
Container for particles within the EMCAL framework.
void SetIsPythia(Bool_t i)
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
bool AddQAPlotsToList(TList *list)
TH2 * fHistDeltaPtvsJet1Pt
jet 1 pt over jet 2 pt vs jet 1 pt
void SetRhoName(const char *n)
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
bool IsInitialized() const
TH2 * fHistJets1PhiEta
matching THnSparse
UShort_t GetNumberOfClusters() const
void SetJetPtCut(Float_t cut)
THnSparse * fHistJets1
Rejection reason vs. jet pt.
UShort_t GetMatchingType() const
TH2 * fHistJet1PtOverJet2PtvsJet1Pt
jet 2 pt over jet 1 pt vs jet 2 pt
void SetPtHardBin(Int_t b)
Double_t Phi_0_2pi() const
TH2 * fHistDeltaCorrPtvsDistance
delta pt corr between matched jets vs jet 2 corr pt
Implementation of task to embed external events.
void FillMatchingHistos(AliEmcalJet *jet1, AliEmcalJet *jet2, Double_t d, Double_t CE1, Double_t CE2)
AliParticleContainer * AddParticleContainer(const char *n)
Create new particle container and attach it to the task.
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 (%)
void SetMatching(MatchingType t, Double_t p1=1, Double_t p2=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
static AliJetResponseMaker * AddTaskJetResponseMaker(const char *ntracks1="Tracks", const char *nclusters1="CaloClusters", const char *njets1="Jets", const char *nrho1="Rho", const Double_t jetradius1=0.2, const char *ntracks2="MCParticles", const char *nclusters2="", const char *njets2="MCJets", const char *nrho2="", const Double_t jetradius2=0.2, const Double_t jetptcut=1, const Double_t jetareacut=0.557, const Double_t jetBias=5, const Int_t biasType=0, const AliJetResponseMaker::MatchingType matching=AliJetResponseMaker::kGeometrical, const Double_t maxDistance1=0.25, const Double_t maxDistance2=0.25, const char *cutType="TPC", const Int_t ptHardBin=-999, const Double_t minCent=-999, const Double_t maxCent=-999, const char *taskname="AliJetResponseMaker", const Bool_t biggerMatrix=kFALSE, AliJetResponseMaker *address=0, const Double_t nefmincut=-10, const Double_t nefmaxcut=10, const Int_t jetTagging=0, const Double_t maxTrackPt=100)
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)
void ConnectParticleContainer(AliParticleContainer *c)
void RecordEmbeddedEventProperties()
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)
void SetHistoBins(Int_t nbins, Double_t min, Double_t max)
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
void ConnectClusterContainer(AliClusterContainer *c)
TH2 * fHistDeltaMCPtvsDeltaArea
jet 1 MC pt - jet2 pt vs jet 2 area
void SetMaxTrackPt(Float_t b)
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 SetFlavourCut(Int_t myflavour)
void SetMatchedToClosest(UShort_t m)
Int_t fNbins
no. of pt bins
TH2 * fHistJet1CorrPtvsJet2CorrPt
delta pt corr between matched jets vs delta area
void SetNEFCut(Float_t min=0., Float_t max=1.)
TH2 * fHistDeltaCorrPtvsDeltaArea
delta pt corr between matched jets vs jet 2 area
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()