CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
CgemID.h
Go to the documentation of this file.
1#ifndef __CgemID_h__
2#define __CgemID_h__
3
4//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
5/* Header file: BOSS */
7
8/* Header file: C++ */
9#include <string>
10#include <assert.h>
11#include <cstdlib>
12
13//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
14class CgemID : public BesDetectorID
15{
16public:
17 typedef Identifier::size_type size_type; /* unsigned int */
18 typedef Identifier::value_type value_type; /* unsigned int */
19
20 CgemID(); /* Constructor */
21 ~CgemID(); /* Destructor */
22
23 /* For a single strip */
24 static Identifier strip_id (int f_layer, int f_sheet, int f_strip_type, int f_strip);
25
26 static value_type getIntID(unsigned int f_layer,
27 unsigned int f_sheet,
28 unsigned int f_strip_type,
29 unsigned int f_strip);
30
31 /* Get max informtion of correlated ID */
32 static value_type getLAYER_MAX ();
33 static value_type getSHEET_MAX ();
34 static value_type getXSTRIP_MAX (unsigned int f_layer);
35 static value_type getVSTRIP_MAX (unsigned int f_layer);
38
39 /* Check over whether in the range or not */
40 static bool values_ok (const unsigned int f_layer,
41 const unsigned int f_sheet,
42 const unsigned int f_strip_type,
43 const unsigned int f_strip);
44
45 static bool is_xstrip (const Identifier& id);
46
47 /* Values of different levels (failure returns 0) */
48 static int layer (const Identifier& id);
49 static int sheet (const Identifier& id);
50 static int strip (const Identifier& id);
51
52private:
53 typedef std::vector<Identifier> id_vec;
54 typedef id_vec::const_iterator id_vec_it;
55
56 /* Bit Index and Mask */
57 /* Layer */
58 static const unsigned int LAYER_INDEX = 0; /* Starting bit */
59 static const unsigned int LAYER_MASK = 0x00000007; /* continuous bits: 0-2 */
60
61 /* Sheet */
62 static const unsigned int SHEET_INDEX = 3; /* Starting bit */
63 static const unsigned int SHEET_MASK = 0x00000038; /* continuous bits: 3-5 */
64
65 /* Strip */
66 static const unsigned int XSTRIP_TYPE = 0; /* X-Strip */
67 static const unsigned int VSTRIP_TYPE = 1; /* V-Strip */
68
69 static const unsigned int STRIP_TYPE_INDEX = 6; /* Starting bit */
70 static const unsigned int STRIP_TYPE_MASK = 0x00000040; /* continuous bits: 6-6 */
71
72 static const unsigned int STRIP_INDEX = 7; /* Starting bit */
73 static const unsigned int STRIP_MASK = 0x0007FF80; /* continuous bits: 7-18 */
74
75 /* MAX information */
76 static const unsigned int LAYER_MAX = 3;
77 static const unsigned int SHEET_MAX = 2;
78 static const unsigned int XSTRIP_MAX[3] ;
79 static const unsigned int VSTRIP_MAX[3] ;
80};
81
82//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
83#endif
Definition: CgemID.h:15
static int strip(const Identifier &id)
Definition: CgemID.cxx:83
static int sheet(const Identifier &id)
Definition: CgemID.cxx:77
static value_type getXSTRIP_MAX(unsigned int f_layer)
Definition: CgemID.cxx:130
static value_type getVSTRIP_TYPE()
Definition: CgemID.cxx:148
Identifier::size_type size_type
Definition: CgemID.h:17
static value_type getXSTRIP_TYPE()
Definition: CgemID.cxx:142
static int layer(const Identifier &id)
Definition: CgemID.cxx:71
static value_type getVSTRIP_MAX(unsigned int f_layer)
Definition: CgemID.cxx:136
CgemID()
Definition: CgemID.cxx:13
static value_type getLAYER_MAX()
Definition: CgemID.cxx:118
static value_type getSHEET_MAX()
Definition: CgemID.cxx:124
Identifier::value_type value_type
Definition: CgemID.h:18
static bool is_xstrip(const Identifier &id)
Definition: CgemID.cxx:64
~CgemID()
Definition: CgemID.cxx:18
static bool values_ok(const unsigned int f_layer, const unsigned int f_sheet, const unsigned int f_strip_type, const unsigned int f_strip)
Definition: CgemID.cxx:23
static value_type getIntID(unsigned int f_layer, unsigned int f_sheet, unsigned int f_strip_type, unsigned int f_strip)
Definition: CgemID.cxx:104
static Identifier strip_id(int f_layer, int f_sheet, int f_strip_type, int f_strip)
Definition: CgemID.cxx:89
unsigned int value_type
Definition: Identifier.h:27
unsigned int size_type
Definition: Identifier.h:28