CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FedChannelConnection.h
Go to the documentation of this file.
1 #ifndef CondFormats_SiStripObjects_FedChannelConnection_H
2 #define CondFormats_SiStripObjects_FedChannelConnection_H
3 
5 #include <boost/cstdint.hpp>
6 #include <ostream>
7 #include <sstream>
8 
10 
12 std::ostream& operator<< ( std::ostream&, const FedChannelConnection& );
13 
16 
25 
26  public:
27 
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 
94  uint16_t lldChannel() const;
95 
97  const uint16_t& fedCrate() const;
98 
100  const uint16_t& fedSlot() const;
101 
103  const uint16_t& fedId() const;
104 
106  const uint16_t& fedCh() const;
107 
109  void fedCrate( uint16_t& fed_crate );
110 
112  void fedSlot( uint16_t& fed_slot );
113 
115  void fedId( uint16_t& fed_id );
116 
118  void fedCh( uint16_t& fed_ch );
119 
120  // -------------------- Control structure information --------------------
121 
123  const uint16_t& fecCrate() const;
124 
126  const uint16_t& fecSlot() const;
127 
129  const uint16_t& fecRing() const;
130 
132  const uint16_t& ccuAddr() const;
133 
135  const uint16_t& ccuChan() const;
136 
137  // -------------------- Front-end ASICs --------------------
138 
142  const uint16_t& i2cAddr( const uint16_t& apv0_or_1 ) const;
143 
145  const bool& dcu() const;
146 
148  const bool& mux() const;
149 
151  const bool& pll() const;
152 
154  const bool& lld() const;
155 
157  const uint16_t& fiberLength() const;
158 
159  private:
160 
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 
192 };
193 
194 // ---------- inline methods ----------
195 
196 inline bool FedChannelConnection::isConnected() const {
197  return ( fedId_ != sistrip::invalid_ &&
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 #endif // CondFormats_SiStripObjects_FedChannelConnection_H
231 
const uint16_t & fecSlot() const
const uint16_t & fecCrate() const
const bool & lld() const
const uint16_t & fedCh() const
uint16_t apvPairNumber() const
void terse(std::stringstream &) const
void print(std::stringstream &) const
uint16_t lldChannel() const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
const uint16_t & fedId() const
bool operator<(const FedChannelConnection &, const FedChannelConnection &)
const uint16_t & fecRing() const
const uint16_t & fedSlot() const
const uint32_t & detId() const
Class containning control, module, detector and connection information, at the level of a FED channel...
const uint16_t & ccuChan() const
const bool & mux() const
const bool & dcu() const
const uint16_t & ccuAddr() const
const uint32_t & dcuId() const
void consistencyCheck() const
const uint16_t & nApvPairs() const
static const uint16_t invalid_
Definition: Constants.h:16
const bool & pll() const
const uint16_t & fedCrate() const
const uint16_t & fiberLength() const
uint16_t nDetStrips() const
const uint16_t & i2cAddr(const uint16_t &apv0_or_1) const