Skip to content

Commit

Permalink
cofde formats
Browse files Browse the repository at this point in the history
  • Loading branch information
gkaratha committed Feb 16, 2024
1 parent 1ec926f commit ff35286
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion DataFormats/L1Trigger/interface/TkTripletWord.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ namespace l1t {
ditrack_maxz0_t ditrack_maxz0,
unassigned_t unassigned);

template<class packVarType>
template <class packVarType>
inline void packIntoWord(unsigned int& currentOffset, unsigned int wordChunkSize, packVarType& packVar);

private:
Expand Down
16 changes: 9 additions & 7 deletions DataFormats/L1Trigger/src/TkTripletWord.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ namespace l1t {
valid, pt, eta, phi, mass, charge, ditrack_minmass, ditrack_maxmass, ditrack_minz0, ditrack_maxz0, unassigned);
}

template<class packVarType>
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 <class packVarType>
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,
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
Expand All @@ -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;
}
}

Expand Down
2 changes: 0 additions & 2 deletions L1Trigger/L1TTrackMatch/plugins/L1TrackUnpacker.h
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down

0 comments on commit ff35286

Please sign in to comment.