#include <MucID.h>
Inheritance diagram for MucID:
Public Types | |
typedef Identifier::size_type | size_type |
typedef Identifier::size_type | size_type |
typedef Identifier::value_type | value_type |
typedef Identifier::value_type | value_type |
Public Member Functions | |
int | channel_max (const Identifier &id) |
int | channel_max (const Identifier &id) |
Identifier | emc (void) const |
Identifier | emc (void) const |
int | getGapNum (const Identifier &id) |
int | getGapNum (const Identifier &id) |
int | getSegNum (const Identifier &id) |
int | getSegNum (const Identifier &id) |
int | getStripNum (const Identifier &id) |
int | getStripNum (const Identifier &id) |
Identifier | hlt (void) const |
Identifier | hlt (void) const |
bool | is_emc (const Identifier &id) const |
bool | is_emc (const Identifier &id) const |
bool | is_hlt (const Identifier &id) const |
bool | is_hlt (const Identifier &id) const |
bool | is_mdc (const Identifier &id) const |
bool | is_mdc (const Identifier &id) const |
bool | is_muc (const Identifier &id) const |
bool | is_muc (const Identifier &id) const |
bool | is_tof (const Identifier &id) const |
bool | is_tof (const Identifier &id) const |
int | layer_max (const Identifier &id) |
int | layer_max (const Identifier &id) |
Identifier | mdc (void) const |
Identifier | mdc (void) const |
Identifier | muc (void) const |
Identifier | muc (void) const |
MucID () | |
constructor | |
MucID () | |
constructor | |
int | segment_max (const Identifier &id) |
Max/Min values for each field. | |
int | segment_max (const Identifier &id) |
Max/Min values for each field. | |
Identifier | tof (void) const |
Identifier | tof (void) const |
~MucID () | |
destructor | |
~MucID () | |
destructor | |
Static Public Member Functions | |
int | barrel_ec (const Identifier &id) |
Values of different levels. | |
int | barrel_ec (const Identifier &id) |
Values of different levels. | |
int | channel (const Identifier &id) |
int | channel (const Identifier &id) |
Identifier | channel_id (int barrel_ec, int segment, int layer, int channel) |
For a single crystal. | |
Identifier | channel_id (int barrel_ec, int segment, int layer, int channel) |
For a single crystal. | |
int | gap (const Identifier &id) |
int | gap (const Identifier &id) |
value_type | getBARREL_EC_MAX () |
value_type | getBARREL_EC_MAX () |
value_type | getBARREL_EC_MIN () |
value_type | getBARREL_EC_MIN () |
value_type | getCHANNEL_BARREL_MAX () |
value_type | getCHANNEL_BARREL_MAX () |
value_type | getCHANNEL_ENDCAP_MAX () |
value_type | getCHANNEL_ENDCAP_MAX () |
value_type | getGapMax () |
value_type | getGapMax () |
--------------------------------------------------------------------------- | |
value_type | getGapNum (int part) |
value_type | getGapNum (int part) |
value_type | getIntID (int barrel_ec, int segment, int layer, int channel) |
value_type | getIntID (int barrel_ec, int segment, int layer, int channel) |
value_type | getLAYER_BARREL_MAX () |
value_type | getLAYER_BARREL_MAX () |
value_type | getLAYER_ENDCAP_MAX () |
value_type | getLAYER_ENDCAP_MAX () |
value_type | getPartNum () |
value_type | getPartNum () |
value_type | getSegMax () |
value_type | getSegMax () |
--------------------------------------------------------------------------- | |
value_type | getSEGMENT_BARREL_MAX () |
value_type | getSEGMENT_BARREL_MAX () |
value_type | getSEGMENT_ENDCAP_MAX () |
value_type | getSEGMENT_ENDCAP_MAX () |
value_type | getSegNum (int part) |
value_type | getSegNum (int part) |
--------------------------------------------------------------------------- | |
value_type | getStripMax () |
value_type | getStripMax () |
value_type | getStripNum (int part, int seg, int gap) |
value_type | getStripNum (int part, int seg, int gap) |
bool | is_barrel (const Identifier &id) |
Test for barrel. | |
bool | is_barrel (const Identifier &id) |
Test for barrel. | |
int | layer (const Identifier &id) |
int | layer (const Identifier &id) |
int | part (const Identifier &id) |
int | part (const Identifier &id) |
int | seg (const Identifier &id) |
int | seg (const Identifier &id) |
int | segment (const Identifier &id) |
int | segment (const Identifier &id) |
int | strip (const Identifier &id) |
int | strip (const Identifier &id) |
bool | values_ok (const unsigned int barrel_ec, const unsigned int segment, const unsigned int layer, const unsigned int channel) |
bool | values_ok (const unsigned int barrel_ec, const unsigned int segment, const unsigned int layer, const unsigned int channel) |
Protected Member Functions | |
int | emc_field_value () const |
int | emc_field_value () const |
int | get_detectorID (const Identifier &id) const |
int | get_detectorID (const Identifier &id) const |
int | hlt_field_value () const |
int | hlt_field_value () const |
int | mdc_field_value () const |
Provide efficient access to individual field values. | |
int | mdc_field_value () const |
Provide efficient access to individual field values. | |
int | muc_field_value () const |
int | muc_field_value () const |
int | tof_field_value () const |
int | tof_field_value () const |
Static Protected Attributes | |
const unsigned int | EMC_ID = 0x30 |
const unsigned int | EMC_INDEX = 24 |
const unsigned int | EMC_MASK = 0xFF000000 |
const unsigned int | HLT_ID = 0x50 |
const unsigned int | HLT_INDEX = 24 |
const unsigned int | HLT_MASK = 0xFF000000 |
const unsigned int | MDC_ID = 0x10 |
const unsigned int | MDC_INDEX = 24 |
const unsigned int | MDC_MASK = 0xFF000000 |
const unsigned int | MUC_ID = 0x40 |
const unsigned int | MUC_INDEX = 24 |
const unsigned int | MUC_MASK = 0xFF000000 |
const unsigned int | TOF_ID = 0x20 |
const unsigned int | TOF_INDEX = 24 |
const unsigned int | TOF_MASK = 0xFF000000 |
Private Types | |
typedef std::vector< Identifier > | id_vec |
typedef std::vector< Identifier > | id_vec |
typedef id_vec::const_iterator | id_vec_it |
typedef id_vec::const_iterator | id_vec_it |
Static Private Attributes | |
const unsigned int | BARREL_EC_INDEX = 16 |
const unsigned int | BARREL_EC_MASK = 0x000F0000 |
const unsigned int | BARREL_EC_MAX = 2 |
const unsigned int | BARREL_EC_MIN = 0 |
const unsigned int | BARREL_EC_NUM = 3 |
const unsigned int | CHANNEL_BARREL_LAYER_NUM [LAYER_BARREL_NUM] |
const unsigned int | CHANNEL_BARREL_NUM_MAX = 112 |
const unsigned int | CHANNEL_ENDCAP_NUM_MAX = 64 |
const unsigned int | CHANNEL_INDEX = 0 |
const unsigned int | CHANNEL_MASK = 0x000000FF |
const unsigned int | LAYER_BARREL_NUM = 9 |
const unsigned int | LAYER_ENDCAP_NUM = 8 |
const unsigned int | LAYER_INDEX = 8 |
const unsigned int | LAYER_MASK = 0x00000F00 |
const unsigned int | SEGMENT_BARREL_NUM = 8 |
const unsigned int | SEGMENT_ENDCAP_NUM = 4 |
const unsigned int | SEGMENT_INDEX = 12 |
const unsigned int | SEGMENT_MASK = 0x0000F000 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constructor
00007 { 00008 }
|
|
destructor
00010 { 00011 }
|
|
constructor
|
|
destructor
|
|
Values of different levels.
|
|
Values of different levels.
00041 { 00042 return ((id.get_value() & MucID::BARREL_EC_MASK) >> MucID::BARREL_EC_INDEX); 00043 }
|
|
|
|
00071 { 00072 return (id.get_value() & MucID::CHANNEL_MASK) >> MucID::CHANNEL_INDEX; 00073 }
|
|
For a single crystal.
|
|
For a single crystal.
00139 { 00140 assert ( values_ok(barrel_ec, segment, layer, channel) ); 00141 value_type value = (MUC_ID << MUC_INDEX) | (barrel_ec << BARREL_EC_INDEX)| 00142 (segment << SEGMENT_INDEX) | (layer << LAYER_INDEX) | (channel << CHANNEL_INDEX); 00143 return Identifier(value); 00144 }
|
|
|
|
00117 { 00118 if (this->is_barrel(id)) { 00119 return CHANNEL_BARREL_NUM_MAX - 1; 00120 } else { 00121 return CHANNEL_ENDCAP_NUM_MAX - 1; 00122 } 00123 }
|
|
|
|
00054 { 00055 Identifier id = Identifier( m_EmcId << EMC_INDEX ); 00056 return id; 00057 }
|
|
|
|
00097 {return (m_EmcId);}
|
|
|
|
00066 { 00067 return (id.get_value() & MucID::LAYER_MASK) >> MucID::LAYER_INDEX; 00068 }
|
|
|
|
|
|
|
|
00236 { 00237 return BARREL_EC_NUM - 1; 00238 }
|
|
|
|
00241 {
00242 return 0;
00243 }
|
|
|
|
00226 {
00227 return CHANNEL_BARREL_NUM_MAX;
00228 }
|
|
|
|
00231 {
00232 return CHANNEL_ENDCAP_NUM_MAX;
00233 }
|
|
|
|
---------------------------------------------------------------------------
00195 { 00196 if (LAYER_BARREL_NUM > LAYER_ENDCAP_NUM) return LAYER_BARREL_NUM; 00197 else return LAYER_ENDCAP_NUM; 00198 }
|
|
|
|
|
|
00108 { 00109 if (this->is_barrel(id)) { 00110 return LAYER_BARREL_NUM; 00111 } else { 00112 return LAYER_ENDCAP_NUM; 00113 } 00114 }
|
|
00171 { 00172 if (part == 1) return LAYER_BARREL_NUM; 00173 if (part == 0 || part == 2) return LAYER_ENDCAP_NUM; 00174 else return 0; 00175 }
|
|
|
|
00151 { 00152 value_type value = (MUC_ID << MUC_INDEX) | (barrel_ec << BARREL_EC_INDEX)| 00153 (segment << SEGMENT_INDEX) | (layer << LAYER_INDEX) | (channel << CHANNEL_INDEX); 00154 return value; 00155 00156 }
|
|
|
|
00216 { 00217 return LAYER_BARREL_NUM - 1; 00218 }
|
|
|
|
00221 { 00222 return LAYER_ENDCAP_NUM - 1; 00223 }
|
|
|
|
00159 {
00160 return BARREL_EC_NUM;
00161 }
|
|
|
|
---------------------------------------------------------------------------
00188 { 00189 if (SEGMENT_BARREL_NUM > SEGMENT_ENDCAP_NUM) return SEGMENT_BARREL_NUM; 00190 else return SEGMENT_ENDCAP_NUM; 00191 }
|
|
|
|
00206 { 00207 return SEGMENT_BARREL_NUM - 1; 00208 }
|
|
|
|
00211 { 00212 return SEGMENT_ENDCAP_NUM - 1; 00213 }
|
|
|
|
|
|
00090 { 00091 if (is_barrel(id)) { 00092 return SEGMENT_BARREL_NUM; 00093 } else { 00094 return SEGMENT_ENDCAP_NUM; 00095 } 00096 }
|
|
---------------------------------------------------------------------------
00164 { 00165 if (part == 1) return SEGMENT_BARREL_NUM; 00166 else if (part == 0 || part == 2) return SEGMENT_ENDCAP_NUM; 00167 else return 0; 00168 }
|
|
|
|
00200 { 00201 if (CHANNEL_BARREL_NUM_MAX > CHANNEL_ENDCAP_NUM_MAX) return CHANNEL_BARREL_NUM_MAX; 00202 else return CHANNEL_ENDCAP_NUM_MAX; 00203 }
|
|
|
|
|
|
00126 { 00127 if (this->is_barrel(id)) { 00128 return CHANNEL_BARREL_LAYER_NUM[this->gap(id)]; 00129 } else { 00130 return CHANNEL_ENDCAP_NUM_MAX; 00131 } 00132 }
|
|
00178 { 00179 if (part == 1) { 00180 if (seg == 2) return CHANNEL_BARREL_LAYER_NUM[gap]; 00181 else return CHANNEL_BARREL_LAYER_NUM[gap]; 00182 } else { 00183 return CHANNEL_ENDCAP_NUM_MAX; 00184 } 00185 }
|
|
|
|
00064 { 00065 Identifier id = Identifier( m_HltId << HLT_INDEX ); 00066 return id; 00067 }
|
|
|
|
00103 {return (m_HltId);}
|
|
Test for barrel.
|
|
Test for barrel.
00035 { 00036 unsigned int pos = (id.get_value() & MucID::BARREL_EC_MASK) >> MucID::BARREL_EC_INDEX; 00037 return (pos == 0 || pos == BARREL_EC_NUM - 1) ? false : true; 00038 }
|
|
|
|
00029 { 00030 Identifier::value_type value = id.get_value(); 00031 return (value & EMC_MASK >> EMC_INDEX) == EMC_ID ? true : false; 00032 }
|
|
|
|
00039 { 00040 Identifier::value_type value = id.get_value(); 00041 return (value & HLT_MASK >> HLT_INDEX) == HLT_ID ? true : false; 00042 }
|
|
|
|
00019 { 00020 Identifier::value_type value = id.get_value(); 00021 return (value & MDC_MASK >> MDC_INDEX) == MDC_ID ? true : false; 00022 }
|
|
|
|
00034 { 00035 Identifier::value_type value = id.get_value(); 00036 return (value & MUC_MASK >> MUC_INDEX) == MUC_ID ? true : false; 00037 }
|
|
|
|
00024 { 00025 Identifier::value_type value = id.get_value(); 00026 return (value & TOF_MASK >> TOF_INDEX) == TOF_ID ? true : false; 00027 }
|
|
|
|
00061 { 00062 return (id.get_value() & MucID::LAYER_MASK) >> MucID::LAYER_INDEX; 00063 }
|
|
|
|
00099 { 00100 if (this->is_barrel(id)) { 00101 return LAYER_BARREL_NUM - 1; 00102 } else { 00103 return LAYER_ENDCAP_NUM - 1; 00104 } 00105 }
|
|
|
|
00044 { 00045 Identifier id = Identifier( m_MdcId << MDC_INDEX ); 00046 return id; 00047 }
|
|
Provide efficient access to individual field values.
|
|
Provide efficient access to individual field values.
00091 {return (m_MdcId);}
|
|
|
|
00059 { 00060 Identifier id = Identifier( m_MucId << MUC_INDEX ); 00061 return id; 00062 }
|
|
|
|
00100 {return (m_MucId);}
|
|
|
|
00046 { 00047 return ((id.get_value() & MucID::BARREL_EC_MASK) >> MucID::BARREL_EC_INDEX); 00048 }
|
|
|
|
00056 { 00057 return (id.get_value() & MucID::SEGMENT_MASK) >> MucID::SEGMENT_INDEX; 00058 }
|
|
|
|
00051 { 00052 return (id.get_value() & MucID::SEGMENT_MASK) >> MucID::SEGMENT_INDEX; 00053 }
|
|
Max/Min values for each field.
|
|
Max/Min values for each field.
00081 { 00082 if (is_barrel(id)) { 00083 return SEGMENT_BARREL_NUM - 1; 00084 } else { 00085 return SEGMENT_ENDCAP_NUM - 1; 00086 } 00087 }
|
|
|
|
00076 { 00077 return (id.get_value() & MucID::CHANNEL_MASK) >> MucID::CHANNEL_INDEX; 00078 }
|
|
|
|
00049 { 00050 Identifier id = Identifier( m_TofId << TOF_INDEX ); 00051 return id; 00052 }
|
|
|
|
00094 {return (m_TofId);}
|
|
|
|
00018 { 00019 // Check values 00020 if ( barrel_ec >= BARREL_EC_NUM ) return false; 00021 if ( barrel_ec == 0 || barrel_ec == BARREL_EC_NUM - 1 ) { 00022 if ( segment >= SEGMENT_ENDCAP_NUM ) return false; 00023 if ( layer >= LAYER_ENDCAP_NUM ) return false; 00024 if ( channel >= CHANNEL_ENDCAP_NUM_MAX ) return false; 00025 } 00026 else { 00027 if ( segment >= SEGMENT_BARREL_NUM ) return false; 00028 if ( layer >= LAYER_BARREL_NUM ) return false; 00029 if ( channel >= CHANNEL_BARREL_LAYER_NUM[layer] ) return false; 00030 } 00031 return true; 00032 }
|
|
|
|
|
|
|
|
|
|
|
|
Initial value: {64,112,64,112,64,112,64,112,64} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|