CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TTUEmulator.h
Go to the documentation of this file.
1 #ifndef TTUEMULATOR_H
2 #define TTUEMULATOR_H 1
3 
4 // Include files
8 
11 
12 #include <map>
13 #include <bitset>
14 #include <array>
15 #include <memory>
16 
39 class TTUEmulator {
40 public:
42  TTUEmulator( ) { };
43 
44  TTUEmulator( int, int );
45 
46  TTUEmulator( int, const char *, const char *, int );
47 
48  TTUEmulator( int, const char *, const char * , const char *, int );
49 
50  bool initialise();
51 
52  void emulate();
53 
54  void processTtu( RPCInputSignal * );
55 
56  void processTtu( RPCInputSignal * , int );
57 
58  void printinfo() const;
59 
60  void setSpecifications( const TTUBoardSpecs *, const RBCBoardSpecs *);
61 
62  void clearTriggerResponse();
63 
64  int mode() const {
65  return m_mode;
66  };
67 
68  void setmode(int mode) {
69  m_mode = mode;
70  };
71 
72  int line() const {
73  return m_line;
74  };
75 
76  void SetLineId( int );
77 
78  void setSpecs();
79 
81 
82  std::array<RPCWheel,2> m_Wheels;
83  std::bitset<2> m_trigger;
84  std::map<int, std::bitset<2> > m_triggerBx;
85 
87  {
88  public:
89 
90  TriggerResponse() { m_bx = 0; m_wedge = 0; m_trigger.reset(); };
92 
93  void setTriggerBits( int bx , const std::bitset<2> & inbits )
94  {
95  m_bx = bx;
96  m_trigger = inbits;
97  };
98 
99  void setTriggerBits( int bx , int wdg, const std::bitset<2> & inbits )
100  {
101  m_bx = bx;
102  m_wedge = wdg;
103  m_trigger = inbits;
104  };
105 
106  int m_bx;
107  int m_wedge;
108  std::bitset<2> m_trigger;
109 
110  };
111 
112  std::vector<TriggerResponse> m_triggerBxVec;
113 
114 protected:
115 
116 private:
117 
118  int m_id;
119  int m_bx;
120  int m_mode;
121  int m_line;
122 
123  std::array<int,6> m_wheelIds;
124 
126 
127  std::array<TTUInput,2> m_ttuin;
128 
129  std::unique_ptr<TTUConfiguration> m_ttuconf;
130 
131  bool m_debug;
132 
133 
134 
135 };
136 #endif // TTUEMULATOR_H
std::bitset< 2 > m_trigger
Definition: TTUEmulator.h:83
std::vector< TriggerResponse > m_triggerBxVec
Definition: TTUEmulator.h:112
void printinfo() const
Definition: TTUEmulator.cc:275
int m_maxWheels
Definition: TTUEmulator.h:80
void clearTriggerResponse()
Definition: TTUEmulator.cc:268
std::unique_ptr< TTUConfiguration > m_ttuconf
Definition: TTUEmulator.h:129
std::bitset< 2 > m_trigger
Definition: TTUEmulator.h:108
void emulate()
Definition: TTUEmulator.cc:100
bool initialise()
Definition: TTUEmulator.cc:79
std::array< int, 6 > m_wheelIds
Definition: TTUEmulator.h:123
std::array< TTUInput, 2 > m_ttuin
Definition: TTUEmulator.h:127
void SetLineId(int)
Definition: TTUEmulator.cc:95
void setTriggerBits(int bx, const std::bitset< 2 > &inbits)
Definition: TTUEmulator.h:93
void processTtu(RPCInputSignal *)
Definition: TTUEmulator.cc:108
std::array< RPCWheel, 2 > m_Wheels
Definition: TTUEmulator.h:82
int mode() const
Definition: TTUEmulator.h:64
std::map< int, std::bitset< 2 > > m_triggerBx
Definition: TTUEmulator.h:84
void setmode(int mode)
Definition: TTUEmulator.h:68
void setSpecs()
std::string m_logtype
Definition: TTUEmulator.h:125
int line() const
Definition: TTUEmulator.h:72
void setSpecifications(const TTUBoardSpecs *, const RBCBoardSpecs *)
Definition: TTUEmulator.cc:64
TTUEmulator()
Standard constructor.
Definition: TTUEmulator.h:42
void setTriggerBits(int bx, int wdg, const std::bitset< 2 > &inbits)
Definition: TTUEmulator.h:99