Conversation
|
Hi @ehrlich-uva,
which require these tests: build. @Mu2e/fnalbuild-users, @Mu2e/write have access to CI actions on main. ⌛ The following tests have been triggered for 943b1fb: build (Build queue - API unavailable) |
|
☔ The build tests failed for 943b1fb.
N.B. These results were obtained from a build of this Pull Request at 943b1fb after being merged into the base branch at 891d8a5. For more information, please check the job page here. |
|
@FNALbuild run build test |
|
⌛ The following tests have been triggered for 99f99a7: build (Build queue - API unavailable) |
|
☀️ The build tests passed at 99f99a7.
N.B. These results were obtained from a build of this Pull Request at 99f99a7 after being merged into the base branch at 891d8a5. For more information, please check the job page here. |
Review: PR #1802 — converts CrvDigis to artFragmentsBuild tests pass on the latest commit ( 🔴 Bugs / correctness1. Wrong exception category in
|
|
Responses to AI
|
Follow-up review of PR #1802 (head
|
| # | Item | Fix |
|---|---|---|
| 1 | Wrong exception tag CALODIGI_COMPARE |
now CRVDIGI_COMPARE |
| 3 | TDC×2 overflow | now clamped to 0xffff with a warning |
| 5 | setTimestamp used event number |
now event.time().value() |
| 6 | Typo buildDrcEventsFromDigis |
fixed |
| 8 | Unused-ROC data blocks | comment added explaining intent |
| 9 | Silent continue on odd byte count |
now throw |
| 11 | Comparator summary gated on diagLevel>0 |
always printed |
| 12 | Counter includes skipped digis | split into _totalDigis / _totalDigisEncoded |
| 13 | Hard-coded _fragmentIdOffset |
now a fhicl::Atom |
↩️ Author pushed back — acceptable
- Add diagnostics #2
if(i->first==0) return i->second;guards the only reachable division-by-zero case (first iteration, whereprevBetais still 0). Logic is correct but a brief comment clarifying why would help future readers ("prevBeta is 0 on first iteration, so this only fires when the map starts at beta=0"). - merge with my branch trackerPatRec #4
EventWindowTag2— fair,CRVROCStatusPacketFEBIIonly hasEventWindowTag0/1. Ignore. - Tracker pat rec #10
std::coutkept for consistency with other*DigisToFragmentsmodules — fine.
🟡 Still open / newly visible in 98451bd
A. cet::exception with trailing std::endl
throw cet::exception("CRVDIGI_TO_FRAGMENT") << "Byte count is not a multiple of 2" << std::endl;cet::exception is not an ostream and std::endl shouldn't be streamed into it. Drop it (use "\n" or nothing). Apply the same to any other cet::exception additions.
B. _fragmentIdOffset still int, casts to 16-bit fragment ID
fragPtr->setFragmentID(static_cast<artdaq::Fragment::fragment_id_t>(dtcID + _fragmentIdOffset));dtcID is uint8_t and _fragmentIdOffset is int; negative or >65535 values will silently wrap into fragment_id_t. Either use fhicl::Atom<uint16_t> with a range check, or add a ctor-time validation such as:
if(_fragmentIdOffset < 0 || _fragmentIdOffset + 0xFF > 0xFFFF)
throw cet::exception("CRVDIGI_TO_FRAGMENT") << "fragmentIdOffset out of range";C. _crvDtcIdStart still int but used as uint8_t
fhicl::Atom<int> crvDtcIdStart{Name("CrvDtcIdStart"), Comment("First CRV DTC ID"), 0};uint8_t dtcID = _crvDtcIdStart + (ROC-1)/CRVId::nROCPerDTC;Same silent-truncation concern. Validate at construction.
D. hdrPkt.SetByte(5, ...) workaround
auto hdrPkt = hdr.ConvertToDataPacket(); //this function has a bug. it does not transfer the subsystem ID to the DTC_DataPacket.
hdrPkt.SetByte(5, static_cast<uint8_t>(((packetCount & 0x0700) >> 8) | (subsystem << 5))); //this is a temporary bug fix.Please open an upstream issue in artdaq-core-mu2e and reference its URL in this comment so this hack is easy to remove later.
E. Comparator endJob() cosmetic indentation
void CrvDigiCollectionsComparator::endJob() {
std::cout << "\n ----- [CrvDigiCollectionsComparator] Summary ----- " << std::endl;
std::cout << "Total events: " << totalEvents_ << std::endl;
...
}Body still indented by 4 spaces from when it was inside an if; re-indent to 2 spaces to match the rest of the file.
F. Layout assumptions — consider static_asserts
The memcpys in buildDtcEventsFromDigis assume exact layouts of CRVHitRawFEBII and CRVROCStatusPacketFEBII. You already do this for DTC_EventHeader/DTC_SubEventHeader; add the same for the two CRV packet structs so any upstream size change fails loudly at compile time.
G. _totalDigisEncoded not printed when diagLevel==0
Both summaries in endJob() are still inside if(_diagLevel > 0). For a round-trip / regression module, an always-on one-line summary like the comparator's is useful. Low priority.
H. Duplicated "Cannot handle … samples" skip silently drops digis
These digis will be absent from the round-trip collection and will cause a size-mismatch in CrvDigiCollectionsComparator that is not easy to distinguish from a real encoding bug. Consider either (a) throwing here when the comparator is used in a regression fcl, or (b) making the comparator aware of "skippable" digis (NZS + wrong-size waveform) so the round-trip is exact.
I. Unrelated changes piggy-backed on this PR
The diff now also touches CMakeLists.txt (version bump 11.01.00 → 13.07.00), CalPatRec/* (proton time cluster collection, debug prints), DAQ/CMakeLists.txt (add art::Framework_Principal), and Sources/src/PBISequence_source.cc (firstSubRun/firstEvent options). None of these are mentioned in the PR description and none are related to "converts CrvDigis to artFragments." They look like an accidental rebase/merge artifact — please confirm they belong here or strip them out.
J. Documentation
- New fcl files reference
CRVConditions/data/status_extracted_20260221.txtandcalib_extracted_20260221.txt— verify these exist on the branch; the diff does not contain them. - Update the PR description: the cutoff removals (
photonYieldVariationCutoffLow/High) and the CalPatRec / PBISequence changes (if intended) should be documented there.
Recommendation
Blocking before merge: A, B, C, I (especially the unrelated PBISequence / CalPatRec / version-bump changes — they should either be explained or reverted).
Should fix: D, F, H.
Nice-to-have: E, G, J, comment on #2.
Overall the round-trip (CrvDigisToFragments → CrvDigisFromArtdaqFragmentsFEBII → CrvDigiCollectionsComparator) is a very good addition and the core encoding logic looks solid.
|
Responses to AI: |
Added a module that converts CrvDigis to artFragments and an additional modules that compares two CrvDigiCollections.
Small changes for the CRV photon generator (removal of cutoffs for yield variations, not needed anymore) were already in my workspace. I will keep them in this PR. The PR also contains a merge from changes in Offline that happened in the meantime.