BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
DetectorDescription/Identifier/include/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 <assert.h>
6#include <string>
7
8class TofID : public BesDetectorID {
9public:
12
13 /// constructor
14 TofID();
15
16 /// destructor
17 ~TofID();
18
19 /// For a single crystal
20 static Identifier cell_id( int barrel_ec, int layer, int phi_module, int end );
21 static Identifier cell_id( int value );
22
23 static value_type getIntID( int barrel_ec, int layer, int phi_module, int end );
24
25 /// For a single MRPC
26 static Identifier cell_id( int barrel_ec, int endcap, int module, int strip, int end );
27 static value_type getIntID( int barrel_ec, int endcap, int module, int strip, int end );
28
35
36 static bool values_ok( const unsigned int barrel_ec, const unsigned int layer,
37 const unsigned int phi_module, const unsigned int end );
38
39 // MRPC sunss
44
45 static bool values_ok( const unsigned int barrel_ec, const unsigned int endcap,
46 const unsigned int module, const unsigned int strip,
47 const unsigned int end );
48 // MRPC sunss
49
50 /// Test for barrel
51 static bool is_barrel( const Identifier& id );
52 static bool is_barrel( const unsigned int barrel_ec );
53
54 /// Values of different levels (failure returns 0)
55 static int barrel_ec( const Identifier& id );
56 static int layer( const Identifier& id );
57 static int phi_module( const Identifier& id );
58 static int end( const Identifier& id );
59
60 /// Max/Min values for each field (error returns -999)
61 int phi_module_max( const Identifier& id );
62 int layer_max( const Identifier& id );
63
64 // MRPC sunss
65 static bool is_scin( const Identifier& id );
66 static bool is_scin( const unsigned int barrel_ec );
67 static bool is_mrpc( const Identifier& id );
68 static bool is_mrpc( const unsigned int barrel_ec );
69
70 static int endcap( const Identifier& id );
71 static int module( const Identifier& id );
72 static int strip( const Identifier& id );
73 // MRPC sunss
74
75private:
76 typedef std::vector<Identifier> id_vec;
77 typedef id_vec::const_iterator id_vec_it;
78
79 static const unsigned int BARREL_EC_INDEX = 14;
80 static const unsigned int BARREL_EC_MASK = 0x0000C000;
81
82 static const unsigned int LAYER_INDEX = 8;
83 static const unsigned int LAYER_MASK = 0x00000100;
84
85 static const unsigned int PHI_INDEX = 1;
86 static const unsigned int PHI_MASK = 0x000000FE;
87
88 static const unsigned int END_INDEX = 0;
89 static const unsigned int END_MASK = 0x00000001;
90
91 static const unsigned int LAYER_BARREL_MAX = 1;
92 static const unsigned int LAYER_ENDCAP_MAX = 0;
93
94 static const unsigned int PHI_BARREL_MAX = 87;
95 static const unsigned int PHI_ENDCAP_MAX = 47;
96
97 static const unsigned int BARREL_EC_MAX = 2;
98 static const unsigned int BARREL_EC_MIN = 0;
99
100 // sunss
101 static const unsigned int ENDCAP_INDEX = 11;
102 static const unsigned int ENDCAP_MASK = 0x00000800;
103
104 static const unsigned int MODULE_INDEX = 5;
105 static const unsigned int MODULE_MASK = 0x000007E0;
106
107 static const unsigned int STRIP_INDEX = 1;
108 static const unsigned int STRIP_MASK = 0x0000001E;
109
110 static const unsigned int BARREL_EC_MRPC = 3;
111 static const unsigned int ENDCAP_MRPC_MAX = 1;
112 static const unsigned int MODULE_MRPC_MAX = 35;
113 static const unsigned int STRIP_MRPC_MAX = 11;
114};
115
116#endif
static int endcap(const Identifier &id)
Definition TofID.cxx:108
static int strip(const Identifier &id)
Definition TofID.cxx:120
static Identifier cell_id(int barrel_ec, int layer, int phi_module, int end)
For a single crystal.
Definition TofID.cxx:126
static value_type getENDCAP_MRPC_MAX()
Definition TofID.cxx:176
static bool is_scin(const Identifier &id)
Definition TofID.cxx:88
~TofID()
destructor
Definition TofID.cxx:7
static value_type getMODULE_MRPC_MAX()
Definition TofID.cxx:178
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:10
static int end(const Identifier &id)
Definition TofID.cxx:71
static value_type getPHI_BARREL_MAX()
Definition TofID.cxx:167
static value_type getPHI_ENDCAP_MAX()
Definition TofID.cxx:169
static value_type getSTRIP_MRPC_MAX()
Definition TofID.cxx:180
static value_type getBARREL_EC_MIN()
Definition TofID.cxx:172
static value_type getBARREL_EC_MAX()
Definition TofID.cxx:170
static bool is_barrel(const Identifier &id)
Test for barrel.
Definition TofID.cxx:40
TofID()
constructor
Definition TofID.cxx:5
static bool is_mrpc(const Identifier &id)
Definition TofID.cxx:98
static int phi_module(const Identifier &id)
Definition TofID.cxx:65
static int barrel_ec(const Identifier &id)
Values of different levels (failure returns 0).
Definition TofID.cxx:54
int phi_module_max(const Identifier &id)
Max/Min values for each field (error returns -999).
Definition TofID.cxx:82
static value_type getLAYER_ENDCAP_MAX()
Definition TofID.cxx:165
static value_type getBARREL_EC_MRPC()
Definition TofID.cxx:174
static value_type getIntID(int barrel_ec, int layer, int phi_module, int end)
Definition TofID.cxx:147
static int layer(const Identifier &id)
Definition TofID.cxx:59
int layer_max(const Identifier &id)
Definition TofID.cxx:76
static int module(const Identifier &id)
Definition TofID.cxx:114
static value_type getLAYER_BARREL_MAX()
Definition TofID.cxx:163