BOSS 8.0.0
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
 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
 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 95 of file Event/eformat/include/eformat/SourceIdentifier.h.

Constructor & Destructor Documentation

◆ SourceIdentifier() [1/6]

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.

19 : m_sd( subdet ), m_id( id ) {}

◆ SourceIdentifier() [2/6]

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 21 of file SourceIdentifier.cxx.

22 : m_sd( static_cast<eformat::SubDetector>( ( sid >> 16 ) & 0xff ) )
23 , m_id( static_cast<uint16_t>( 0xffff & sid ) ) {}

◆ SourceIdentifier() [3/6]

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

◆ SourceIdentifier() [4/6]

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.

◆ SourceIdentifier() [5/6]

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

◆ SourceIdentifier() [6/6]

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.

Member Function Documentation

◆ code() [1/3]

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

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

Definition at line 25 of file SourceIdentifier.cxx.

25 {
26 uint32_t retval = ( 0xff ) & m_sd;
27 retval <<= 16;
28 retval |= m_id;
29 return retval;
30}

Referenced by main(), and main().

◆ code() [2/3]

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

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

◆ code() [3/3]

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

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

◆ human() [1/3]

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

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

Definition at line 32 of file SourceIdentifier.cxx.

32 {
33 std::ostringstream oss;
34 oss << human_detector() << ", Identifier = " << (unsigned int)module_id();
35 return oss.str();
36}
std::string human_detector(void) const

◆ human() [2/3]

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

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

◆ human() [3/3]

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

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

◆ human_detector() [1/3]

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 38 of file SourceIdentifier.cxx.

