BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
TofID.h
Go to the documentation of this file.
1#ifndef __TofID_h__
2#define __TofID_h__
3
5#include <string>
6#include <assert.h>
7
8class TofID : public BesDetectorID
9{
10 public:
13
14 /// constructor
15 TofID();
16
17 /// destructor
18 ~TofID();
19
20 /// For a single crystal
21 static Identifier cell_id ( int barrel_ec,
22 int layer,
23 int phi_module,
24 int end
25 );
26 static Identifier cell_id( int value );
27
28 static value_type getIntID ( int barrel_ec,
29 int layer,
30 int phi_module,
31 int end
32 );
33
34 /// For a single MRPC
35 static Identifier cell_id ( int barrel_ec,
36 int endcap,
37 int module,
38 int strip,
39 int end
40 );
41 static value_type getIntID ( int barrel_ec,
42 int endcap,
43 int module,
44 int strip,
45 int end
46 );
47
54
55 static bool values_ok ( const unsigned int barrel_ec,
56 const unsigned int layer,
57 const unsigned int phi_module,
58 const unsigned int end
59 ) ;
60
61 // MRPC sunss
66
67 static bool values_ok ( const unsigned int barrel_ec,
68 const unsigned int endcap,
69 const unsigned int module,
70 const unsigned int strip,
71 const unsigned int end
72 ) ;
73 // MRPC sunss
74
75 /// Test for barrel
76 static bool is_barrel (const Identifier& id) ;
77 static bool is_barrel (const unsigned int barrel_ec) ;
78
79 /// Values of different levels (failure returns 0)
80 static int barrel_ec (const Identifier& id) ;
81 static int layer (const Identifier& id) ;
82 static int phi_module (const Identifier& id) ;
83 static int end (const Identifier& id) ;
84
85 /// Max/Min values for each field (error returns -999)
86 int phi_module_max (const Identifier& id) ;
87 int layer_max (const Identifier& id);
88
89 // MRPC sunss
90 static bool is_scin (const Identifier& id) ;
91 static bool is_scin (const unsigned int barrel_ec) ;
92 static bool is_mrpc (const Identifier& id) ;
93 static bool is_mrpc (const unsigned int barrel_ec) ;
94
95 static int endcap (const Identifier& id) ;
96 static int module (const Identifier& id) ;
97 static int strip (const Identifier& id) ;
98 // MRPC sunss
99
100private:
101
102 typedef std::vector<Identifier> id_vec;
103 typedef id_vec::const_iterator id_vec_it;
104
105 static const unsigned int BARREL_EC_INDEX = 14;
106 static const unsigned int BARREL_EC_MASK = 0x0000C000;
107
108 static const unsigned int LAYER_INDEX = 8;
109 static const unsigned int LAYER_MASK = 0x00000100;
110
111 static const unsigned int PHI_INDEX = 1;
112 static const unsigned int PHI_MASK = 0x000000FE;
113
114 static const unsigned int END_INDEX = 0;
115 static const unsigned int END_MASK = 0x00000001;
116
117 static const unsigned int LAYER_BARREL_MAX = 1;
118 static const unsigned int LAYER_ENDCAP_MAX = 0;
119
120 static const unsigned int PHI_BARREL_MAX = 87;
121 static const unsigned int PHI_ENDCAP_MAX = 47;
122
123 static const unsigned int BARREL_EC_MAX = 2;
124 static const unsigned int BARREL_EC_MIN = 0;
125
126 // sunss
127 static const unsigned int ENDCAP_INDEX = 11;
128 static const unsigned int ENDCAP_MASK = 0x00000800;
129
130 static const unsigned int MODULE_INDEX = 5;
131 static const unsigned int MODULE_MASK = 0x000007E0;
132
133 static const unsigned int STRIP_INDEX = 1;
134 static const unsigned int STRIP_MASK = 0x0000001E;
135
136 static const unsigned int BARREL_EC_MRPC = 3;
137 static const unsigned int ENDCAP_MRPC_MAX = 1;
138 static const unsigned int MODULE_MRPC_MAX = 35;
139 static const unsigned int STRIP_MRPC_MAX = 11;
140
141};
142
143#endif
unsigned int value_type
Definition: Identifier.h:27
unsigned int size_type
Definition: Identifier.h:28
Definition: TofID.h:9
static int endcap(const Identifier &id)
Definition: TofID.cxx:124
static int strip(const Identifier &id)
Definition: TofID.cxx:136
static Identifier cell_id(int barrel_ec, int layer, int phi_module, int end)
For a single crystal.
Definition: TofID.cxx:143
static value_type getENDCAP_MRPC_MAX()
Definition: TofID.cxx:241
Identifier::size_type size_type
Definition: TofID.h:11
static bool is_scin(const Identifier &id)
Definition: TofID.cxx:102
~TofID()
destructor
Definition: TofID.cxx:9
static value_type getMODULE_MRPC_MAX()
Definition: TofID.cxx:246
static bool values_ok(const unsigned int barrel_ec, const unsigned int layer, const unsigned int phi_module, const unsigned int end)
Definition: TofID.cxx:13
static int end(const Identifier &id)
Definition: TofID.cxx:79
static value_type getPHI_BARREL_MAX()
Definition: TofID.cxx:217
static value_type getPHI_ENDCAP_MAX()
Definition: TofID.cxx:222
static value_type getSTRIP_MRPC_MAX()
Definition: TofID.cxx:251
static value_type getBARREL_EC_MIN()
Definition: TofID.cxx:231
static value_type getBARREL_EC_MAX()
Definition: TofID.cxx:226
static bool is_barrel(const Identifier &id)
Test for barrel.
Definition: TofID.cxx:49
TofID()
constructor
Definition: TofID.cxx:6
static bool is_mrpc(const Identifier &id)
Definition: TofID.cxx:113
static int phi_module(const Identifier &id)
Definition: TofID.cxx:73
static int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
Definition: TofID.cxx:61
int phi_module_max(const Identifier &id)
Max/Min values for each field (error returns -999)
Definition: TofID.cxx:93
static value_type getLAYER_ENDCAP_MAX()
Definition: TofID.cxx:212
static value_type getBARREL_EC_MRPC()
Definition: TofID.cxx:236
static value_type getIntID(int barrel_ec, int layer, int phi_module, int end)
Definition: TofID.cxx:178
Identifier::value_type value_type
Definition: TofID.h:12
static int layer(const Identifier &id)
Definition: TofID.cxx:66
int layer_max(const Identifier &id)
Definition: TofID.cxx:84
static int module(const Identifier &id)
Definition: TofID.cxx:130
static value_type getLAYER_BARREL_MAX()
Definition: TofID.cxx:207