test
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 
2 #ifndef CalibFormats_SiStripObjects_SiStripModule_H
3 #define CalibFormats_SiStripObjects_SiStripModule_H
4 
7 #include <boost/cstdint.hpp>
8 #include <sstream>
9 #include <ostream>
10 #include <vector>
11 #include <map>
12 
13 class SiStripModule;
14 
16 std::ostream& operator<< ( std::ostream&, const SiStripModule& );
17 
25 
26  public:
27 
28  // ---------- Constructors and adding devices ----------
29 
31  SiStripModule( const FedChannelConnection& conn );
32 
35 
37  void addDevices( const FedChannelConnection& conn );
38 
39  // ---------- Typedefs and enums ----------
40 
42  typedef std::pair<uint16_t,uint16_t> PairOfU16;
43 
45  //typedef PairOfU16 FedChannel;
46  class FedChannel {
47  public:
48  uint16_t fedCrate_;
49  uint16_t fedSlot_;
50  uint16_t fedId_;
51  uint16_t fedCh_;
52  FedChannel( const uint16_t& crate, const uint16_t& slot, const uint16_t& id, const uint16_t& ch ) :
53  fedCrate_(crate), fedSlot_(slot), fedId_(id), fedCh_(ch) {;}
54  FedChannel() : fedCrate_(0), fedSlot_(0), fedId_(0), fedCh_(0) {;}
55  };
56 
57 
59  typedef std::map< uint16_t, FedChannel > FedCabling;
60 
61  // ---------- Control structure ----------
62 
63  inline const uint16_t& fecCrate() const;
64  inline const uint16_t& fecSlot() const;
65  inline const uint16_t& fecRing() const;
66  inline const uint16_t& ccuAddr() const;
67  inline const uint16_t& ccuChan() const;
68 
71  inline const SiStripFecKey& key() const;
72 
73  // ---------- APV devices ----------
74 
76  std::vector<uint16_t> activeApvs() const;
77 
81  const uint16_t& activeApv( const uint16_t& apv_address ) const;
82 
85  PairOfU16 activeApvPair( const uint16_t& lld_channel ) const;
86 
88  void addApv( const uint16_t& apv_address );
89 
90  // ---------- Other hybrid devices ----------
91 
93  inline const uint16_t& dcu() const;
94 
96  inline const uint16_t& mux() const;
97 
99  inline const uint16_t& pll() const;
100 
102  inline const uint16_t& lld() const;
103 
104  // ---------- Module information ----------
105 
107  inline const uint32_t& dcuId() const;
108 
110  uint16_t lldChannel( const uint16_t& apv_pair_num ) const;
111 
113  inline void dcuId( const uint32_t& dcu_id );
114 
115  // ---------- Detector information ----------
116 
118  inline const uint32_t& detId() const;
119 
121  uint16_t apvPairNumber( const uint16_t& lld_channel ) const;
122 
124  inline const uint16_t& nApvPairs() const;
125 
127  inline uint16_t nDetStrips() const;
128 
130  inline void detId( const uint32_t& det_id );
131 
133  void nApvPairs( const uint16_t& npairs );
134 
135  // ---------- FED connection information ----------
136 
138  inline const FedCabling& fedChannels() const;
139 
141  FedChannel fedCh( const uint16_t& apv_pair_num ) const;
142 
145  bool fedCh( const uint16_t& apv_address,
146  const FedChannel& fed_ch );
147 
148  // ---------- Miscellaneous ----------
149 
151  void print( std::stringstream& ) const;
152 
154  void terse( std::stringstream& ) const;
155 
157  inline const uint16_t& length() const;
158 
160  inline void length( const uint16_t& length );
161 
162  private:
163 
166 
167  // APVs found (identified by decimal I2C address)
168  uint16_t apv32_;
169  uint16_t apv33_;
170  uint16_t apv34_;
171  uint16_t apv35_;
172  uint16_t apv36_;
173  uint16_t apv37_;
174 
175  // Devices found (with hex addr)
176  uint16_t dcu0x00_;
177  uint16_t mux0x43_;
178  uint16_t pll0x44_;
179  uint16_t lld0x60_;
180 
181  // Detector
182  uint32_t dcuId_;
183  uint32_t detId_;
184  uint16_t nApvPairs_;
185 
188  uint16_t length_;
189 
190 };
191 
192 // --------------- inline methods ---------------
193 
194 const uint16_t& SiStripModule::fecCrate() const { return key_.fecCrate(); }
195 const uint16_t& SiStripModule::fecSlot() const { return key_.fecSlot(); }
196 const uint16_t& SiStripModule::fecRing() const { return key_.fecRing(); }
197 const uint16_t& SiStripModule::ccuAddr() const { return key_.ccuAddr(); }
198 const uint16_t& SiStripModule::ccuChan() const { return key_.ccuChan(); }
199 
200 const SiStripFecKey& SiStripModule::key() const { return key_; }
201 
202 const uint32_t& SiStripModule::dcuId() const { return dcuId_; }
203 const uint32_t& SiStripModule::detId() const { return detId_; }
204 const uint16_t& SiStripModule::nApvPairs() const { return nApvPairs_; }
205 uint16_t SiStripModule::nDetStrips() const { return 256*nApvPairs_; }
206 
207 void SiStripModule::dcuId( const uint32_t& dcu_id ) { if ( dcu_id ) { dcuId_ = dcu_id; dcu0x00_ = true; } }
208 void SiStripModule::detId( const uint32_t& det_id ) { if ( det_id ) { detId_ = det_id; } }
210 
211 const uint16_t& SiStripModule::length() const { return length_; }
212 void SiStripModule::length( const uint16_t& length ) { length_ = length; }
213 
214 const uint16_t& SiStripModule::dcu() const { return dcu0x00_; }
215 const uint16_t& SiStripModule::mux() const { return mux0x43_; }
216 const uint16_t& SiStripModule::pll() const { return pll0x44_; }
217 const uint16_t& SiStripModule::lld() const { return lld0x60_; }
218 
219 #endif // CalibTracker_SiStripObjects_SiStripModule_H
220 
221 
Device and connection information at the level of a front-end module.
Definition: SiStripModule.h:24
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:188
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:45
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:42
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:59
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:52
const uint16_t & activeApv(const uint16_t &apv_address) const
SiStripModule(const FedChannelConnection &conn)
uint16_t apv36_
uint16_t dcu0x00_