1 #ifndef CondFormats_SiStripObjects_SiStripFedCabling_H
2 #define CondFormats_SiStripObjects_SiStripFedCabling_H
5 #include <boost/range/iterator_range.hpp>
6 #include <boost/cstdint.hpp>
11 #define SISTRIPCABLING_USING_NEW_STRUCTURE
12 #define SISTRIPCABLING_USING_NEW_INTERFACE
16 #ifndef SISTRIPCABLING_USING_NEW_STRUCTURE // ------------
54 void print( std::stringstream& )
const;
57 void terse( std::stringstream& )
const;
60 void summary( std::stringstream& )
const;
65 const std::vector<uint16_t>&
feds()
const;
68 const std::vector<FedChannelConnection>&
connections( uint16_t fed_id )
const;
72 uint16_t fed_chan )
const;
75 inline const std::vector<FedChannelConnection>&
detected()
const;
78 inline const std::vector<FedChannelConnection>&
undetected()
const;
85 std::vector<uint16_t>
feds_;
95 std::vector< std::vector<FedChannelConnection> > connected_;
103 std::vector<FedChannelConnection>
detected_;
122 #else // SISTRIPCABLING_USING_NEW_STRUCTURE --------------------
123 #ifndef SISTRIPCABLING_USING_NEW_INTERFACE // ------------------
143 typedef std::vector<uint16_t>
Feds;
153 typedef std::vector<FedChannelConnection>
Conns;
163 typedef std::pair<uint32_t,uint32_t>
ConnsPair;
165 typedef std::vector<ConnsPair>
Registry;
184 const std::vector<uint16_t>&
feds()
const;
187 const std::vector<FedChannelConnection>&
connections( uint16_t fed_id )
const;
191 uint16_t fed_chan )
const;
194 inline const std::vector<FedChannelConnection>&
detected()
const;
197 inline const std::vector<FedChannelConnection>&
undetected()
const;
205 void print( std::stringstream& )
const;
208 void terse( std::stringstream& )
const;
211 void summary( std::stringstream& )
const;
228 uint32_t
size()
const;
233 void print( std::stringstream& )
const;
293 return ( range_.begin() == range_.end() );
297 return std::distance( range_.begin(), range_.end() );
301 return ( ( range_.begin() == vector_.end() &&
302 range_.end() == vector_.end() ) ?
304 ConnsPair( std::distance( vector_.begin(), range_.begin() ),
305 std::distance( vector_.begin(), range_.end() ) ) );
318 #else // SISTRIPCABLING_USING_NEW_INTERFACE --------------------
338 typedef std::vector<uint16_t>
Feds;
348 typedef std::vector<FedChannelConnection>
Conns;
371 const std::vector<FedChannelConnection>&
connections( uint16_t fed_id )
const;
377 const std::vector<uint16_t>&
feds()
const;
380 const std::vector<FedChannelConnection>&
detected()
const;
383 const std::vector<FedChannelConnection>&
undetected()
const;
425 void print( std::stringstream& ss )
const {
430 void terse( std::stringstream& )
const;
454 uint32_t
size()
const;
459 void print( std::stringstream& )
const;
507 return range_.begin();
523 return ( range_.begin() == range_.end() );
527 return std::distance( range_.begin(), range_.end() );
531 return ( ( range_.begin() == vector_.end() &&
532 range_.end() == vector_.end() ) ?
534 ConnsPair( std::distance( vector_.begin(), range_.begin() ),
535 std::distance( vector_.begin(), range_.end() ) ) );
548 #endif // SISTRIPCABLING_USING_NEW_INTERFACE -------------------
549 #endif // SISTRIPCABLING_USING_NEW_STRUCTURE -------------------
552 #endif // CondFormats_SiStripObjects_SiStripFedCabling_H
ConnsConstIterRange detectedDevices() const
ConnsConstIter end() const
ConnsConstIterRange vector_
boost::iterator_range< ConnsIter > ConnsIterRange
void print(std::stringstream &) const
ConnsConstIterRange range() const
const std::vector< uint16_t > & feds() const
Conns connections_
Container of connection objects.
Feds feds_
"Active" FEDs that have connected FE devices
std::pair< uint32_t, uint32_t > ConnsPair
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
static const uint32_t invalid32_
void terse(std::stringstream &) const
ConnsConstIterRange undetectedDevices() const
void printSummary(std::stringstream &) const
Builds range of iterators from pair of offsets.
const FedChannelConnection & connection(uint16_t fed_id, uint16_t fed_ch) const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
boost::iterator_range< FedsConstIter > FedsConstIterRange
Registry registry_
Container of "ranges" indexed by FED id.
Conns::iterator ConnsIter
Conns undetected_
FE devices that are detected.
boost::iterator_range< ConnsConstIter > ConnsConstIterRange
void buildFedCabling(const std::vector< FedChannelConnection > &)
static ConnsPair emptyPair()
ConnsPair connsPair() const
Class containning control, module, detector and connection information, at the level of a FED channel...
Conns detected_
Connections to FE devices that are not detected.
FedsConstIterRange fedIds() const
void print(std::stringstream &ss) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTDEBUG.
boost::iterator_range< FedsIter > FedsIterRange
std::vector< uint16_t > Feds
void summary(std::stringstream &ss) const
LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTSUMMARY.
ConnsConstIterRange invalid() const
Feds::const_iterator FedsConstIter
const std::vector< FedChannelConnection > & undetected() const
ConnsConstIter begin() const
ConnsRange range(ConnsPair) const
Builds range of iterators from pair of offsets.
std::vector< ConnsPair > Registry
const std::vector< FedChannelConnection > & detected() const
ConnsConstIterRange fedConnections(uint16_t fed_id) const
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
ConnsConstIterRange range_
std::vector< FedChannelConnection > Conns
Conns::const_iterator ConnsConstIter
void printDebug(std::stringstream &) const
tuple size
Write out results.
const std::vector< FedChannelConnection > & connections(uint16_t fed_id) const