2#include "Identifier/CgemID.h"
9const unsigned int CgemID::XSTRIP_MAX[3] = {856 , 630 , 832 };
10const unsigned int CgemID::VSTRIP_MAX[3] = {1173 , 1077 , 1395 };
24 const unsigned int f_sheet,
25 const unsigned int f_strip_type,
26 const unsigned int f_strip)
29 if ((f_strip_type != XSTRIP_TYPE) && (f_strip_type != VSTRIP_TYPE))
35 if ((f_layer < LAYER_MAX) && (f_sheet < SHEET_MAX))
37 if (f_strip_type == XSTRIP_TYPE)
39 if (f_strip < XSTRIP_MAX[f_layer])
45 if (f_strip_type == VSTRIP_TYPE)
47 if (f_strip < VSTRIP_MAX[f_layer])
54 std::cout <<
" INFO : Identifier::CgemID, values_ok(): " << std::endl;
55 std::cout <<
" layer = " << f_layer
56 <<
" sheet = " << f_sheet
57 <<
" stripType = " << f_strip_type
58 <<
" strip = " << f_strip << std::endl;
66 unsigned int type = (
id.get_value() & CgemID::STRIP_TYPE_MASK) >> CgemID::STRIP_TYPE_INDEX;
67 return (type == XSTRIP_TYPE) ?
true :
false;
73 return (
id.get_value() & CgemID::LAYER_MASK) >> CgemID::LAYER_INDEX;
79 return (
id.get_value() & CgemID::SHEET_MASK) >> CgemID::SHEET_INDEX;
85 return (
id.get_value() & CgemID::STRIP_MASK) >> CgemID::STRIP_INDEX;
92 assert(
values_ok(f_layer, f_sheet, f_strip_type, f_strip));
95 | ( f_layer << LAYER_INDEX )
96 | ( f_sheet << SHEET_INDEX )
97 | ( f_strip_type << STRIP_TYPE_INDEX )
98 | ( f_strip << STRIP_INDEX );
105 unsigned int f_sheet,
106 unsigned int f_strip_type,
107 unsigned int f_strip)
110 |((f_layer << LAYER_INDEX) & LAYER_MASK)
111 |((f_sheet << SHEET_INDEX) & SHEET_MASK)
112 |((f_strip_type << STRIP_TYPE_INDEX) & STRIP_TYPE_MASK)
113 |((f_strip << STRIP_INDEX) & STRIP_MASK);
132 return XSTRIP_MAX[f_layer];
138 return VSTRIP_MAX[f_layer];
static const unsigned int CGEM_ID
static const unsigned int CGEM_INDEX
static const unsigned int CGEM_MASK
static int strip(const Identifier &id)
static int sheet(const Identifier &id)
static value_type getXSTRIP_MAX(unsigned int f_layer)
static value_type getVSTRIP_TYPE()
static value_type getXSTRIP_TYPE()
static int layer(const Identifier &id)
static value_type getVSTRIP_MAX(unsigned int f_layer)
static value_type getLAYER_MAX()
static value_type getSHEET_MAX()
static bool is_xstrip(const Identifier &id)
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)
static value_type getIntID(unsigned int f_layer, unsigned int f_sheet, unsigned int f_strip_type, unsigned int f_strip)
static Identifier strip_id(int f_layer, int f_sheet, int f_strip_type, int f_strip)