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 <ostream>
10 #include <sstream>
11 #include <vector>
12 #include <cstdint>
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 &);
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 */
SiStripFecCabling
Definition: SiStripFecCabling.h:24
SiStripFecCabling::terse
void terse(std::stringstream &) const
Definition: SiStripFecCabling.cc:372
SiStripFecCabling::nApvPairs
void nApvPairs(const FedChannelConnection &conn)
Definition: SiStripFecCabling.h:103
SiStripFecCabling::addDevices
void addDevices(const FedChannelConnection &conn)
Definition: SiStripFecCabling.cc:61
SiStripFecCabling::print
void print(std::stringstream &) const
Definition: SiStripFecCabling.cc:334
SiStripFedCabling.h
SiStripModule
Device and connection information at the level of a front-end module.
Definition: SiStripModule.h:24
SiStripCommissioningClient_cfg.conn
conn
Definition: SiStripCommissioningClient_cfg.py:5
SiStripFecCrate.h
SiStripFedCabling
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses,...
Definition: SiStripFedCabling.h:25
SiStripFecCabling::countDevices
NumberOfDevices countDevices() const
Definition: SiStripFecCabling.cc:219
SiStripFecCabling::crates_
std::vector< SiStripFecCrate > crates_
Definition: SiStripFecCabling.h:71
SiStripFecCabling::~SiStripFecCabling
~SiStripFecCabling()
Definition: SiStripFecCabling.h:33
NumberOfDevices
Simple container class for counting devices.
Definition: NumberOfDevices.h:14
NumberOfDevices.h
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
SiStripFecCabling::dcuId
void dcuId(const FedChannelConnection &conn)
Definition: SiStripFecCabling.h:89
FedChannelConnection
Class containning control, module, detector and connection information, at the level of a FED channel...
Definition: FedChannelConnection.h:26
SiStripFecCabling::SiStripFecCabling
SiStripFecCabling()
Definition: SiStripFecCabling.h:31
operator<<
std::ostream & operator<<(std::ostream &, const SiStripFecCabling &)
Definition: SiStripFecCabling.cc:393
SiStripFecCabling::connections
void connections(std::vector< FedChannelConnection > &) const
Definition: SiStripFecCabling.cc:75
SiStripFecCabling::crates
const std::vector< SiStripFecCrate > & crates() const
Definition: SiStripFecCabling.h:76
SiStripFecCabling::buildFecCabling
void buildFecCabling(const SiStripFedCabling &)
Definition: SiStripFecCabling.cc:22
FedChannelConnection.h
SiStripFecCabling::fecs
const std::vector< SiStripFec > & fecs() const
Definition: SiStripFecCabling.h:80
SiStripFecCabling::detId
void detId(const FedChannelConnection &conn)
Definition: SiStripFecCabling.h:96
SiStripFecCabling::module
const SiStripModule & module(const FedChannelConnection &conn) const
Definition: SiStripFecCabling.cc:181