CMS 3D CMS Logo

DTuROSControlData.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
12 //
13 //--------------------------------------------------
14 #ifndef DTDigi_DTuROSControlData_h
15 #define DTDigi_DTuROSControlData_h
16 
17 #include <vector>
18 
19 static const int DOCESLOTS = 12;
20 static const int SEISXOK = 12;
21 
23 
24 public:
25 
28  slot_ = -1;
29  for (int i=0; i<SEISXOK; i++) okxword_[i] = 0;
30  }
31 
34 
35  void setslot(int slot) {slot_ = slot;}
36 
37  void setheader1(long dword) {header1_ = dword;}
38 
39  void setheader2(long dword) {header2_ = dword;}
40 
41  void settrailer(long dword) {trailer_ = dword;}
42 
43  void setokword1(long okword) {okword1_ = okword;}
44 
45  void setokword2(long okword) {okword2_ = okword;}
46 
47  void setokxword(int i, long okxword) {okxword_[i] = okxword;}
48 
49  void setexword(long exword) {exword_.push_back(exword);}
50 
51  void seterror(int error) {error_.push_back(error);}
52 
53  int getslot() const {return slot_;}
54 
55  long getheader1() const {return header1_;}
56 
57  long getheader2() const {return header2_;}
58 
59  long gettrailer() const {return trailer_;}
60 
61  long getokword1() const {return okword1_;}
62 
63  long getokword2() const {return okword2_;}
64 
65  int getokflag(int i) const {if (i < 60) return ((okword1_ >> i)&0x1); return ((okword2_ >> (i-60))&0x1);}
66 
67  long getokxword(int i) const {return okxword_[i];}
68 
69  int getokxflag(int i) const {return ((okxword_[i/12] >> (5*(i%12)))&0x1F);}
70 
71  std::vector<long> getexwords() const {return exword_;}
72 
73  long getexword(int i) const {return exword_.at(i);}
74 
75  std::vector<int> geterrors() const {return error_;}
76 
77  int geterror(int i) const {return error_.at(i);}
78 
79  int geterrorROBID(int i) const {return (error_.at(i) >> 21)&0x7F;}
80 
81  int geterrorTDCID(int i) const {return (error_.at(i) >> 19)&0x3;}
82 
83  int geterrorFlag(int i) const {return (error_.at(i))&0x7FFF;}
84 
85  int getboardId() const {return (getheader2())&0xFFFF;}
86 
87  int getuserWord() const {return (getheader2() >> 32)&0xFFFFFFFF;}
88 
89 private:
90 
91  int slot_;
92 
94 
96 
97  std::vector<long> exword_;
98 
99  std::vector<int> error_;
100 
101 };
102 
103 
105 
106 public:
107 
109  DTuROSFEDData() {for (int i=0; i<DOCESLOTS; i++) rsize_[i] = 0;}
110 
113 
114  void setfed(int fed) {fed_ = fed;}
115 
116  void setheader1(long dword) {header1_ = dword;}
117 
118  void setheader2(long dword) {header2_ = dword;}
119 
120  void settrailer(long dword) {trailer_ = dword;}
121 
122  void setnslots(int nslots) {nslots_ = nslots;}
123 
124  void setevtlgth(int evtLgth) {evtLgth_ = evtLgth;}
125 
126  void setslotsize(int slot, int size) {rsize_[slot-1] = size;}
127 
128  void setuROS(int slot, DTuROSROSData rwords) {rdata_[slot-1] = rwords;}
129 
130  int getfed() const {return fed_;}
131 
132  long getheader1() const {return header1_;}
133 
134  long getheader2() const {return header2_;}
135 
136  long gettrailer() const {return trailer_;}
137 
138  int getnslots() const {return nslots_;}
139 
140  int getevtlgth() const {return evtLgth_;}
141 
142  int getslotsize(int slot) const {return rsize_[slot-1];}
143 
144  int getBXId() const {return (getheader1() >> 20)&0xFFF;}
145 
146  int getTTS() const {return (gettrailer() >> 4)&0xF;}
147 
148  DTuROSROSData getuROS(int slot) const {return rdata_[slot-1];}
149 
150 private:
151 
153 
154  int fed_, nslots_, evtLgth_, rsize_[DOCESLOTS];
155 
157 
158 };
159 
160 
161 typedef std::vector<DTuROSFEDData> DTuROSFEDDataCollection;
162 #endif
size
Write out results.
static const int SEISXOK
int getokflag(int i) const
void setuROS(int slot, DTuROSROSData rwords)
long gettrailer() const
std::vector< int > geterrors() const
void settrailer(long dword)
void setfed(int fed)
DTuROSROSData()
Constructor.
void settrailer(long dword)
int getevtlgth() const
int geterrorTDCID(int i) const
void setheader1(long dword)
void setokxword(int i, long okxword)
void seterror(int error)
~DTuROSROSData()
Destructor.
static const int DOCESLOTS
long getokxword(int i) const
DTuROSFEDData()
Constructor.
void setslotsize(int slot, int size)
long getheader2() const
void setexword(long exword)
std::vector< DTuROSFEDData > DTuROSFEDDataCollection
int getBXId() const
std::vector< long > exword_
DTuROSROSData getuROS(int slot) const
long getheader2() const
void setokword1(long okword)
long getokword1() const
int getokxflag(int i) const
std::vector< long > getexwords() const
void setheader2(long dword)
int getuserWord() const
void setheader1(long dword)
long getexword(int i) const
void setnslots(int nslots)
int getboardId() const
long gettrailer() const
void setslot(int slot)
void setheader2(long dword)
int geterror(int i) const
int geterrorROBID(int i) const
int geterrorFlag(int i) const
int getslotsize(int slot) const
std::vector< int > error_
int getslot() const
long getheader1() const
int getTTS() const
void setokword2(long okword)
long getokword2() const
int getnslots() const
int getfed() const
long okxword_[SEISXOK]
void setevtlgth(int evtLgth)
long getheader1() const
~DTuROSFEDData()
Destructor.