Skip to content

FITS loader fix - #288

Open
mwy-wing wants to merge 7 commits into
cositools:develop/emfrom
mwy-wing:fix/backend
Open

mwy-wing wants to merge 7 commits into
cositools:develop/emfrom
mwy-wing:fix/backend

Conversation

@mwy-wing

@mwy-wing mwy-wing commented Oct 23, 2026 •

Copy link
Copy Markdown

Fixed issue #265. All problems described in the issue have been resolved, and unit tests pass on both macOS and Linux.

@mwy-wing
mwy-wing requested a review from zoglauer October 23, 2026 03:23
@mwy-wing mwy-wing self-assigned this Oct 23, 2026
@mwy-wing

Copy link
Copy Markdown
Author

Added fix to issue #270, and #257

@fhagemann

Copy link
Copy Markdown

Probably irrelevant, but do we also need a check if a detector exists in the geometry or not for the FITS loader?

@ckierans

Copy link
Copy Markdown
Collaborator

Hi Wing,

Thanks! Before I give a full review, I'm just realizing now from you message in issue #270 (#270 (comment)) that you're not using the EventType (Event Type) parameter in the L0 or FITS data loader. In the L0 data, you're saving parameter etype and in the FITS loader you have variable eventType, but they're both unused. The Event Type details the veto type based on Table 36 in the FEE ICD and the EVENTTYPE table that's immediate after the L1a FITS data format in the HEASARC ICD. Here's a screenshot from the FEE ICD for your quick reference:

Screenshot 2026-11-16 at 1 38 19 PM

Note that the non-vetoed events have event type 0x00-0x02, the guard ring vetoed events have 0x03-0x05, the hard veto ACS events have 0x06-0x08 and the soft vetoed events have 0x09-0x0B. You should be using this parameter to define whether or not an event had a Veto, and filling the SetGuardRingVeto and SetShieldVeto methods, as appropriate. So, instead of your boolean flag for GuardRingVeto defined in MModuleLoaderMeasurementsFITS.cxx line 361 being defined by the HitType:
// Set boolean flags based on hit type
H->IsGuardRing(typeHit == 2);
if (H->IsGuardRing() == true) {
Event->SetGuardRingVeto(true);
}
it should be instead defined by the EventType from the FITS or L0 file, and you should add one for the ShieldVeto too.

We don't currently distinguish between Soft vetos and Hard vetos in nuclearizer, but I think we'll want to eventually. You're welcome to introduce the new variables now, if you want to, or you can just use the SetShieldVeto option for both, and I'll add an issue to include SoftVetos in Nuclearizer.

@mwy-wing

mwy-wing commented Nov 16, 2026 •

Copy link
Copy Markdown
Author

Hi Carolyn,
Yes, after I made the comment, I did some research and found the same answer. It's already included in the other PR (#302), which now sets SetGuardRingVeto and SetShieldVeto from the event type (commit 0593fa4).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants