BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
eformat::helper::SourceIdentifier Class Reference

#include <SourceIdentifier.h>

Public Member Functions

 SourceIdentifier (eformat::SubDetector subdet, uint16_t id)
 
 SourceIdentifier (uint32_t sid)
 
eformat::SubDetector subdetector_id (void) const
 
uint16_t module_id (void) const
 
uint32_t code (void) const
 
std::string human (void) const
 
std::string human_detector (void) const
 

Detailed Description

Defines converters between source identifiers and its components.

Definition at line 94 of file SourceIdentifier.h.

Constructor & Destructor Documentation

◆ SourceIdentifier() [1/2]

eformat::helper::SourceIdentifier::SourceIdentifier ( eformat::SubDetector  subdet,
uint16_t  id 
)

Constructor. Takes the components to form a source identifier.

Parameters
subdetThe subdetector for this source
idThe module identifier

Definition at line 18 of file SourceIdentifier.cxx.

20 : m_sd(subdet),
21 m_id(id)
22{
23}

◆ SourceIdentifier() [2/2]

eformat::helper::SourceIdentifier::SourceIdentifier ( uint32_t  sid)

Constructor. Takes the source identifier to understand the components from.

Parameters
sidThe source identifier, fully built.
Warning
This source identifier has to conform to the current version of the library or unpredictable results might occur.

Definition at line 25 of file SourceIdentifier.cxx.

26 : m_sd(static_cast<eformat::SubDetector>((sid >> 16) & 0xff)),
27 m_id(static_cast<uint16_t>(0xffff & sid))
28{
29}

Member Function Documentation

◆ code()

uint32_t eformat::helper::SourceIdentifier::code ( void  ) const

Gets the full 32-bit number made by assembling the 3 numbers above.

Definition at line 31 of file SourceIdentifier.cxx.

32{
33 uint32_t retval = (0xff) & m_sd;
34 retval <<= 16;
35 retval |= m_id;
36 return retval;
37}

Referenced by main().

◆ human()

std::string eformat::helper::SourceIdentifier::human ( void  ) const

Returns a string that represents the source identifier in a human readable format

Definition at line 39 of file SourceIdentifier.cxx.

40{
41 std::ostringstream oss;
42 oss << human_detector() << ", Identifier = " << (unsigned int)module_id();
43 return oss.str();
44}
std::string human_detector(void) const

◆ human_detector()

std::string eformat::helper::SourceIdentifier::human_detector ( void  ) const

Returns a string that represents the subdetector identifier in a human readable format

Definition at line 46 of file SourceIdentifier.cxx.

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
eformat::SubDetector subdetector_id(void) const
@ TILECAL_BARREL_C_SIDE
@ TILECAL_EXT_C_SIDE
@ MUON_CSC_ENDCAP_C_SIDE
@ TILECAL_LASER_CRATE
@ MUON_TGC_ENDCAP_C_SIDE
@ MUON_CSC_ENDCAP_A_SIDE
@ LAR_EM_ENDCAP_A_SIDE
@ TDAQ_MUON_CTP_INTERFACE
@ MUON_MDT_BARREL_A_SIDE
@ MUON_MDT_ENDCAP_C_SIDE
@ LAR_HAD_ENDCAP_C_SIDE
@ MUON_TGC_ENDCAP_A_SIDE
@ LAR_EM_BARREL_A_SIDE
@ LAR_EM_BARREL_C_SIDE
@ MUON_MDT_ENDCAP_A_SIDE
@ TDAQ_CALO_JET_PROC_ROI
@ LAR_HAD_ENDCAP_A_SIDE
@ TDAQ_CALO_CLUSTER_PROC_ROI
@ TILECAL_EXT_A_SIDE
@ TDAQ_CALO_CLUSTER_PROC_DAQ
@ TDAQ_CALO_JET_PROC_DAQ
@ TRT_ANCILLARY_CRATE
@ PIXEL_FORWARD_C_SIDE
@ PIXEL_FORWARD_A_SIDE
@ MUON_RPC_BARREL_C_SIDE
@ TILECAL_BARREL_A_SIDE
@ MUON_ANCILLARY_CRATE
@ LAR_EM_ENDCAP_C_SIDE
@ MUON_RPC_BARREL_A_SIDE
@ MUON_MDT_BARREL_C_SIDE

◆ module_id()

uint16_t eformat::helper::SourceIdentifier::module_id ( void  ) const
inline

Extracts the Module identifier from the source identifier.

Definition at line 123 of file SourceIdentifier.h.

123{ return m_id; }

Referenced by main().

◆ subdetector_id()

eformat::SubDetector eformat::helper::SourceIdentifier::subdetector_id ( void  ) const
inline

Extracts the SubDetector component of the identifier.

Definition at line 118 of file SourceIdentifier.h.

118{ return m_sd; }

Referenced by main().


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