1414 * A run header is a minimal metadata object associated with a \ref GRunDataCollection.
1515 *
1616 * It records:
17- * - \c runID : run identifier (application-defined)
18- * - \c events_processed : number of events integrated into this run summary so far
17+ * - \c runID : run identifier (application-defined)
18+ * - \c events_processed : total number of events seen by the run action
19+ * - \c events_with_payload : number of events that contributed at least one run-mode payload
1920 *
2021 * The constructor emits a brief log summary. In multi-threaded contexts, an optional
2122 * thread ID can be attached for diagnostics and provenance.
@@ -43,20 +44,25 @@ inline auto defineOptions() -> GOptions {
4344} // namespace grun_header
4445
4546/* *
46- * \brief Minimal run metadata: run ID and integrated- event counter .
47+ * \brief Minimal run metadata: run ID and run-level event counters .
4748 *
4849 * \details
4950 * This object is typically owned by \ref GRunDataCollection as a \c std::unique_ptr.
5051 * It provides:
5152 * - stable access to run identifier
52- * - a simple counter tracking how many events were integrated
53+ * - a simple counter tracking how many events were processed
54+ * - a simple counter tracking how many events contributed run-mode payload
5355 *
54- * The counter is incremented via \ref GRunHeader::increment_events_processed "increment_events_processed()".
56+ * The counters are incremented via:
57+ * - \ref GRunHeader::increment_events_processed "increment_events_processed()"
58+ * - \ref GRunHeader::increment_events_with_payload "increment_events_with_payload()"
5559 *
5660 * \note
57- * \ref GRunDataCollection does not automatically increment this counter in the current implementation.
58- * If you want the value to reflect integrated events, ensure the caller (or the run collection)
59- * invokes \ref GRunHeader::increment_events_processed "increment_events_processed()" once per event.
61+ * \ref GRunDataCollection does not automatically decide which events contributed payload.
62+ * The caller (or higher-level run/event action code) must invoke:
63+ * - \ref GRunHeader::increment_events_processed "increment_events_processed()" once per processed event
64+ * - \ref GRunHeader::increment_events_with_payload "increment_events_with_payload()" once per event
65+ * that produced at least one run-mode payload
6066 */
6167class GRunHeader : public GBase <GRunHeader>
6268{
@@ -67,7 +73,8 @@ class GRunHeader : public GBase<GRunHeader>
6773 * \details
6874 * The constructor logs:
6975 * - run ID
70- * - initial event count (usually 0)
76+ * - initial total processed-event count (usually 0)
77+ * - initial payload-event count (usually 0)
7178 * - optional thread ID if provided
7279 *
7380 * \param gopts Shared options object used to configure logging and behavior.
@@ -80,13 +87,15 @@ class GRunHeader : public GBase<GRunHeader>
8087 if (tid != -1 ) {
8188 log->info (1 , " \n " ,
8289 TPOINTITEM , " Run ID: " , rid, " \n " ,
83- TPOINTITEM , " Number of events collected: " , events_processed,
90+ TPOINTITEM , " Number of events processed: " , events_processed, " \n " ,
91+ TPOINTITEM , " Number of events with payload: " , events_with_payload, " \n " ,
8492 TPOINTITEM , " Thread ID: " , tid);
8593 }
8694 else {
8795 log->info (1 , " \n " ,
8896 TPOINTITEM , " Run ID: " , rid, " \n " ,
89- TPOINTITEM , " Number of events collected: " , events_processed);
97+ TPOINTITEM , " Number of events processed: " , events_processed, " \n " ,
98+ TPOINTITEM , " Number of events with payload: " , events_with_payload);
9099 }
91100 }
92101
@@ -97,32 +106,61 @@ class GRunHeader : public GBase<GRunHeader>
97106 [[nodiscard]] auto getRunID () const -> int { return runID; }
98107
99108 /* *
100- * \brief Get the number of events integrated into this run summary so far.
109+ * \brief Get the total number of events processed in this run summary so far.
101110 *
102111 * \details
103112 * This value is incremented by \ref GRunHeader::increment_events_processed "increment_events_processed()".
104- * Typical usage is "once per event integrated into the run accumulator ".
113+ * Typical usage is "once per processed event reaching end-of-event handling ".
105114 *
106115 * \return Number of processed events.
107116 */
108117 [[nodiscard]] auto get_events_processed () const -> int { return events_processed; }
109118
119+ /* *
120+ * \brief Get the number of events that contributed run-mode payload in this run summary so far.
121+ *
122+ * \details
123+ * This value is incremented by
124+ * \ref GRunHeader::increment_events_with_payload "increment_events_with_payload()".
125+ * Typical usage is "once per event that contributed at least one run-mode payload".
126+ *
127+ * \return Number of payload-producing events.
128+ */
129+ [[nodiscard]] auto get_events_with_payload () const -> int { return events_with_payload; }
130+
110131 /* *
111132 * \brief Increment the number of processed events.
112133 *
113134 * \details
114- * Intended to be called once per event integrated into the run accumulator .
135+ * Intended to be called once per processed event .
115136 */
116137 void increment_events_processed () { events_processed++; }
117138
118139 /* *
119- * \brief Add a number of processed events to the counter.
120- *
121- * \param count Number of processed events to add.
122- */
140+ * \brief Increment the number of events that produced run-mode payload.
141+ *
142+ * \details
143+ * Intended to be called once per event that contributed at least one run-mode payload
144+ * to the run accumulator.
145+ */
146+ void increment_events_with_payload () { events_with_payload++; }
147+
148+ /* *
149+ * \brief Add a number of processed events to the counter.
150+ *
151+ * \param count Number of processed events to add.
152+ */
123153 void add_events_processed (int count) { events_processed += count; }
124154
155+ /* *
156+ * \brief Add a number of payload-producing events to the counter.
157+ *
158+ * \param count Number of payload-producing events to add.
159+ */
160+ void add_events_with_payload (int count) { events_with_payload += count; }
161+
125162private:
126- int events_processed{0 }; // /< Number of events integrated into the run summary.
127- int runID; // /< Run identifier.
128- };
163+ int events_processed{0 }; // /< Total number of processed events in the run summary.
164+ int events_with_payload{0 }; // /< Number of processed events that contributed run-mode payload.
165+ int runID; // /< Run identifier.
166+ };
0 commit comments