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