|
MUSIC unknown
Analysis for the MUSIC active-target ionization chamber
|
Groups time-sorted hits into events. More...
#include <EventBuilder.hpp>
Public Types | |
| typedef std::vector< Int_t > | SlotMap |
| Board/channel to array slot lookup, indexed as BuildSlotMap() defines. | |
Static Public Member Functions | |
| static void | ResetEventState (EventState &e) |
| Clear an event back to its empty state, ready to be seeded. | |
| static void | ResetPerChannelData (PerChannelData &p) |
| Clear the per-slot detail alongside a reset event. | |
| static Bool_t | ShouldKeepHit (ULong64_t cand_ts, ULong64_t prev_ts, UShort_t cand_energy, UShort_t prev_energy, ULong64_t ref_ts, DedupStrategy strategy) |
| Decide which of two hits on the same slot survives. | |
| static SlotMap | BuildSlotMap () |
| Build the board/channel to slot lookup for this dataset. | |
| static void | AssignHit (EventState &e, PerChannelData *pc, ULong64_t ref_ts, Int_t slot, UShort_t energy, ULong64_t timestamp, UInt_t flags, DedupStrategy strategy) |
| Place one hit into an event, resolving any collision. | |
| static Bool_t | CheckEventComplete (const EventState &e) |
| Whether an event has everything required to be written out. | |
| static void | GetFlagSummary (const EventState &e, Bool_t &has_fake, Bool_t &has_saturation, Bool_t &has_pileup) |
| Unpack the OR-ed status flags into the conditions that matter. | |
| static Bool_t | BuildEventsFromSortedHits (const std::vector< RawHit > &hits, const SlotMap &slot_map, const TString &output_name, const TString &file_label) |
| Build every event in a subfile and write them to a ROOT tree. | |
Groups time-sorted hits into events.
A grid hit seeds an event; hits within the coincidence window are assigned to its slots. A second hit on an already-filled slot is resolved by the configured DedupStrategy.
All-static: the builder holds no state of its own, so the same functions serve the parallel file workers without synchronisation.
Definition at line 74 of file EventBuilder.hpp.
| typedef std::vector<Int_t> EventBuilder::SlotMap |
Board/channel to array slot lookup, indexed as BuildSlotMap() defines.
Definition at line 78 of file EventBuilder.hpp.
|
static |
Place one hit into an event, resolving any collision.
| [in,out] | e | Event to fill. |
| [in,out] | pc | Per-slot detail, or null to skip recording it. |
| ref_ts | Seeding grid hit's timestamp. | |
| slot | Target slot; see SlotLayout.hpp. | |
| energy | Hit energy, in ADC. | |
| timestamp | Hit timestamp. | |
| flags | Hit status flags, OR-ed into EventState::flags_or. | |
| strategy | Rule for resolving a slot that is already filled. |
Definition at line 76 of file EventBuilder.cpp.
Referenced by BuildEventsFromSortedHits().
|
static |
Build every event in a subfile and write them to a ROOT tree.
| hits | Hits for one subfile, already sorted by timestamp. |
| slot_map | Lookup from BuildSlotMap(). |
| output_name | Output basename for the events file. |
| file_label | Label from FileSet::FileLabel(), used in logs and plots. |
Definition at line 296 of file EventBuilder.cpp.
Referenced by RunFusedPipelineForFile().
|
static |
Build the board/channel to slot lookup for this dataset.
Definition at line 42 of file EventBuilder.cpp.
|
static |
Whether an event has everything required to be written out.
| e | Event to test. |
Definition at line 120 of file EventBuilder.cpp.
Referenced by FinalizeEvent().
|
static |
Unpack the OR-ed status flags into the conditions that matter.
| e | Event to inspect. | |
| [out] | has_fake | A synthetic event was inserted by the acquisition. |
| [out] | has_saturation | Some channel saturated within its gate. |
| [out] | has_pileup | Pileup was flagged on some channel. |
Definition at line 134 of file EventBuilder.cpp.
Referenced by FinalizeEvent().
|
static |
Clear an event back to its empty state, ready to be seeded.
| [out] | e | Event to reset. |
Definition at line 4 of file EventBuilder.cpp.
Referenced by BuildEventsFromSortedHits().
|
static |
Clear the per-slot detail alongside a reset event.
| [out] | p | Data to reset. |
Definition at line 19 of file EventBuilder.cpp.
Referenced by BuildEventsFromSortedHits().
|
static |
Decide which of two hits on the same slot survives.
| cand_ts | Candidate hit's timestamp. |
| prev_ts | Timestamp of the hit already assigned. |
| cand_energy | Candidate hit's energy, in ADC. |
| prev_energy | Energy of the hit already assigned. |
| ref_ts | Timestamp of the grid hit that seeded the event, which DedupStrategy::kCLOSEST_TO_FIRST_GRID measures against. |
| strategy | Resolution rule. |
Definition at line 27 of file EventBuilder.cpp.
Referenced by AssignHit().