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 
7 #include <boost/cstdint.hpp>
8 #include <ostream>
9 #include <sstream>
10 
12 
14 std::ostream& operator<< ( std::ostream&, const FedChannelConnection& );
15 
18 
27 
28  public:
29 
30  // ---------- Constructor ----------
31 
34  FedChannelConnection( const uint16_t& fec_crate,
35  const uint16_t& fec_slot,
36  const uint16_t& fec_ring,
37  const uint16_t& ccu_addr,
38  const uint16_t& ccu_chan,
39  const uint16_t& apv0 = 0,
40  const uint16_t& apv1 = 0,
41  const uint32_t& dcu_id = 0,
42  const uint32_t& det_id = 0,
43  const uint16_t& pairs = 0,
44  const uint16_t& fed_id = 0,
45  const uint16_t& fed_ch = 0,
46  const uint16_t& length = 0,
47  const bool& dcu = false,
48  const bool& pll = false,
49  const bool& mux = false,
50  const bool& lld = false );
51 
54 
57 
58  // ---------- Utility methods ----------
59 
61  bool isConnected() const;
62 
64  void consistencyCheck() const {;} //@@ TO BE IMPLEMENTED...
65 
67  void print( std::stringstream& ) const;
68 
70  void terse( std::stringstream& ) const;
71 
72  // -------------------- Module and detector information --------------------
73 
75  const uint32_t& dcuId() const;
76 
78  const uint32_t& detId() const;
79 
81  uint16_t nDetStrips() const;
82 
84  const uint16_t& nApvPairs() const;
85 
87  uint16_t nApvs() const;
88 
89  // -------------------- FED connection information --------------------
90 
93  uint16_t apvPairNumber() const;
94 
96  uint16_t lldChannel() const;
97 
99  const uint16_t& fedCrate() const;
100 
102  const uint16_t& fedSlot() const;
103 
105  const uint16_t& fedId() const;
106 
108  const uint16_t& fedCh() const;
109 
111  void fedCrate( uint16_t& fed_crate );
112 
114  void fedSlot( uint16_t& fed_slot );
115 
117  void fedId( uint16_t& fed_id );
118 
120  void fedCh( uint16_t& fed_ch );
121 
122  // -------------------- Control structure information --------------------
123 
125  const uint16_t& fecCrate() const;
126 
128  const uint16_t& fecSlot() const;
129 
131  const uint16_t& fecRing() const;
132 
134  const uint16_t& ccuAddr() const;
135 
137  const uint16_t& ccuChan() const;
138 
139  // -------------------- Front-end ASICs --------------------
140 
144  const uint16_t& i2cAddr( const uint16_t& apv0_or_1 ) const;
145 
147  const bool& dcu() const;
148 
150  const bool& mux() const;
151 
153  const bool& pll() const;
154 
156  const bool& lld() const;
157 
159  const uint16_t& fiberLength() const;
160 
161  private:
162 
163  // ---------- Private member data ----------
164 
165  // Control
166  uint16_t fecCrate_;
167  uint16_t fecSlot_;
168  uint16_t fecRing_;
169  uint16_t ccuAddr_;
170  uint16_t ccuChan_;
171 
172  // I2C addresses
173  uint16_t apv0_;
174  uint16_t apv1_;
175 
176  // Module / Detector
177  uint32_t dcuId_;
178  uint32_t detId_;
179  uint16_t nApvPairs_;
180 
181  // FED
182  uint16_t fedCrate_;
183  uint16_t fedSlot_;
184  uint16_t fedId_;
185  uint16_t fedCh_;
186  uint16_t length_;
187 
188  // Found devices
189  bool dcu0x00_;
190  bool mux0x43_;
191  bool pll0x44_;
192  bool lld0x60_;
193 
194 
196 };
197 
198 // ---------- inline methods ----------
199 
200 inline bool FedChannelConnection::isConnected() const {
201  return ( fedId_ != sistrip::invalid_ &&
203 }
204 
205 inline const uint16_t& FedChannelConnection::fecCrate() const { return fecCrate_; }
206 inline const uint16_t& FedChannelConnection::fecSlot() const { return fecSlot_; }
207 inline const uint16_t& FedChannelConnection::fecRing() const { return fecRing_; }
208 inline const uint16_t& FedChannelConnection::ccuAddr() const { return ccuAddr_; }
209 inline const uint16_t& FedChannelConnection::ccuChan() const { return ccuChan_; }
210 
211 inline const bool& FedChannelConnection::dcu() const { return dcu0x00_; }
212 inline const bool& FedChannelConnection::mux() const { return mux0x43_; }
213 inline const bool& FedChannelConnection::pll() const { return pll0x44_; }
214 inline const bool& FedChannelConnection::lld() const { return lld0x60_; }
215 
216 inline const uint32_t& FedChannelConnection::dcuId() const { return dcuId_; }
217 inline const uint32_t& FedChannelConnection::detId() const { return detId_; }
218 inline uint16_t FedChannelConnection::nDetStrips() const { return 256*nApvPairs_; }
219 inline const uint16_t& FedChannelConnection::nApvPairs() const { return nApvPairs_; }
220 inline uint16_t FedChannelConnection::nApvs() const { return 2*nApvPairs(); }
221 
222 inline const uint16_t& FedChannelConnection::fedCrate() const { return fedCrate_; }
223 inline const uint16_t& FedChannelConnection::fedSlot() const { return fedSlot_; }
224 inline const uint16_t& FedChannelConnection::fedId() const { return fedId_; }
225 inline const uint16_t& FedChannelConnection::fedCh() const { return fedCh_; }
226 
227 inline const uint16_t& FedChannelConnection::fiberLength() const { return length_; }
228 
229 inline void FedChannelConnection::fedId( uint16_t& fed_id ) { fedId_ = fed_id; }
230 inline void FedChannelConnection::fedCh( uint16_t& fed_ch ) { fedCh_ = fed_ch; }
231 inline void FedChannelConnection::fedCrate( uint16_t& fed_crate ) { fedCrate_ = fed_crate; }
232 inline void FedChannelConnection::fedSlot( uint16_t& fed_slot ) { fedSlot_ = fed_slot; }
233 
234 #endif // CondFormats_SiStripObjects_FedChannelConnection_H
235 
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
list pairs
sort tag files by run number