ATLAS Offline Software
RPCdecoder.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUONCABLINGTOOLS_RPCDECODER_H
6 #define MUONCABLINGTOOLS_RPCDECODER_H
7 
8 #include <iostream>
9 #include <sstream>
10 
12 
13 class RPCdecoder {
14 public:
16 
17 private:
18  static const int s_value_boundaries[4][2];
19  static const char s_value_descriptions[4][15];
20 
21 private:
22  bool m_fail = false;
23 
24 private:
25  unsigned int m_code = 0U;
26 
27  int m_strip_type = 0;
28  int m_logic_sector = 0;
29  int m_lvl1_station = 0;
30  int m_rpc_layer = 0;
31  int m_rpc_z_index = 0;
32  int m_strip_number = 0;
33 
34  void reset(void);
35  void reset_status(void);
36  void reset_data(void);
37 
38  void set_indexes(unsigned int);
39  void set_code(int, int, int, int, int, int);
40  void fault_decoding(int, value_type);
41 
42 public:
43  RPCdecoder();
44  RPCdecoder(unsigned int);
45  RPCdecoder(int, int, int, int, int, int);
46  RPCdecoder(ViewType, int, int, int, int, int);
47 
48  RPCdecoder(const RPCdecoder& deco);
49  RPCdecoder& operator=(const RPCdecoder& deco);
50 
51  ~RPCdecoder() = default;
52 
53 public:
54  RPCdecoder& operator()(unsigned int);
55  RPCdecoder& operator()(ViewType, int, int, int, int, int);
56  RPCdecoder& operator()(int, int, int, int, int, int);
57 
58 public:
59  operator bool() { return !m_fail; }
60 
61 public:
62  bool OK(int, value_type) const;
63 
64  unsigned int code(void) const { return m_code; }
65  int strip_type(void) const { return m_strip_type; }
66  int logic_sector(void) const { return m_logic_sector; }
67  int lvl1_station(void) const { return m_lvl1_station; }
68  int rpc_layer(void) const { return m_rpc_layer; }
69  int rpc_z_index(void) const { return m_rpc_z_index; }
70  int strip_number(void) const { return m_strip_number; }
71  int cabling_code(void) const { return m_strip_number + m_rpc_z_index * 100 + m_rpc_layer * 10000; }
72 
73  ViewType view(void) const;
74  HalfType half_barrel(void) const;
75  int side2type(ViewType side) const;
76 
77  void Print(std::ostream&, bool) const;
78 };
79 
80 #endif
RPCdecoder
Definition: RPCdecoder.h:13
RPCdecoder::OK
bool OK(int, value_type) const
Definition: RPCdecoder.cxx:80
RPCdecoder::rpc_layer
int rpc_layer(void) const
Definition: RPCdecoder.h:68
RPCdecoder::reset
void reset(void)
Definition: RPCdecoder.cxx:55
RPCdecoder::RPCdecoder
RPCdecoder()
Definition: RPCdecoder.cxx:23
RPCdecoder::m_logic_sector
int m_logic_sector
Definition: RPCdecoder.h:28
RPCdecoder::RPC_Layer
@ RPC_Layer
Definition: RPCdecoder.h:15
RPCdecoder::strip_number
int strip_number(void) const
Definition: RPCdecoder.h:70
RPCdecoder::Strip_Type
@ Strip_Type
Definition: RPCdecoder.h:15
RPCdecoder::set_indexes
void set_indexes(unsigned int)
Definition: RPCdecoder.cxx:106
RPCdecoder::Logic_Sector
@ Logic_Sector
Definition: RPCdecoder.h:15
RPCdecoder::m_strip_number
int m_strip_number
Definition: RPCdecoder.h:32
RPCdecoder::m_rpc_layer
int m_rpc_layer
Definition: RPCdecoder.h:30
RPCdecoder::m_rpc_z_index
int m_rpc_z_index
Definition: RPCdecoder.h:31
RPCdecoder::rpc_z_index
int rpc_z_index(void) const
Definition: RPCdecoder.h:69
RPCdecoder::LVL1_Station
@ LVL1_Station
Definition: RPCdecoder.h:15
RPCdecoder::side2type
int side2type(ViewType side) const
Definition: RPCdecoder.cxx:160
RPCdecoder::fault_decoding
void fault_decoding(int, value_type)
Definition: RPCdecoder.cxx:72
RPCdecoder::s_value_descriptions
static const char s_value_descriptions[4][15]
Definition: RPCdecoder.h:19
TRT::Hit::side
@ side
Definition: HitInfo.h:83
RPCdecoder::m_lvl1_station
int m_lvl1_station
Definition: RPCdecoder.h:29
RPCdecoder::strip_type
int strip_type(void) const
Definition: RPCdecoder.h:65
RPCdecoder::code
unsigned int code(void) const
Definition: RPCdecoder.h:64
RPCdecoder::~RPCdecoder
~RPCdecoder()=default
RPCdecoder::Print
void Print(std::ostream &, bool) const
Definition: RPCdecoder.cxx:165
ViewType
ViewType
Definition: RPCdef.h:8
RPCdecoder::set_code
void set_code(int, int, int, int, int, int)
Definition: RPCdecoder.cxx:85
RPCdef.h
RPCdecoder::lvl1_station
int lvl1_station(void) const
Definition: RPCdecoder.h:67
RPCdecoder::operator=
RPCdecoder & operator=(const RPCdecoder &deco)
Definition: RPCdecoder.cxx:48
RPCdecoder::reset_data
void reset_data(void)
Definition: RPCdecoder.cxx:60
RPCdecoder::s_value_boundaries
static const int s_value_boundaries[4][2]
Definition: RPCdecoder.h:18
RPCdecoder::reset_status
void reset_status(void)
Definition: RPCdecoder.cxx:70
RPCdecoder::m_fail
bool m_fail
Definition: RPCdecoder.h:22
RPCdecoder::m_code
unsigned int m_code
Definition: RPCdecoder.h:25
RPCdecoder::half_barrel
HalfType half_barrel(void) const
Definition: RPCdecoder.cxx:155
RPCdecoder::view
ViewType view(void) const
Definition: RPCdecoder.cxx:150
RPCdecoder::cabling_code
int cabling_code(void) const
Definition: RPCdecoder.h:71
RPCdecoder::logic_sector
int logic_sector(void) const
Definition: RPCdecoder.h:66
RPCdecoder::m_strip_type
int m_strip_type
Definition: RPCdecoder.h:27
value_type
Definition: EDM_MasterSearch.h:11
xAOD::bool
setBGCode setTAP setLVL2ErrorBits bool
Definition: TrigDecision_v1.cxx:60
HalfType
HalfType
Definition: RPCdef.h:9
RPCdecoder::operator()
RPCdecoder & operator()(unsigned int)
Definition: RPCdecoder.cxx:129