CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripFecCabling.h
Go to the documentation of this file.
1 // Last commit: $Id: SiStripFecCabling.h,v 1.17 2007/05/24 15:16:56 bainbrid Exp $
2 
3 #ifndef CalibFormats_SiStripObjects_SiStripFecCabling_H
4 #define CalibFormats_SiStripObjects_SiStripFecCabling_H
5 
10 #include <boost/cstdint.hpp>
11 #include <sstream>
12 #include <ostream>
13 #include <vector>
14 
15 class SiStripFecCabling;
16 
18 std::ostream& operator<< ( std::ostream&, const SiStripFecCabling& );
19 
20 /*
21  @class SiStripFecCabling
22  @author R.Bainbridge
23  @brief FEC cabling object for the strip tracker.
24 */
26 
27  public:
28 
29  // ---------- Constructors, destructors ----------
30 
36  ~SiStripFecCabling() {;} //@@ needs implementation!!
37 
38  // ---------- Methods to retrieve connection info ----------
39 
41  inline const std::vector<SiStripFecCrate>& crates() const;
43  inline const std::vector<SiStripFec>& fecs() const; //@@ TEMPORARY: to maintain backward compatibility!
45  void connections( std::vector<FedChannelConnection>& ) const;
47  const SiStripModule& module( const FedChannelConnection& conn ) const;
49  const SiStripModule& module( const uint32_t& dcu_id ) const;
53  void print( std::stringstream& ) const;
55  void terse( std::stringstream& ) const;
56 
57  // ---------- Methods used to build FEC cabling ----------
58 
60  void buildFecCabling( const SiStripFedCabling& );
62  void addDevices( const FedChannelConnection& conn );
64  inline void dcuId( const FedChannelConnection& conn );
66  inline void detId( const FedChannelConnection& conn );
68  inline void nApvPairs( const FedChannelConnection& conn );
69 
70  private:
71 
73  std::vector<SiStripFecCrate> crates_;
74 
75 };
76 
77 // ---------- Inline methods ----------
78 
79 const std::vector<SiStripFecCrate>& SiStripFecCabling::crates() const { return crates_; }
80 
81 // TEMPORARY method to maintain backward compatibility!
82 const std::vector<SiStripFec>& SiStripFecCabling::fecs() const {
83  static std::vector<SiStripFec> my_fecs;
84  if ( !crates_.empty() ) { return crates_[0].fecs(); }
85  else { return my_fecs; }
86 }
87 
89  const_cast<SiStripModule&>(module(conn)).dcuId(conn.dcuId());
90 }
91 
93  const_cast<SiStripModule&>(module(conn)).detId(conn.detId());
94 }
95 
97  const_cast<SiStripModule&>(module(conn)).nApvPairs(conn.nApvPairs());
98 }
99 
100 #endif // CalibTracker_SiStripObjects_SiStripFecCabling_H
101 
102 /*
103 
104 inline void fedCh( const FedChannelConnection& conn ); //@@ needs to be implemented
105 
106 void SiStripFecCabling::fedCh( const FedChannelConnection& conn ) {
107  module(conn).detId(conn.fedId());
108  module(conn).detId(conn.fedCh());
109 }
110 
111 */
Device and connection information at the level of a front-end module.
Definition: SiStripModule.h:25
void nApvPairs(const FedChannelConnection &conn)
const SiStripModule & module(const FedChannelConnection &conn) const
const std::vector< SiStripFec > & fecs() const
void addDevices(const FedChannelConnection &conn)
std::vector< SiStripFecCrate > crates_
void terse(std::stringstream &) const
const std::vector< SiStripFecCrate > & crates() const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
void connections(std::vector< FedChannelConnection > &) const
const uint32_t & detId() const
Class containning control, module, detector and connection information, at the level of a FED channel...
void dcuId(const FedChannelConnection &conn)
void print(std::stringstream &) const
void buildFecCabling(const SiStripFedCabling &)
const uint32_t & dcuId() const
Simple container class for counting devices.
const uint16_t & nApvPairs() const
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
void detId(const FedChannelConnection &conn)
NumberOfDevices countDevices() const