BOSS
7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
SourceIdentifier.h
Go to the documentation of this file.
1
//Dear emacs, this is -*- c++ -*-
2
3
/**
4
* @file eformat/SourceIdentifier.h
5
* @author <a href="mailto:
[email protected]
>Andr� dos ANJOS</a>
6
* $Author: zhangy $
7
* $Revision: 1.1.1.1 $
8
* $Date: 2009/06/19 07:35:41 $
9
*
10
* @brief Declares a type that can perform the conversion between source
11
* identifier components and the its 32-bit version.
12
*/
13
14
#ifndef EFORMAT_HELPER_SOURCEIDENTIFIER_H
15
#define EFORMAT_HELPER_SOURCEIDENTIFIER_H
16
17
#include <stdint.h>
18
#include <string>
19
20
namespace
eformat
{
21
22
/**
23
* Sub-detector ID
24
*/
25
enum
SubDetector
{
FULL_SD_EVENT
= 0x00,
26
PIXEL_BARREL
= 0x11,
27
PIXEL_FORWARD_A_SIDE
= 0x12,
28
PIXEL_FORWARD_C_SIDE
= 0x13,
29
PIXEL_B_LAYER
= 0x14,
30
SCT_BARREL_A_SIDE
= 0x21,
31
SCT_BARREL_C_SIDE
= 0x22,
32
SCT_ENDCAP_A_SIDE
= 0x23,
33
SCT_ENDCAP_C_SIDE
= 0x24,
34
TRT_ANCILLARY_CRATE
= 0x30,
35
TRT_BARREL_A_SIDE
= 0x31,
36
TRT_BARREL_C_SIDE
= 0x32,
37
TRT_ENDCAP_A_SIDE
= 0x33,
38
TRT_ENDCAP_C_SIDE
= 0x34,
39
LAR_EM_BARREL_A_SIDE
= 0x41,
40
LAR_EM_BARREL_C_SIDE
= 0x42,
41
LAR_EM_ENDCAP_A_SIDE
= 0x43,
42
LAR_EM_ENDCAP_C_SIDE
= 0x44,
43
LAR_HAD_ENDCAP_A_SIDE
= 0x45,
44
LAR_HAD_ENDCAP_C_SIDE
= 0x46,
45
LAR_FCAL_A_SIDE
= 0x47,
46
LAR_FCAL_C_SIDE
= 0x48,
47
TILECAL_LASER_CRATE
= 0x50,
48
TILECAL_BARREL_A_SIDE
= 0x51,
49
TILECAL_BARREL_C_SIDE
= 0x52,
50
TILECAL_EXT_A_SIDE
= 0x53,
51
TILECAL_EXT_C_SIDE
= 0x54,
52
MUON_ANCILLARY_CRATE
= 0x60,
53
MUON_MDT_BARREL_A_SIDE
= 0x61,
54
MUON_MDT_BARREL_C_SIDE
= 0x62,
55
MUON_MDT_ENDCAP_A_SIDE
= 0x63,
56
MUON_MDT_ENDCAP_C_SIDE
= 0x64,
57
MUON_RPC_BARREL_A_SIDE
= 0x65,
58
MUON_RPC_BARREL_C_SIDE
= 0x66,
59
MUON_TGC_ENDCAP_A_SIDE
= 0x67,
60
MUON_TGC_ENDCAP_C_SIDE
= 0x68,
61
MUON_CSC_ENDCAP_A_SIDE
= 0x69,
62
MUON_CSC_ENDCAP_C_SIDE
= 0x6A,
63
TDAQ_BEAM_CRATE
= 0x70,
64
TDAQ_CALO_PREPROC
= 0x71,
65
TDAQ_CALO_CLUSTER_PROC_DAQ
= 0x72,
66
TDAQ_CALO_CLUSTER_PROC_ROI
= 0x73,
67
TDAQ_CALO_JET_PROC_DAQ
= 0x74,
68
TDAQ_CALO_JET_PROC_ROI
= 0x75,
69
TDAQ_MUON_CTP_INTERFACE
= 0x76,
70
TDAQ_CTP
= 0x77,
71
TDAQ_L2SV
= 0x78,
72
TDAQ_SFI
= 0x79,
73
TDAQ_SFO
= 0x7a,
74
TDAQ_LVL2
= 0x7b,
75
TDAQ_EVENT_FILTER
= 0x7c,
76
OTHER
= 0x81,
77
BESIII_MDC
= 0xa1,
78
BESIII_TOF
= 0xa2,
79
BESIII_EMC
= 0xa3,
80
BESIII_MUC
= 0xa4,
81
BESIII_TRG
= 0xa5
82
};
83
84
/**
85
* An alias
86
*/
87
typedef
enum
SubDetector
SubDetector
;
88
89
namespace
helper {
90
91
/**
92
* Defines converters between source identifiers and its components.
93
*/
94
class
SourceIdentifier
{
95
96
public
:
97
/**
98
* Constructor. Takes the components to form a source identifier.
99
*
100
* @param subdet The subdetector for this source
101
* @param id The module identifier
102
*/
103
SourceIdentifier
(
eformat::SubDetector
subdet, uint16_t
id
);
104
105
/**
106
* Constructor. Takes the source identifier to understand the components
107
* from.
108
*
109
* @param sid The source identifier, fully built.
110
* @warning This source identifier <b>has</b> to conform to the current
111
* version of the library or unpredictable results might occur.
112
*/
113
SourceIdentifier
(uint32_t sid);
114
115
/**
116
* Extracts the SubDetector component of the identifier.
117
*/
118
inline
eformat::SubDetector
subdetector_id
(
void
)
const
{
return
m_sd; }
119
120
/**
121
* Extracts the Module identifier from the source identifier.
122
*/
123
inline
uint16_t
module_id
(
void
)
const
{
return
m_id; }
124
125
/**
126
* Gets the full 32-bit number made by assembling the 3 numbers
127
* above.
128
*/
129
uint32_t
code
(
void
)
const
;
130
131
/**
132
* Returns a string that represents the source identifier in a human
133
* readable format
134
*/
135
std::string
human
(
void
)
const
;
136
137
/**
138
* Returns a string that represents the subdetector identifier in a human
139
* readable format
140
*/
141
std::string
human_detector
(
void
)
const
;
142
143
private
:
//representation
144
145
eformat::SubDetector
m_sd;
///< The subdetector component
146
uint16_t m_id;
///< The module identifier
147
148
};
149
150
}
151
152
}
153
154
#endif
//EVENTFORMAT_HELPER_SOURCEID_H
eformat::helper::SourceIdentifier
Definition:
SourceIdentifier.h:94
eformat::helper::SourceIdentifier::subdetector_id
eformat::SubDetector subdetector_id(void) const
Definition:
SourceIdentifier.h:118
eformat::helper::SourceIdentifier::code
uint32_t code(void) const
Definition:
SourceIdentifier.cxx:31
eformat::helper::SourceIdentifier::module_id
uint16_t module_id(void) const
Definition:
SourceIdentifier.h:123
eformat::helper::SourceIdentifier::human
std::string human(void) const
Definition:
SourceIdentifier.cxx:39
eformat::helper::SourceIdentifier::human_detector
std::string human_detector(void) const
Definition:
SourceIdentifier.cxx:46
eformat
Definition:
BadVersionIssue.h:20
eformat::SubDetector
SubDetector
Definition:
SourceIdentifier.h:25
eformat::TRT_ENDCAP_C_SIDE
@ TRT_ENDCAP_C_SIDE
Definition:
SourceIdentifier.h:38
eformat::PIXEL_B_LAYER
@ PIXEL_B_LAYER
Definition:
SourceIdentifier.h:29
eformat::TDAQ_L2SV
@ TDAQ_L2SV
Definition:
SourceIdentifier.h:71
eformat::TILECAL_BARREL_C_SIDE
@ TILECAL_BARREL_C_SIDE
Definition:
SourceIdentifier.h:49
eformat::TILECAL_EXT_C_SIDE
@ TILECAL_EXT_C_SIDE
Definition:
SourceIdentifier.h:51
eformat::MUON_CSC_ENDCAP_C_SIDE
@ MUON_CSC_ENDCAP_C_SIDE
Definition:
SourceIdentifier.h:62
eformat::TILECAL_LASER_CRATE
@ TILECAL_LASER_CRATE
Definition:
SourceIdentifier.h:47
eformat::MUON_TGC_ENDCAP_C_SIDE
@ MUON_TGC_ENDCAP_C_SIDE
Definition:
SourceIdentifier.h:60
eformat::TDAQ_BEAM_CRATE
@ TDAQ_BEAM_CRATE
Definition:
SourceIdentifier.h:63
eformat::MUON_CSC_ENDCAP_A_SIDE
@ MUON_CSC_ENDCAP_A_SIDE
Definition:
SourceIdentifier.h:61
eformat::TDAQ_EVENT_FILTER
@ TDAQ_EVENT_FILTER
Definition:
SourceIdentifier.h:75
eformat::LAR_EM_ENDCAP_A_SIDE
@ LAR_EM_ENDCAP_A_SIDE
Definition:
SourceIdentifier.h:41
eformat::BESIII_TRG
@ BESIII_TRG
Definition:
SourceIdentifier.h:81
eformat::BESIII_EMC
@ BESIII_EMC
Definition:
SourceIdentifier.h:79
eformat::PIXEL_BARREL
@ PIXEL_BARREL
Definition:
SourceIdentifier.h:26
eformat::TDAQ_MUON_CTP_INTERFACE
@ TDAQ_MUON_CTP_INTERFACE
Definition:
SourceIdentifier.h:69
eformat::TDAQ_SFO
@ TDAQ_SFO
Definition:
SourceIdentifier.h:73
eformat::BESIII_MUC
@ BESIII_MUC
Definition:
SourceIdentifier.h:80
eformat::OTHER
@ OTHER
Definition:
SourceIdentifier.h:76
eformat::TRT_BARREL_A_SIDE
@ TRT_BARREL_A_SIDE
Definition:
SourceIdentifier.h:35
eformat::MUON_MDT_BARREL_A_SIDE
@ MUON_MDT_BARREL_A_SIDE
Definition:
SourceIdentifier.h:53
eformat::TDAQ_SFI
@ TDAQ_SFI
Definition:
SourceIdentifier.h:72
eformat::TRT_BARREL_C_SIDE
@ TRT_BARREL_C_SIDE
Definition:
SourceIdentifier.h:36
eformat::MUON_MDT_ENDCAP_C_SIDE
@ MUON_MDT_ENDCAP_C_SIDE
Definition:
SourceIdentifier.h:56
eformat::BESIII_TOF
@ BESIII_TOF
Definition:
SourceIdentifier.h:78
eformat::LAR_HAD_ENDCAP_C_SIDE
@ LAR_HAD_ENDCAP_C_SIDE
Definition:
SourceIdentifier.h:44
eformat::MUON_TGC_ENDCAP_A_SIDE
@ MUON_TGC_ENDCAP_A_SIDE
Definition:
SourceIdentifier.h:59
eformat::LAR_EM_BARREL_A_SIDE
@ LAR_EM_BARREL_A_SIDE
Definition:
SourceIdentifier.h:39
eformat::LAR_EM_BARREL_C_SIDE
@ LAR_EM_BARREL_C_SIDE
Definition:
SourceIdentifier.h:40
eformat::MUON_MDT_ENDCAP_A_SIDE
@ MUON_MDT_ENDCAP_A_SIDE
Definition:
SourceIdentifier.h:55
eformat::TDAQ_CALO_JET_PROC_ROI
@ TDAQ_CALO_JET_PROC_ROI
Definition:
SourceIdentifier.h:68
eformat::LAR_HAD_ENDCAP_A_SIDE
@ LAR_HAD_ENDCAP_A_SIDE
Definition:
SourceIdentifier.h:43
eformat::TDAQ_CALO_CLUSTER_PROC_ROI
@ TDAQ_CALO_CLUSTER_PROC_ROI
Definition:
SourceIdentifier.h:66
eformat::TILECAL_EXT_A_SIDE
@ TILECAL_EXT_A_SIDE
Definition:
SourceIdentifier.h:50
eformat::SCT_ENDCAP_A_SIDE
@ SCT_ENDCAP_A_SIDE
Definition:
SourceIdentifier.h:32
eformat::TDAQ_CALO_PREPROC
@ TDAQ_CALO_PREPROC
Definition:
SourceIdentifier.h:64
eformat::TDAQ_CALO_CLUSTER_PROC_DAQ
@ TDAQ_CALO_CLUSTER_PROC_DAQ
Definition:
SourceIdentifier.h:65
eformat::TDAQ_CALO_JET_PROC_DAQ
@ TDAQ_CALO_JET_PROC_DAQ
Definition:
SourceIdentifier.h:67
eformat::TRT_ANCILLARY_CRATE
@ TRT_ANCILLARY_CRATE
Definition:
SourceIdentifier.h:34
eformat::FULL_SD_EVENT
@ FULL_SD_EVENT
Definition:
SourceIdentifier.h:25
eformat::PIXEL_FORWARD_C_SIDE
@ PIXEL_FORWARD_C_SIDE
Definition:
SourceIdentifier.h:28
eformat::PIXEL_FORWARD_A_SIDE
@ PIXEL_FORWARD_A_SIDE
Definition:
SourceIdentifier.h:27
eformat::SCT_ENDCAP_C_SIDE
@ SCT_ENDCAP_C_SIDE
Definition:
SourceIdentifier.h:33
eformat::SCT_BARREL_A_SIDE
@ SCT_BARREL_A_SIDE
Definition:
SourceIdentifier.h:30
eformat::LAR_FCAL_A_SIDE
@ LAR_FCAL_A_SIDE
Definition:
SourceIdentifier.h:45
eformat::MUON_RPC_BARREL_C_SIDE
@ MUON_RPC_BARREL_C_SIDE
Definition:
SourceIdentifier.h:58
eformat::LAR_FCAL_C_SIDE
@ LAR_FCAL_C_SIDE
Definition:
SourceIdentifier.h:46
eformat::TRT_ENDCAP_A_SIDE
@ TRT_ENDCAP_A_SIDE
Definition:
SourceIdentifier.h:37
eformat::BESIII_MDC
@ BESIII_MDC
Definition:
SourceIdentifier.h:77
eformat::TILECAL_BARREL_A_SIDE
@ TILECAL_BARREL_A_SIDE
Definition:
SourceIdentifier.h:48
eformat::SCT_BARREL_C_SIDE
@ SCT_BARREL_C_SIDE
Definition:
SourceIdentifier.h:31
eformat::MUON_ANCILLARY_CRATE
@ MUON_ANCILLARY_CRATE
Definition:
SourceIdentifier.h:52
eformat::LAR_EM_ENDCAP_C_SIDE
@ LAR_EM_ENDCAP_C_SIDE
Definition:
SourceIdentifier.h:42
eformat::MUON_RPC_BARREL_A_SIDE
@ MUON_RPC_BARREL_A_SIDE
Definition:
SourceIdentifier.h:57
eformat::TDAQ_CTP
@ TDAQ_CTP
Definition:
SourceIdentifier.h:70
eformat::MUON_MDT_BARREL_C_SIDE
@ MUON_MDT_BARREL_C_SIDE
Definition:
SourceIdentifier.h:54
eformat::TDAQ_LVL2
@ TDAQ_LVL2
Definition:
SourceIdentifier.h:74
source
Event
eformat
eformat-00-01-00
eformat
SourceIdentifier.h
Generated by
1.9.6