CMS 3D CMS Logo

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 <ostream>
11 #include <sstream>
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 public:
26  // ---------- Constructors, destructors ----------
27 
33  ~SiStripFecCabling() { ; } //@@ needs implementation!!
34 
35  // ---------- Methods to retrieve connection info ----------
36 
38  inline const std::vector<SiStripFecCrate> &crates() const;
39  inline std::vector<SiStripFecCrate> &crates();
41  inline const std::vector<SiStripFec> &fecs() const; //@@ TEMPORARY: to maintain backward compatibility!
43  void connections(std::vector<FedChannelConnection> &) const;
45  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:
71  std::vector<SiStripFecCrate> crates_;
72 };
73 
74 // ---------- Inline methods ----------
75 
76 const std::vector<SiStripFecCrate> &SiStripFecCabling::crates() const { return crates_; }
77 std::vector<SiStripFecCrate> &SiStripFecCabling::crates() { return crates_; }
78 
79 // TEMPORARY method to maintain backward compatibility!
80 const std::vector<SiStripFec> &SiStripFecCabling::fecs() const {
81  const static std::vector<SiStripFec> my_fecs;
82  if (!crates_.empty()) {
83  return crates_[0].fecs();
84  } else {
85  return my_fecs;
86  }
87 }
88 
90  auto m = module(conn);
91  if (m) {
92  m->dcuId(conn.dcuId());
93  }
94 }
95 
97  auto m = module(conn);
98  if (m) {
99  m->detId(conn.detId());
100  }
101 }
102 
104  auto m = module(conn);
105  if (m) {
106  m->nApvPairs(conn.nApvPairs());
107  }
108 }
109 
110 #endif // CalibTracker_SiStripObjects_SiStripFecCabling_H
111 
112 /*
113 
114 inline void fedCh( const FedChannelConnection& conn ); //@@ needs to be
115 implemented
116 
117 void SiStripFecCabling::fedCh( const FedChannelConnection& conn ) {
118  module(conn).detId(conn.fedId());
119  module(conn).detId(conn.fedCh());
120 }
121 
122 */
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 &, const SiStripFecCabling &)
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