Skip to content

Commit

Permalink
Changes after the code format checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexx Perloff authored and Alexx Perloff committed Sep 12, 2022
1 parent 1b9aa85 commit db7adce
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 86 deletions.
14 changes: 7 additions & 7 deletions L1Trigger/L1TTrackMatch/interface/L1TkEtMissEmuAlgo.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
// Namespace that defines constants and types used by the EtMiss Emulation
// Includes functions for writing LUTs and converting to integer representations
namespace l1tmetemu {

const unsigned int kInternalPtWidth{14};
const unsigned int kPtMagSize{9};
const unsigned int kMETSize{16}; // For output Magnitude default 16
const unsigned int kMETSize{16}; // For output Magnitude default 16
const unsigned int kMETMagSize{11};
const unsigned int kMETPhiSize{13}; // For Output Phi default 13
const unsigned int kEtExtra{4};
Expand All @@ -31,7 +31,7 @@ namespace l1tmetemu {
const unsigned int kAtanLUTSize{64};
const unsigned int kAtanLUTMagSize{2};

typedef ap_ufixed<kMETSize,kMETMagSize, AP_RND_CONV, AP_SAT> METWord_t;
typedef ap_ufixed<kMETSize, kMETMagSize, AP_RND_CONV, AP_SAT> METWord_t;
typedef ap_int<kMETPhiSize> METWordphi_t;
typedef ap_int<TTTrack_TrackWord::TrackBitWidths::kPhiSize + kGlobalPhiExtra> global_phi_t;
typedef ap_ufixed<kCosLUTSize, kCosLUTMagSize, AP_RND_CONV, AP_SAT> cos_lut_fixed_t;
Expand All @@ -44,8 +44,8 @@ namespace l1tmetemu {
const double kMaxMET = 1 << kMETMagSize; // 2 TeV
const double kMaxMETPhi{2 * M_PI};

const double kStepMETwordEt = kMaxMET / ( 1 << kMETSize);
const double kStepMETwordPhi = kMaxMETPhi / ( 1 << kMETPhiSize);
const double kStepMETwordEt = kMaxMET / (1 << kMETSize);
const double kStepMETwordPhi = kMaxMETPhi / (1 << kMETPhiSize);
const double kBinsInPi = 1.0 / kStepMETwordPhi;

// Enough symmetry in cos and sin between 0 and pi/2 to get all possible values
Expand All @@ -63,8 +63,8 @@ namespace l1tmetemu {

std::vector<cos_lut_fixed_t> generateCosLUT(unsigned int size);

global_phi_t localToGlobalPhi(TTTrack_TrackWord::phi_t local_phi, global_phi_t sector_shift );
global_phi_t localToGlobalPhi(TTTrack_TrackWord::phi_t local_phi, global_phi_t sector_shift);

std::vector<global_phi_t> generatePhiSliceLUT(unsigned int N);

template <typename T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace l1tmhtemu {
// extra room for sumPx, sumPy
const unsigned int kEtExtra{10};
const unsigned int kValidSize{1};
const unsigned int kMHTSize{16}; // For output Magnitude default 15
const unsigned int kMHTSize{16}; // For output Magnitude default 15
const unsigned int kMHTIntSize{11};
const unsigned int kMHTPhiSize{13}; // For output Phi default 14
const unsigned int kHTSize{kInternalPtWidth + kEtExtra};
Expand Down Expand Up @@ -56,7 +56,7 @@ namespace l1tmhtemu {
typedef ap_int<kInternalPhiWidth> phi_t;

typedef ap_int<kHTSize> Et_t;
typedef ap_ufixed<kMHTSize,kMHTIntSize> MHT_t;
typedef ap_ufixed<kMHTSize, kMHTIntSize> MHT_t;
typedef ap_uint<kMHTPhiSize> MHTphi_t;

const unsigned int kMHTBins = 1 << kMHTSize;
Expand Down
7 changes: 3 additions & 4 deletions L1Trigger/L1TTrackMatch/plugins/L1TkHTMissEmulatorProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,12 @@ void L1TkHTMissEmulatorProducer::produce(edm::Event& iEvent, const edm::EventSet
<< "\n"
<< "====MHT AP_INTS TO FLOATS====\n"
<< "sumPx: " << (float)sumPx * l1tmhtemu::kStepPt * l1tmhtemu::kStepPhi
<< "| sumPy: " << (float)sumPy * l1tmhtemu::kStepPt * l1tmhtemu::kStepPhi
<< "| ET: " << EtMiss.Et.to_double() << "| HT: " << (float)HT * l1tmhtemu::kStepPt
<< "| PHI: " << (float)phi * l1tmhtemu::kStepMHTPhi - M_PI << "\n"
<< "| sumPy: " << (float)sumPy * l1tmhtemu::kStepPt * l1tmhtemu::kStepPhi << "| ET: " << EtMiss.Et.to_double()
<< "| HT: " << (float)HT * l1tmhtemu::kStepPt << "| PHI: " << (float)phi * l1tmhtemu::kStepMHTPhi - M_PI << "\n"
<< "-------------------------------------------------------------------------\n";
}
//rescale HT to correct output range
HT = HT / (int)(1/l1tmhtemu::kStepPt);
HT = HT / (int)(1 / l1tmhtemu::kStepPt);

EtSum L1HTSum(missingEt, EtSum::EtSumType::kMissingHt, (int)HT.range(), 0, (int)phi, (int)jetn);

Expand Down
56 changes: 25 additions & 31 deletions L1Trigger/L1TTrackMatch/plugins/L1TrackerEtMissEmulatorProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ L1TrackerEtMissEmulatorProducer::L1TrackerEtMissEmulatorProducer(const edm::Para
: trackToken_(consumes<L1TTTrackRefCollectionType>(iConfig.getParameter<edm::InputTag>("L1TrackInputTag"))),
vtxAssocTrackToken_(
consumes<L1TTTrackRefCollectionType>(iConfig.getParameter<edm::InputTag>("L1TrackAssociatedInputTag"))) {

phiQuadrants_ = l1tmetemu::generatePhiSliceLUT(l1tmetemu::kNQuadrants);
phiShifts_ = l1tmetemu::generatePhiSliceLUT(l1tmetemu::kNSector);

Expand Down Expand Up @@ -148,36 +147,37 @@ void L1TrackerEtMissEmulatorProducer::produce(edm::Event& iEvent, const edm::Eve
for (const auto& track : *L1TTTrackHandle) {
if (std::find(L1TTTrackAssociatedHandle->begin(), L1TTTrackAssociatedHandle->end(), track) !=
L1TTTrackAssociatedHandle->end()) {

bool EtaSector = (track->getTanlWord() & (1 << (TTTrack_TrackWord::TrackBitWidths::kTanlSize - 1)));

ap_uint<TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1> ptEmulationBits = track->getTrackWord()(
TTTrack_TrackWord::TrackBitLocations::kRinvMSB - 1, TTTrack_TrackWord::TrackBitLocations::kRinvLSB);
ap_ufixed<TTTrack_TrackWord::TrackBitWidths::kRinvSize - 1, l1tmetemu::kPtMagSize> ptEmulation;
ptEmulation.V = ptEmulationBits.range();

l1tmetemu::global_phi_t globalPhi = l1tmetemu::localToGlobalPhi(track->getPhiWord(),phiShifts_[track->phiSector()]);
l1tmetemu::global_phi_t globalPhi =
l1tmetemu::localToGlobalPhi(track->getPhiWord(), phiShifts_[track->phiSector()]);

num_assoc_tracks++;
if (debug_ == 7) {
edm::LogVerbatim("L1TrackerEtMissEmulatorProducer")
<< "Track to Vertex ID: " << num_assoc_tracks << "\n"
<< "Phi Sector: " << track->phiSector() << " pT: " << track->getRinvWord() << " Phi: " << track->getPhiWord()
<< " TanL: " << track->getTanlWord() << " Z0: " << track->getZ0Word()
<< "Phi Sector: " << track->phiSector() << " pT: " << track->getRinvWord()
<< " Phi: " << track->getPhiWord() << " TanL: " << track->getTanlWord() << " Z0: " << track->getZ0Word()
<< " Chi2rphi: " << track->getChi2RPhiWord() << " Chi2rz: " << track->getChi2RZWord()
<< " bendChi2: " << track->getBendChi2Word() << " Emu pT " << ptEmulation.to_double() << "\n"
<< " bendChi2: " << track->getBendChi2Word() << " Emu pT " << ptEmulation.to_double() << "\n"
<< "--------------------------------------------------------------\n";
}

if (debug_ == 2) {
edm::LogVerbatim("L1TrackerEtMissEmulatorProducer")
<< "========================Phi debug=================================\n"
<< "Emu pT: " << ptEmulation.to_double() << " float pT: " << track->momentum().perp() << "\n"
<< "Int Phi: " << globalPhi << " Float Phi: " << track->phi()
<< " Float Cos(Phi): " << cos(track->phi()) << " Float Sin(Phi): " << sin(track->phi())
<< " Float Px: " << track->momentum().perp()*cos(track->phi()) << " Float Py: " << track->momentum().perp()*sin(track->phi()) << "\n";
<< "Int Phi: " << globalPhi << " Float Phi: " << track->phi() << " Float Cos(Phi): " << cos(track->phi())
<< " Float Sin(Phi): " << sin(track->phi())
<< " Float Px: " << track->momentum().perp() * cos(track->phi())
<< " Float Py: " << track->momentum().perp() * sin(track->phi()) << "\n";
}

l1tmetemu::Et_t temppx = 0;
l1tmetemu::Et_t temppy = 0;

Expand All @@ -193,7 +193,6 @@ void L1TrackerEtMissEmulatorProducer::produce(edm::Event& iEvent, const edm::Eve
<< "Sector: " << track->phiSector() << " Quadrant: " << 1 << "\n"
<< "Emu Phi: " << globalPhi << " Emu Cos(Phi): " << cosLUT_[globalPhi]
<< " Emu Sin(Phi): " << cosLUT_[phiQuadrants_[1] - 1 - globalPhi] << "\n";

}
} else if (globalPhi >= phiQuadrants_[1] && globalPhi < phiQuadrants_[2]) {
temppx = -((l1tmetemu::Et_t)ptEmulation * cosLUT_[phiQuadrants_[2] - 1 - globalPhi]);
Expand All @@ -202,8 +201,7 @@ void L1TrackerEtMissEmulatorProducer::produce(edm::Event& iEvent, const edm::Eve
if (debug_ == 2) {
edm::LogVerbatim("L1TrackerEtMissEmulatorProducer")
<< "Sector: " << track->phiSector() << " Quadrant: " << 2 << "\n"
<< "Emu Phi: " << globalPhi << " Emu Cos(Phi): -"
<< cosLUT_[phiQuadrants_[2] - 1 - globalPhi]
<< "Emu Phi: " << globalPhi << " Emu Cos(Phi): -" << cosLUT_[phiQuadrants_[2] - 1 - globalPhi]
<< " Emu Sin(Phi): " << cosLUT_[globalPhi - phiQuadrants_[1]] << "\n";
}
} else if (globalPhi >= phiQuadrants_[2] && globalPhi < phiQuadrants_[3]) {
Expand All @@ -224,9 +222,8 @@ void L1TrackerEtMissEmulatorProducer::produce(edm::Event& iEvent, const edm::Eve
if (debug_ == 2) {
edm::LogVerbatim("L1TrackerEtMissEmulatorProducer")
<< "Sector: " << track->phiSector() << " Quadrant: " << 4 << "\n"
<< " Emu Phi: " << globalPhi
<< " Emu Cos(Phi): " << cosLUT_[phiQuadrants_[4] - 1 - globalPhi] << " Emu Sin(Phi): -"
<< cosLUT_[globalPhi - phiQuadrants_[3]] << "\n";
<< " Emu Phi: " << globalPhi << " Emu Cos(Phi): " << cosLUT_[phiQuadrants_[4] - 1 - globalPhi]
<< " Emu Sin(Phi): -" << cosLUT_[globalPhi - phiQuadrants_[3]] << "\n";
}
} else {
temppx = 0;
Expand All @@ -240,11 +237,11 @@ void L1TrackerEtMissEmulatorProducer::produce(edm::Event& iEvent, const edm::Eve

if (debug_ == 4) {
edm::LogVerbatim("L1TrackerEtMissEmulatorProducer")
<< std::setprecision(8)
<< "Sector: " << track->phiSector() << " Eta sector: " << EtaSector << "\n"
<< "Track Ref Pt: " << track->momentum().perp()
<< " Track Ref Px: " << track->momentum().x() << " Track Ref Py: " << track->momentum().y() << "\n"
<< "Track Pt: " << ptEmulation << " Track phi: " << globalPhi << " Track Px: " << temppx << " Track Py: " << temppy << "\n"
<< std::setprecision(8) << "Sector: " << track->phiSector() << " Eta sector: " << EtaSector << "\n"
<< "Track Ref Pt: " << track->momentum().perp() << " Track Ref Px: " << track->momentum().x()
<< " Track Ref Py: " << track->momentum().y() << "\n"
<< "Track Pt: " << ptEmulation << " Track phi: " << globalPhi << " Track Px: " << temppx
<< " Track Py: " << temppy << "\n"
<< "Sector Sum Px: " << sumPx[link_number] << " Sector Sum Py: " << sumPy[link_number] << "\n";
}
}
Expand All @@ -264,16 +261,13 @@ void L1TrackerEtMissEmulatorProducer::produce(edm::Event& iEvent, const edm::Eve
l1tmetemu::EtMiss EtMiss = cordicSqrt.toPolar(-GlobalPx, -GlobalPy);

if (debug_ == 4 || debug_ == 6) {

edm::LogVerbatim("L1TrackerEtMissEmulatorProducer")
<< "====Sector Pt====\n";
edm::LogVerbatim("L1TrackerEtMissEmulatorProducer") << "====Sector Pt====\n";

for (unsigned int i = 0; i < l1tmetemu::kNSector * 2; i++) {
edm::LogVerbatim("L1TrackerEtMissEmulatorProducer")
<< "Sector " << i << "\n"
<< "Px: " << sumPx[i] << " | Py: " << sumPy[i]
<< " | Link Totals: " << link_totals[i]
<< " | Sector Totals: " << sector_totals[(int)(i/2)] << "\n";
<< "Sector " << i << "\n"
<< "Px: " << sumPx[i] << " | Py: " << sumPy[i] << " | Link Totals: " << link_totals[i]
<< " | Sector Totals: " << sector_totals[(int)(i / 2)] << "\n";
}

edm::LogVerbatim("L1TrackerEtMissEmulatorProducer")
Expand All @@ -282,9 +276,9 @@ void L1TrackerEtMissEmulatorProducer::produce(edm::Event& iEvent, const edm::Eve

edm::LogVerbatim("L1TrackerEtMissEmulatorProducer")
<< "====MET===\n"
<< "MET word Et: " << EtMiss.Et.range()*l1tmetemu::kStepMETwordEt << "| MET word phi: " << EtMiss.Phi << "\n"
<< "MET: " << EtMiss.Et.to_double()
<< "| MET phi: " << EtMiss.Phi.to_double() * l1tmetemu::kStepMETwordPhi << "\n"
<< "MET word Et: " << EtMiss.Et.range() * l1tmetemu::kStepMETwordEt << "| MET word phi: " << EtMiss.Phi << "\n"
<< "MET: " << EtMiss.Et.to_double() << "| MET phi: " << EtMiss.Phi.to_double() * l1tmetemu::kStepMETwordPhi
<< "\n"
<< "Word MET: " << EtMiss.Et.to_string(2) << " | Word MET phi: " << EtMiss.Phi.to_string(2) << "\n"
<< "# Tracks Associated to Vertex: " << num_assoc_tracks << "\n"
<< "========================================================\n";
Expand Down
69 changes: 30 additions & 39 deletions L1Trigger/L1TTrackMatch/src/Cordic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

using namespace l1tmetemu;

Cordic::Cordic(const int aSteps, bool debug)
: cordicSteps(aSteps),
debug(debug) {
Cordic::Cordic(const int aSteps, bool debug) : cordicSteps(aSteps), debug(debug) {
atanLUT.reserve(aSteps);
magNormalisationLUT.reserve(aSteps);

Expand Down Expand Up @@ -40,8 +38,7 @@ template <typename T>
void Cordic::cordic_subfunc(T &x, T &y, T &z) const {
if (debug) {
edm::LogVerbatim("L1TkEtMissEmulator") << "\n=====Cordic Initial Conditions=====\n"
<< "Cordic x: " << x << " Cordic y: " << y
<< " Cordic z: " << z << "\n"
<< "Cordic x: " << x << " Cordic y: " << y << " Cordic z: " << z << "\n"
<< "\n=====Cordic Steps=====";
}

Expand All @@ -68,7 +65,6 @@ void Cordic::cordic_subfunc(T &x, T &y, T &z) const {
<< " Cordic gain: " << magNormalisationLUT[step] << " kStepMETwordPhi: " << kStepMETwordPhi << "\n";
}
}

}

EtMiss Cordic::toPolar(Et_t x, Et_t y) const {
Expand All @@ -80,32 +76,29 @@ EtMiss Cordic::toPolar(Et_t x, Et_t y) const {
}

// Some needed constants
const ap_fixed<l1tmetemu::Et_t::width + 1, 3> pi = M_PI; // pi
const ap_fixed<l1tmetemu::Et_t::width + 2, 3> pi2 = M_PI / 2.; // pi/2
const l1tmetemu::METWordphi_t pistep = M_PI / l1tmetemu::kStepMETwordPhi; // (pi) / l1tmetemu::kStepMETwordPhi
const l1tmetemu::METWordphi_t pi2step = pistep / 2.; // (pi/2) / l1tmetemu::kStepMETwordPhi
const ap_fixed<l1tmetemu::Et_t::width + 1, 3> pi = M_PI; // pi
const ap_fixed<l1tmetemu::Et_t::width + 2, 3> pi2 = M_PI / 2.; // pi/2
const l1tmetemu::METWordphi_t pistep = M_PI / l1tmetemu::kStepMETwordPhi; // (pi) / l1tmetemu::kStepMETwordPhi
const l1tmetemu::METWordphi_t pi2step = pistep / 2.; // (pi/2) / l1tmetemu::kStepMETwordPhi

// Find the sign of the inputs
ap_uint<2> signx = (x > 0) ? 2 : (x == 0) ? 1 : 0;
ap_uint<2> signy = (y > 0) ? 2 : (y == 0) ? 1 : 0;

// Corner cases
if (signy == 1 && signx == 2) { // y == 0 and x > 0
if (signy == 1 && signx == 2) { // y == 0 and x > 0
ret_etmiss.Et = x;
ret_etmiss.Phi = 0;
return ret_etmiss;
}
else if (signy == 1 && signx == 0) { // y == 0 and x < 0
} else if (signy == 1 && signx == 0) { // y == 0 and x < 0
ret_etmiss.Et = -x;
ret_etmiss.Phi = pistep;
return ret_etmiss;
}
else if (signy == 2 && signx == 1) { // y > 0 and x == 0
} else if (signy == 2 && signx == 1) { // y > 0 and x == 0
ret_etmiss.Et = y;
ret_etmiss.Phi = pi2step;
return ret_etmiss;
}
else if (signy == 0 && signx == 1) { // y < 0 and x == 0
} else if (signy == 0 && signx == 1) { // y < 0 and x == 0
ret_etmiss.Et = -y;
ret_etmiss.Phi = -pi2step;
return ret_etmiss;
Expand All @@ -115,15 +108,13 @@ EtMiss Cordic::toPolar(Et_t x, Et_t y) const {
ap_fixed<Et_t::width + 1, Et_t::iwidth + 1, Et_t::qmode, Et_t::omode> absx, absy;
if (signy == 0) {
absy = -y;
}
else {
} else {
absy = y;
}

if (signx == 0) {
absx = -x;
}
else {
} else {
absx = x;
}

Expand All @@ -140,8 +131,9 @@ EtMiss Cordic::toPolar(Et_t x, Et_t y) const {
}

if (debug) {
edm::LogVerbatim("L1TkEtMissEmulator") << "\n=====Normalized input=====\n"
<< "norm(abs(x)): " << absx_sft.to_double() << " norm(abs(y)): " << absy_sft.to_double();
edm::LogVerbatim("L1TkEtMissEmulator")
<< "\n=====Normalized input=====\n"
<< "norm(abs(x)): " << absx_sft.to_double() << " norm(abs(y)): " << absy_sft.to_double();
}

// Setup the CORDIC inputs/outputs
Expand All @@ -150,16 +142,16 @@ EtMiss Cordic::toPolar(Et_t x, Et_t y) const {
cx = absy_sft;
cy = absx_sft;
cphi = 0;
}
else {
} else {
cx = absx_sft;
cy = absy_sft;
cphi = 0;
}

if (debug) {
edm::LogVerbatim("L1TkEtMissEmulator") << "\n=====CORDIC function arguments=====\n"
<< "x: " << cx.to_double() << " y: " << cy.to_double() << " phi: " << cphi.to_double();
edm::LogVerbatim("L1TkEtMissEmulator")
<< "\n=====CORDIC function arguments=====\n"
<< "x: " << cx.to_double() << " y: " << cy.to_double() << " phi: " << cphi.to_double();
}

// Perform the CORDIC (vectoring) function
Expand All @@ -171,29 +163,28 @@ EtMiss Cordic::toPolar(Et_t x, Et_t y) const {
}

ap_fixed<Et_t::width, 3, Et_t::qmode, Et_t::omode> ophi;
if (signx == 0 && signy == 2) { // x < 0 and y > 0
if (signx == 0 && signy == 2) { // x < 0 and y > 0
ophi = pi - cphi;
}
else if (signx == 0 && signy == 0) { // x < 0 and y < 0
} else if (signx == 0 && signy == 0) { // x < 0 and y < 0
ophi = cphi - pi;
}
else if (signx == 2 && signy == 0) { // x > 0 and y < 0
} else if (signx == 2 && signy == 0) { // x > 0 and y < 0
ophi = -cphi;
}
else {
} else {
ophi = cphi;
}

// Re-scale the outputs
Et_t magnitude = ((ap_fixed<Et_t::width + Et_t::iwidth + 3 + 1, Et_t::iwidth, Et_t::qmode, Et_t::omode>)cx) << (Et_t::iwidth + 1 - 2);
Et_t magnitude = ((ap_fixed<Et_t::width + Et_t::iwidth + 3 + 1, Et_t::iwidth, Et_t::qmode, Et_t::omode>)cx)
<< (Et_t::iwidth + 1 - 2);
ret_etmiss.Et = l1tmetemu::Et_t(magnitude * magNormalisationLUT[cordicSteps - 1]);
ret_etmiss.Phi = ophi * pi_bins_fixed_t(kBinsInPi);

if (debug) {
edm::LogVerbatim("L1TkEtMissEmulator") << "\n=====toPolar output=====\n"
<< std::setprecision(8)
<< "magnitude: " << magnitude.to_double() << " phi: " << ophi.to_double() << " kBinsInPi: " << pi_bins_fixed_t(kBinsInPi).to_double() << "\n"
<< "Et: " << ret_etmiss.Et.to_double() << " phi (int): " << ret_etmiss.Phi.to_int() << "\n";
edm::LogVerbatim("L1TkEtMissEmulator")
<< "\n=====toPolar output=====\n"
<< std::setprecision(8) << "magnitude: " << magnitude.to_double() << " phi: " << ophi.to_double()
<< " kBinsInPi: " << pi_bins_fixed_t(kBinsInPi).to_double() << "\n"
<< "Et: " << ret_etmiss.Et.to_double() << " phi (int): " << ret_etmiss.Phi.to_int() << "\n";
}

return ret_etmiss;
Expand Down
6 changes: 3 additions & 3 deletions L1Trigger/L1TTrackMatch/src/L1TkEtMissEmuAlgo.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ namespace l1tmetemu {
return cosLUT;
}

global_phi_t localToGlobalPhi(TTTrack_TrackWord::phi_t local_phi, global_phi_t sector_shift ) {
global_phi_t localToGlobalPhi(TTTrack_TrackWord::phi_t local_phi, global_phi_t sector_shift) {
global_phi_t PhiMin = 0;
global_phi_t PhiMax = 2*M_PI / TTTrack_TrackWord::stepPhi0;
global_phi_t PhiMax = 2 * M_PI / TTTrack_TrackWord::stepPhi0;

// The initial word comes in as a uint; the correct bits, but not automatically using 2s compliment format.
global_phi_t globalPhi = local_phi;
Expand All @@ -32,7 +32,7 @@ namespace l1tmetemu {
globalPhi = globalPhi + PhiMax;
} else if (globalPhi > PhiMax) {
globalPhi = globalPhi - PhiMax;
}
}

return globalPhi;
}
Expand Down

0 comments on commit db7adce

Please sign in to comment.