Repository navigation
Conversation
…of the ALMIRA timestamp: 12 bits filled as following [frame (8 bits) | clock cycle in the ROF (4 bits)]
…from the TF length and rounded up. This was introduced to cope with the new default ROF length of 16 BC (required by designers) which does not divide exactly the orbit.
Please consider the following formatting changes to AliceO2Group#16137
| /// (e.g. ROF 18 BC, clock 4 BC -> 4.5 -> 5 cycles). Tolerance for the float rounding: 18 BC / 24.95 ns must give 18, not 19 | ||
| static int computeNClockCycles(int rofLengthInBC, float clockPeriod) | ||
| { | ||
| return std::ceil(rofLengthInBC * o2::constants::lhc::LHCBunchSpacingNS / clockPeriod - 1e-3); // - 1e-3: tolerance for float rounding |
There was a problem hiding this comment.
Why not std::round, w/o custom margin ?
There was a problem hiding this comment.
Thanks a lot for yout comment!
You are right, I overlooked this. This was a leftover from when I did not yet have detailed information on the relation between the ROF and the clock cycles, so I allowed a ROF length not multiple of the clock period, with a shorter last cycle.
In that case the number of cycles has to be rounded up (e.g. 17 BC with a 4 BC clock needs 5 cycles, while std::round would give 4), hence the std::ceil, and the custom margin was there to protect the ceil from float rounding (18 × 24.95 / 24.95 → 18.000001 → 19).
Now that I know from the designers that the ROF length is always a multiple of the clock period, there is no partial cycle and that calculation no longer makes sense.
So I am going to replace it with std::round and add a fatal check in the digitizer that the ROF length should be a multiple of the clock period.
Please let me know if you have other thoughts about this, thanks again!
The ToA stored in TRK/FT3 digits is no longer a float in ns: it is encoded as it will be in the ALMIRA chip
Digit:float mToA->uint16_t mTimestampToAThe default ROF length is now 16 BC for all layers (it was 18 BC). This value was chosen after discussing with the designers and the tracking experts.
--configKeyValues "TRKAlmiraParam.roFrameLengthInBCPerLayer[0]=16;..."The number of ROFs per TF is now computed from the TF length and rounded up. The previous formula,
(3564 / ROFLength) * nOrbitsPerTF, lost the last ROFs of each TF when the ROF length does not divide the orbit (16 BC, 32 orbits: 7104 instead of 7128 ROFs). Results are unchanged for ROF lengths that divide the orbit (e.g. the previous default of 18 BC).