@@ -124,6 +124,17 @@ namespace sbn {
124124 // / Type of mask with `triggerLocation` bits.
125125 using triggerLocationMask = mask_t <triggerLocation>;
126126
127+ // / Type(s) of trigger logic being satisfied.
128+ enum class triggerLogic : unsigned int {
129+ PMTAnalogSum, // /< Discriminated PMT signal sum above threshold.
130+ PMTPairMajority, // /< Minimum number of discriminated PMT above threshold.
131+ // ==> add here if more are needed <==
132+ NBits // /< Number of bits currently supported.
133+ }; // triggerLocation
134+
135+ // / Type of mask with `triggerLogic` bits.
136+ using triggerLogicMask = mask_t <triggerLogic>;
137+
127138 // / Type representing the type(s) of this trigger.
128139 enum class triggerType : unsigned int {
129140 Majority, // /< A minimum number of close-by PMT pairs above threshold was reached.
@@ -180,6 +191,8 @@ namespace sbn {
180191 std::string bitName (triggerSource bit);
181192 // / Returns a mnemonic short name of the trigger location.
182193 std::string bitName (triggerLocation bit);
194+ // / Returns a mnemonic short name of the trigger logic.
195+ std::string bitName (triggerLogic bit);
183196 // / Returns a mnemonic short name of the trigger type.
184197 std::string bitName (triggerType bit);
185198 // / Returns a mnemonic short name for the trigger window mode.
@@ -196,6 +209,8 @@ namespace sbn {
196209 using bits::triggerSourceMask;
197210 using bits::triggerType;
198211 using bits::triggerTypeMask;
212+ using bits::triggerLogic;
213+ using bits::triggerLogicMask;
199214 using bits::triggerLocation;
200215 using bits::triggerLocationMask;
201216 using bits::triggerWindowMode;
@@ -283,8 +298,8 @@ inline std::string sbn::bits::bitName(triggerSource bit) {
283298 + std::to_string (value (bit)) + " }): unknown bit" s);
284299} // sbn::bitName()
285300
286- // -----------------------------------------------------------------------------
287301
302+ // -----------------------------------------------------------------------------
288303inline std::string sbn::bits::bitName (triggerLocation bit) {
289304
290305 using namespace std ::string_literals;
@@ -301,6 +316,21 @@ inline std::string sbn::bits::bitName(triggerLocation bit) {
301316 + std::to_string (value (bit)) + " }): unknown bit" s);
302317} // sbn::bitName(triggerLocation)
303318
319+
320+ // -----------------------------------------------------------------------------
321+ inline std::string sbn::bits::bitName (triggerLogic bit) {
322+
323+ using namespace std ::string_literals;
324+ switch (bit) {
325+ case triggerLogic::PMTPairMajority: return " PMT pair majority" s;
326+ case triggerLogic::PMTAnalogSum: return " PMT analog sum" s;
327+ case triggerLogic::NBits: return " <invalid>" s;
328+ } // switch
329+ throw std::runtime_error (" sbn::bits::bitName(triggerLogic{ " s
330+ + std::to_string (value (bit)) + " }): unknown bit" s);
331+ } // sbn::bitName(triggerLogic)
332+
333+
304334// -----------------------------------------------------------------------------
305335inline std::string sbn::bits::bitName (triggerType bit) {
306336
@@ -314,6 +344,8 @@ inline std::string sbn::bits::bitName(triggerType bit) {
314344 + std::to_string (value (bit)) + " }): unknown bit" s);
315345} // sbn::bitName(triggerType)
316346
347+
348+ // -----------------------------------------------------------------------------
317349inline std::string sbn::bits::bitName (triggerWindowMode bit) {
318350
319351 using namespace std ::string_literals;
@@ -330,6 +362,7 @@ inline std::string sbn::bits::bitName(triggerWindowMode bit) {
330362} // triggerWindowMode
331363
332364
365+ // -----------------------------------------------------------------------------
333366inline std::string sbn::bits::bitName (gateSelection bit) {
334367
335368 using namespace std ::string_literals;
@@ -361,6 +394,7 @@ inline std::string sbn::bits::bitName(gateSelection bit) {
361394} // sbn::bitName()
362395
363396
397+ // -----------------------------------------------------------------------------
364398namespace icarus ::trigger {
365399
366400 using triggerLocation = sbn::triggerLocation;
0 commit comments