DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
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
24
29struct DetID
30{
31
32 using Version_t = uint16_t; // NOLINT(build/unsigned)
33 using Subdetector_t = uint16_t; // NOLINT(build/unsigned)
34
40 {
41 kUnknown = 0,
42 kDAQ = 1,
43 kHD_PDS = 2,
44 kHD_TPC = 3,
45 kHD_CRT = 4,
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
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;
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 is a versioned structure containing the 6 bits field of the unique identifier for a subdetector...
Definition DetID.hpp:30
static std::string subdetector_to_string(const Subdetector &type)
Definition DetID.hxx:67
std::string to_string() const
Definition DetID.hpp:77
static Subdetector string_to_subdetector(const std::string &typestring)
Definition DetID.hxx:102
static constexpr Version_t s_det_id_version
The version of this DetID struct.
Definition DetID.hpp:60
bool is_in_valid_state() const noexcept
Definition DetID.hpp:84
Subdetector subdetector
The general subdetector of the source of the data.
Definition DetID.hpp:69
Subdetector
The Subdetector enum describes the kind of source we're dealing with.
Definition DetID.hpp:40
DetID(const Subdetector &subdetector_arg)
Definition DetID.hpp:73
Version_t version
Version number of the DetID.
Definition DetID.hpp:65