38 {
39 using namespace eformat;
40 std::string s;
41 switch ( subdetector_id() )
42 {
43 case FULL_SD_EVENT: s += "FULL_SD_EVENT"; break;
44 case PIXEL_BARREL: s += "PIXEL_BARREL"; break;
45 case PIXEL_FORWARD_A_SIDE: s += "PIXEL_FORWARD_A_SIDE"; break;
46 case PIXEL_FORWARD_C_SIDE: s += "PIXEL_FORWARD_C_SIDE"; break;
47 case PIXEL_B_LAYER: s += "PIXEL_B_LAYER"; break;
48 case SCT_BARREL_A_SIDE: s += "SCT_BARREL_A_SIDE"; break;
49 case SCT_BARREL_C_SIDE: s += "SCT_BARREL_C_SIDE"; break;
50 case SCT_ENDCAP_A_SIDE: s += "SCT_ENDCAP_A_SIDE"; break;
51 case SCT_ENDCAP_C_SIDE: s += "SCT_ENDCAP_C_SIDE"; break;
52 case TRT_ANCILLARY_CRATE: s += "TRT_ANCILLARY_CRATE"; break;
53 case TRT_BARREL_A_SIDE: s += "TRT_BARREL_A_SIDE"; break;
54 case TRT_BARREL_C_SIDE: s += "TRT_BARREL_C_SIDE"; break;
55 case TRT_ENDCAP_A_SIDE: s += "TRT_ENDCAP_A_SIDE"; break;
56 case TRT_ENDCAP_C_SIDE: s += "TRT_ENDCAP_C_SIDE"; break;
57 case LAR_EM_BARREL_A_SIDE: s += "LAR_EM_BARREL_A_SIDE"; break;
58 case LAR_EM_BARREL_C_SIDE: s += "LAR_EM_BARREL_C_SIDE"; break;
59 case LAR_EM_ENDCAP_A_SIDE: s += "LAR_EM_ENDCAP_A_SIDE"; break;
60 case LAR_EM_ENDCAP_C_SIDE: s += "LAR_EM_ENDCAP_C_SIDE"; break;
61 case LAR_HAD_ENDCAP_A_SIDE: s += "LAR_HAD_ENDCAP_A_SIDE"; break;
62 case LAR_HAD_ENDCAP_C_SIDE: s += "LAR_HAD_ENDCAP_C_SIDE"; break;
63 case LAR_FCAL_A_SIDE: s += "LAR_FCAL_A_SIDE"; break;
64 case LAR_FCAL_C_SIDE: s += "LAR_FCAL_C_SIDE"; break;
65 case TILECAL_LASER_CRATE: s += "TILECAL_LASER_CRATE"; break;
66 case TILECAL_BARREL_A_SIDE: s += "TILECAL_BARREL_A_SIDE"; break;
67 case TILECAL_BARREL_C_SIDE: s += "TILECAL_BARREL_C_SIDE"; break;
68 case TILECAL_EXT_A_SIDE: s += "TILECAL_EXT_A_SIDE"; break;
69 case TILECAL_EXT_C_SIDE: s += "TILECAL_EXT_C_SIDE"; break;
70 case MUON_ANCILLARY_CRATE: s += "MUON_ANCILLARY_CRATE"; break;
71 case MUON_MDT_BARREL_A_SIDE: s += "MUON_MDT_BARREL_A_SIDE"; break;
72 case MUON_MDT_BARREL_C_SIDE: s += "MUON_MDT_BARREL_C_SIDE"; break;
73 case MUON_MDT_ENDCAP_A_SIDE: s += "MUON_MDT_ENDCAP_A_SIDE"; break;
74 case MUON_MDT_ENDCAP_C_SIDE: s += "MUON_MDT_ENDCAP_C_SIDE"; break;
75 case MUON_RPC_BARREL_A_SIDE: s += "MUON_RPC_BARREL_A_SIDE"; break;
76 case MUON_RPC_BARREL_C_SIDE: s += "MUON_RPC_BARREL_C_SIDE"; break;
77 case MUON_TGC_ENDCAP_A_SIDE: s += "MUON_TGC_ENDCAP_A_SIDE"; break;
78 case MUON_TGC_ENDCAP_C_SIDE: s += "MUON_TGC_ENDCAP_C_SIDE"; break;
79 case MUON_CSC_ENDCAP_A_SIDE: s += "MUON_CSC_ENDCAP_A_SIDE"; break;
80 case MUON_CSC_ENDCAP_C_SIDE: s += "MUON_CSC_ENDCAP_C_SIDE"; break;
81 case TDAQ_BEAM_CRATE: s += "TDAQ_BEAM_CRATE"; break;
82 case TDAQ_CALO_PREPROC: s += "TDAQ_CALO_PREPROC"; break;
83 case TDAQ_CALO_CLUSTER_PROC_DAQ: s += "TDAQ_CALO_CLUSTER_PROC_DAQ"; break;
84 case TDAQ_CALO_CLUSTER_PROC_ROI: s += "TDAQ_CALO_CLUSTER_PROC_ROI"; break;
85 case TDAQ_CALO_JET_PROC_DAQ: s += "TDAQ_CALO_JET_PROC_DAQ"; break;
86 case TDAQ_CALO_JET_PROC_ROI: s += "TDAQ_CALO_JET_PROC_ROI"; break;
87 case TDAQ_MUON_CTP_INTERFACE: s += "TDAQ_MUON_CTP_INTERFACE"; break;
88 case TDAQ_CTP: s += "TDAQ_CTP"; break;
89 case TDAQ_L2SV: s += "TDAQ_L2SV"; break;
90 case TDAQ_SFI: s += "TDAQ_SFI"; break;
91 case TDAQ_SFO: s += "TDAQ_SFO"; break;
92 case TDAQ_LVL2: s += "TDAQ_LVL2"; break;
93 case TDAQ_EVENT_FILTER: s += "TDAQ_EVENT_FILTER"; break;
94 case OTHER: s += "OTHER"; break;
95 default: break;
96 }
97 return s;
98}
XmlRpcServer s

Referenced by human().

◆ human_detector() [2/3]

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

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

◆ human_detector() [3/3]

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

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

◆ module_id() [1/3]

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

Extracts the Module identifier from the source identifier.

Definition at line 124 of file Event/eformat/include/eformat/SourceIdentifier.h.

124{ return m_id; }

Referenced by human(), and main().

◆ module_id() [2/3]

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

Extracts the Module identifier from the source identifier.

Definition at line 124 of file InstallArea/x86_64-el9-gcc13-dbg/include/eformat/SourceIdentifier.h.

124{ return m_id; }

◆ module_id() [3/3]

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

Extracts the Module identifier from the source identifier.

Definition at line 124 of file InstallArea/x86_64-el9-gcc13-opt/include/eformat/SourceIdentifier.h.

124{ return m_id; }

◆ subdetector_id() [1/3]

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

Extracts the SubDetector component of the identifier.

Definition at line 119 of file Event/eformat/include/eformat/SourceIdentifier.h.

119{ return m_sd; }

Referenced by human_detector(), and main().

◆ subdetector_id() [2/3]

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

Extracts the SubDetector component of the identifier.

Definition at line 119 of file InstallArea/x86_64-el9-gcc13-dbg/include/eformat/SourceIdentifier.h.

119{ return m_sd; }

◆ subdetector_id() [3/3]

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

Extracts the SubDetector component of the identifier.

Definition at line 119 of file InstallArea/x86_64-el9-gcc13-opt/include/eformat/SourceIdentifier.h.

119{ return m_sd; }

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