DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
DetID.hxx
Go to the documentation of this file.
1
3
10inline std::ostream&
11operator<<(std::ostream& o, DetID::Subdetector const& type)
12{
14}
15
22inline std::ostream&
23operator<<(std::ostream& o, DetID const& det_id)
24{
25 return o << "subdetector: " << det_id.subdetector;
26}
27
34inline std::istream&
35operator>>(std::istream& is, DetID::Subdetector& t)
36{
37 std::string tmp;
38 is >> tmp;
39
41
42 return is;
43}
44
50inline std::istream&
51operator>>(std::istream& is, DetID& det_id)
52{
53 std::string tmp;
54 is >> tmp >> det_id.subdetector;
55
56 return is;
57}
58
59inline std::string
61{
62 switch (type) {
64 return "DAQ";
66 return "HD_PDS";
68 return "HD_TPC";
70 return "HD_CRT";
72 return "VD_CathodePDS";
74 return "VD_MembranePDS";
76 return "VD_BottomTPC";
78 return "VD_TopTPC";
80 return "VD_BernCRT";
82 return "VD_GrenobleCRT";
84 return "NDLAr_TPC";
86 return "NDLAr_PDS";
88 return "ND_GAr";
89 default:
90 return "Unknown";
91 }
92}
93
95DetID::string_to_subdetector(const std::string& typestring)
96{
97 if (typestring == "DAQ")
98 return Subdetector::kDAQ;
99 if (typestring == "HD_PDS")
101 if (typestring == "HD_TPC")
103 if (typestring == "HD_CRT")
105 if (typestring == "VD_CathodePDS")
107 if (typestring == "VD_MembranePDS")
109 if (typestring == "VD_BottomTPC")
111 if (typestring == "VD_TopTPC")
113 if (typestring == "VD_BernCRT")
115 if (typestring == "VD_GrenobleCRT")
117 if (typestring == "NDLAr_TPC")
119 if (typestring == "NDLAr_PDS")
121 if (typestring == "ND_GAr")
123
125}
126
127} // namespace dunedaq::detdataformats
std::istream & operator>>(std::istream &is, DetID::Subdetector &t)
Read a DetID::Subdetector from a string stream.
Definition DetID.hxx:35
std::ostream & operator<<(std::ostream &o, DAQEthHeader const &h)
DetID is a structure containing the 6 bits field of the unique identifier for a subdetector in the ra...
Definition DetID.hpp:30
static std::string subdetector_to_string(const Subdetector &type)
Definition DetID.hxx:60
static Subdetector string_to_subdetector(const std::string &typestring)
Definition DetID.hxx:95
Subdetector
The Subdetector enum describes the kind of source we're dealing with.
Definition DetID.hpp:36