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;
41  inline std::vector<SiStripFecCrate>& crates();
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;
50  const SiStripModule& module( const uint32_t& dcu_id ) const;
54  void print( std::stringstream& ) const;
56  void terse( std::stringstream& ) const;
57 
58  // ---------- Methods used to build FEC cabling ----------
59 
61  void buildFecCabling( const SiStripFedCabling& );
63  void addDevices( const FedChannelConnection& conn );
65  inline void dcuId( const FedChannelConnection& conn );
67  inline void detId( const FedChannelConnection& conn );
69  inline void nApvPairs( const FedChannelConnection& conn );
70 
71  private:
72 
74  std::vector<SiStripFecCrate> crates_;
75 
76 };
77 
78 // ---------- Inline methods ----------
79 
80 const std::vector<SiStripFecCrate>& SiStripFecCabling::crates() const { return crates_; }
81 std::vector<SiStripFecCrate>& SiStripFecCabling::crates() { return crates_; }
82 
83 // TEMPORARY method to maintain backward compatibility!
84 const std::vector<SiStripFec>& SiStripFecCabling::fecs() const {
85  const static std::vector<SiStripFec> my_fecs;
86  if ( !crates_.empty() ) { return crates_[0].fecs(); }
87  else { return my_fecs; }
88 }
89 
91  auto m = module(conn);
92  if(m) {m->dcuId(conn.dcuId());}
93 }
94 
96  auto m = module(conn);
97  if(m) { m->detId(conn.detId()); }
98 }
99 
101  auto m = module(conn);
102  if(m) { m->nApvPairs(conn.nApvPairs()); }
103 }
104 
105 #endif // CalibTracker_SiStripObjects_SiStripFecCabling_H
106 
107 /*
108 
109 inline void fedCh( const FedChannelConnection& conn ); //@@ needs to be implemented
110 
111 void SiStripFecCabling::fedCh( const FedChannelConnection& conn ) {
112  module(conn).detId(conn.fedId());
113  module(conn).detId(conn.fedCh());
114 }
115 
116 */
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:188
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