SBND Timing Reconstruction Refactor#170
Conversation
…v10_03_00_hlay_enums Avoid duplication and add enumeration
…v10_03_00_hlay_crt Move constexpr upstream so it can be used in more places
…b.com/SBNSoftware/sbnobj into feature/frame_shift_refactor_v10_03_02_01
|
@JosiePaton @PetrilloAtWork can you guys review for CAF? |
PetrilloAtWork
left a comment
There was a problem hiding this comment.
This is a very strong breaking change, which can be focussed into two places.
sbnd::timing::FrameShiftInfo: I think it's fair to say it's a completely different class, at the point where one should think what happens when this new class is initialised with old data. ROOT will convert what it can, and from the documentation it seems the conversion will be wrong (turning from a shift —double— to a timestamp —uint64_t). I strongly recommend you to think about this issue, and act accordingly. Two possibilities that come to my mind are:- Remove version 10 from
classes_def.xml; I am not sure which type of failure this will trigger when reading old data, but I believe there will be some. This would need to be verified. - Write explicit conversion code ("ROOT I/O rule") handling the conversion. In the minimal case, this rule would throw an exception claiming the "upgrade" is not supported.
- Remove version 10 from
sbnd::timing::TimingInfo: undefined values change from0to something likeINT_MAX. Again old data will be interpreted differently. An I/O rule changing the data members that are0to the new undefined value should be arranged, and the code should be surveyed to make sure that the magic undefined value0is not implicitly used.
| uint64_t FrameCrtt1() const { return fFrameCrtt1; } | ||
| uint16_t TimingTypeCrtt1() const { return fTimingTypeCrtt1; } | ||
| uint16_t TimingChannelCrtt1() const { return fTimingChannelCrtt1; } | ||
|
|
||
| uint64_t FrameBeamGate() const { return fFrameBeamGate; } | ||
| uint16_t TimingTypeBeamGate() const { return fTimingTypeBeamGate; } | ||
| uint16_t TimingChannelBeamGate() const { return fTimingChannelBeamGate; } | ||
|
|
||
| uint64_t FrameEtrig() const { return fFrameEtrig; } | ||
| uint16_t TimingTypeEtrig() const { return fTimingTypeEtrig; } | ||
| uint16_t TimingChannelEtrig() const { return fTimingChannelEtrig; } | ||
|
|
||
| uint64_t FrameDefault() const { return fFrameDefault; } | ||
| uint16_t TimingTypeDefault() const { return fTimingTypeDefault; } | ||
| uint16_t TimingChannelDefault() const { return fTimingChannelDefault; } |
There was a problem hiding this comment.
A note, maybe just for the future: this class has private data accessible only via member functions, which means that users will have to interact with the latter; but only the former are documented inline, which makes one additional step (involving parsing source code) to get to the documentation.
I would suggest the interface to be documented with priority over the internal implementation (data in this case); ideally, both, although it adds maintenance burden.
Co-authored-by: Gianluca Petrillo <petrillo.at.work@gmail.com>
I agree that this is a break changing for SBND workflow. We refactored the entire decoding on raw data to unify the timing reconstruction. Understandably, this is a clean up attempt of bad code writing in the first place. However, I don't fully understand all of your suggestions below, so adding my question to each your point below.
Is the suggestion to keep or remove this line?
Agree that this can be a clean suggestion although I do not know what ROOT I/O rules are.
|
Updated documentation links in FrameShiftInfo.hh
Description
Link(s) to docdb describing changes (optional)
https://sbn-docdb.fnal.gov/cgi-bin/sso/ShowDocument?docid=46654
Relevant PR links (optional)
This PR needs the XA decoder PR in sbndcode to go in first:
SBNSoftware/sbndcode#847
This PR needs to be merged together with this group of PRs: