Skip to content

Conversation

@wdconinc
Copy link
Member

@wdconinc wdconinc commented Oct 20, 2025

Needs:

This PR on top of #186 is a demonstration of how we can accomplish synchronized distribution of entire multiplets to specific ET analyzer stations. In this case we can demonstrate this with the mock data generator, but the idea is that the DAQ would 'somehow' inject the analogous control words.

This approach uses the six ET control words associated with each event and the corresponding station select words, where ints on position 0, 2, and 4 are tested for equality and ints in position 1, 3, 5 are AND'ed for selection.

Here we write in positions 0, 2, and 4 respectively the event number, multiplet number, and multiplet number mod 30. In position 5 we write a bit pattern with only activated bit at the multiplet number mod 30.

We can now select entire multiplets with a bit pattern in position 5 of the station select registers, e.g. a single station with 0x3fffffff will analyze all events. two stations with 0x15555555 and 0x2aaaaaaa will analyze alternating multiplets.

Why mod 30? The select words for each station are ignored when they are -1, or 0xffffffff. That means that splitting multiplets over 32 bits and having a single station analyze all of them is impossible.

@wdconinc
Copy link
Member Author

@paulmking @jonzarling This is a proof-of-concept that injects a control word with a bit pattern that represents the multiplet counter mod 30. Stations can use select words to accept a subset of multiplets based on that bit pattern.

Note that the bit pattern approach turned out to be preferred over using the user select function: that function has to be parameter-less and must be provided with a shared library. This led to less flexibility (since unable to adapt to varying numbers of analyzer stations) and administrative overhead for the project (due to the additional shared library). The bit pattern avoids this since it can all be decided at runtime.

I looked at https://github.com/JeffersonLab/emu and only control[0] is filled with the CODA component ID (EB, ROC, I guess), so there may be some work needed to get the bit pattern control words to be filled when it is handed to the ET.

Next up on my end is modifying our analyzer to start up N stations (in N threads) that share the load.

@wdconinc wdconinc force-pushed the et-select-multiplet branch from 0273fda to 426377b Compare October 22, 2025 18:54
… ET events

- Add optional control,int num_control parameters to QwEventBuffer API:
  WriteEvent, WriteEtEvent and EncodeSubsystemData now accept control words.
- Update QwMockDataGenerator to populate and pass control words for mock events.
- Extend THaEtClient::codaWrite signature to accept control words and num_control,
  call et_event_setcontrol() to set them on the ET event before sending.
- Emit control-word diagnostics when EvET chunk verbose > 1.

This enables writing per-event ET control words end-to-end (mock generator ->
QwEventBuffer -> THaEtClient -> ET).
…tSelect, manage selectwords, use ET_STATION_SELECT_MATCH when provided, and configure default select words in QwEventBuffer::OpenETStream
…data generator

- QwEventBuffer::OpenETStream: set a station_mask (0x3fffffff) and initialize selectwords to use the station bitmask (instead of the previous 0/-1 combination) so the ET station selection defaults to a proper mask.
- QwMockDataGenerator: include <cstdint>, increase max_num_stations to 30, compute multiplet and station, build a station_mask = (1u << (station % max_num_stations)) and place it into the control words passed to EncodeSubsystemData. Add comment explaining why 32 stations are avoided (all-bits-set == -1 is ignored).
@wdconinc wdconinc force-pushed the et-select-multiplet branch from 426377b to ade2356 Compare October 27, 2025 19:06
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.

1 participant