ATLAS Offline Software
Loading...
Searching...
No Matches
RPCdecoder Class Reference

#include <RPCdecoder.h>

Collaboration diagram for RPCdecoder:

Public Types

enum  value_type { Strip_Type , Logic_Sector , LVL1_Station , RPC_Layer }

Public Member Functions

 RPCdecoder ()
 RPCdecoder (unsigned int)
 RPCdecoder (int, int, int, int, int, int)
 RPCdecoder (ViewType, int, int, int, int, int)
 RPCdecoder (const RPCdecoder &deco)
RPCdecoderoperator= (const RPCdecoder &deco)
 ~RPCdecoder ()=default
RPCdecoderoperator() (unsigned int)
RPCdecoderoperator() (ViewType, int, int, int, int, int)
RPCdecoderoperator() (int, int, int, int, int, int)
 operator bool ()
bool OK (int, value_type) const
unsigned int code (void) const
int strip_type (void) const
int logic_sector (void) const
int lvl1_station (void) const
int rpc_layer (void) const
int rpc_z_index (void) const
int strip_number (void) const
int cabling_code (void) const
ViewType view (void) const
HalfType half_barrel (void) const
int side2type (ViewType side) const
void Print (std::ostream &, bool) const

Private Member Functions

void reset (void)
void reset_status (void)
void reset_data (void)
void set_indexes (unsigned int)
void set_code (int, int, int, int, int, int)
void fault_decoding (int, value_type)

Private Attributes

bool m_fail = false
unsigned int m_code = 0U
int m_strip_type = 0
int m_logic_sector = 0
int m_lvl1_station = 0
int m_rpc_layer = 0
int m_rpc_z_index = 0
int m_strip_number = 0

Static Private Attributes

static const int s_value_boundaries [4][2]
static const char s_value_descriptions [4][15] = {{"strip_type"}, {"logic_sector"}, {"lvl1_station"}, {"rpc_layer"}}

Detailed Description

Definition at line 13 of file RPCdecoder.h.

Member Enumeration Documentation

◆ value_type

Enumerator
Strip_Type 
Logic_Sector 
LVL1_Station 
RPC_Layer 

Definition at line 15 of file RPCdecoder.h.

Constructor & Destructor Documentation

◆ RPCdecoder() [1/5]

RPCdecoder::RPCdecoder ( )

Definition at line 23 of file RPCdecoder.cxx.

23{ this->reset(); }
void reset(void)

◆ RPCdecoder() [2/5]

RPCdecoder::RPCdecoder ( unsigned int code)

Definition at line 25 of file RPCdecoder.cxx.

25 {
26 this->reset();
27 this->set_indexes(code);
28}
unsigned int code(void) const
Definition RPCdecoder.h:64
void set_indexes(unsigned int)

◆ RPCdecoder() [3/5]

RPCdecoder::RPCdecoder ( int strip_type,
int logic_sector,
int lvl1_station,
int rpc_layer,
int rpc_z_index,
int strip_number )

Definition at line 30 of file RPCdecoder.cxx.

30 {
31 this->reset();
33}
int strip_type(void) const
Definition RPCdecoder.h:65
int rpc_layer(void) const
Definition RPCdecoder.h:68
int strip_number(void) const
Definition RPCdecoder.h:70
int lvl1_station(void) const
Definition RPCdecoder.h:67
int logic_sector(void) const
Definition RPCdecoder.h:66
void set_code(int, int, int, int, int, int)
int rpc_z_index(void) const
Definition RPCdecoder.h:69

◆ RPCdecoder() [4/5]

RPCdecoder::RPCdecoder ( ViewType side,
int logic_sector,
int lvl1_station,
int rpc_layer,
int rpc_z_index,
int strip_number )

Definition at line 35 of file RPCdecoder.cxx.

35 {
36 this->reset();
37 int strip_type = this->side2type(side);
39}
int side2type(ViewType side) const

◆ RPCdecoder() [5/5]

RPCdecoder::RPCdecoder ( const RPCdecoder & deco)

Definition at line 41 of file RPCdecoder.cxx.

41 {
42 this->reset();
43 this->set_indexes(deco.code());
44}

◆ ~RPCdecoder()

RPCdecoder::~RPCdecoder ( )
default

Member Function Documentation

◆ cabling_code()

int RPCdecoder::cabling_code ( void ) const
inline

Definition at line 71 of file RPCdecoder.h.

71{ return m_strip_number + m_rpc_z_index * 100 + m_rpc_layer * 10000; }
int m_rpc_z_index
Definition RPCdecoder.h:31
int m_rpc_layer
Definition RPCdecoder.h:30
int m_strip_number
Definition RPCdecoder.h:32

◆ code()

unsigned int RPCdecoder::code ( void ) const
inline

