@@ -64,7 +64,7 @@ namespace l1ct {
6464 static const int BITWIDTH_ENDCAP_SLIM =
6565 pt_t ::width + eta_t ::width + phi_t ::width + pt_t ::width + emid_t ::width + id_prob_t ::width + id_prob_t ::width;
6666
67- static const int BITWIDTH_BARREL = BITWIDTH_BARREL_SLIM; // FIXME: add barrel isolation
67+ static const int BITWIDTH_BARREL = BITWIDTH_BARREL_SLIM;
6868 static const int BITWIDTH_ENDCAP = BITWIDTH_ENDCAP_SLIM + srrtot_t ::width + meanz_t ::width + hoe_t ::width;
6969
7070 inline ap_uint<BITWIDTH_ENDCAP> pack_endcap () const {
@@ -100,6 +100,7 @@ namespace l1ct {
100100
101101 inline static HadCaloObj unpack_barrel (const ap_uint<BITWIDTH_BARREL> &src) {
102102 HadCaloObj ret;
103+ ret.clear ();
103104 unsigned int start = 0 ;
104105 unpack_from_bits (src, start, ret.hwPt );
105106 unpack_from_bits (src, start, ret.hwEta );
@@ -111,6 +112,7 @@ namespace l1ct {
111112
112113 inline static HadCaloObj unpack_endcap (const ap_uint<BITWIDTH_ENDCAP> &src) {
113114 HadCaloObj ret;
115+ ret.clear ();
114116 unsigned int start = 0 ;
115117 unpack_from_bits (src, start, ret.hwPt );
116118 unpack_from_bits (src, start, ret.hwEta );
@@ -172,6 +174,8 @@ namespace l1ct {
172174 eta_t hwEta; // relative to the region center, at calo
173175 phi_t hwPhi; // relative to the region center, at calo
174176 emid_t hwEmID;
177+ shower_shape_t hwShowerShape;
178+ rel_iso_t hwRelIso;
175179 srrtot_t hwSrrTot;
176180 meanz_t hwMeanZ;
177181 hoe_t hwHoe;
@@ -180,7 +184,8 @@ namespace l1ct {
180184
181185 inline bool operator ==(const EmCaloObj &other) const {
182186 return hwPt == other.hwPt && hwEta == other.hwEta && hwPhi == other.hwPhi && hwPtErr == other.hwPtErr &&
183- hwEmID == other.hwEmID && hwSrrTot == other.hwSrrTot && hwMeanZ == other.hwMeanZ && hwHoe == other.hwHoe &&
187+ hwEmID == other.hwEmID && hwShowerShape == other.hwShowerShape && hwRelIso == other.hwRelIso &&
188+ hwSrrTot == other.hwSrrTot && hwMeanZ == other.hwMeanZ && hwHoe == other.hwHoe &&
184189 hwPiProb == other.hwPiProb && hwEmProb == other.hwEmProb ;
185190 }
186191
@@ -193,6 +198,8 @@ namespace l1ct {
193198 hwEta = 0 ;
194199 hwPhi = 0 ;
195200 hwEmID = 0 ;
201+ hwShowerShape = 0 ;
202+ hwRelIso = 0 ;
196203 hwSrrTot = 0 ;
197204 hwMeanZ = 0 ;
198205 hwHoe = 0 ;
@@ -211,6 +218,8 @@ namespace l1ct {
211218 float floatPtErr () const { return Scales::floatPt (hwPtErr); }
212219 float floatEta () const { return Scales::floatEta (hwEta); }
213220 float floatPhi () const { return Scales::floatPhi (hwPhi); }
221+ float floatShowerShape () const { return Scales::floatShoweShape (hwShowerShape); }
222+ float floatRelIso () const { return Scales::floatRelIso (hwRelIso); }
214223 float floatSrrTot () const { return Scales::floatSrrTot (hwSrrTot); };
215224 float floatMeanZ () const { return Scales::floatMeanZ (hwMeanZ); };
216225 float floatHoe () const { return Scales::floatHoe (hwHoe); };
@@ -222,7 +231,7 @@ namespace l1ct {
222231 static const int BITWIDTH_ENDCAP_SLIM =
223232 pt_t ::width + pt_t ::width + eta_t ::width + phi_t ::width + emid_t ::width + id_prob_t ::width + id_prob_t ::width;
224233
225- static const int BITWIDTH_BARREL = BITWIDTH_BARREL_SLIM; // FIXME: add barrel isolation
234+ static const int BITWIDTH_BARREL = BITWIDTH_BARREL_SLIM + shower_shape_t ::width + rel_iso_t ::width;
226235 static const int BITWIDTH_ENDCAP = BITWIDTH_ENDCAP_SLIM + srrtot_t ::width + meanz_t ::width + hoe_t ::width;
227236
228237 inline ap_uint<BITWIDTH_ENDCAP> pack_endcap () const {
@@ -251,24 +260,30 @@ namespace l1ct {
251260 pack_into_bits (ret, start, hwPhi);
252261 pack_into_bits (ret, start, hwPtErr);
253262 pack_into_bits (ret, start, hwEmID);
263+ pack_into_bits (ret, start, hwShowerShape);
264+ pack_into_bits (ret, start, hwRelIso);
254265 return ret;
255266 }
256267
257268 inline ap_uint<BITWIDTH_BARREL_SLIM> pack_barrel_slim () const { return pack_barrel ()(BITWIDTH_BARREL_SLIM - 1 , 0 ); }
258269
259270 inline static EmCaloObj unpack_barrel (const ap_uint<BITWIDTH_BARREL> &src) {
260271 EmCaloObj ret;
272+ ret.clear ();
261273 unsigned int start = 0 ;
262274 unpack_from_bits (src, start, ret.hwPt );
263275 unpack_from_bits (src, start, ret.hwEta );
264276 unpack_from_bits (src, start, ret.hwPhi );
265277 unpack_from_bits (src, start, ret.hwPtErr );
266278 unpack_from_bits (src, start, ret.hwEmID );
279+ unpack_from_bits (src, start, ret.hwShowerShape );
280+ unpack_from_bits (src, start, ret.hwRelIso );
267281 return ret;
268282 }
269283
270284 inline static EmCaloObj unpack_endcap (const ap_uint<BITWIDTH_ENDCAP> &src) {
271285 EmCaloObj ret;
286+ ret.clear ();
272287 unsigned int start = 0 ;
273288 unpack_from_bits (src, start, ret.hwPt );
274289 unpack_from_bits (src, start, ret.hwEta );
@@ -289,7 +304,8 @@ namespace l1ct {
289304 // The firmware implementation should actually use the specific pack/unpack implementations
290305
291306 static const int BITWIDTH = pt_t ::width + pt_t ::width + eta_t ::width + phi_t ::width + emid_t ::width +
292- id_prob_t ::width + id_prob_t ::width + srrtot_t ::width + meanz_t ::width + hoe_t ::width;
307+ shower_shape_t ::width + rel_iso_t ::width + id_prob_t ::width + id_prob_t ::width +
308+ srrtot_t ::width + meanz_t ::width + hoe_t ::width;
293309
294310 inline ap_uint<BITWIDTH> pack () const {
295311 ap_uint<BITWIDTH> ret;
@@ -299,6 +315,8 @@ namespace l1ct {
299315 pack_into_bits (ret, start, hwPhi);
300316 pack_into_bits (ret, start, hwPtErr);
301317 pack_into_bits (ret, start, hwEmID);
318+ pack_into_bits (ret, start, hwShowerShape);
319+ pack_into_bits (ret, start, hwRelIso);
302320 pack_into_bits (ret, start, hwPiProb);
303321 pack_into_bits (ret, start, hwEmProb);
304322 pack_into_bits (ret, start, hwSrrTot);
@@ -314,6 +332,8 @@ namespace l1ct {
314332 unpack_from_bits (src, start, ret.hwPhi );
315333 unpack_from_bits (src, start, ret.hwPtErr );
316334 unpack_from_bits (src, start, ret.hwEmID );
335+ unpack_from_bits (src, start, ret.hwShowerShape );
336+ unpack_from_bits (src, start, ret.hwRelIso );
317337 unpack_from_bits (src, start, ret.hwPiProb );
318338 unpack_from_bits (src, start, ret.hwEmProb );
319339 unpack_from_bits (src, start, ret.hwSrrTot );
@@ -480,6 +500,7 @@ namespace l1ct {
480500
481501 inline static TkObj unpack_barrel (const ap_uint<BITWIDTH_BARREL> &src) {
482502 TkObj ret;
503+ ret.clear ();
483504 unsigned int start = 0 ;
484505 unpack_from_bits (src, start, ret.hwPt );
485506 unpack_from_bits (src, start, ret.hwEta );
@@ -496,6 +517,7 @@ namespace l1ct {
496517
497518 inline static TkObj unpack_endcap (const ap_uint<BITWIDTH_ENDCAP> &src) {
498519 TkObj ret;
520+ ret.clear ();
499521 unsigned int start = 0 ;
500522 unpack_from_bits (src, start, ret.hwPt );
501523 unpack_from_bits (src, start, ret.hwEta );
@@ -514,7 +536,6 @@ namespace l1ct {
514536 }
515537
516538 inline ap_uint<BITWIDTH_SLIM> pack_slim () const { return pack_endcap ()(BITWIDTH_SLIM - 1 , 0 ); }
517-
518539 };
519540 inline void clear (TkObj &c) { c.clear (); }
520541
0 commit comments