DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq::detdataformats::DetID Struct Reference

DetID is a versioned structure containing the 6 bits field of the unique identifier for a subdetector in the raw data. For convenience this field is expanded to 16 bits. More...

#include <DetID.hpp>

Public Types

enum class  Subdetector : Subdetector_t {
  kUnknown = 0 , kDAQ = 1 , kHD_PDS = 2 , kHD_TPC = 3 ,
  kHD_CRT = 4 , kVD_CathodePDS = 8 , kVD_MembranePDS = 9 , kVD_BottomTPC = 10 ,
  kVD_TopTPC = 11 , kVD_BernCRT = 12 , kVD_GrenobleCRT = 13 , kNDLAr_TPC = 32 ,
  kNDLAr_PDS = 33 , kND_GAr = 34
}
 The Subdetector enum describes the kind of source we're dealing with. More...
 
using Version_t = uint16_t
 
using Subdetector_t = uint16_t
 

Public Member Functions

 DetID ()=default
 
 DetID (const Subdetector &subdetector_arg)
 
std::string to_string () const
 
bool is_in_valid_state () const noexcept
 

Static Public Member Functions

static std::string subdetector_to_string (const Subdetector &type)
 
static Subdetector string_to_subdetector (const std::string &typestring)
 

Public Attributes

Version_t version { s_det_id_version }
 Version number of the DetID.
 
Subdetector subdetector { Subdetector::kUnknown }
 The general subdetector of the source of the data.
 

Static Public Attributes

static constexpr Version_t s_det_id_version = 1
 The version of this DetID struct.
 

Detailed Description

DetID is a versioned structure containing the 6 bits field of the unique identifier for a subdetector in the raw data. For convenience this field is expanded to 16 bits.

Definition at line 29 of file DetID.hpp.

Member Typedef Documentation

◆ Subdetector_t

Definition at line 33 of file DetID.hpp.

◆ Version_t

Definition at line 32 of file DetID.hpp.

Member Enumeration Documentation

◆ Subdetector

The Subdetector enum describes the kind of source we're dealing with.

Enumerator
kUnknown 
kDAQ 
kHD_PDS 
kHD_TPC 
kHD_CRT 
kVD_CathodePDS 
kVD_MembranePDS 
kVD_BottomTPC 
kVD_TopTPC 
kVD_BernCRT 
kVD_GrenobleCRT 
kNDLAr_TPC 
kNDLAr_PDS 
kND_GAr 

Definition at line 39 of file DetID.hpp.

Constructor & Destructor Documentation

◆ DetID() [1/2]

dunedaq::detdataformats::DetID::DetID ( )
default

◆ DetID() [2/2]

dunedaq::detdataformats::DetID::DetID ( const Subdetector & subdetector_arg)
inline

Definition at line 73 of file DetID.hpp.

74 : subdetector(subdetector_arg)
75 {}
Subdetector subdetector
The general subdetector of the source of the data.
Definition DetID.hpp:69

Member Function Documentation

◆ is_in_valid_state()

bool dunedaq::detdataformats::DetID::is_in_valid_state ( ) const
inlinenoexcept

Definition at line 84 of file DetID.hpp.

◆ string_to_subdetector()

DetID::Subdetector dunedaq::detdataformats::DetID::string_to_subdetector ( const std::string & typestring)
inlinestatic

Definition at line 102 of file DetID.hxx.

103{
104 if (typestring == "DAQ")
105 return Subdetector::kDAQ;
106 if (typestring == "HD_PDS")
108 if (typestring == "HD_TPC")
110 if (typestring == "HD_CRT")
112 if (typestring == "VD_Cathode_PDS")
114 if (typestring == "VD_Membrane_PDS")
116 if (typestring == "VD_Bottom_TPC")
118 if (typestring == "VD_Top_TPC")
120 if (typestring == "VD_BernCRT")
122 if (typestring == "VD_GrenobleCRT")
124 if (typestring == "NDLAr_TPC")
126 if (typestring == "NDLAr_PDS")
128 if (typestring == "ND_GAr")
130
132}

◆ subdetector_to_string()

std::string dunedaq::detdataformats::DetID::subdetector_to_string ( const Subdetector & type)
inlinestatic

Definition at line 67 of file DetID.hxx.

68{
69 switch (type) {
71 return "DAQ";
73 return "HD_PDS";
75 return "HD_TPC";
77 return "HD_CRT";
79 return "VD_Cathode_PDS";
81 return "VD_Membrane_PDS";
83 return "VD_Bottom_TPC";
85 return "VD_Top_TPC";
87 return "VD_BernCRT";
89 return "VD_GrenobleCRT";
91 return "NDLAr_TPC";
93 return "NDLAr_PDS";
95 return "ND_GAr";
96 default:
97 return "Unknown";
98 }
99}

◆ to_string()

std::string dunedaq::detdataformats::DetID::to_string ( ) const
inline

Definition at line 77 of file DetID.hpp.

78 {
79 std::ostringstream ostr;
81 return ostr.str();
82 }
static std::string subdetector_to_string(const Subdetector &type)
Definition DetID.hxx:67

Member Data Documentation

◆ s_det_id_version

Version_t dunedaq::detdataformats::DetID::s_det_id_version = 1
staticconstexpr

The version of this DetID struct.

Definition at line 60 of file DetID.hpp.

◆ subdetector

Subdetector dunedaq::detdataformats::DetID::subdetector { Subdetector::kUnknown }

The general subdetector of the source of the data.

Definition at line 69 of file DetID.hpp.

◆ version

Version_t dunedaq::detdataformats::DetID::version { s_det_id_version }

Version number of the DetID.

Definition at line 65 of file DetID.hpp.

static constexpr Version_t s_det_id_version
The version of this DetID struct.
Definition DetID.hpp:60

The documentation for this struct was generated from the following files: