1#include "Identifier/MucID.h"
4const unsigned int MucID::CHANNEL_BARREL_LAYER_NUM[MucID::LAYER_BARREL_NUM] =
5 {64,112,64,112,64,112,64,112,64};
15 const unsigned int segment,
16 const unsigned int layer,
17 const unsigned int channel
20 if (
barrel_ec >= BARREL_EC_NUM )
return false;
22 if (
segment >= SEGMENT_ENDCAP_NUM )
return false;
23 if (
layer >= LAYER_ENDCAP_NUM )
return false;
24 if (
channel >= CHANNEL_ENDCAP_NUM_MAX )
return false;
27 if (
segment >= SEGMENT_BARREL_NUM )
return false;
28 if (
layer >= LAYER_BARREL_NUM )
return false;
29 if (
channel >= CHANNEL_BARREL_LAYER_NUM[
layer] )
return false;
36 unsigned int pos = (
id.get_value() & MucID::BARREL_EC_MASK) >> MucID::BARREL_EC_INDEX;
37 return (pos == 0 || pos == BARREL_EC_NUM - 1) ?
false :
true;
42 return ((
id.get_value() & MucID::BARREL_EC_MASK) >> MucID::BARREL_EC_INDEX);
47 return ((
id.get_value() & MucID::BARREL_EC_MASK) >> MucID::BARREL_EC_INDEX);
52 return (
id.get_value() & MucID::SEGMENT_MASK) >> MucID::SEGMENT_INDEX;
57 return (
id.get_value() & MucID::SEGMENT_MASK) >> MucID::SEGMENT_INDEX;
62 return (
id.get_value() & MucID::LAYER_MASK) >> MucID::LAYER_INDEX;
67 return (
id.get_value() & MucID::LAYER_MASK) >> MucID::LAYER_INDEX;
72 return (
id.get_value() & MucID::CHANNEL_MASK) >> MucID::CHANNEL_INDEX;
77 return (
id.get_value() & MucID::CHANNEL_MASK) >> MucID::CHANNEL_INDEX;
83 return SEGMENT_BARREL_NUM - 1;
85 return SEGMENT_ENDCAP_NUM - 1;
92 return SEGMENT_BARREL_NUM;
94 return SEGMENT_ENDCAP_NUM;
101 return LAYER_BARREL_NUM - 1;
103 return LAYER_ENDCAP_NUM - 1;
110 return LAYER_BARREL_NUM;
112 return LAYER_ENDCAP_NUM;
119 return CHANNEL_BARREL_NUM_MAX - 1;
121 return CHANNEL_ENDCAP_NUM_MAX - 1;
128 return CHANNEL_BARREL_LAYER_NUM[this->
gap(
id)];
130 return CHANNEL_ENDCAP_NUM_MAX;
160 return BARREL_EC_NUM;
165 if (
part == 1)
return SEGMENT_BARREL_NUM;
166 else if (
part == 0 ||
part == 2)
return SEGMENT_ENDCAP_NUM;
172 if (
part == 1)
return LAYER_BARREL_NUM;
173 if (
part == 0 ||
part == 2)
return LAYER_ENDCAP_NUM;
180 if (
seg == 2)
return CHANNEL_BARREL_LAYER_NUM[
gap];
181 else return CHANNEL_BARREL_LAYER_NUM[
gap];
183 return CHANNEL_ENDCAP_NUM_MAX;
189 if (SEGMENT_BARREL_NUM > SEGMENT_ENDCAP_NUM)
return SEGMENT_BARREL_NUM;
190 else return SEGMENT_ENDCAP_NUM;
196 if (LAYER_BARREL_NUM > LAYER_ENDCAP_NUM)
return LAYER_BARREL_NUM;
197 else return LAYER_ENDCAP_NUM;
201 if (CHANNEL_BARREL_NUM_MAX > CHANNEL_ENDCAP_NUM_MAX)
return CHANNEL_BARREL_NUM_MAX;
202 else return CHANNEL_ENDCAP_NUM_MAX;
207 return SEGMENT_BARREL_NUM - 1;
212 return SEGMENT_ENDCAP_NUM - 1;
217 return LAYER_BARREL_NUM - 1;
222 return LAYER_ENDCAP_NUM - 1;
227 return CHANNEL_BARREL_NUM_MAX;
232 return CHANNEL_ENDCAP_NUM_MAX;
237 return BARREL_EC_NUM - 1;
static const unsigned int MUC_INDEX
static const unsigned int MUC_ID
static int barrel_ec(const Identifier &id)
Values of different levels.
static value_type getStripMax()
static value_type getIntID(int barrel_ec, int segment, int layer, int channel)
static int layer(const Identifier &id)
static bool values_ok(const unsigned int barrel_ec, const unsigned int segment, const unsigned int layer, const unsigned int channel)
static int channel(const Identifier &id)
static value_type getSEGMENT_BARREL_MAX()
int segment_max(const Identifier &id)
Max/Min values for each field.
static int part(const Identifier &id)
static value_type getGapMax()
static int segment(const Identifier &id)
static value_type getBARREL_EC_MAX()
static value_type getPartNum()
static Identifier channel_id(int barrel_ec, int segment, int layer, int channel)
For a single crystal.
Identifier::value_type value_type
int layer_max(const Identifier &id)
static value_type getSegMax()
static value_type getSEGMENT_ENDCAP_MAX()
static value_type getLAYER_BARREL_MAX()
static bool is_barrel(const Identifier &id)
Test for barrel.
static int gap(const Identifier &id)
static int seg(const Identifier &id)
static value_type getLAYER_ENDCAP_MAX()
static value_type getBARREL_EC_MIN()
static value_type getSegNum(int part)
static value_type getStripNum(int part, int seg, int gap)
static value_type getCHANNEL_BARREL_MAX()
static int strip(const Identifier &id)
static value_type getGapNum(int part)
int channel_max(const Identifier &id)
static value_type getCHANNEL_ENDCAP_MAX()