1#include "Identifier/MdcID.h"
13 const unsigned int layer,
14 const unsigned int wire
17 if ( wireType != AXIAL_WIRE && wireType != STEREO_WIRE )
return false;
19 if ( wireType == STEREO_WIRE ) {
20 if (
layer < INNER_STEREO_LAYER_MAX
21 ||
layer < ( INNER_STEREO_LAYER_MAX
22 + INNER_AXIAL_LAYER_MAX
23 + OUTER_STEREO_LAYER_MAX )
24 &&
layer >= (INNER_STEREO_LAYER_MAX + INNER_AXIAL_LAYER_MAX ))
28 if ( wireType == AXIAL_WIRE ) {
29 if (
layer >= INNER_STEREO_LAYER_MAX
30 &&
layer < ( INNER_STEREO_LAYER_MAX + INNER_AXIAL_LAYER_MAX )
31 ||
layer >= ( INNER_STEREO_LAYER_MAX + INNER_AXIAL_LAYER_MAX
32 + OUTER_STEREO_LAYER_MAX ) &&
layer < LAYER_MAX )
37 std::cout <<
" ++ MdcID::values_ok++ wiretype = " << wireType <<
" layer = " <<
layer <<
" wire = " <<
wire << std::endl;
44 unsigned int type = (
id.get_value() & MdcID::WIRETYPE_MASK) >> MdcID::WIRETYPE_INDEX;
45 return (type == AXIAL_WIRE) ?
true :
false;
50 return (
id.get_value() & MdcID::LAYER_MASK) >> MdcID::LAYER_INDEX;
55 return (
id.get_value() & MdcID::WIRE_MASK) >> MdcID::WIRE_INDEX;
61 return AXIAL_LAYER_MAX;
63 return STEREO_LAYER_MAX;
70 return AXIAL_WIRE_MAX;
72 return STEREO_WIRE_MAX;
83 (wireType << WIRETYPE_INDEX) |
84 (
layer << LAYER_INDEX) |
93 if (
layer < INNER_STEREO_LAYER_MAX
94 ||
layer < (INNER_STEREO_LAYER_MAX + INNER_AXIAL_LAYER_MAX + OUTER_STEREO_LAYER_MAX)
95 &&
layer >= (INNER_STEREO_LAYER_MAX + INNER_AXIAL_LAYER_MAX )
106 unsigned int wireType;
108 if (
layer < INNER_STEREO_LAYER_MAX
109 ||
layer < (INNER_STEREO_LAYER_MAX + INNER_AXIAL_LAYER_MAX + OUTER_STEREO_LAYER_MAX)
110 &&
layer >= (INNER_STEREO_LAYER_MAX + INNER_AXIAL_LAYER_MAX )
112 wireType = STEREO_WIRE;
113 else wireType = AXIAL_WIRE;
116 ((wireType << WIRETYPE_INDEX)&WIRETYPE_MASK) |
117 ((
layer << LAYER_INDEX)&LAYER_MASK) |
118 ((
wire << WIRE_INDEX)&WIRE_MASK);
129 ((wireType << WIRETYPE_INDEX)&WIRETYPE_MASK) |
130 ((
layer << LAYER_INDEX)&LAYER_MASK) |
131 ((
wire << WIRE_INDEX)&WIRE_MASK);
140 return AXIAL_LAYER_MAX;
144 return STEREO_LAYER_MAX;
148 return AXIAL_WIRE_MAX;
152 return STEREO_WIRE_MAX;
static const unsigned int MDC_MASK
static const unsigned int MDC_INDEX
static const unsigned int MDC_ID
static value_type getAXIAL_LAYER_MAX()
static Identifier wire_id(int wireType, int layer, int wire)
For a single wire.
int layer_max(const Identifier &id)
Max/Min values for each field (error returns -999)
bool is_axial(const Identifier &id)
Test for axial and stereo wire.
static value_type getSTEREO_WIRE()
static bool values_ok(const unsigned int wireType, const unsigned int layer, const unsigned int wire)
static int layer(const Identifier &id)
Values of different levels (failure returns 0)
int wire_max(const Identifier &id)
static value_type getAXIAL_WIRE_MAX()
static int wire(const Identifier &id)
static value_type getIntID(unsigned int wireType, unsigned int layer, unsigned int wire)
static value_type getSTEREO_WIRE_MAX()
static value_type getSTEREO_LAYER_MAX()
static value_type getAXIAL_WIRE()