diff --git a/DataFormats/L1Trigger/interface/TkTripletWord.h b/DataFormats/L1Trigger/interface/TkTripletWord.h index dc49fbdf81652..42afd72cacceb 100644 --- a/DataFormats/L1Trigger/interface/TkTripletWord.h +++ b/DataFormats/L1Trigger/interface/TkTripletWord.h @@ -234,7 +234,7 @@ namespace l1t { ditrack_maxz0_t ditrack_maxz0, unassigned_t unassigned); - template + template inline void packIntoWord(unsigned int& currentOffset, unsigned int wordChunkSize, packVarType& packVar); private: diff --git a/DataFormats/L1Trigger/src/TkTripletWord.cc b/DataFormats/L1Trigger/src/TkTripletWord.cc index 1df6ca077571c..2131ff414f293 100644 --- a/DataFormats/L1Trigger/src/TkTripletWord.cc +++ b/DataFormats/L1Trigger/src/TkTripletWord.cc @@ -19,12 +19,14 @@ namespace l1t { valid, pt, eta, phi, mass, charge, ditrack_minmass, ditrack_maxmass, ditrack_minz0, ditrack_maxz0, unassigned); } - template - inline void TkTripletWord::packIntoWord(unsigned int& currentOffset, unsigned int wordChunkSize, packVarType& packVar){ - for (unsigned int b = currentOffset; b < (currentOffset + wordChunkSize); ++b) { - tkTripletWord_.set(b, packVar[b-currentOffset]); - } - currentOffset += wordChunkSize; + template + inline void TkTripletWord::packIntoWord(unsigned int& currentOffset, + unsigned int wordChunkSize, + packVarType& packVar) { + for (unsigned int b = currentOffset; b < (currentOffset + wordChunkSize); ++b) { + tkTripletWord_.set(b, packVar[b - currentOffset]); + } + currentOffset += wordChunkSize; } void TkTripletWord::setTkTripletWord(valid_t valid, @@ -50,6 +52,6 @@ namespace l1t { packIntoWord(offset, TkTripletBitWidths::kDiTrackMaxMassSize, ditrack_maxmass); packIntoWord(offset, TkTripletBitWidths::kDiTrackMinZ0Size, ditrack_minz0); packIntoWord(offset, TkTripletBitWidths::kDiTrackMaxZ0Size, ditrack_maxz0); -} + } } //namespace l1t diff --git a/L1Trigger/L1TTrackMatch/plugins/L1TrackTripletEmulatorProducer.cc b/L1Trigger/L1TTrackMatch/plugins/L1TrackTripletEmulatorProducer.cc index b45e1e578e1f8..3af5706f3e2b3 100644 --- a/L1Trigger/L1TTrackMatch/plugins/L1TrackTripletEmulatorProducer.cc +++ b/L1Trigger/L1TTrackMatch/plugins/L1TrackTripletEmulatorProducer.cc @@ -195,7 +195,9 @@ void L1TrackTripletEmulatorProducer::produce(Event &iEvent, const EventSetup &iS L1track trk2{-99, -99, -99, -99, -99, -99, -99, 0}; L1track trk3{-99, -99, -99, -99, -99, -99, -99, 0}; + int current_track_idx = -1; for (auto current_track : *TTTrackHandle) { + current_track_idx += 1; double current_track_pt = 0; if (use_float_track_precision_) current_track_pt = current_track->momentum().perp(); @@ -213,7 +215,7 @@ void L1TrackTripletEmulatorProducer::produce(Event &iEvent, const EventSetup &iS trk1.MVA = current_track->trkMVA1(); trk1.Nstubs = current_track->getStubRefs().size(); trk1.Z0 = current_track->z0(); - trk1.Index = &(*current_track) - &(*TTTrackHandle->at(0)); + trk1.Index = current_track_idx; } else { trk1.Pt = FloatPtFromBits(*current_track); trk1.Eta = FloatEtaFromBits(*current_track); @@ -222,7 +224,7 @@ void L1TrackTripletEmulatorProducer::produce(Event &iEvent, const EventSetup &iS trk1.MVA = current_track->trkMVA1(); trk1.Nstubs = current_track->getStubRefs().size(); trk1.Z0 = FloatZ0FromBits(*current_track); - trk1.Index = &(*current_track) - &(*TTTrackHandle->at(0)); + trk1.Index = current_track_idx; } } diff --git a/L1Trigger/L1TTrackMatch/plugins/L1TrackUnpacker.h b/L1Trigger/L1TTrackMatch/plugins/L1TrackUnpacker.h index 2e249b3558fd2..5d7f021116816 100644 --- a/L1Trigger/L1TTrackMatch/plugins/L1TrackUnpacker.h +++ b/L1Trigger/L1TTrackMatch/plugins/L1TrackUnpacker.h @@ -10,8 +10,6 @@ #include "DataFormats/L1TrackTrigger/interface/TTTypes.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" - - namespace l1trackunpacker { //For precision studies const unsigned int PT_INTPART_BITS{9};