CMS 3D CMS Logo

FedChannelConnection.h
Go to the documentation of this file.
1 #ifndef CondFormats_SiStripObjects_FedChannelConnection_H
2 #define CondFormats_SiStripObjects_FedChannelConnection_H
3 
5 
7 #include <ostream>
8 #include <sstream>
9 #include <cstdint>
10 
12 
14 std::ostream& operator<<(std::ostream&, const FedChannelConnection&);
15 
18 
27 public:
28  // ---------- Constructor ----------
29 
32  FedChannelConnection(const uint16_t& fec_crate,
33  const uint16_t& fec_slot,
34  const uint16_t& fec_ring,
35  const uint16_t& ccu_addr,
36  const uint16_t& ccu_chan,
37  const uint16_t& apv0 = 0,
38  const uint16_t& apv1 = 0,
39  const uint32_t& dcu_id = 0,
40  const uint32_t& det_id = 0,
41  const uint16_t& pairs = 0,
42  const uint16_t& fed_id = 0,
43  const uint16_t& fed_ch = 0,
44  const uint16_t& length = 0,
45  const bool& dcu = false,
46  const bool& pll = false,
47  const bool& mux = false,
48  const bool& lld = false);
49 
52 
55 
56  // ---------- Utility methods ----------
57 
59  bool isConnected() const;
60 
62  void consistencyCheck() const { ; } //@@ TO BE IMPLEMENTED...
63 
65  void print(std::stringstream&) const;
66 
68  void terse(std::stringstream&) const;
69 
70  // -------------------- Module and detector information --------------------
71 
73  const uint32_t& dcuId() const;
74 
76  const uint32_t& detId() const;
77 
79  uint16_t nDetStrips() const;
80 
82  const uint16_t& nApvPairs() const;
83 
85  uint16_t nApvs() const;
86 
87  // -------------------- FED connection information --------------------
88 
91  uint16_t apvPairNumber() const;
92  uint16_t apvPairNumberDebug() const;
93 
95  uint16_t lldChannel() const;
96 
98  const uint16_t& fedCrate() const;
99 
101  const uint16_t& fedSlot() const;
102 
104  const uint16_t& fedId() const;
105 
107  const uint16_t& fedCh() const;
108 
110  void fedCrate(uint16_t& fed_crate);
111 
113  void fedSlot(uint16_t& fed_slot);
114 
116  void fedId(uint16_t& fed_id);
117 
119  void fedCh(uint16_t& fed_ch);
120 
121  // -------------------- Control structure information --------------------
122 
124  const uint16_t& fecCrate() const;
125 
127  const uint16_t& fecSlot() const;
128 
130  const uint16_t& fecRing() const;
131 
133  const uint16_t& ccuAddr() const;
134 
136  const uint16_t& ccuChan() const;
137 
138  // -------------------- Front-end ASICs --------------------
139 
143  const uint16_t& i2cAddr(const uint16_t& apv0_or_1) const;
144 
146  const bool& dcu() const;
147 
149  const bool& mux() const;
150 
152  const bool& pll() const;
153 
155  const bool& lld() const;
156 
158  const uint16_t& fiberLength() const;
159 
160 private:
161  // ---------- Private member data ----------
162 
163  // Control
164  uint16_t fecCrate_;
165  uint16_t fecSlot_;
166  uint16_t fecRing_;
167  uint16_t ccuAddr_;
168  uint16_t ccuChan_;
169 
170  // I2C addresses
171  uint16_t apv0_;
172  uint16_t apv1_;
173 
174  // Module / Detector
175  uint32_t dcuId_;
176  uint32_t detId_;
177  uint16_t nApvPairs_;
178 
179  // FED
180  uint16_t fedCrate_;
181  uint16_t fedSlot_;
182  uint16_t fedId_;
183  uint16_t fedCh_;
184  uint16_t length_;
185 
186  // Found devices
187  bool dcu0x00_;
188  bool mux0x43_;
189  bool pll0x44_;
190  bool lld0x60_;
191 
193 };
194 
195 // ---------- inline methods ----------
196 
199 }
200 
201 inline const uint16_t& FedChannelConnection::fecCrate() const { return fecCrate_; }
202 inline const uint16_t& FedChannelConnection::fecSlot() const { return fecSlot_; }
203 inline const uint16_t& FedChannelConnection::fecRing() const { return fecRing_; }
204 inline const uint16_t& FedChannelConnection::ccuAddr() const { return ccuAddr_; }
205 inline const uint16_t& FedChannelConnection::ccuChan() const { return ccuChan_; }
206 
207 inline const bool& FedChannelConnection::dcu() const { return dcu0x00_; }
208 inline const bool& FedChannelConnection::mux() const { return mux0x43_; }
209 inline const bool& FedChannelConnection::pll() const { return pll0x44_; }
210 inline const bool& FedChannelConnection::lld() const { return lld0x60_; }
211 
212 inline const uint32_t& FedChannelConnection::dcuId() const { return dcuId_; }
213 inline const uint32_t& FedChannelConnection::detId() const { return detId_; }
214 inline uint16_t FedChannelConnection::nDetStrips() const { return 256 * nApvPairs_; }
215 inline const uint16_t& FedChannelConnection::nApvPairs() const { return nApvPairs_; }
216 inline uint16_t FedChannelConnection::nApvs() const { return 2 * nApvPairs(); }
217 
218 inline const uint16_t& FedChannelConnection::fedCrate() const { return fedCrate_; }
219 inline const uint16_t& FedChannelConnection::fedSlot() const { return fedSlot_; }
220 inline const uint16_t& FedChannelConnection::fedId() const { return fedId_; }
221 inline const uint16_t& FedChannelConnection::fedCh() const { return fedCh_; }
222 
223 inline const uint16_t& FedChannelConnection::fiberLength() const { return length_; }
224 
225 inline void FedChannelConnection::fedId(uint16_t& fed_id) { fedId_ = fed_id; }
226 inline void FedChannelConnection::fedCh(uint16_t& fed_ch) { fedCh_ = fed_ch; }
227 inline void FedChannelConnection::fedCrate(uint16_t& fed_crate) { fedCrate_ = fed_crate; }
228 inline void FedChannelConnection::fedSlot(uint16_t& fed_slot) { fedSlot_ = fed_slot; }
229 
230 inline uint16_t FedChannelConnection::apvPairNumber() const {
231  if (apv0_ == 32 || apv1_ == 33) {
232  return 0;
233  } else if (apv0_ == 34 || apv1_ == 35) {
234  return 1;
235  } else { // if (apv0_ == 36 || apv1_ == 37) {
236  return nApvPairs_ - 1;
237  }
238 }
239 
240 #endif // CondFormats_SiStripObjects_FedChannelConnection_H
const uint16_t & fecCrate() const
const uint16_t & ccuAddr() const
uint16_t apvPairNumberDebug() const
const uint16_t & fedSlot() const
const bool & dcu() const
uint16_t nDetStrips() const
const uint32_t & dcuId() const
const uint16_t & i2cAddr(const uint16_t &apv0_or_1) const
const uint16_t & fecSlot() const
void print(std::stringstream &) const
std::ostream & operator<<(std::ostream &, const FedChannelConnection &)
const uint16_t & fiberLength() const
bool operator<(const FedChannelConnection &, const FedChannelConnection &)
const bool & pll() const
Class containning control, module, detector and connection information, at the level of a FED channel...
const uint16_t & ccuChan() const
const uint16_t & fedId() const
const uint16_t & fecRing() const
const bool & lld() const
const uint32_t & detId() const
const uint16_t & fedCrate() const
const uint16_t & nApvPairs() const
static const uint16_t invalid_
Definition: Constants.h:16
#define COND_SERIALIZABLE
Definition: Serializable.h:39
uint16_t apvPairNumber() const
void terse(std::stringstream &) const
const bool & mux() const
const uint16_t & fedCh() const