BOSS 7.0.5
BESIII Offline Software System
Loading...
Searching...
No Matches
SourceIdentifier.cxx
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/**
4 * @file SourceIdentifier.cxx
5 * @author <a href="mailto:[email protected]>Andr� Rabello dos
6 * ANJOS</a>
7 * $Author: maqm $
8 * $Revision: 1.2 $
9 * $Date: 2011/02/20 23:38:21 $
10 *
11 * @brief Defines a type that can perform the conversion between source
12 * identifier components and the its 32-bit version.
13 */
14
15#include "eformat/SourceIdentifier.h"
16#include <sstream>
17
19(eformat::SubDetector subdet, uint16_t id)
20 : m_sd(subdet),
21 m_id(id)
22{
23}
24
26 : m_sd(static_cast<eformat::SubDetector>((sid >> 16) & 0xff)),
27 m_id(static_cast<uint16_t>(0xffff & sid))
28{
29}
30
32{
33 uint32_t retval = (0xff) & m_sd;
34 retval <<= 16;
35 retval |= m_id;
36 return retval;
37}
38
40{
41 std::ostringstream oss;
42 oss << human_detector() << ", Identifier = " << (unsigned int)module_id();
43 return oss.str();
44}
45
47{
48 using namespace eformat;
49 std::string s;
50 switch (subdetector_id()) {
51 case FULL_SD_EVENT:
52 s += "FULL_SD_EVENT";
53 break;
54 case PIXEL_BARREL:
55 s += "PIXEL_BARREL";
56 break;
58 s += "PIXEL_FORWARD_A_SIDE";
59 break;
61 s += "PIXEL_FORWARD_C_SIDE";
62 break;
63 case PIXEL_B_LAYER:
64 s += "PIXEL_B_LAYER";
65 break;
67 s += "SCT_BARREL_A_SIDE";
68 break;
70 s += "SCT_BARREL_C_SIDE";
71 break;
73 s += "SCT_ENDCAP_A_SIDE";
74 break;
76 s += "SCT_ENDCAP_C_SIDE";
77 break;
79 s += "TRT_ANCILLARY_CRATE";
80 break;
82 s += "TRT_BARREL_A_SIDE";
83 break;
85 s += "TRT_BARREL_C_SIDE";
86 break;
88 s += "TRT_ENDCAP_A_SIDE";
89 break;
91 s += "TRT_ENDCAP_C_SIDE";
92 break;
94 s += "LAR_EM_BARREL_A_SIDE";
95 break;
97 s += "LAR_EM_BARREL_C_SIDE";
98 break;
100 s += "LAR_EM_ENDCAP_A_SIDE";
101 break;
103 s += "LAR_EM_ENDCAP_C_SIDE";
104 break;
106 s += "LAR_HAD_ENDCAP_A_SIDE";
107 break;
109 s += "LAR_HAD_ENDCAP_C_SIDE";
110 break;
111 case LAR_FCAL_A_SIDE:
112 s += "LAR_FCAL_A_SIDE";
113 break;
114 case LAR_FCAL_C_SIDE:
115 s += "LAR_FCAL_C_SIDE";
116 break;
118 s += "TILECAL_LASER_CRATE";
119 break;
121 s += "TILECAL_BARREL_A_SIDE";
122 break;
124 s += "TILECAL_BARREL_C_SIDE";
125 break;
127 s += "TILECAL_EXT_A_SIDE";
128 break;
130 s += "TILECAL_EXT_C_SIDE";
131 break;
133 s += "MUON_ANCILLARY_CRATE";
134 break;
136 s += "MUON_MDT_BARREL_A_SIDE";
137 break;
139 s += "MUON_MDT_BARREL_C_SIDE";
140 break;
142 s += "MUON_MDT_ENDCAP_A_SIDE";
143 break;
145 s += "MUON_MDT_ENDCAP_C_SIDE";
146 break;
148 s += "MUON_RPC_BARREL_A_SIDE";
149 break;
151 s += "MUON_RPC_BARREL_C_SIDE";
152 break;
154 s += "MUON_TGC_ENDCAP_A_SIDE";
155 break;
157 s += "MUON_TGC_ENDCAP_C_SIDE";
158 break;
160 s += "MUON_CSC_ENDCAP_A_SIDE";
161 break;
163 s += "MUON_CSC_ENDCAP_C_SIDE";
164 break;
165 case TDAQ_BEAM_CRATE:
166 s += "TDAQ_BEAM_CRATE";
167 break;
169 s += "TDAQ_CALO_PREPROC";
170 break;
172 s += "TDAQ_CALO_CLUSTER_PROC_DAQ";
173 break;
175 s += "TDAQ_CALO_CLUSTER_PROC_ROI";
176 break;
178 s += "TDAQ_CALO_JET_PROC_DAQ";
179 break;
181 s += "TDAQ_CALO_JET_PROC_ROI";
182 break;
184 s += "TDAQ_MUON_CTP_INTERFACE";
185 break;
186 case TDAQ_CTP:
187 s += "TDAQ_CTP";
188 break;
189 case TDAQ_L2SV:
190 s += "TDAQ_L2SV";
191 break;
192 case TDAQ_SFI:
193 s += "TDAQ_SFI";
194 break;
195 case TDAQ_SFO:
196 s += "TDAQ_SFO";
197 break;
198 case TDAQ_LVL2:
199 s += "TDAQ_LVL2";
200 break;
202 s += "TDAQ_EVENT_FILTER";
203 break;
204 case OTHER:
205 s += "OTHER";
206 break;
207 default:
208 break;
209 }
210 return s;
211}
XmlRpcServer s
Definition: HelloServer.cpp:11
SourceIdentifier(eformat::SubDetector subdet, uint16_t id)
std::string human_detector(void) const