CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
MucID.h
Go to the documentation of this file.
1#ifndef __MucID_h__
2#define __MucID_h__
3
5#include <string>
6#include <assert.h>
7
8class MucID : public BesDetectorID
9{
10public:
13
14 /// constructor
15 MucID();
16
17 /// destructor
18 ~MucID();
19
20 /// For a single crystal
21 static Identifier channel_id ( int barrel_ec,
22 int segment,
23 int layer,
24 int channel
25 );
26
27 static value_type getIntID ( int barrel_ec,
28 int segment,
29 int layer,
30 int channel
31 );
40
41 static value_type getPartNum();
42 static value_type getSegNum(int part);
43 static value_type getGapNum(int part);
44 static value_type getStripNum(int part, int seg, int gap);
45 static value_type getSegMax();
46 static value_type getGapMax();
47 static value_type getStripMax();
48
49 static bool values_ok ( const unsigned int barrel_ec,
50 const unsigned int segment,
51 const unsigned int layer,
52 const unsigned int channel
53 ) ;
54
55 /// Test for barrel
56 static bool is_barrel (const Identifier& id) ;
57
58 /// Values of different levels
59 static int barrel_ec (const Identifier& id) ;
60 static int segment (const Identifier& id) ;
61 static int layer (const Identifier& id) ;
62 static int channel (const Identifier& id) ;
63
64 static int part (const Identifier& id) ;
65 static int seg (const Identifier& id) ;
66 static int gap (const Identifier& id) ;
67 static int strip (const Identifier& id) ;
68
69 /// Max/Min values for each field
70 int segment_max (const Identifier& id) ;
71 int layer_max (const Identifier& id) ;
72 int channel_max (const Identifier& id) ;
73
74 int getSegNum (const Identifier& id) ;
75 int getGapNum (const Identifier& id) ;
76 int getStripNum (const Identifier& id) ;
77
78private:
79
80 typedef std::vector<Identifier> id_vec;
81 typedef id_vec::const_iterator id_vec_it;
82
83 static const unsigned int BARREL_EC_INDEX = 16;
84 static const unsigned int BARREL_EC_MASK = 0x000F0000;
85
86 static const unsigned int SEGMENT_INDEX = 12;
87 static const unsigned int SEGMENT_MASK = 0x0000F000;
88
89 static const unsigned int LAYER_INDEX = 8;
90 static const unsigned int LAYER_MASK = 0x00000F00;
91
92 static const unsigned int CHANNEL_INDEX = 0;
93 static const unsigned int CHANNEL_MASK = 0x000000FF;
94
95 static const unsigned int BARREL_EC_NUM = 3;
96
97 static const unsigned int LAYER_BARREL_NUM = 9;
98 static const unsigned int LAYER_ENDCAP_NUM = 8;
99
100 static const unsigned int SEGMENT_BARREL_NUM = 8;
101 static const unsigned int SEGMENT_ENDCAP_NUM = 4;
102
103 static const unsigned int CHANNEL_BARREL_NUM_MAX = 112;
104 static const unsigned int CHANNEL_ENDCAP_NUM_MAX = 64;
105
106 static const unsigned int CHANNEL_BARREL_LAYER_NUM[LAYER_BARREL_NUM];
107
108 static const unsigned int BARREL_EC_MAX = 2;
109 static const unsigned int BARREL_EC_MIN = 0;
110
111};
112
113#endif
unsigned int value_type
Definition: Identifier.h:27
unsigned int size_type
Definition: Identifier.h:28
Definition: MucID.h:9
static int barrel_ec(const Identifier &id)
Values of different levels.
Definition: MucID.cxx:41
static value_type getStripMax()
Definition: MucID.cxx:200
static value_type getIntID(int barrel_ec, int segment, int layer, int channel)
Definition: MucID.cxx:147
static int layer(const Identifier &id)
Definition: MucID.cxx:61
static bool values_ok(const unsigned int barrel_ec, const unsigned int segment, const unsigned int layer, const unsigned int channel)
Definition: MucID.cxx:14
static int channel(const Identifier &id)
Definition: MucID.cxx:71
static value_type getSEGMENT_BARREL_MAX()
Definition: MucID.cxx:206
int segment_max(const Identifier &id)
Max/Min values for each field.
Definition: MucID.cxx:81
static int part(const Identifier &id)
Definition: MucID.cxx:46
static value_type getGapMax()
Definition: MucID.cxx:195
static int segment(const Identifier &id)
Definition: MucID.cxx:51
static value_type getBARREL_EC_MAX()
Definition: MucID.cxx:236
static value_type getPartNum()
Definition: MucID.cxx:159
static Identifier channel_id(int barrel_ec, int segment, int layer, int channel)
For a single crystal.
Definition: MucID.cxx:135
Identifier::value_type value_type
Definition: MucID.h:12
Identifier::size_type size_type
Definition: MucID.h:11
int layer_max(const Identifier &id)
Definition: MucID.cxx:99
~MucID()
destructor
Definition: MucID.cxx:10
static value_type getSegMax()
Definition: MucID.cxx:188
static value_type getSEGMENT_ENDCAP_MAX()
Definition: MucID.cxx:211
static value_type getLAYER_BARREL_MAX()
Definition: MucID.cxx:216
static bool is_barrel(const Identifier &id)
Test for barrel.
Definition: MucID.cxx:35
static int gap(const Identifier &id)
Definition: MucID.cxx:66
static int seg(const Identifier &id)
Definition: MucID.cxx:56
static value_type getLAYER_ENDCAP_MAX()
Definition: MucID.cxx:221
static value_type getBARREL_EC_MIN()
Definition: MucID.cxx:241
MucID()
constructor
Definition: MucID.cxx:7
static value_type getSegNum(int part)
Definition: MucID.cxx:164
static value_type getStripNum(int part, int seg, int gap)
Definition: MucID.cxx:178
static value_type getCHANNEL_BARREL_MAX()
Definition: MucID.cxx:226
static int strip(const Identifier &id)
Definition: MucID.cxx:76
static value_type getGapNum(int part)
Definition: MucID.cxx:171
int channel_max(const Identifier &id)
Definition: MucID.cxx:117
static value_type getCHANNEL_ENDCAP_MAX()
Definition: MucID.cxx:231