speed up and fix up trd raw data reading. - #6799
Conversation
f7bc2fd to
a9233df
Compare
tdietel
left a comment
There was a problem hiding this comment.
It's still work in progress. I made some comments, but I'm happy to merge if it helps with progress.
| uint32_t adcmask : 21; | ||
| uint32_t j : 4; // unused always 0xc | ||
| uint32_t adcmask : 21; | ||
| uint32_t c : 5; // unused always 0x1f |
There was a problem hiding this comment.
Is the comment correct? I thought it's the inverted number of ADC channels with data.
There was a problem hiding this comment.
correct as to my understanding at time of writing, but no not correct.
| return 22; | ||
| int position = channel; | ||
| int m = 1 << channel; | ||
| while (!(bp & m)) { |
There was a problem hiding this comment.
Does this code do the same as:
| while (!(bp & m)) { | |
| for (int pos=channel+1; pos<22; pos++) { | |
| if ( bp & (1<<pos) ) { | |
| return pos; | |
| } | |
| } | |
| return 22; | |
There was a problem hiding this comment.
I am not sure what your code does once it's at (or rather beyond) the last bit.
There was a problem hiding this comment.
the newer one works properly, verified. unit tests to come.
the bit is fliped so that each time is simply looks for the next right most bit with a 1 in it, so at the end one has no bits and has a condition for finishing.
There was a problem hiding this comment.
To be clearer line 447,448 handles the case of no bits valid, it is possible to start on the left of the left most bit.
adding a termination at position 32;
| @@ -270,80 +343,77 @@ int DigitsParser::Parse(bool verbose) | |||
| } | |||
| if (digitwordcount == constants::TIMEBINS / 3) { | |||
There was a problem hiding this comment.
Does this actually work if the number of timebins is not divisible by 3?
There was a problem hiding this comment.
it works in the sense that it wont write a digit, but carry on.
There was a problem hiding this comment.
just above that there is a check for digitwordcount > timebins/3 with a fatal log message.
| LOG(info) << "adcmask: 0x" << std::hex << mADCMask << " and channel : " << std::dec << mChannel; | ||
| } | ||
| mChannel = nextmcmadc(mADCMask, mChannel); | ||
| if (mChannel == 21) { |
There was a problem hiding this comment.
I thought I saw a 22 up there...
There was a problem hiding this comment.
21 and 22, 22 gives logs the erroneous digit, and 21 should never get hit, there as a safety net should maybe change it to >21
3fbc1f4 to
53685a5
Compare
53685a5 to
9c66e87
Compare
|
should i leave the list of updates or collapse them all into 1? this can then be merged, stats will come shortly in a seperate pr @tdietel |
|
@bazinski I can squash them at merging, shall I already do this? |
|
Squashing looks like a good idea. Shall we go ahead and merge? |
fix parsing of zero suppressed digits.
increase verbose output
fix bitcounting error causing slow readout
other speed ups, 7 hours per timeframe now down to .7ms per timeframe.
byteswap the adc bit pattern word
fix the DigitMCMADCMask it was reversed.
attempt to jump the non tracklet data at the beginning of the tracklet parse block, partially successful.
erroneous additional digits are marked with EEE in info output
change datareader to write out triggers with the digits (temporary most likely)
This could well change depending on the testing tomorrow.