@@ -278,20 +278,16 @@ void constructTrackletMCMData(TrackletMCMData& trackletword, const int format, c
278278 trackletword.word = 0 ;
279279 // create a tracklet word as it would be sent from the FEE
280280 // slope and position have the 8-th bit flipped each
281- trackletword.word = 0 ;
282281 trackletword.slope = slope ^ 0x80 ;
283282 trackletword.pos = pos ^ 0x80 ;
284283 trackletword.checkbit = 0 ;
285284 if (format & 0x1 ) {
286- // length of q1 and q2 are 6 with a 2 bit offset.
287- // What happens when q2 and q1 dont share the same offset (upper 2 bits ?) ?
288- LOG (error) << " This tracklet format has not been tested yet" ;
289- trackletword.pid = (q0 & 0x3f ) & ((q1 & 0x1 ) << 6 );
290- // TODO check the 2 bit offset is still valid ... ??
285+ // length of q1 and q2 are 6 with a 2 bit offset sitting in the header.
286+ trackletword.pid = (q0 & 0x3f ) | ((q1 & 0x3f ) << 6 );
291287 } else {
292- trackletword.pid = (q0 & 0x3f ) & ((q1 & 0x1 ) << 6 );
288+ // q2 sits with upper 1 bit of q1 in the header pid word, hence the 0x3f so 6 bits of q1 are used here, shifted up above the 6 bits of q0.
289+ trackletword.pid = (int )(q0 & 0x3f ) | ((q1 & 0x3f ) << 6 );
293290 }
294- // q2 sits with upper 2 bits of q1 in the header pid word, hence the 0x1f so 5 bits are used here.
295291}
296292
297293void constructTrackletMCMData (TrackletMCMData& trackletword, const Tracklet64& tracklet)
@@ -319,7 +315,7 @@ void printTrackletHCHeader(o2::trd::TrackletHCHeader& halfchamber)
319315
320316void printTrackletMCMData (o2::trd::TrackletMCMData& tracklet)
321317{
322- LOGF (info, " TrackletMCMData: Raw:0x%08x pos:%d slope:%d pid:0x%08x checkbit:0x%02x" ,
318+ LOGF (info, " TrackletMCMData: Raw:0x%08x pos:%d slope:%d pid:0x%03x checkbit:0x%02x" ,
323319 tracklet.word , tracklet.pos , tracklet.slope , tracklet.pid , tracklet.checkbit );
324320}
325321void printTrackletMCMHeader (o2::trd::TrackletMCMHeader& mcmhead)
0 commit comments