CMS 3D CMS Logo

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
TTUEmulator::m_Wheels
std::array< RPCWheel, 2 > m_Wheels
Definition: TTUEmulator.h:76
RBCBoardSpecs.h
TTUEmulator::setSpecifications
void setSpecifications(const TTUBoardSpecs *, const RBCBoardSpecs *)
Definition: TTUEmulator.cc:52
TTUConfiguration.h
TTUEmulator::m_trigger
std::bitset< 2 > m_trigger
Definition: TTUEmulator.h:77
TTUEmulator::TriggerResponse::setTriggerBits
void setTriggerBits(int bx, const std::bitset< 2 > &inbits)
Definition: TTUEmulator.h:89
TTUEmulator::TriggerResponse::m_trigger
std::bitset< 2 > m_trigger
Definition: TTUEmulator.h:102
TTUEmulator::mode
int mode() const
Definition: TTUEmulator.h:64
TTUBoardSpecs.h
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
TTUEmulator::m_triggerBxVec
std::vector< TriggerResponse > m_triggerBxVec
Definition: TTUEmulator.h:105
TTUEmulator::printinfo
void printinfo() const
Definition: TTUEmulator.cc:232
TTUEmulator::m_maxWheels
int m_maxWheels
Definition: TTUEmulator.h:74
TTUEmulator::m_ttuconf
std::unique_ptr< TTUConfiguration > m_ttuconf
Definition: TTUEmulator.h:120
TTUEmulator::TriggerResponse::~TriggerResponse
~TriggerResponse()
Definition: TTUEmulator.h:87
TTUEmulator::clearTriggerResponse
void clearTriggerResponse()
Definition: TTUEmulator.cc:228
TTUEmulator::m_mode
int m_mode
Definition: TTUEmulator.h:111
TTUEmulator::initialise
bool initialise()
Definition: TTUEmulator.cc:64
RBCBoardSpecs
Definition: RBCBoardSpecs.h:17
TTUEmulator::emulate
void emulate()
Definition: TTUEmulator.cc:82
TTUEmulator::SetLineId
void SetLineId(int)
Definition: TTUEmulator.cc:80
RPCInputSignal
Definition: RPCInputSignal.h:12
TTUEmulator::TriggerResponse
Definition: TTUEmulator.h:80
TTUBoardSpecs
Definition: TTUBoardSpecs.h:18
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TTUEmulator::TriggerResponse::TriggerResponse
TriggerResponse()
Definition: TTUEmulator.h:82
TTUEmulator::processTtu
void processTtu(RPCInputSignal *)
Definition: TTUEmulator.cc:88
TTUEmulator::m_id
int m_id
Definition: TTUEmulator.h:109
TTUEmulator::m_logtype
std::string m_logtype
Definition: TTUEmulator.h:116
TTUEmulator::TriggerResponse::m_wedge
int m_wedge
Definition: TTUEmulator.h:101
TTUEmulator
Definition: TTUEmulator.h:39
TTUEmulator::m_debug
bool m_debug
Definition: TTUEmulator.h:122
TTUEmulator::m_line
int m_line
Definition: TTUEmulator.h:112
TTUEmulator::m_bx
int m_bx
Definition: TTUEmulator.h:110
RPCWheel.h
TTUEmulator::m_triggerBx
std::map< int, std::bitset< 2 > > m_triggerBx
Definition: TTUEmulator.h:78
TTUEmulator::TriggerResponse::m_bx
int m_bx
Definition: TTUEmulator.h:98
RPCInputSignal.h
TTUEmulator::setmode
void setmode(int mode)
Definition: TTUEmulator.h:66
TTUEmulator::setSpecs
void setSpecs()
TTUEmulator::TTUEmulator
TTUEmulator()
Standard constructor.
Definition: TTUEmulator.h:42
TTUEmulator::TriggerResponse::setTriggerBits
void setTriggerBits(int bx, int wdg, const std::bitset< 2 > &inbits)
Definition: TTUEmulator.h:94
TTUEmulator::m_ttuin
std::array< TTUInput, 2 > m_ttuin
Definition: TTUEmulator.h:118
TTUEmulator::line
int line() const
Definition: TTUEmulator.h:68
TTUEmulator::m_wheelIds
std::array< int, 6 > m_wheelIds
Definition: TTUEmulator.h:114