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
FedChannelConnection::fecSlot_
uint16_t fecSlot_
Definition: FedChannelConnection.h:165
FedChannelConnection::nApvPairs
const uint16_t & nApvPairs() const
Definition: FedChannelConnection.h:215
FedChannelConnection::lld0x60_
bool lld0x60_
Definition: FedChannelConnection.h:190
FedChannelConnection::ccuAddr_
uint16_t ccuAddr_
Definition: FedChannelConnection.h:167
FedChannelConnection::lldChannel
uint16_t lldChannel() const
Definition: FedChannelConnection.cc:106
FedChannelConnection::fecCrate
const uint16_t & fecCrate() const
Definition: FedChannelConnection.h:201
operator<<
std::ostream & operator<<(std::ostream &, const FedChannelConnection &)
Definition: FedChannelConnection.cc:195
FedChannelConnection::fedCh
const uint16_t & fedCh() const
Definition: FedChannelConnection.h:221
FedChannelConnection::apvPairNumberDebug
uint16_t apvPairNumberDebug() const
Definition: FedChannelConnection.cc:125
FedChannelConnection::i2cAddr
const uint16_t & i2cAddr(const uint16_t &apv0_or_1) const
Definition: FedChannelConnection.cc:89
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
FedChannelConnection::dcu0x00_
bool dcu0x00_
Definition: FedChannelConnection.h:187
FedChannelConnection::mux
const bool & mux() const
Definition: FedChannelConnection.h:208
FedChannelConnection::fecSlot
const uint16_t & fecSlot() const
Definition: FedChannelConnection.h:202
FedChannelConnection::fedId_
uint16_t fedId_
Definition: FedChannelConnection.h:182
FedChannelConnection::consistencyCheck
void consistencyCheck() const
Definition: FedChannelConnection.h:62
FedChannelConnection::dcuId_
uint32_t dcuId_
Definition: FedChannelConnection.h:175
FedChannelConnection::ccuChan_
uint16_t ccuChan_
Definition: FedChannelConnection.h:168
operator<
bool operator<(const FedChannelConnection &, const FedChannelConnection &)
Definition: FedChannelConnection.cc:77
FedChannelConnection::nDetStrips
uint16_t nDetStrips() const
Definition: FedChannelConnection.h:214
FedChannelConnection
Class containning control, module, detector and connection information, at the level of a FED channel...
Definition: FedChannelConnection.h:26
FedChannelConnection::isConnected
bool isConnected() const
Definition: FedChannelConnection.h:197
FedChannelConnection::length_
uint16_t length_
Definition: FedChannelConnection.h:184
FedChannelConnection::fedCh_
uint16_t fedCh_
Definition: FedChannelConnection.h:183
SiStripConstants.h
FedChannelConnection::ccuAddr
const uint16_t & ccuAddr() const
Definition: FedChannelConnection.h:204
FedChannelConnection::detId
const uint32_t & detId() const
Definition: FedChannelConnection.h:213
FedChannelConnection::fedCrate
const uint16_t & fedCrate() const
Definition: FedChannelConnection.h:218
Serializable.h
FedChannelConnection::print
void print(std::stringstream &) const
Definition: FedChannelConnection.cc:163
FedChannelConnection::pll
const bool & pll() const
Definition: FedChannelConnection.h:209
FedChannelConnection::terse
void terse(std::stringstream &) const
Definition: FedChannelConnection.cc:182
FedChannelConnection::fecRing_
uint16_t fecRing_
Definition: FedChannelConnection.h:166
FedChannelConnection::fedSlot
const uint16_t & fedSlot() const
Definition: FedChannelConnection.h:219
FedChannelConnection::mux0x43_
bool mux0x43_
Definition: FedChannelConnection.h:188
sistrip::invalid_
static const uint16_t invalid_
Definition: Constants.h:16
FedChannelConnection::apv0_
uint16_t apv0_
Definition: FedChannelConnection.h:171
FedChannelConnection::fiberLength
const uint16_t & fiberLength() const
Definition: FedChannelConnection.h:223
FedChannelConnection::fedId
const uint16_t & fedId() const
Definition: FedChannelConnection.h:220
FedChannelConnection::FedChannelConnection
FedChannelConnection()
Definition: FedChannelConnection.cc:52
FedChannelConnection::dcu
const bool & dcu() const
Definition: FedChannelConnection.h:207
FedChannelConnection::fecCrate_
uint16_t fecCrate_
Definition: FedChannelConnection.h:164
FedChannelConnection::detId_
uint32_t detId_
Definition: FedChannelConnection.h:176
FedChannelConnection::~FedChannelConnection
~FedChannelConnection()
Definition: FedChannelConnection.h:54
FedChannelConnection::fedSlot_
uint16_t fedSlot_
Definition: FedChannelConnection.h:181
FedChannelConnection::apvPairNumber
uint16_t apvPairNumber() const
Definition: FedChannelConnection.h:230
FedChannelConnection::lld
const bool & lld() const
Definition: FedChannelConnection.h:210
FedChannelConnection::nApvs
uint16_t nApvs() const
Definition: FedChannelConnection.h:216
FedChannelConnection::fedCrate_
uint16_t fedCrate_
Definition: FedChannelConnection.h:180
FedChannelConnection::dcuId
const uint32_t & dcuId() const
Definition: FedChannelConnection.h:212
FedChannelConnection::nApvPairs_
uint16_t nApvPairs_
Definition: FedChannelConnection.h:177
FedChannelConnection::ccuChan
const uint16_t & ccuChan() const
Definition: FedChannelConnection.h:205
FedChannelConnection::fecRing
const uint16_t & fecRing() const
Definition: FedChannelConnection.h:203
FedChannelConnection::pll0x44_
bool pll0x44_
Definition: FedChannelConnection.h:189
FedChannelConnection::apv1_
uint16_t apv1_
Definition: FedChannelConnection.h:172