Skip to content

Improve IFOComboMap to be powers of two and reduce size of cohfar's XML output

Thomas Almeida requested to merge Tommoa/spiir:feat/improve-icombomap into master

Previously IFOComboMap was indexed as [single detector, two detectors, three detectors, ...]. This means that checking to see how many and which detectors are in use can't be easily done without referring back to the table, and any changes to the table can potentially break other parts of the code.

This pull request changes IFOComboMap to be indexed by powers of two. That means that any index of (2^i - 1) is a single detector, indicated by index into IFOMap. Now when using IFOComboMap, the number of detectors in use can be determined using __builtin_popcount(icombo + 1), and whether a single detector is in use can be done with the check index & (icombo + 1).

Additionally, every possible combination of existing IFO was outputted as a part of the XML dump from cohfar. This meant that the size of the XML dump wasn't tied to the actual number of IFOs in use, and would continue to exponentially increase in size as we increased the number of IFOs that might be in play (e.g. KAGRA, LIGO-India, etc.).

To solve this, we have moved to using the total combination (as an index into IFOComboMap) as a store of the active IFOs, and using __builtin_popcount() to get the total number of IFOs that are in use in that combination. This means that we can quickly and efficiently determine the maximum number of detectors that we actually need to print stats for, with no additional information required.

Passes trigger comparison test.

Edited by Thomas Almeida

Merge request reports