Definition at line 64 of file RPCdecoder.h.

64{ return m_code; }
unsigned int m_code
Definition RPCdecoder.h:25

◆ fault_decoding()

void RPCdecoder::fault_decoding ( int value,
value_type type )
private

Definition at line 72 of file RPCdecoder.cxx.

72 {
73 MsgStream log(Athena::getMessageSvc(), "RPCdecoder");
74 log << MSG::INFO << "fault_decoding() - RPC decoder error: received " << s_value_descriptions[type] << " = " << value
75 << " (min = " << s_value_boundaries[type][0] << ", max = " << s_value_boundaries[type][1] << ")" << endmsg;
76
77 m_fail = true;
78}
#define endmsg
static const int s_value_boundaries[4][2]
Definition RPCdecoder.h:14
static const char s_value_descriptions[4][15]
Definition RPCdecoder.h:20
bool m_fail
Definition RPCdecoder.h:22
IMessageSvc * getMessageSvc(bool quiet=false)

◆ half_barrel()

HalfType RPCdecoder::half_barrel ( void ) const

Definition at line 155 of file RPCdecoder.cxx.

155 {
156 if (m_logic_sector == -1) return NoHalf;
157 return (m_logic_sector < 32) ? Negative : Positive;
158}
@ NoHalf
Definition RPCdef.h:9
@ Positive
Definition RPCdef.h:9
@ Negative
Definition RPCdef.h:9
int m_logic_sector
Definition RPCdecoder.h:28

◆ logic_sector()

int RPCdecoder::logic_sector ( void ) const
inline

Definition at line 66 of file RPCdecoder.h.

66{ return m_logic_sector; }

◆ lvl1_station()

int RPCdecoder::lvl1_station ( void ) const
inline

Definition at line 67 of file RPCdecoder.h.

67{ return m_lvl1_station; }
int m_lvl1_station
Definition RPCdecoder.h:29

◆ OK()

bool RPCdecoder::OK ( int value,
value_type type ) const

Definition at line 80 of file RPCdecoder.cxx.

80 {
81 if (value >= s_value_boundaries[type][0] && value <= s_value_boundaries[type][1]) return true;
82 return false;
83}

◆ operator bool()

RPCdecoder::operator bool ( )
inline

Definition at line 59 of file RPCdecoder.h.

59{ return !m_fail; }

◆ operator()() [1/3]

RPCdecoder & RPCdecoder::operator() ( int strip_type,
int logic_sector,
int lvl1_station,
int rpc_layer,
int rpc_z_index,
int strip_number )

Definition at line 135 of file RPCdecoder.cxx.

135 {
136 this->reset();
138 return *this;
139}

◆ operator()() [2/3]

RPCdecoder & RPCdecoder::operator() ( unsigned int code)

Definition at line 129 of file RPCdecoder.cxx.

129 {
130 this->reset();
131 this->set_indexes(code);
132 return *this;
133}

◆ operator()() [3/3]

RPCdecoder & RPCdecoder::operator() ( ViewType side,
int logic_sector,
int lvl1_station,
int rpc_layer,
int rpc_z_index,
int strip_number )

Definition at line 141 of file RPCdecoder.cxx.

141 {
142 this->reset();
143 int strip_type = side2type(side);
145 return *this;
146}

◆ operator=()

RPCdecoder & RPCdecoder::operator= ( const RPCdecoder & deco)

Definition at line 48 of file RPCdecoder.cxx.

48 {
49 this->reset();
50 this->set_indexes(deco.code());
51 return *this;
52}

◆ Print()

void RPCdecoder::Print ( std::ostream & stream,
bool detail ) const

Definition at line 165 of file RPCdecoder.cxx.

165 {
166 unsigned int div = 247;
167 std::string half = (half_barrel() == Negative) ? "Negative" : "Positive";
168
169 stream << "RPC strip hash code " << code() << ":" << std::endl;
170 if (detail) {
171 stream << " half barrel = " << half << std::endl;
172 stream << " type (1=Phi/2=Eta) = " << strip_type() << std::endl;
173 stream << " logic sector (0" << (char)div << "63) = " << logic_sector() << std::endl;
174 stream << " level-1 station (1" << (char)div << "n) = " << lvl1_station() << std::endl;
175 stream << " RPC layer (0/1) = " << rpc_layer() << std::endl;
176 stream << " RPC z index (0" << (char)div << "n) = " << rpc_z_index() << std::endl;
177 stream << " RPC strip number (0" << (char)div << "n) = " << strip_number() << std::endl;
178 stream << " strip cabling code = " << cabling_code() << std::endl;
179 }
180}
int cabling_code(void) const
Definition RPCdecoder.h:71
HalfType half_barrel(void) const

◆ reset()

