Go to the documentation of this file.00001
00002 #ifndef TTUEMULATOR_H
00003 #define TTUEMULATOR_H 1
00004
00005
00006 #include "L1Trigger/RPCTechnicalTrigger/interface/RPCInputSignal.h"
00007 #include "L1Trigger/RPCTechnicalTrigger/interface/TTUConfiguration.h"
00008 #include "L1Trigger/RPCTechnicalTrigger/interface/RPCWheel.h"
00009
00010 #include "CondFormats/RPCObjects/interface/RBCBoardSpecs.h"
00011 #include "CondFormats/RPCObjects/interface/TTUBoardSpecs.h"
00012
00013 #include <map>
00014 #include <bitset>
00015
00038 class TTUEmulator {
00039 public:
00041 TTUEmulator( ) { };
00042
00043 TTUEmulator( int, int );
00044
00045 TTUEmulator( int, const char *, const char *, int );
00046
00047 TTUEmulator( int, const char *, const char * , const char *, int );
00048
00049 virtual ~TTUEmulator( );
00050
00051 bool initialise();
00052
00053 void emulate();
00054
00055 void processTtu( RPCInputSignal * );
00056
00057 void processTtu( RPCInputSignal * , int );
00058
00059 void printinfo();
00060
00061 void setSpecifications( const TTUBoardSpecs *, const RBCBoardSpecs *);
00062
00063 void clearTriggerResponse();
00064
00065 int mode() {
00066 return m_mode;
00067 };
00068
00069 void setmode(int mode) {
00070 m_mode = mode;
00071 };
00072
00073 int line() {
00074 return m_line;
00075 };
00076
00077 void SetLineId( int );
00078
00079 void setSpecs();
00080
00081 int m_maxWheels;
00082
00083 RPCWheel * m_Wheels;
00084 std::bitset<2> m_trigger;
00085 std::map<int, std::bitset<2> > m_triggerBx;
00086
00087 class TriggerResponse
00088 {
00089 public:
00090
00091 TriggerResponse() { m_bx = 0; m_wedge = 0; m_trigger.reset(); };
00092 ~TriggerResponse() {;};
00093
00094 void setTriggerBits( int bx , const std::bitset<2> & inbits )
00095 {
00096 m_bx = bx;
00097 m_trigger = inbits;
00098 };
00099
00100 void setTriggerBits( int bx , int wdg, const std::bitset<2> & inbits )
00101 {
00102 m_bx = bx;
00103 m_wedge = wdg;
00104 m_trigger = inbits;
00105 };
00106
00107 int m_bx;
00108 int m_wedge;
00109 std::bitset<2> m_trigger;
00110
00111 };
00112
00113 std::vector<TriggerResponse*> m_triggerBxVec;
00114
00115 protected:
00116
00117 private:
00118
00119 int m_id;
00120 int m_bx;
00121 int m_mode;
00122 int m_line;
00123
00124 int * m_wheelIds;
00125
00126 std::string m_logtype;
00127
00128 TTUInput * m_ttuin;
00129
00130 TTUConfiguration * m_ttuconf;
00131
00132 bool m_debug;
00133
00134
00135
00136 };
00137 #endif // TTUEMULATOR_H