Skip to content

Commit 634bab9

Browse files
[PWGDQ] Fixing the issue with the indexes in the dilepton-hadron task (#3585)
* Fixing the issue with the indexes in the dilepton-hadron task * Application of the same change in dq-efficiency * Fix clang --------- Co-authored-by: Lucamicheletti93 <luca.mike93@gmail.com>
1 parent d55c3e5 commit 634bab9

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

PWGDQ/Tasks/dqEfficiency.cxx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,14 +1081,23 @@ struct AnalysisDileptonTrack {
10811081
// Set the global index offset to find the proper lepton
10821082
// TO DO: remove it once the issue with lepton index is solved
10831083
int indexOffset = -999;
1084+
std::vector<int> trackGlobalIndexes;
1085+
1086+
if (dileptons.size() > 0) {
1087+
for (auto track : tracks) {
1088+
trackGlobalIndexes.push_back(track.globalIndex());
1089+
// std::cout << track.index() << " " << track.globalIndex() << std::endl;
1090+
}
1091+
}
10841092
for (auto dilepton : dileptons) {
10851093

10861094
int indexLepton1 = dilepton.index0Id();
10871095
int indexLepton2 = dilepton.index1Id();
10881096

10891097
if (indexOffset == -999) {
1090-
indexOffset = indexLepton1;
1098+
indexOffset = trackGlobalIndexes.at(0);
10911099
}
1100+
trackGlobalIndexes.clear();
10921101

10931102
auto lepton1 = tracks.iteratorAt(indexLepton1 - indexOffset);
10941103
auto lepton2 = tracks.iteratorAt(indexLepton2 - indexOffset);

PWGDQ/Tasks/tableReader.cxx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1245,6 +1245,14 @@ struct AnalysisDileptonHadron {
12451245
// Set the global index offset to find the proper lepton
12461246
// TO DO: remove it once the issue with lepton index is solved
12471247
int indexOffset = -999;
1248+
std::vector<int> trackGlobalIndexes;
1249+
1250+
if (dileptons.size() > 0) {
1251+
for (auto track : tracks) {
1252+
trackGlobalIndexes.push_back(track.globalIndex());
1253+
// std::cout << track.index() << " " << track.globalIndex() << std::endl;
1254+
}
1255+
}
12481256
// loop once over dileptons for QA purposes
12491257
for (auto dilepton : dileptons) {
12501258
VarManager::FillTrack<fgDileptonFillMap>(dilepton, fValuesDilepton);
@@ -1255,10 +1263,13 @@ struct AnalysisDileptonHadron {
12551263
int indexLepton2 = dilepton.index1Id();
12561264

12571265
if (indexOffset == -999) {
1258-
indexOffset = indexLepton1;
1266+
indexOffset = trackGlobalIndexes.at(0);
12591267
}
1268+
trackGlobalIndexes.clear();
12601269

12611270
// get full track info of tracks based on the index
1271+
std::cout << indexLepton1 - indexOffset << std::endl;
1272+
std::cout << indexLepton2 - indexOffset << std::endl;
12621273
auto lepton1 = tracks.iteratorAt(indexLepton1 - indexOffset);
12631274
auto lepton2 = tracks.iteratorAt(indexLepton2 - indexOffset);
12641275

0 commit comments

Comments
 (0)