CMS 3D CMS Logo

SiStripFedCabling.h
Go to the documentation of this file.
1 #ifndef CondFormats_SiStripObjects_SiStripFedCabling_H
2 #define CondFormats_SiStripObjects_SiStripFedCabling_H
3 
5 
7 #include <boost/range/iterator_range.hpp>
8 #include <sstream>
9 #include <vector>
10 #include <string>
11 #include <cstdint>
12 
13 #define SISTRIPCABLING_USING_NEW_STRUCTURE
14 #define SISTRIPCABLING_USING_NEW_INTERFACE
15 
16 class TrackerTopology;
17 
18 class SiStripFedCabling;
19 
26 public:
27  // -------------------- Typedefs and structs --------------------
28 
29  typedef std::vector<uint16_t> Feds;
30 
31  typedef Feds::iterator FedsIter;
32 
33  typedef Feds::const_iterator FedsConstIter;
34 
35  typedef boost::iterator_range<FedsIter> FedsIterRange;
36 
37  typedef boost::iterator_range<FedsConstIter> FedsConstIterRange;
38 
39  typedef std::vector<FedChannelConnection> Conns;
40 
41  typedef Conns::iterator ConnsIter;
42 
43  typedef Conns::const_iterator ConnsConstIter;
44 
45  typedef boost::iterator_range<ConnsIter> ConnsIterRange;
46 
47  typedef boost::iterator_range<ConnsConstIter> ConnsConstIterRange;
48 
49  typedef std::pair<uint32_t, uint32_t> ConnsPair;
50 
51  typedef std::vector<ConnsPair> Registry;
52 
53  // -------------------- Constructors, destructors --------------------
54 
57 
60 
63 
66 
67  // -------------------- Methods to retrieve connections --------------------
68 
70  FedsConstIterRange fedIds() const;
71 
73  ConnsConstIterRange fedConnections(uint16_t fed_id) const;
74 
76  FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const;
77 
80 
83 
84  // -------------------- Utility methods --------------------
85 
87  void buildFedCabling(ConnsConstIterRange connections);
88 
90  void printDebug(std::stringstream&, const TrackerTopology* trackerTopo) const;
91 
93  void print(std::stringstream& ss, const TrackerTopology* trackerTopo) const { printDebug(ss, trackerTopo); }
94 
96  void terse(std::stringstream&) const;
97 
99  void printSummary(std::stringstream&, const TrackerTopology* trackerTopo) const;
101  void summary(std::stringstream& ss, const TrackerTopology* trackerTopo) const { printSummary(ss, trackerTopo); }
102 
104  class ConnsRange {
105  public:
106  ConnsRange(const Conns&, ConnsPair);
107  ConnsRange(const Conns&);
108  ConnsRange() { ; }
109 
110  ConnsConstIter begin() const;
111  ConnsConstIter end() const;
112  ConnsConstIterRange range() const;
114 
115  bool empty() const;
116  uint32_t size() const;
117 
118  ConnsPair connsPair() const;
119  static ConnsPair emptyPair();
120 
121  void print(std::stringstream&) const;
122 
123  private:
126  };
127 
129  ConnsRange range(ConnsPair) const;
130 
131  // -------------------- Private member data --------------------
132 
133 private:
136 
139 
142 
145 
148 
150 };
151 
152 std::ostream& operator<<(std::ostream&, const SiStripFedCabling::ConnsRange&);
153 
155  return FedsConstIterRange(feds_.begin(), feds_.end());
156 }
157 
159  return ConnsConstIterRange(detected_.begin(), detected_.end());
160 }
161 
163  return ConnsConstIterRange(undetected_.begin(), undetected_.end());
164 }
165 
167 
169 
171 
173  return ConnsConstIterRange(vector_.end(), vector_.end());
174 }
175 
176 inline bool SiStripFedCabling::ConnsRange::empty() const { return (range_.begin() == range_.end()); }
177 
178 inline uint32_t SiStripFedCabling::ConnsRange::size() const { return std::distance(range_.begin(), range_.end()); }
179 
181  return (
182  (range_.begin() == vector_.end() && range_.end() == vector_.end())
184  : ConnsPair(std::distance(vector_.begin(), range_.begin()), std::distance(vector_.begin(), range_.end())));
185 }
186 
189 }
190 
192  return ConnsRange(connections_, p);
193 }
194 
195 #endif // CondFormats_SiStripObjects_SiStripFedCabling_H
SiStripFedCabling::print
void print(std::stringstream &ss, const TrackerTopology *trackerTopo) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTDEBUG.
Definition: SiStripFedCabling.h:93
SiStripFedCabling::~SiStripFedCabling
~SiStripFedCabling()
Definition: SiStripFedCabling.cc:40
SiStripFedCabling::feds_
Feds feds_
"Active" FEDs that have connected FE devices
Definition: SiStripFedCabling.h:135
SiStripFedCabling::ConnsRange::vector_
ConnsConstIterRange vector_
Definition: SiStripFedCabling.h:124
sistrip::invalid32_
static const uint32_t invalid32_
Definition: Constants.h:15
SiStripFedCabling::ConnsRange::emptyPair
static ConnsPair emptyPair()
Definition: SiStripFedCabling.h:187
SiStripFedCabling::detectedDevices
ConnsConstIterRange detectedDevices() const
Definition: SiStripFedCabling.h:158
TrackerTopology
Definition: TrackerTopology.h:16
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
SiStripFedCabling::ConnsRange::end
ConnsConstIter end() const
Definition: SiStripFedCabling.h:168
SiStripFedCabling::ConnsRange
Builds range of iterators from pair of offsets.
Definition: SiStripFedCabling.h:104
COND_SERIALIZABLE
#define COND_SERIALIZABLE
Definition: Serializable.h:39
SiStripFedCabling::ConnsRange::empty
bool empty() const
Definition: SiStripFedCabling.h:176
SiStripFedCabling::ConnsRange::connsPair
ConnsPair connsPair() const
Definition: SiStripFedCabling.h:180
SiStripFedCabling::fedConnection
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
Definition: SiStripFedCabling.cc:171
SiStripFedCabling::ConnsRange::range
ConnsConstIterRange range() const
Definition: SiStripFedCabling.h:170
SiStripFedCabling::ConnsConstIterRange
boost::iterator_range< ConnsConstIter > ConnsConstIterRange
Definition: SiStripFedCabling.h:47
SiStripFedCabling
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses,...
Definition: SiStripFedCabling.h:25
SiStripFedCabling::undetected_
Conns undetected_
FE devices that are detected.
Definition: SiStripFedCabling.h:147
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiStripFedCabling::FedsConstIterRange
boost::iterator_range< FedsConstIter > FedsConstIterRange
Definition: SiStripFedCabling.h:37
SiStripFedCabling::registry_
Registry registry_
Container of "ranges" indexed by FED id.
Definition: SiStripFedCabling.h:138
SiStripFedCabling::Feds
std::vector< uint16_t > Feds
Definition: SiStripFedCabling.h:29
SiStripFedCabling::printSummary
void printSummary(std::stringstream &, const TrackerTopology *trackerTopo) const
Definition: SiStripFedCabling.cc:287
SiStripFedCabling::range
ConnsRange range(ConnsPair) const
Builds range of iterators from pair of offsets.
Definition: SiStripFedCabling.h:191
SiStripFedCabling::ConnsIter
Conns::iterator ConnsIter
Definition: SiStripFedCabling.h:41
SiStripFedCabling::FedsIter
Feds::iterator FedsIter
Definition: SiStripFedCabling.h:31
SiStripFedCabling::ConnsRange::invalid
ConnsConstIterRange invalid() const
Definition: SiStripFedCabling.h:172
SiStripFedCabling::ConnsRange::print
void print(std::stringstream &) const
Definition: SiStripFedCabling.cc:132
FedChannelConnection
Class containning control, module, detector and connection information, at the level of a FED channel...
Definition: FedChannelConnection.h:26
SiStripFedCabling::FedsIterRange
boost::iterator_range< FedsIter > FedsIterRange
Definition: SiStripFedCabling.h:35
SiStripFedCabling::FedsConstIter
Feds::const_iterator FedsConstIter
Definition: SiStripFedCabling.h:33
operator<<
std::ostream & operator<<(std::ostream &, const SiStripFedCabling::ConnsRange &)
Definition: SiStripFedCabling.cc:151
SiStripFedCabling::detected_
Conns detected_
Connections to FE devices that are not detected.
Definition: SiStripFedCabling.h:144
Serializable.h
SiStripFedCabling::ConnsRange::range_
ConnsConstIterRange range_
Definition: SiStripFedCabling.h:125
SiStripFedCabling::ConnsRange::ConnsRange
ConnsRange()
Definition: SiStripFedCabling.h:108
SiStripFedCabling::ConnsPair
std::pair< uint32_t, uint32_t > ConnsPair
Definition: SiStripFedCabling.h:49
SiStripFedCabling::buildFedCabling
void buildFedCabling(ConnsConstIterRange connections)
Definition: SiStripFedCabling.cc:47
FedChannelConnection.h
SiStripFedCabling::printDebug
void printDebug(std::stringstream &, const TrackerTopology *trackerTopo) const
Definition: SiStripFedCabling.cc:182
SiStripFedCabling::undetectedDevices
ConnsConstIterRange undetectedDevices() const
Definition: SiStripFedCabling.h:162
SiStripFedCabling::Registry
std::vector< ConnsPair > Registry
Definition: SiStripFedCabling.h:51
SiStripFedCabling::Conns
std::vector< FedChannelConnection > Conns
Definition: SiStripFedCabling.h:39
SiStripFedCabling::summary
void summary(std::stringstream &ss, const TrackerTopology *trackerTopo) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTSUMMARY.
Definition: SiStripFedCabling.h:101
SiStripFedCabling::fedIds
FedsConstIterRange fedIds() const
Definition: SiStripFedCabling.h:154
SiStripFedCabling::terse
void terse(std::stringstream &) const
Definition: SiStripFedCabling.cc:249
SiStripFedCabling::SiStripFedCabling
SiStripFedCabling()
Definition: SiStripFedCabling.cc:33
SiStripFedCabling::fedConnections
ConnsConstIterRange fedConnections(uint16_t fed_id) const
Definition: SiStripFedCabling.cc:160
SiStripFedCabling::ConnsRange::size
uint32_t size() const
Definition: SiStripFedCabling.h:178
HLT_FULL_cff.distance
distance
Definition: HLT_FULL_cff.py:7796
SiStripFedCabling::ConnsConstIter
Conns::const_iterator ConnsConstIter
Definition: SiStripFedCabling.h:43
SiStripFedCabling::connections_
Conns connections_
Container of connection objects.
Definition: SiStripFedCabling.h:141
SiStripFedCabling::ConnsIterRange
boost::iterator_range< ConnsIter > ConnsIterRange
Definition: SiStripFedCabling.h:45
SiStripFedCabling::ConnsRange::begin
ConnsConstIter begin() const
Definition: SiStripFedCabling.h:166