DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq
sourcecode
detdataformats
include
detdataformats
DetID.hpp
Go to the documentation of this file.
1
9
#ifndef DETDATAFORMATS_INCLUDE_DETDATAFORMATS_DETID_HPP_
10
#define DETDATAFORMATS_INCLUDE_DETDATAFORMATS_DETID_HPP_
11
12
#include <cassert>
13
#include <cstddef>
14
#include <cstdint>
15
#include <iomanip>
16
#include <istream>
17
#include <limits>
18
#include <ostream>
19
#include <sstream>
20
#include <string>
21
#include <tuple>
22
23
namespace
dunedaq::detdataformats
{
24
29
struct
DetID
30
{
31
32
using
Version_t
= uint16_t;
// NOLINT(build/unsigned)
33
using
Subdetector_t
= uint16_t;
// NOLINT(build/unsigned)
34
39
enum class
Subdetector
:
Subdetector_t
40
{
41
kUnknown
= 0,
42
kDAQ
= 1,
43
kHD_PDS
= 2,
44
kHD_TPC
= 3,
45
kHD_CRT
= 4,
46
kVD_CathodePDS
= 8,
47
kVD_MembranePDS
= 9,
48
kVD_BottomTPC
= 10,
49
kVD_TopTPC
= 11,
50
kVD_BernCRT
= 12,
51
kVD_GrenobleCRT
= 13,
52
kNDLAr_TPC
= 32,
53
kNDLAr_PDS
= 33,
54
kND_GAr
= 34
55
};
56
60
static
constexpr
Version_t
s_det_id_version
= 1;
61
65
Version_t
version
{
s_det_id_version
};
69
Subdetector
subdetector
{
Subdetector::kUnknown
};
70
71
DetID
() =
default
;
72
73
DetID
(
const
Subdetector
& subdetector_arg)
74
:
subdetector
(subdetector_arg)
75
{}
76
77
std::string
to_string
()
const
78
{
79
std::ostringstream ostr;
80
ostr <<
subdetector_to_string
(
subdetector
);
81
return
ostr.str();
82
}
83
84
bool
is_in_valid_state
() const noexcept {
return
subdetector
!=
Subdetector::kUnknown
; }
85
86
inline
static
std::string
subdetector_to_string
(
const
Subdetector
& type);
87
inline
static
Subdetector
string_to_subdetector
(
const
std::string& typestring);
88
};
89
90
}
// namespace dunedaq::detdataformats
91
92
#include "
detail/DetID.hxx
"
93
94
#endif
// DETDATAFORMATS_INCLUDE_DETDATAFORMATS_DETID_HPP_
DetID.hxx
dunedaq::detdataformats
Definition
DAQEthHeader.hpp:16
dunedaq::detdataformats::DetID
DetID is a versioned structure containing the 6 bits field of the unique identifier for a subdetector...
Definition
DetID.hpp:30
dunedaq::detdataformats::DetID::subdetector_to_string
static std::string subdetector_to_string(const Subdetector &type)
Definition
DetID.hxx:67
dunedaq::detdataformats::DetID::Subdetector_t
uint16_t Subdetector_t
Definition
DetID.hpp:33
dunedaq::detdataformats::DetID::to_string
std::string to_string() const
Definition
DetID.hpp:77
dunedaq::detdataformats::DetID::string_to_subdetector
static Subdetector string_to_subdetector(const std::string &typestring)
Definition
DetID.hxx:102
dunedaq::detdataformats::DetID::s_det_id_version
static constexpr Version_t s_det_id_version
The version of this DetID struct.
Definition
DetID.hpp:60
dunedaq::detdataformats::DetID::Version_t
uint16_t Version_t
Definition
DetID.hpp:32
dunedaq::detdataformats::DetID::is_in_valid_state
bool is_in_valid_state() const noexcept
Definition
DetID.hpp:84
dunedaq::detdataformats::DetID::subdetector
Subdetector subdetector
The general subdetector of the source of the data.
Definition
DetID.hpp:69
dunedaq::detdataformats::DetID::DetID
DetID()=default
dunedaq::detdataformats::DetID::Subdetector
Subdetector
The Subdetector enum describes the kind of source we're dealing with.
Definition
DetID.hpp:40
dunedaq::detdataformats::DetID::Subdetector::kVD_GrenobleCRT
@ kVD_GrenobleCRT
dunedaq::detdataformats::DetID::Subdetector::kVD_MembranePDS
@ kVD_MembranePDS
dunedaq::detdataformats::DetID::Subdetector::kVD_TopTPC
@ kVD_TopTPC
dunedaq::detdataformats::DetID::Subdetector::kUnknown
@ kUnknown
dunedaq::detdataformats::DetID::Subdetector::kHD_TPC
@ kHD_TPC
dunedaq::detdataformats::DetID::Subdetector::kND_GAr
@ kND_GAr
dunedaq::detdataformats::DetID::Subdetector::kVD_BottomTPC
@ kVD_BottomTPC
dunedaq::detdataformats::DetID::Subdetector::kNDLAr_TPC
@ kNDLAr_TPC
dunedaq::detdataformats::DetID::Subdetector::kNDLAr_PDS
@ kNDLAr_PDS
dunedaq::detdataformats::DetID::Subdetector::kVD_CathodePDS
@ kVD_CathodePDS
dunedaq::detdataformats::DetID::Subdetector::kHD_CRT
@ kHD_CRT
dunedaq::detdataformats::DetID::Subdetector::kHD_PDS
@ kHD_PDS
dunedaq::detdataformats::DetID::Subdetector::kVD_BernCRT
@ kVD_BernCRT
dunedaq::detdataformats::DetID::Subdetector::kDAQ
@ kDAQ
dunedaq::detdataformats::DetID::DetID
DetID(const Subdetector &subdetector_arg)
Definition
DetID.hpp:73
dunedaq::detdataformats::DetID::version
Version_t version
Version number of the DetID.
Definition
DetID.hpp:65
Generated on Sat Jun 28 2025 for DUNE-DAQ by
1.12.0