CGEM BOSS 6.6.5.i
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 Identifier cgem(void) const;
29
30 // Short print out of any identifier (optionally provide
31 // separation character - default is '.'):
32 // void show(const Identifier& id, char sep = '.' ) const;
33
34 // or provide the printout in string form
35 // std::string show_to_string (const Identifier& id, char sep = '.' ) const;
36
37 // Expanded print out of any identifier
38 // void print(const Identifier& id) const;
39
40 // or provide the printout in string form
41 // std::string print_to_string (const Identifier& id) const;
42
43 // Test of an Identifier to see if it belongs to a particular
44 // detector system:
45 bool is_mdc (const Identifier& id) const;
46 bool is_tof (const Identifier& id) const;
47 bool is_emc (const Identifier& id) const;
48 bool is_muc (const Identifier& id) const;
49 bool is_hlt (const Identifier& id) const;
50 bool is_mrpc (const Identifier& id) const;
51 bool is_cgem (const Identifier& id) const;
52
53protected:
54 /// Provide efficient access to individual field values
55 int mdc_field_value () const;
56 int cgem_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 CGEM_ID = 0x60;
87 static const unsigned int CGEM_INDEX = 24;
88 static const unsigned int CGEM_MASK = 0xFF000000;
89
90 static const unsigned int MRPC_ID = 0x70;
91 static const unsigned int MRPC_INDEX = 24;
92 static const unsigned int MRPC_MASK = 0xFF000000;
93
94private:
95 int m_MdcId;
96 int m_CgemId;
97 int m_TofId;
98 int m_EmcId;
99 int m_MucId;
100 int m_HltId;
101 int m_MrpcId;
102};
103
104//<<<<<< INLINE MEMBER FUNCTIONS >>>>>>
105/////////////////////////////////////////////////////////////////////////////
106inline int
107BesDetectorID::mdc_field_value() const {return (m_MdcId);}
108
109inline int
110BesDetectorID::cgem_field_value() const {return (m_CgemId);}
111
112inline int
113BesDetectorID::tof_field_value() const {return (m_TofId);}
114
115inline int
116BesDetectorID::emc_field_value() const {return (m_EmcId);}
117
118inline int
119BesDetectorID::muc_field_value() const {return (m_MucId);}
120
121inline int
122BesDetectorID::hlt_field_value() const {return (m_HltId);}
123
124inline int
125BesDetectorID::mrpc_field_value() const {return (m_MrpcId);}
126
127#endif // BESDETECTORID_H
static const unsigned int EMC_INDEX
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
static const unsigned int MRPC_ID
bool is_muc(const Identifier &id) const
static const unsigned int CGEM_ID
static const unsigned int MRPC_INDEX
static const unsigned int EMC_MASK
Identifier mrpc(void) const
bool is_mrpc(const Identifier &id) const
static const unsigned int CGEM_MASK
bool is_emc(const Identifier &id) const
static const unsigned int TOF_ID
static const unsigned int EMC_ID
int get_detectorID(const Identifier &id) const
Identifier cgem(void) 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
static const unsigned int HLT_ID
bool is_tof(const Identifier &id) const
static const unsigned int MUC_INDEX
Identifier hlt(void) const
bool is_cgem(const Identifier &id) const
Identifier mdc(void) const
int mdc_field_value() const
Provide efficient access to individual field values.
static const unsigned int TOF_INDEX
static const unsigned int HLT_MASK
static const unsigned int MDC_MASK
static const unsigned int TOF_MASK
static const unsigned int MRPC_MASK
int cgem_field_value() const
static const unsigned int MDC_INDEX
static const unsigned int MDC_ID
static const unsigned int MUC_MASK
static const unsigned int CGEM_INDEX
int tof_field_value() const
int emc_field_value() const