BOSS
8.0.0
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:Andre.dos.Anjos@cern.ch>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
18
eformat::helper::SourceIdentifier::SourceIdentifier
(
eformat::SubDetector
subdet, uint16_t
id
)
19
: m_sd( subdet ), m_id( id ) {}
20
21
eformat::helper::SourceIdentifier::SourceIdentifier
( uint32_t sid )
22
: m_sd( static_cast<
eformat
::
SubDetector
>( ( sid >> 16 ) & 0xff ) )
23
, m_id( static_cast<uint16_t>( 0xffff & sid ) ) {}
24
25
uint32_t
eformat::helper::SourceIdentifier::code
(
void
)
const
{
26
uint32_t retval = ( 0xff ) & m_sd;
27
retval <<= 16;
28
retval |= m_id;
29
return
retval;
30
}
31
32
std::string
eformat::helper::SourceIdentifier::human
(
void
)
const
{
33
std::ostringstream oss;
34
oss <<
human_detector
() <<
", Identifier = "
<< (
unsigned
int)
module_id
();
35
return
oss.str();
36
}
37
38
std::string
eformat::helper::SourceIdentifier::human_detector
(
void
)
const
{
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
}
s
XmlRpcServer s
Definition
HelloServer.cpp:11
eformat::helper::SourceIdentifier::SourceIdentifier
SourceIdentifier(eformat::SubDetector subdet, uint16_t id)
Definition
SourceIdentifier.cxx:18
eformat::helper::SourceIdentifier::subdetector_id
eformat::SubDetector subdetector_id(void) const
Definition
Event/eformat/include/eformat/SourceIdentifier.h:119
eformat::helper::SourceIdentifier::code
uint32_t code(void) const
Definition
SourceIdentifier.cxx:25
eformat::helper::SourceIdentifier::module_id
uint16_t module_id(void) const
Definition
Event/eformat/include/eformat/SourceIdentifier.h:124
eformat::helper::SourceIdentifier::human
std::string human(void) const
Definition
SourceIdentifier.cxx:32
eformat::helper::SourceIdentifier::human_detector
std::string human_detector(void) const
Definition
SourceIdentifier.cxx:38
eformat
Definition
Event/eformat/include/eformat/BadVersionIssue.h:20
eformat::SubDetector
SubDetector
Definition
Event/eformat/include/eformat/SourceIdentifier.h:25
eformat::LAR_FCAL_C_SIDE
@ LAR_FCAL_C_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:47
eformat::TDAQ_MUON_CTP_INTERFACE
@ TDAQ_MUON_CTP_INTERFACE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:70
eformat::MUON_MDT_ENDCAP_A_SIDE
@ MUON_MDT_ENDCAP_A_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:56
eformat::PIXEL_FORWARD_A_SIDE
@ PIXEL_FORWARD_A_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:28
eformat::TDAQ_L2SV
@ TDAQ_L2SV
Definition
Event/eformat/include/eformat/SourceIdentifier.h:72
eformat::TRT_BARREL_C_SIDE
@ TRT_BARREL_C_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:37
eformat::MUON_RPC_BARREL_C_SIDE
@ MUON_RPC_BARREL_C_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:59
eformat::TILECAL_EXT_A_SIDE
@ TILECAL_EXT_A_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:51
eformat::TRT_BARREL_A_SIDE
@ TRT_BARREL_A_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:36
eformat::MUON_RPC_BARREL_A_SIDE
@ MUON_RPC_BARREL_A_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:58
eformat::SCT_BARREL_A_SIDE
@ SCT_BARREL_A_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:31
eformat::TDAQ_CALO_CLUSTER_PROC_DAQ
@ TDAQ_CALO_CLUSTER_PROC_DAQ
Definition
Event/eformat/include/eformat/SourceIdentifier.h:66
eformat::LAR_EM_BARREL_C_SIDE
@ LAR_EM_BARREL_C_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:41
eformat::TILECAL_BARREL_A_SIDE
@ TILECAL_BARREL_A_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:49
eformat::TRT_ENDCAP_A_SIDE
@ TRT_ENDCAP_A_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:38
eformat::MUON_MDT_ENDCAP_C_SIDE
@ MUON_MDT_ENDCAP_C_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:57
eformat::TDAQ_CALO_CLUSTER_PROC_ROI
@ TDAQ_CALO_CLUSTER_PROC_ROI
Definition
Event/eformat/include/eformat/SourceIdentifier.h:67
eformat::SCT_BARREL_C_SIDE
@ SCT_BARREL_C_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:32
eformat::TDAQ_CALO_JET_PROC_DAQ
@ TDAQ_CALO_JET_PROC_DAQ
Definition
Event/eformat/include/eformat/SourceIdentifier.h:68
eformat::LAR_EM_BARREL_A_SIDE
@ LAR_EM_BARREL_A_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:40
eformat::MUON_ANCILLARY_CRATE
@ MUON_ANCILLARY_CRATE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:53
eformat::LAR_EM_ENDCAP_A_SIDE
@ LAR_EM_ENDCAP_A_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:42
eformat::OTHER
@ OTHER
Definition
Event/eformat/include/eformat/SourceIdentifier.h:77
eformat::FULL_SD_EVENT
@ FULL_SD_EVENT
Definition
Event/eformat/include/eformat/SourceIdentifier.h:26
eformat::MUON_CSC_ENDCAP_A_SIDE
@ MUON_CSC_ENDCAP_A_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:62
eformat::TILECAL_EXT_C_SIDE
@ TILECAL_EXT_C_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:52
eformat::MUON_MDT_BARREL_A_SIDE
@ MUON_MDT_BARREL_A_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:54
eformat::TILECAL_LASER_CRATE
@ TILECAL_LASER_CRATE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:48
eformat::MUON_TGC_ENDCAP_A_SIDE
@ MUON_TGC_ENDCAP_A_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:60
eformat::MUON_CSC_ENDCAP_C_SIDE
@ MUON_CSC_ENDCAP_C_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:63
eformat::TRT_ANCILLARY_CRATE
@ TRT_ANCILLARY_CRATE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:35
eformat::TRT_ENDCAP_C_SIDE
@ TRT_ENDCAP_C_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:39
eformat::MUON_MDT_BARREL_C_SIDE
@ MUON_MDT_BARREL_C_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:55
eformat::PIXEL_B_LAYER
@ PIXEL_B_LAYER
Definition
Event/eformat/include/eformat/SourceIdentifier.h:30
eformat::LAR_HAD_ENDCAP_A_SIDE
@ LAR_HAD_ENDCAP_A_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:44
eformat::TDAQ_CALO_JET_PROC_ROI
@ TDAQ_CALO_JET_PROC_ROI
Definition
Event/eformat/include/eformat/SourceIdentifier.h:69
eformat::LAR_HAD_ENDCAP_C_SIDE
@ LAR_HAD_ENDCAP_C_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:45
eformat::TDAQ_CTP
@ TDAQ_CTP
Definition
Event/eformat/include/eformat/SourceIdentifier.h:71
eformat::TILECAL_BARREL_C_SIDE
@ TILECAL_BARREL_C_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:50
eformat::LAR_FCAL_A_SIDE
@ LAR_FCAL_A_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:46
eformat::SCT_ENDCAP_C_SIDE
@ SCT_ENDCAP_C_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:34
eformat::TDAQ_LVL2
@ TDAQ_LVL2
Definition
Event/eformat/include/eformat/SourceIdentifier.h:75
eformat::MUON_TGC_ENDCAP_C_SIDE
@ MUON_TGC_ENDCAP_C_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:61
eformat::LAR_EM_ENDCAP_C_SIDE
@ LAR_EM_ENDCAP_C_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:43
eformat::SCT_ENDCAP_A_SIDE
@ SCT_ENDCAP_A_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:33
eformat::TDAQ_SFI
@ TDAQ_SFI
Definition
Event/eformat/include/eformat/SourceIdentifier.h:73
eformat::PIXEL_FORWARD_C_SIDE
@ PIXEL_FORWARD_C_SIDE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:29
eformat::PIXEL_BARREL
@ PIXEL_BARREL
Definition
Event/eformat/include/eformat/SourceIdentifier.h:27
eformat::TDAQ_CALO_PREPROC
@ TDAQ_CALO_PREPROC
Definition
Event/eformat/include/eformat/SourceIdentifier.h:65
eformat::TDAQ_SFO
@ TDAQ_SFO
Definition
Event/eformat/include/eformat/SourceIdentifier.h:74
eformat::TDAQ_EVENT_FILTER
@ TDAQ_EVENT_FILTER
Definition
Event/eformat/include/eformat/SourceIdentifier.h:76
eformat::TDAQ_BEAM_CRATE
@ TDAQ_BEAM_CRATE
Definition
Event/eformat/include/eformat/SourceIdentifier.h:64
8.0.0
BOSS_Source
Event
eformat
src
SourceIdentifier.cxx
Generated by
1.16.1