Skip to content

Commit

Permalink
fix z0 for egamma gt packed format
Browse files Browse the repository at this point in the history
  • Loading branch information
cerminar committed Oct 20, 2023
1 parent b275c12 commit 5aa5323
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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

0 comments on commit 5aa5323

Please sign in to comment.