BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
DetectorDescription/Identifier/include/Identifier/BesDetectorID.h
Go to the documentation of this file.
1#ifndef BESDETECTORID_H
2#define BESDETECTORID_H
3
4#include "Identifier/Identifier.h"
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 // Short print out of any identifier (optionally provide
30 // separation character - default is '.'):
31 // void show(const Identifier& id, char sep = '.' ) const;
32
33 // or provide the printout in string form
34 // std::string show_to_string (const Identifier& id, char sep = '.' ) const;
35
36 // Expanded print out of any identifier
37 // void print(const Identifier& id) const;
38
39 // or provide the printout in string form
40 // std::string print_to_string (const Identifier& id) const;
41
42 // Test of an Identifier to see if it belongs to a particular
43 // detector system:
44 bool is_mdc( const Identifier& id ) const;
45 bool is_tof( const Identifier& id ) const;
46 bool is_emc( const Identifier& id ) const;
47 bool is_muc( const Identifier& id ) const;
48 bool is_hlt( const Identifier& id ) const;
49 bool is_mrpc( const Identifier& id ) const;
50
51protected:
52 /// Provide efficient access to individual field values
53 int mdc_field_value() const;
54 int tof_field_value() const;
55 int emc_field_value() const;
56 int muc_field_value() const;
57 int hlt_field_value() const;
58 int mrpc_field_value() const;
59
60 // extract detector id information
61 int get_detectorID( const Identifier& id ) const;
62
63 static const unsigned int MDC_ID = 0x10;
64 static const unsigned int MDC_INDEX = 24;
65 static const unsigned int MDC_MASK = 0xFF000000;
66
67 static const unsigned int TOF_ID = 0x20;
68 static const unsigned int TOF_INDEX = 24;
69 static const unsigned int TOF_MASK = 0xFF000000;
70
71 static const unsigned int EMC_ID = 0x30;
72 static const unsigned int EMC_INDEX = 24;
73 static const unsigned int EMC_MASK = 0xFF000000;
74
75 static const unsigned int MUC_ID = 0x40;
76 static const unsigned int MUC_INDEX = 24;
77 static const unsigned int MUC_MASK = 0xFF000000;
78
79 static const unsigned int HLT_ID = 0x50;
80 static const unsigned int HLT_INDEX = 24;
81 static const unsigned int HLT_MASK = 0xFF000000;
82
83 static const unsigned int MRPC_ID = 0x70;
84 static const unsigned int MRPC_INDEX = 24;
85 static const unsigned int MRPC_MASK = 0xFF000000;
86
87private:
88 int m_MdcId;
89 int m_TofId;
90 int m_EmcId;
91 int m_MucId;
92 int m_HltId;
93 int m_MrpcId;
94};
95
96//<<<<<< INLINE MEMBER FUNCTIONS >>>>>>
97/////////////////////////////////////////////////////////////////////////////
98inline int BesDetectorID::mdc_field_value() const { return ( m_MdcId ); }
99
100inline int BesDetectorID::tof_field_value() const { return ( m_TofId ); }
101
102inline int BesDetectorID::emc_field_value() const { return ( m_EmcId ); }
103
104inline int BesDetectorID::muc_field_value() const { return ( m_MucId ); }
105
106inline int BesDetectorID::hlt_field_value() const { return ( m_HltId ); }
107
108inline int BesDetectorID::mrpc_field_value() const { return ( m_MrpcId ); }
109
110#endif // BESDETECTORID_H
Identifier emc(void) const
bool is_mdc(const Identifier &id) const
bool is_hlt(const Identifier &id) const
bool is_muc(const Identifier &id) const
Identifier mrpc(void) const
bool is_mrpc(const Identifier &id) const
bool is_emc(const Identifier &id) const
int get_detectorID(const Identifier &id) const
Identifier tof(void) const
Identifier muc(void) const
bool is_tof(const Identifier &id) const
Identifier hlt(void) const
Identifier mdc(void) const
int mdc_field_value() const
Provide efficient access to individual field values.