BOSS 7.0.8
BESIII Offline Software System
Loading...
Searching...
No Matches
BesDetectorID.h
Go to the documentation of this file.
1#ifndef BESDETECTORID_H
2#define BESDETECTORID_H
3
5#include <string>
6
7/**
8 * class BesDetectorID
9 *
10 * This class provides an interface to generate or decode an
11 * identifier for the upper levels of the detector element hierarchy,
12 * i.e. BES III, the detector systems.
13 **/
14
16
17public:
18 BesDetectorID(void);
19 ~BesDetectorID(void);
20
21 // Detector systems:
22 Identifier mdc(void) const;
23 Identifier tof(void) const;
24 Identifier emc(void) const;
25 Identifier muc(void) const;
26 Identifier hlt(void) const;
27 Identifier mrpc(void) const;
28
29
30
31 // Short print out of any identifier (optionally provide
32 // separation character - default is '.'):
33 // void show(const Identifier& id, char sep = '.' ) const;
34
35 // or provide the printout in string form
36 // std::string show_to_string (const Identifier& id, char sep = '.' ) const;
37
38 // Expanded print out of any identifier
39 // void print(const Identifier& id) const;
40
41 // or provide the printout in string form
42 // std::string print_to_string (const Identifier& id) const;
43
44 // Test of an Identifier to see if it belongs to a particular
45 // detector system:
46 bool is_mdc (const Identifier& id) const;
47 bool is_tof (const Identifier& id) const;
48 bool is_emc (const Identifier& id) const;
49 bool is_muc (const Identifier& id) const;
50 bool is_hlt (const Identifier& id) const;
51 bool is_mrpc (const Identifier& id) const;
52
53
54protected:
55 /// Provide efficient access to individual field values
56 int mdc_field_value () const;
57 int tof_field_value () const;
58 int emc_field_value () const;
59 int muc_field_value () const;
60 int hlt_field_value () const;
61 int mrpc_field_value () const;
62
63 // extract detector id information
64 int get_detectorID (const Identifier& id) const;
65
66 static const unsigned int MDC_ID = 0x10;
67 static const unsigned int MDC_INDEX = 24;
68 static const unsigned int MDC_MASK = 0xFF000000;
69
70 static const unsigned int TOF_ID = 0x20;
71 static const unsigned int TOF_INDEX = 24;
72 static const unsigned int TOF_MASK = 0xFF000000;
73
74 static const unsigned int EMC_ID = 0x30;
75 static const unsigned int EMC_INDEX = 24;
76 static const unsigned int EMC_MASK = 0xFF000000;
77
78 static const unsigned int MUC_ID = 0x40;
79 static const unsigned int MUC_INDEX = 24;
80 static const unsigned int MUC_MASK = 0xFF000000;
81
82 static const unsigned int HLT_ID = 0x50;
83 static const unsigned int HLT_INDEX = 24;
84 static const unsigned int HLT_MASK = 0xFF000000;
85
86 static const unsigned int MRPC_ID = 0x70;
87 static const unsigned int MRPC_INDEX = 24;
88 static const unsigned int MRPC_MASK = 0xFF000000;
89
90
91
92
93private:
94 int m_MdcId;
95 int m_TofId;
96 int m_EmcId;
97 int m_MucId;
98 int m_HltId;
99 int m_MrpcId;
100};
101
102//<<<<<< INLINE MEMBER FUNCTIONS >>>>>>
103/////////////////////////////////////////////////////////////////////////////
104inline int
105BesDetectorID::mdc_field_value() const {return (m_MdcId);}
106
107inline int
108BesDetectorID::tof_field_value() const {return (m_TofId);}
109
110inline int
111BesDetectorID::emc_field_value() const {return (m_EmcId);}
112
113inline int
114BesDetectorID::muc_field_value() const {return (m_MucId);}
115
116inline int
117BesDetectorID::hlt_field_value() const {return (m_HltId);}
118
119inline int
120BesDetectorID::mrpc_field_value() const {return (m_MrpcId);}
121
122#endif // BESDETECTORID_H
static const unsigned int EMC_INDEX
Definition: BesDetectorID.h:75
Identifier emc(void) const
int hlt_field_value() const
bool is_mdc(const Identifier &id) const
bool is_hlt(const Identifier &id) const
static const unsigned int MUC_ID
Definition: BesDetectorID.h:78
static const unsigned int MRPC_ID
Definition: BesDetectorID.h:86
bool is_muc(const Identifier &id) const
static const unsigned int MRPC_INDEX
Definition: BesDetectorID.h:87
static const unsigned int EMC_MASK
Definition: BesDetectorID.h:76
Identifier mrpc(void) const
bool is_mrpc(const Identifier &id) const
bool is_emc(const Identifier &id) const
static const unsigned int TOF_ID
Definition: BesDetectorID.h:70
static const unsigned int EMC_ID
Definition: BesDetectorID.h:74
int get_detectorID(const Identifier &id) const
Identifier tof(void) const
int muc_field_value() const
int mrpc_field_value() const
Identifier muc(void) const
static const unsigned int HLT_INDEX
Definition: BesDetectorID.h:83
static const unsigned int HLT_ID
Definition: BesDetectorID.h:82
bool is_tof(const Identifier &id) const
static const unsigned int MUC_INDEX
Definition: BesDetectorID.h:79
Identifier hlt(void) const
Identifier mdc(void) const
int mdc_field_value() const
Provide efficient access to individual field values.
static const unsigned int TOF_INDEX
Definition: BesDetectorID.h:71
static const unsigned int HLT_MASK
Definition: BesDetectorID.h:84
static const unsigned int MDC_MASK
Definition: BesDetectorID.h:68
static const unsigned int TOF_MASK
Definition: BesDetectorID.h:72
static const unsigned int MRPC_MASK
Definition: BesDetectorID.h:88
static const unsigned int MDC_INDEX
Definition: BesDetectorID.h:67
static const unsigned int MDC_ID
Definition: BesDetectorID.h:66
static const unsigned int MUC_MASK
Definition: BesDetectorID.h:80
int tof_field_value() const
int emc_field_value() const