File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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);
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments