All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Typedefs | Variables
BeamBits.h File Reference

Definitions of the trigger bits for SBN. More...

#include <stdexcept>
#include <string>
#include <vector>
#include <initializer_list>
#include <type_traits>

Go to the source code of this file.

Classes

struct  sbn::bits::mask_t< EnumType >
 

Namespaces

 sbn
 This module creates Common Analysis Files.
 
 sbn::bits
 Simple utilities to deal with bit enumerators.
 
 icarus::trigger
 

Typedefs

using icarus::trigger::triggerLocation = sbn::triggerLocation
 
using icarus::trigger::triggerSource = sbn::triggerSource
 

Functions

Generic bit functions
template<typename EnumType >
mask_t< EnumType > sbn::bits::makeMask (typename mask_t< EnumType >::maskbits_t bits) noexcept
 Converts a integral type into a mask. More...
 
template<typename EnumType >
constexpr auto sbn::bits::value (EnumType bit)
 Returns the value of specified bit (conversion like enum to int). More...
 
template<typename EnumType , typename... OtherBits>
constexpr mask_t< EnumType > sbn::bits::mask (EnumType bit, OtherBits...otherBits)
 Returns a mask with all specified bits set. More...
 
template<typename EnumType >
constexpr bool sbn::bits::hasBitSet (mask_t< EnumType > bitMask, EnumType bit)
 Returns whether the specified bit is set in bitMask. More...
 
template<typename EnumType >
std::string sbn::bits::name (EnumType bit)
 Returns the name of the specified bit. Delegates to bitName(). More...
 
template<typename EnumType >
std::vector< std::string > sbn::bits::names (mask_t< EnumType > mask)
 

Variables

static constexpr std::size_t icarus::trigger::kEast = sbn::bits::value<triggerLocation>(triggerLocation::CryoEast)
 
static constexpr std::size_t icarus::trigger::kWest = sbn::bits::value<triggerLocation>(triggerLocation::CryoWest)
 
static constexpr std::size_t icarus::trigger::kNTriggerLocation = sbn::bits::value<triggerLocation>(triggerLocation::NBits)
 
static constexpr std::size_t icarus::trigger::kBNB = sbn::bits::value<triggerSource>(triggerSource::BNB)
 
static constexpr std::size_t icarus::trigger::kNuMI = sbn::bits::value<triggerSource>(triggerSource::NuMI)
 
static constexpr std::size_t icarus::trigger::kOffBeamBNB = sbn::bits::value<triggerSource>(triggerSource::OffbeamBNB)
 
static constexpr std::size_t icarus::trigger::kOffBeamNuMI = sbn::bits::value<triggerSource>(triggerSource::OffbeamNuMI)
 
static constexpr std::size_t icarus::trigger::kCalibration = sbn::bits::value<triggerSource>(triggerSource::Calib)
 
static constexpr std::size_t icarus::trigger::kNTriggerSource = sbn::bits::value<triggerSource>(triggerSource::NBits)
 

Beam bits

enum  sbn::bits::triggerSource : unsigned int {
  sbn::bits::triggerSource::Unknown, sbn::bits::triggerSource::BNB, sbn::bits::triggerSource::NuMI, sbn::bits::triggerSource::OffbeamBNB,
  sbn::bits::triggerSource::OffbeamNuMI, sbn::bits::triggerSource::Calib, sbn::bits::triggerSource::NBits
}
 Type of beam or beam gate or other trigger source. More...
 
enum  sbn::bits::triggerLocation : unsigned int {
  sbn::bits::triggerLocation::CryoEast, sbn::bits::triggerLocation::CryoWest, sbn::bits::triggerLocation::TPCEE, sbn::bits::triggerLocation::TPCEW,
  sbn::bits::triggerLocation::TPCWE, sbn::bits::triggerLocation::TPCWW, sbn::bits::triggerLocation::NBits
}
 Location or locations generating a trigger. More...
 
enum  sbn::bits::triggerType : unsigned int { sbn::bits::triggerType::Majority, sbn::bits::triggerType::MinimumBias, sbn::bits::triggerType::NBits }
 Type representing the type(s) of this trigger. More...
 
enum  sbn::bits::triggerWindowMode : unsigned int { sbn::bits::triggerWindowMode::Separated, sbn::bits::triggerWindowMode::Overlapping, sbn::bits::triggerWindowMode::NBits }
 Trigger window mode. More...
 
enum  sbn::bits::gateSelection : unsigned int {
  sbn::bits::gateSelection::GateBNB, sbn::bits::gateSelection::DriftGateBNB, sbn::bits::gateSelection::GateNuMI, sbn::bits::gateSelection::DriftGateNuMI,
  sbn::bits::gateSelection::GateOffbeamBNB, sbn::bits::gateSelection::DriftGateOffbeamBNB, sbn::bits::gateSelection::GateOffbeamNuMI, sbn::bits::gateSelection::DriftGateOffbeamNuMI,
  sbn::bits::gateSelection::GateCalibration, sbn::bits::gateSelection::DriftGateCalibration, sbn::bits::gateSelection::MinbiasGateBNB, sbn::bits::gateSelection::MinbiasGateNuMI,
  sbn::bits::gateSelection::MinbiasGateOffbeamBNB, sbn::bits::gateSelection::MinbiasGateOffbeamNuMI, sbn::bits::gateSelection::MinbiasGateCalibration, sbn::bits::gateSelection::MinbiasDriftGateBNB,
  sbn::bits::gateSelection::MinbiasDriftGateNuMI, sbn::bits::gateSelection::MinbiasDriftGateOffbeamBNB, sbn::bits::gateSelection::MinbiasDriftGateOffbeamNuMI, sbn::bits::gateSelection::MinbiasDriftGateCalibration,
  sbn::bits::gateSelection::NBits
}
 Enabled gates in the trigger configuration. See register 0X00050008 in docdb SBN-doc-23778-v1. More...
 
using sbn::bits::triggerSourceMask = mask_t< triggerSource >
 Type of mask with triggerSource bits. More...
 
using sbn::bits::triggerLocationMask = mask_t< triggerLocation >
 Type of mask with triggerLocation bits. More...
 
using sbn::bits::triggerTypeMask = mask_t< triggerType >
 Type of mask with triggerType bits. More...
 
using sbn::bits::gateSelectionMask = mask_t< gateSelection >
 
std::string sbn::bits::bitName (triggerSource bit)
 Returns a mnemonic short name of the beam type. More...
 
std::string sbn::bits::bitName (triggerLocation bit)
 Returns a mnemonic short name of the trigger location. More...
 
std::string sbn::bits::bitName (triggerType bit)
 Returns a mnemonic short name of the trigger type. More...
 
std::string sbn::bits::bitName (triggerWindowMode bit)
 Returns a mnemonic short name for the trigger window mode. More...
 
std::string sbn::bits::bitName (gateSelection bit)
 Returns a mnemonic short name for the trigger window mode. More...
 

Detailed Description

Definitions of the trigger bits for SBN.

Author
Gianluca Petrillo (petri.nosp@m.llo@.nosp@m.slac..nosp@m.stan.nosp@m.ford..nosp@m.edu)
Date
May 19, 2021

This is a header-only library.

Todo:
This header should be moved into the proper place (proposal: sbnobj/Common/Trigger in sbnobj)

Definition in file BeamBits.h.