void RPCdecoder::reset ( void )
private

Definition at line 55 of file RPCdecoder.cxx.

55 {
56 this->reset_status();
57 this->reset_data();
58}
void reset_status(void)
void reset_data(void)

◆ reset_data()

void RPCdecoder::reset_data ( void )
private

Definition at line 60 of file RPCdecoder.cxx.

60 {
61 m_code = 0;
62 m_strip_type = -1;
63 m_logic_sector = -1;
64 m_lvl1_station = -1;
65 m_rpc_layer = -1;
66 m_rpc_z_index = -1;
67 m_strip_number = -1;
68}
int m_strip_type
Definition RPCdecoder.h:27

◆ reset_status()

void RPCdecoder::reset_status ( void )
private

Definition at line 70 of file RPCdecoder.cxx.

70{ m_fail = false; }

◆ rpc_layer()

int RPCdecoder::rpc_layer ( void ) const
inline

Definition at line 68 of file RPCdecoder.h.

68{ return m_rpc_layer; }

◆ rpc_z_index()

int RPCdecoder::rpc_z_index ( void ) const
inline

Definition at line 69 of file RPCdecoder.h.

69{ return m_rpc_z_index; }

◆ set_code()

void RPCdecoder::set_code ( int strip_type,
int logic_sector,
int lvl1_station,
int rpc_layer,
int rpc_z_index,
int strip_number )
private

Definition at line 85 of file RPCdecoder.cxx.

◆ set_indexes()

void RPCdecoder::set_indexes ( unsigned int code)
private

Definition at line 106 of file RPCdecoder.cxx.

106 {
107 m_strip_number = code % 100;
108 m_rpc_z_index = (code / 100) % 100;
109 m_rpc_layer = (code / 10000) % 10;
110 m_lvl1_station = (code / 100000) % 10;
111 m_logic_sector = (code / 1000000) % 100;
112 m_strip_type = code / 100000000;
113
118
119 if (m_fail) {
120 this->reset_data();
121 return;
122 }
123
124 m_code = code;
125}

◆ side2type()

int RPCdecoder::side2type ( ViewType side) const

Definition at line 160 of file RPCdecoder.cxx.

160 {
161 if (side == NoView) return -1;
162 return (side == Eta) ? 2 : 1;
163}
@ Eta
Definition RPCdef.h:8
@ NoView
Definition RPCdef.h:8

◆ strip_number()

int RPCdecoder::strip_number ( void ) const
inline

Definition at line 70 of file RPCdecoder.h.

70{ return m_strip_number; }

◆ strip_type()

int RPCdecoder::strip_type ( void ) const
inline

Definition at line 65 of file RPCdecoder.h.

65{ return m_strip_type; }

◆ view()

ViewType RPCdecoder::view ( void ) const

Definition at line 150 of file RPCdecoder.cxx.

150 {
151 if (m_strip_type == -1) return NoView;
152 return (m_strip_type == 1) ? Phi : Eta;
153}
@ Phi
Definition RPCdef.h:8

Member Data Documentation

◆ m_code

unsigned int RPCdecoder::m_code = 0U
private

Definition at line 25 of file RPCdecoder.h.

◆ m_fail

bool RPCdecoder::m_fail = false
private

Definition at line 22 of file RPCdecoder.h.

◆ m_logic_sector

int RPCdecoder::m_logic_sector = 0
private

Definition at line 28 of file RPCdecoder.h.

◆ m_lvl1_station

int RPCdecoder::m_lvl1_station = 0
private

Definition at line 29 of file RPCdecoder.h.

◆ m_rpc_layer

int RPCdecoder::m_rpc_layer = 0
private

Definition at line 30 of file RPCdecoder.h.

◆ m_rpc_z_index

int RPCdecoder::m_rpc_z_index = 0
private

Definition at line 31 of file RPCdecoder.h.

◆ m_strip_number

int RPCdecoder::m_strip_number = 0
private

Definition at line 32 of file RPCdecoder.h.

◆ m_strip_type

int RPCdecoder::m_strip_type = 0
private

Definition at line 27 of file RPCdecoder.h.

◆ s_value_boundaries

const int RPCdecoder::s_value_boundaries
staticprivate
Initial value:
= {
{1, 2},
{0, 63},
{1, 3},
{0, 1}
}

Definition at line 14 of file RPCdecoder.h.

14 :
16
17private:
18 static const int s_value_boundaries[4][2];
19 static const char s_value_descriptions[4][15];

◆ s_value_descriptions

const char RPCdecoder::s_value_descriptions = {{"strip_type"}, {"logic_sector"}, {"lvl1_station"}, {"rpc_layer"}}
staticprivate

Definition at line 20 of file RPCdecoder.h.


The documentation for this class was generated from the following files: