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 public:
26  for (int i = 0; i < SEISXOK; i++)
27  okxword_[i] = 0;
28  }
29 
32 
33  void setslot(int slot) { slot_ = slot; }
34 
35  void setheader1(long dword) { header1_ = dword; }
36 
37  void setheader2(long dword) { header2_ = dword; }
38 
39  void settrailer(long dword) { trailer_ = dword; }
40 
41  void setokword1(long okword) { okword1_ = okword; }
42 
43  void setokword2(long okword) { okword2_ = okword; }
44 
45  void setokxword(int i, long okxword) { okxword_[i] = okxword; }
46 
47  void setexword(long exword) { exword_.push_back(exword); }
48 
49  void seterror(int error) { error_.push_back(error); }
50 
51  int getslot() const { return slot_; }
52 
53  long getheader1() const { return header1_; }
54 
55  long getheader2() const { return header2_; }
56 
57  long gettrailer() const { return trailer_; }
58 
59  long getokword1() const { return okword1_; }
60 
61  long getokword2() const { return okword2_; }
62 
63  int getokflag(int i) const {
64  if (i < 60)
65  return ((okword1_ >> i) & 0x1);
66  return ((okword2_ >> (i - 60)) & 0x1);
67  }
68 
69  long getokxword(int i) const { return okxword_[i]; }
70 
71  int getokxflag(int i) const { return ((okxword_[i / 12] >> (5 * (i % 12))) & 0x1F); }
72 
73  std::vector<long> getexwords() const { return exword_; }
74 
75  long getexword(int i) const { return exword_.at(i); }
76 
77  std::vector<int> geterrors() const { return error_; }
78 
79  int geterror(int i) const { return error_.at(i); }
80 
81  int geterrorROBID(int i) const { return (error_.at(i) >> 21) & 0x7F; }
82 
83  int geterrorTDCID(int i) const { return (error_.at(i) >> 19) & 0x3; }
84 
85  int geterrorFlag(int i) const { return (error_.at(i)) & 0x7FFF; }
86 
87  int getboardId() const { return (getheader2()) & 0xFFFF; }
88 
89  int getuserWord() const { return (getheader2() >> 32) & 0xFFFFFFFF; }
90 
91 private:
92  int slot_;
93 
95 
97 
98  std::vector<long> exword_;
99 
100  std::vector<int> error_;
101 };
102 
104 public:
107  for (int i = 0; i < DOCESLOTS; i++)
108  rsize_[i] = 0;
109  }
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:
152 
154 
156 };
157 
158 typedef std::vector<DTuROSFEDData> DTuROSFEDDataCollection;
159 #endif
int geterror(int i) const
size
Write out results.
static const int SEISXOK
void setuROS(int slot, DTuROSROSData rwords)
long getheader2() const
void settrailer(long dword)
int getevtlgth() const
void setfed(int fed)
DTuROSROSData()
Constructor.
DTuROSROSData rdata_[DOCESLOTS]
void settrailer(long dword)
DTuROSROSData getuROS(int slot) const
int geterrorFlag(int i) const
std::vector< int > geterrors() const
int rsize_[DOCESLOTS]
int getBXId() const
long getheader2() const
void setheader1(long dword)
long getokxword(int i) const
int getfed() const
int getokxflag(int i) const
void setokxword(int i, long okxword)
void seterror(int error)
~DTuROSROSData()
Destructor.
long getheader1() const
static const int DOCESLOTS
DTuROSFEDData()
Constructor.
int getboardId() const
void setslotsize(int slot, int size)
long gettrailer() const
long getokword2() const
int geterrorROBID(int i) const
std::vector< long > getexwords() const
void setexword(long exword)
int getokflag(int i) const
std::vector< DTuROSFEDData > DTuROSFEDDataCollection
int getslot() const
std::vector< long > exword_
void setokword1(long okword)
int getnslots() const
void setheader2(long dword)
int getTTS() const
long getokword1() const
void setheader1(long dword)
int getuserWord() const
void setnslots(int nslots)
void setslot(int slot)
void setheader2(long dword)
long gettrailer() const
std::vector< int > error_
void setokword2(long okword)
long getheader1() const
long okxword_[SEISXOK]
void setevtlgth(int evtLgth)
int getslotsize(int slot) const
~DTuROSFEDData()
Destructor.
long getexword(int i) const
int geterrorTDCID(int i) const