CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripModule.h
Go to the documentation of this file.
1 // Last commit: $Id: SiStripModule.h,v 1.12 2008/02/06 16:40:42 bainbrid Exp $
2 
3 #ifndef CalibFormats_SiStripObjects_SiStripModule_H
4 #define CalibFormats_SiStripObjects_SiStripModule_H
5 
8 #include <boost/cstdint.hpp>
9 #include <sstream>
10 #include <ostream>
11 #include <vector>
12 #include <map>
13 
14 class SiStripModule;
15 
17 std::ostream& operator<< ( std::ostream&, const SiStripModule& );
18 
26 
27  public:
28 
29  // ---------- Constructors and adding devices ----------
30 
33 
36 
38  void addDevices( const FedChannelConnection& conn );
39 
40  // ---------- Typedefs and enums ----------
41 
43  typedef std::pair<uint16_t,uint16_t> PairOfU16;
44 
46  //typedef PairOfU16 FedChannel;
47  class FedChannel {
48  public:
49  uint16_t fedCrate_;
50  uint16_t fedSlot_;
51  uint16_t fedId_;
52  uint16_t fedCh_;
53  FedChannel( const uint16_t& crate, const uint16_t& slot, const uint16_t& id, const uint16_t& ch ) :
54  fedCrate_(crate), fedSlot_(slot), fedId_(id), fedCh_(ch) {;}
55  FedChannel() : fedCrate_(0), fedSlot_(0), fedId_(0), fedCh_(0) {;}
56  };
57 
58 
60  typedef std::map< uint16_t, FedChannel > FedCabling;
61 
62  // ---------- Control structure ----------
63 
64  inline const uint16_t& fecCrate() const;
65  inline const uint16_t& fecSlot() const;
66  inline const uint16_t& fecRing() const;
67  inline const uint16_t& ccuAddr() const;
68  inline const uint16_t& ccuChan() const;
69 
72  inline const SiStripFecKey& key() const;
73 
74  // ---------- APV devices ----------
75 
77  std::vector<uint16_t> activeApvs() const;
78 
82  const uint16_t& activeApv( const uint16_t& apv_address ) const;
83 
86  PairOfU16 activeApvPair( const uint16_t& lld_channel ) const;
87 
89  void addApv( const uint16_t& apv_address );
90 
91  // ---------- Other hybrid devices ----------
92 
94  inline const uint16_t& dcu() const;
95 
97  inline const uint16_t& mux() const;
98 
100  inline const uint16_t& pll() const;
101 
103  inline const uint16_t& lld() const;
104 
105  // ---------- Module information ----------
106 
108  inline const uint32_t& dcuId() const;
109 
111  uint16_t lldChannel( const uint16_t& apv_pair_num ) const;
112 
114  inline void dcuId( const uint32_t& dcu_id );
115 
116  // ---------- Detector information ----------
117 
119  inline const uint32_t& detId() const;
120 
122  uint16_t apvPairNumber( const uint16_t& lld_channel ) const;
123 
125  inline const uint16_t& nApvPairs() const;
126 
128  inline uint16_t nDetStrips() const;
129 
131  inline void detId( const uint32_t& det_id );
132 
134  void nApvPairs( const uint16_t& npairs );
135 
136  // ---------- FED connection information ----------
137 
139  inline const FedCabling& fedChannels() const;
140 
142  FedChannel fedCh( const uint16_t& apv_pair_num ) const;
143 
146  bool fedCh( const uint16_t& apv_address,
147  const FedChannel& fed_ch );
148 
149  // ---------- Miscellaneous ----------
150 
152  void print( std::stringstream& ) const;
153 
155  void terse( std::stringstream& ) const;
156 
158  inline const uint16_t& length() const;
159 
161  inline void length( const uint16_t& length );
162 
163  private:
164 
167 
168  // APVs found (identified by decimal I2C address)
169  uint16_t apv32_;
170  uint16_t apv33_;
171  uint16_t apv34_;
172  uint16_t apv35_;
173  uint16_t apv36_;
174  uint16_t apv37_;
175 
176  // Devices found (with hex addr)
177  uint16_t dcu0x00_;
178  uint16_t mux0x43_;
179  uint16_t pll0x44_;
180  uint16_t lld0x60_;
181 
182  // Detector
183  uint32_t dcuId_;
184  uint32_t detId_;
185  uint16_t nApvPairs_;
186 
189  uint16_t length_;
190 
191 };
192 
193 // --------------- inline methods ---------------
194 
195 const uint16_t& SiStripModule::fecCrate() const { return key_.fecCrate(); }
196 const uint16_t& SiStripModule::fecSlot() const { return key_.fecSlot(); }
197 const uint16_t& SiStripModule::fecRing() const { return key_.fecRing(); }
198 const uint16_t& SiStripModule::ccuAddr() const { return key_.ccuAddr(); }
199 const uint16_t& SiStripModule::ccuChan() const { return key_.ccuChan(); }
200 
201 const SiStripFecKey& SiStripModule::key() const { return key_; }
202 
203 const uint32_t& SiStripModule::dcuId() const { return dcuId_; }
204 const uint32_t& SiStripModule::detId() const { return detId_; }
205 const uint16_t& SiStripModule::nApvPairs() const { return nApvPairs_; }
206 uint16_t SiStripModule::nDetStrips() const { return 256*nApvPairs_; }
207 
208 void SiStripModule::dcuId( const uint32_t& dcu_id ) { if ( dcu_id ) { dcuId_ = dcu_id; dcu0x00_ = true; } }
209 void SiStripModule::detId( const uint32_t& det_id ) { if ( det_id ) { detId_ = det_id; } }
211 
212 const uint16_t& SiStripModule::length() const { return length_; }
213 void SiStripModule::length( const uint16_t& length ) { length_ = length; }
214 
215 const uint16_t& SiStripModule::dcu() const { return dcu0x00_; }
216 const uint16_t& SiStripModule::mux() const { return mux0x43_; }
217 const uint16_t& SiStripModule::pll() const { return pll0x44_; }
218 const uint16_t& SiStripModule::lld() const { return lld0x60_; }
219 
220 #endif // CalibTracker_SiStripObjects_SiStripModule_H
221 
222 
Device and connection information at the level of a front-end module.
Definition: SiStripModule.h:25
uint16_t apv35_
void terse(std::stringstream &) const
uint16_t pll0x44_
std::vector< uint16_t > activeApvs() const
SiStripFecKey key_
const uint16_t & fecRing() const
uint32_t dcuId_
void print(std::stringstream &) const
const SiStripFecKey & key() const
uint16_t apv37_
void addDevices(const FedChannelConnection &conn)
const uint16_t & fecSlot() const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
uint16_t apv33_
const FedCabling & fedChannels() const
uint16_t apvPairNumber(const uint16_t &lld_channel) const
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
Definition: SiStripFecKey.h:46
const uint16_t & length() const
const uint16_t & pll() const
Class containning control, module, detector and connection information, at the level of a FED channel...
uint16_t apv32_
uint16_t mux0x43_
const uint16_t & dcu() const
uint16_t nDetStrips() const
uint16_t lldChannel(const uint16_t &apv_pair_num) const
const uint16_t & ccuChan() const
uint32_t detId_
void addApv(const uint16_t &apv_address)
const uint16_t & fecSlot() const
const uint16_t & fecRing() const
const uint16_t & fecCrate() const
PairOfU16 activeApvPair(const uint16_t &lld_channel) const
const uint16_t & nApvPairs() const
const uint16_t & fecCrate() const
const uint32_t & dcuId() const
const uint16_t & mux() const
const uint16_t & ccuAddr() const
std::pair< uint16_t, uint16_t > PairOfU16
Definition: SiStripModule.h:43
const uint32_t & detId() const
FedCabling cabling_
const uint16_t & lld() const
uint16_t lld0x60_
uint16_t length_
FedChannel fedCh(const uint16_t &apv_pair_num) const
const uint16_t & ccuChan() const
uint16_t apv34_
uint16_t nApvPairs_
std::map< uint16_t, FedChannel > FedCabling
Definition: SiStripModule.h:60
const uint16_t & ccuAddr() const
FedChannel(const uint16_t &crate, const uint16_t &slot, const uint16_t &id, const uint16_t &ch)
Definition: SiStripModule.h:53
tuple conn
Definition: results_mgr.py:53
const uint16_t & activeApv(const uint16_t &apv_address) const
SiStripModule(const FedChannelConnection &conn)
uint16_t apv36_
uint16_t dcu0x00_