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 
2 #ifndef CalibFormats_SiStripObjects_SiStripFecCabling_H
3 #define CalibFormats_SiStripObjects_SiStripFecCabling_H
4 
9 #include <boost/cstdint.hpp>
10 #include <sstream>
11 #include <ostream>
12 #include <vector>
13 
14 class SiStripFecCabling;
15 
17 std::ostream& operator<< ( std::ostream&, const SiStripFecCabling& );
18 
19 /*
20  @class SiStripFecCabling
21  @author R.Bainbridge
22  @brief FEC cabling object for the strip tracker.
23 */
25 
26  public:
27 
28  // ---------- Constructors, destructors ----------
29 
35  ~SiStripFecCabling() {;} //@@ needs implementation!!
36 
37  // ---------- Methods to retrieve connection info ----------
38 
40  inline const std::vector<SiStripFecCrate>& crates() const;
42  inline const std::vector<SiStripFec>& fecs() const; //@@ TEMPORARY: to maintain backward compatibility!
44  void connections( std::vector<FedChannelConnection>& ) const;
46  const SiStripModule& module( const FedChannelConnection& conn ) const;
48  const SiStripModule& module( const uint32_t& dcu_id ) const;
52  void print( std::stringstream& ) const;
54  void terse( std::stringstream& ) const;
55 
56  // ---------- Methods used to build FEC cabling ----------
57 
59  void buildFecCabling( const SiStripFedCabling& );
61  void addDevices( const FedChannelConnection& conn );
63  inline void dcuId( const FedChannelConnection& conn );
65  inline void detId( const FedChannelConnection& conn );
67  inline void nApvPairs( const FedChannelConnection& conn );
68 
69  private:
70 
72  std::vector<SiStripFecCrate> crates_;
73 
74 };
75 
76 // ---------- Inline methods ----------
77 
78 const std::vector<SiStripFecCrate>& SiStripFecCabling::crates() const { return crates_; }
79 
80 // TEMPORARY method to maintain backward compatibility!
81 const std::vector<SiStripFec>& SiStripFecCabling::fecs() const {
82  const static std::vector<SiStripFec> my_fecs;
83  if ( !crates_.empty() ) { return crates_[0].fecs(); }
84  else { return my_fecs; }
85 }
86 
88  const_cast<SiStripModule&>(module(conn)).dcuId(conn.dcuId());
89 }
90 
92  const_cast<SiStripModule&>(module(conn)).detId(conn.detId());
93 }
94 
96  const_cast<SiStripModule&>(module(conn)).nApvPairs(conn.nApvPairs());
97 }
98 
99 #endif // CalibTracker_SiStripObjects_SiStripFecCabling_H
100 
101 /*
102 
103 inline void fedCh( const FedChannelConnection& conn ); //@@ needs to be implemented
104 
105 void SiStripFecCabling::fedCh( const FedChannelConnection& conn ) {
106  module(conn).detId(conn.fedId());
107  module(conn).detId(conn.fedCh());
108 }
109 
110 */
Device and connection information at the level of a front-end module.
Definition: SiStripModule.h:24
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)
tuple conn
Definition: results_mgr.py:53
NumberOfDevices countDevices() const