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 if (
barrel_ec >= BARREL_EC_NUM )
return false;
18 if (
segment >= SEGMENT_ENDCAP_NUM )
return false;
19 if (
layer >= LAYER_ENDCAP_NUM )
return false;
20 if (
channel >= CHANNEL_ENDCAP_NUM_MAX )
return false;
24 if (
segment >= SEGMENT_BARREL_NUM )
return false;
25 if (
layer >= LAYER_BARREL_NUM )
return false;
26 if (
channel >= CHANNEL_BARREL_LAYER_NUM[
layer] )
return false;
33 unsigned int pos = (
id.get_value() & MucID::BARREL_EC_MASK ) >> MucID::BARREL_EC_INDEX;
34 return ( pos == 0 || pos == BARREL_EC_NUM - 1 ) ? false :
true;
39 return ( (
id.get_value() & MucID::BARREL_EC_MASK ) >> MucID::BARREL_EC_INDEX );
44 return ( (
id.get_value() & MucID::BARREL_EC_MASK ) >> MucID::BARREL_EC_INDEX );
49 return (
id.get_value() & MucID::SEGMENT_MASK ) >> MucID::SEGMENT_INDEX;
54 return (
id.get_value() & MucID::SEGMENT_MASK ) >> MucID::SEGMENT_INDEX;
59 return (
id.get_value() & MucID::LAYER_MASK ) >> MucID::LAYER_INDEX;
64 return (
id.get_value() & MucID::LAYER_MASK ) >> MucID::LAYER_INDEX;
69 return (
id.get_value() & MucID::CHANNEL_MASK ) >> MucID::CHANNEL_INDEX;
74 return (
id.get_value() & MucID::CHANNEL_MASK ) >> MucID::CHANNEL_INDEX;
79 if (
is_barrel(
id ) ) {
return SEGMENT_BARREL_NUM - 1; }
80 else {
return SEGMENT_ENDCAP_NUM - 1; }
85 if (
is_barrel(
id ) ) {
return SEGMENT_BARREL_NUM; }
86 else {
return SEGMENT_ENDCAP_NUM; }
91 if ( this->
is_barrel(
id ) ) {
return LAYER_BARREL_NUM - 1; }
92 else {
return LAYER_ENDCAP_NUM - 1; }
97 if ( this->
is_barrel(
id ) ) {
return LAYER_BARREL_NUM; }
98 else {
return LAYER_ENDCAP_NUM; }
103 if ( this->
is_barrel(
id ) ) {
return CHANNEL_BARREL_NUM_MAX - 1; }
104 else {
return CHANNEL_ENDCAP_NUM_MAX - 1; }
109 if ( this->
is_barrel(
id ) ) {
return CHANNEL_BARREL_LAYER_NUM[this->
gap(
id )]; }
110 else {
return CHANNEL_ENDCAP_NUM_MAX; }
117 (
segment << SEGMENT_INDEX ) | (
layer << LAYER_INDEX ) |
125 (
segment << SEGMENT_INDEX ) | (
layer << LAYER_INDEX ) |
135 if (
part == 1 )
return SEGMENT_BARREL_NUM;
136 else if (
part == 0 ||
part == 2 )
return SEGMENT_ENDCAP_NUM;
142 if (
part == 1 )
return LAYER_BARREL_NUM;
143 if (
part == 0 ||
part == 2 )
return LAYER_ENDCAP_NUM;
151 if (
seg == 2 )
return CHANNEL_BARREL_LAYER_NUM[
gap];
152 else return CHANNEL_BARREL_LAYER_NUM[
gap];
154 else {
return CHANNEL_ENDCAP_NUM_MAX; }
159 if ( SEGMENT_BARREL_NUM > SEGMENT_ENDCAP_NUM )
return SEGMENT_BARREL_NUM;
160 else return SEGMENT_ENDCAP_NUM;
166 if ( LAYER_BARREL_NUM > LAYER_ENDCAP_NUM )
return LAYER_BARREL_NUM;
167 else return LAYER_ENDCAP_NUM;
171 if ( CHANNEL_BARREL_NUM_MAX > CHANNEL_ENDCAP_NUM_MAX )
return CHANNEL_BARREL_NUM_MAX;
172 else return CHANNEL_ENDCAP_NUM_MAX;
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()