CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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:
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 { return m_mode; };
65 
66  void setmode(int mode) { m_mode = mode; };
67 
68  int line() const { return m_line; };
69 
70  void SetLineId(int);
71 
72  void setSpecs();
73 
75 
76  std::array<RPCWheel, 2> m_Wheels;
77  std::bitset<2> m_trigger;
78  std::map<int, std::bitset<2> > m_triggerBx;
79 
81  public:
83  m_bx = 0;
84  m_wedge = 0;
85  m_trigger.reset();
86  };
88 
89  void setTriggerBits(int bx, const std::bitset<2> &inbits) {
90  m_bx = bx;
91  m_trigger = inbits;
92  };
93 
94  void setTriggerBits(int bx, int wdg, const std::bitset<2> &inbits) {
95  m_bx = bx;
96  m_wedge = wdg;
97  m_trigger = inbits;
98  };
99 
100  int m_bx;
101  int m_wedge;
102  std::bitset<2> m_trigger;
103  };
104 
105  std::vector<TriggerResponse> m_triggerBxVec;
106 
107 protected:
108 private:
109  int m_id;
110  int m_bx;
111  int m_mode;
112  int m_line;
113 
114  std::array<int, 6> m_wheelIds;
115 
117 
118  std::array<TTUInput, 2> m_ttuin;
119 
120  std::unique_ptr<TTUConfiguration> m_ttuconf;
121 
122  bool m_debug;
123 };
124 #endif // TTUEMULATOR_H
std::bitset< 2 > m_trigger
Definition: TTUEmulator.h:77
std::array< int, 6 > m_wheelIds
Definition: TTUEmulator.h:114
std::array< RPCWheel, 2 > m_Wheels
Definition: TTUEmulator.h:76
std::vector< TriggerResponse > m_triggerBxVec
Definition: TTUEmulator.h:105
void printinfo() const
Definition: TTUEmulator.cc:232
int m_maxWheels
Definition: TTUEmulator.h:74
void clearTriggerResponse()
Definition: TTUEmulator.cc:228
std::unique_ptr< TTUConfiguration > m_ttuconf
Definition: TTUEmulator.h:120
std::bitset< 2 > m_trigger
Definition: TTUEmulator.h:102
void emulate()
Definition: TTUEmulator.cc:82
bool initialise()
Definition: TTUEmulator.cc:64
void SetLineId(int)
Definition: TTUEmulator.cc:80
void setTriggerBits(int bx, const std::bitset< 2 > &inbits)
Definition: TTUEmulator.h:89
void processTtu(RPCInputSignal *)
Definition: TTUEmulator.cc:88
int mode() const
Definition: TTUEmulator.h:64
std::map< int, std::bitset< 2 > > m_triggerBx
Definition: TTUEmulator.h:78
void setmode(int mode)
Definition: TTUEmulator.h:66
void setSpecs()
std::string m_logtype
Definition: TTUEmulator.h:116
std::array< TTUInput, 2 > m_ttuin
Definition: TTUEmulator.h:118
int line() const
Definition: TTUEmulator.h:68
void setSpecifications(const TTUBoardSpecs *, const RBCBoardSpecs *)
Definition: TTUEmulator.cc:52
TTUEmulator()
Standard constructor.
Definition: TTUEmulator.h:42
void setTriggerBits(int bx, int wdg, const std::bitset< 2 > &inbits)
Definition: TTUEmulator.h:94