BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/Identifier/Identifier/TofID.h
Go to the documentation of this file.
1#ifndef __TofID_h__
2#define __TofID_h__
3
4#include "Identifier/BesDetectorID.h"
5#include <string>
6#include <assert.h>
7
8class TofID : public BesDetectorID
9{
10 public:
13
14 /// constructor
16
17 /// destructor
19
20 /// For a single crystal
22 int layer,
23 int phi_module,
24 int end
25 );
26 static Identifier cell_id( int value );
27
29 int layer,
30 int phi_module,
31 int end
32 );
33
34 /// For a single MRPC
36 int endcap,
37 int module,
38 int strip,
39 int end
40 );
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
static int layer(const Identifier &id)
static value_type getBARREL_EC_MIN()
static int endcap(const Identifier &id)
Definition: TofID.cxx:124
static int strip(const Identifier &id)
Definition: TofID.cxx:136
static value_type getENDCAP_MRPC_MAX()
static bool is_barrel(const unsigned int barrel_ec)
static int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0)
static value_type getSTRIP_MRPC_MAX()
static bool values_ok(const unsigned int barrel_ec, const unsigned int endcap, const unsigned int module, const unsigned int strip, const unsigned int end)
static value_type getBARREL_EC_MAX()
~TofID()
destructor
static value_type getPHI_BARREL_MAX()
static value_type getLAYER_ENDCAP_MAX()
static bool is_scin(const Identifier &id)
static int end(const Identifier &id)
Definition: TofID.cxx:79
static value_type getPHI_ENDCAP_MAX()
static bool is_mrpc(const Identifier &id)
static int phi_module(const Identifier &id)
static value_type getMODULE_MRPC_MAX()
static int end(const Identifier &id)
TofID()
constructor
static Identifier cell_id(int value)
static value_type getIntID(int barrel_ec, int layer, int phi_module, int end)
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)
static value_type getBARREL_EC_MRPC()
static int endcap(const Identifier &id)
static bool is_barrel(const Identifier &id)
Test for barrel.
static value_type getIntID(int barrel_ec, int endcap, int module, int strip, int end)
static Identifier cell_id(int barrel_ec, int endcap, int module, int strip, int end)
For a single MRPC.
static int strip(const Identifier &id)
static bool is_mrpc(const unsigned int barrel_ec)
static int module(const Identifier &id)
static Identifier cell_id(int barrel_ec, int layer, int phi_module, int end)
For a single crystal.
static int layer(const Identifier &id)
Definition: TofID.cxx:66
static bool values_ok(const unsigned int barrel_ec, const unsigned int layer, const unsigned int phi_module, const unsigned int end)
int layer_max(const Identifier &id)
static value_type getLAYER_BARREL_MAX()
static int module(const Identifier &id)
Definition: TofID.cxx:130
static bool is_scin(const unsigned int barrel_ec)