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