Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix z0 for e/gamma GT packed format #125

Draft
wants to merge 1 commit into
base: L1PF_12_5_X
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DataFormats/L1TParticleFlow/interface/egamma.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ namespace l1ct {
ele.v3.eta = CTtoGT_eta(hwEta);
ele.quality = hwQual;
ele.charge = hwCharge;
ele.z0 = hwZ0;
ele.z0(l1ct::z0_t::width - 1, 0) = hwZ0(l1ct::z0_t::width - 1, 0);
ele.isolation = hwIso;
return ele;
}
Expand Down
5 changes: 4 additions & 1 deletion DataFormats/L1TParticleFlow/interface/gt_datatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ namespace l1gt {
typedef ap_ufixed<16, 11, AP_RND_CONV, AP_SAT> pt_t;
typedef ap_fixed<13, 13, AP_RND_CONV> phi_t;
typedef ap_fixed<14, 14, AP_RND_CONV, AP_SAT> eta_t;
typedef ap_fixed<10, 9, AP_RND_CONV, AP_SAT> z0_t;
// While bitwise identical to the l1ct::z0_t value, we store z0 in mm to profit of ap_fixed goodies
typedef ap_fixed<10, 9, AP_RND_CONV, AP_SAT> z0_t; // NOTE: mm instead of cm!!!
typedef ap_uint<1> valid_t;

// E/gamma fields
Expand All @@ -41,9 +42,11 @@ namespace l1gt {
const float INTPT_LSB = 1.0 / (1 << (pt_t::width - pt_t::iwidth));
const int INTPHI_TWOPI = 2 * INTPHI_PI;
constexpr float ETAPHI_LSB = M_PI / INTPHI_PI;
constexpr float Z0_UNITS = 0.1; // 1 L1 unit is 1 mm, while CMS standard units are cm
inline float floatPt(pt_t pt) { return pt.to_float(); }
inline float floatEta(eta_t eta) { return eta.to_float() * ETAPHI_LSB; }
inline float floatPhi(phi_t phi) { return phi.to_float() * ETAPHI_LSB; }
inline float floatZ0(z0_t z0) { return z0.to_float() * Z0_UNITS; }
} // namespace Scales

struct ThreeVector {
Expand Down