CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Types | Public Member Functions | Private Attributes
SiStripFedCabling Class Reference

Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses, DCU id... More...

#include <SiStripFedCabling.h>

Classes

class  ConnsRange
 Builds range of iterators from pair of offsets. More...
 

Public Types

typedef std::vector
< FedChannelConnection
Conns
 
typedef Conns::const_iterator ConnsConstIter
 
typedef boost::iterator_range
< ConnsConstIter
ConnsConstIterRange
 
typedef Conns::iterator ConnsIter
 
typedef boost::iterator_range
< ConnsIter
ConnsIterRange
 
typedef std::pair< uint32_t,
uint32_t > 
ConnsPair
 
typedef std::vector< uint16_t > Feds
 
typedef Feds::const_iterator FedsConstIter
 
typedef boost::iterator_range
< FedsConstIter
FedsConstIterRange
 
typedef Feds::iterator FedsIter
 
typedef boost::iterator_range
< FedsIter
FedsIterRange
 
typedef std::vector< ConnsPairRegistry
 

Public Member Functions

void buildFedCabling (const std::vector< FedChannelConnection > &)
 
void buildFedCabling (ConnsConstIterRange connections)
 
const FedChannelConnectionconnection (uint16_t fed_id, uint16_t fed_ch) const
 
const std::vector
< FedChannelConnection > & 
connections (uint16_t fed_id) const
 
const std::vector
< FedChannelConnection > & 
detected () const
 
ConnsConstIterRange detectedDevices () const
 
FedChannelConnection fedConnection (uint16_t fed_id, uint16_t fed_ch) const
 
ConnsConstIterRange fedConnections (uint16_t fed_id) const
 
FedsConstIterRange fedIds () const
 
const std::vector< uint16_t > & feds () const
 
void print (std::stringstream &ss) const
 LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTDEBUG. More...
 
void printDebug (std::stringstream &) const
 
void printSummary (std::stringstream &) const
 
ConnsRange range (ConnsPair) const
 Builds range of iterators from pair of offsets. More...
 
 SiStripFedCabling (const std::vector< FedChannelConnection > &)
 
 SiStripFedCabling (ConnsConstIterRange)
 
 SiStripFedCabling (const SiStripFedCabling &)
 
 SiStripFedCabling ()
 
void summary (std::stringstream &ss) const
 LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTSUMMARY. More...
 
void terse (std::stringstream &) const
 
const std::vector
< FedChannelConnection > & 
undetected () const
 
ConnsConstIterRange undetectedDevices () const
 
 ~SiStripFedCabling ()
 

Private Attributes

Conns connections_
 Container of connection objects. More...
 
Conns detected_
 Connections to FE devices that are not detected. More...
 
Feds feds_
 "Active" FEDs that have connected FE devices More...
 
Registry registry_
 Container of "ranges" indexed by FED id. More...
 
Conns undetected_
 FE devices that are detected. More...
 

Detailed Description

Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses, DCU id...

Definition at line 332 of file SiStripFedCabling.h.

Member Typedef Documentation

Definition at line 348 of file SiStripFedCabling.h.

typedef Conns::const_iterator SiStripFedCabling::ConnsConstIter

Definition at line 352 of file SiStripFedCabling.h.

Definition at line 356 of file SiStripFedCabling.h.

typedef Conns::iterator SiStripFedCabling::ConnsIter

Definition at line 350 of file SiStripFedCabling.h.

typedef boost::iterator_range<ConnsIter> SiStripFedCabling::ConnsIterRange

Definition at line 354 of file SiStripFedCabling.h.

typedef std::pair<uint32_t,uint32_t> SiStripFedCabling::ConnsPair

Definition at line 358 of file SiStripFedCabling.h.

typedef std::vector<uint16_t> SiStripFedCabling::Feds

Definition at line 338 of file SiStripFedCabling.h.

typedef Feds::const_iterator SiStripFedCabling::FedsConstIter

Definition at line 342 of file SiStripFedCabling.h.

typedef boost::iterator_range<FedsConstIter> SiStripFedCabling::FedsConstIterRange

Definition at line 346 of file SiStripFedCabling.h.

typedef Feds::iterator SiStripFedCabling::FedsIter

Definition at line 340 of file SiStripFedCabling.h.

typedef boost::iterator_range<FedsIter> SiStripFedCabling::FedsIterRange

Definition at line 344 of file SiStripFedCabling.h.

typedef std::vector<ConnsPair> SiStripFedCabling::Registry

Definition at line 360 of file SiStripFedCabling.h.

Constructor & Destructor Documentation

SiStripFedCabling::SiStripFedCabling ( const std::vector< FedChannelConnection > &  input)

TO BE DEPRECATED! TO BE DEPRECATED! TO BE DEPRECATED!

Definition at line 913 of file SiStripFedCabling.cc.

References buildFedCabling(), LogTrace, and sistrip::mlCabling_.

914  : feds_(),
915  registry_(),
916  connections_(),
917  detected_(),
918  undetected_()
919 {
921  << "[SiStripFedCabling::" << __func__ << "]"
922  << " Constructing object for vector of connections...";
924  input.end() ) );
925 }
Conns connections_
Container of connection objects.
Feds feds_
&quot;Active&quot; FEDs that have connected FE devices
Registry registry_
Container of &quot;ranges&quot; indexed by FED id.
Conns undetected_
FE devices that are detected.
static const char mlCabling_[]
boost::iterator_range< ConnsConstIter > ConnsConstIterRange
void buildFedCabling(const std::vector< FedChannelConnection > &)
Conns detected_
Connections to FE devices that are not detected.
#define LogTrace(id)
SiStripFedCabling::SiStripFedCabling ( ConnsConstIterRange  input)

Constructor taking FED channel connection objects as input.

Definition at line 976 of file SiStripFedCabling.cc.

References buildFedCabling(), LogTrace, and sistrip::mlCabling_.

977  : feds_(),
978  registry_(),
979  connections_(),
980  detected_(),
981  undetected_()
982 {
984  << "[SiStripFedCabling::" << __func__ << "]"
985  << " Constructing object from connection range...";
987 }
Conns connections_
Container of connection objects.
Feds feds_
&quot;Active&quot; FEDs that have connected FE devices
Registry registry_
Container of &quot;ranges&quot; indexed by FED id.
Conns undetected_
FE devices that are detected.
static const char mlCabling_[]
void buildFedCabling(const std::vector< FedChannelConnection > &)
Conns detected_
Connections to FE devices that are not detected.
#define LogTrace(id)
SiStripFedCabling::SiStripFedCabling ( const SiStripFedCabling input)

Copy constructor.

Definition at line 991 of file SiStripFedCabling.cc.

References LogTrace, and sistrip::mlCabling_.

992  : feds_( input.feds_ ),
993  registry_( input.registry_ ),
994  connections_( input.connections_ ),
995  detected_( input.detected_ ),
996  undetected_( input.undetected_ )
997 {
999  << "[SiStripFedCabling::" << __func__ << "]"
1000  << " Copy constructing object...";
1001 }
Conns connections_
Container of connection objects.
Feds feds_
&quot;Active&quot; FEDs that have connected FE devices
Registry registry_
Container of &quot;ranges&quot; indexed by FED id.
Conns undetected_
FE devices that are detected.
static const char mlCabling_[]
Conns detected_
Connections to FE devices that are not detected.
#define LogTrace(id)
SiStripFedCabling::SiStripFedCabling ( )

Public default constructor.

Definition at line 1005 of file SiStripFedCabling.cc.

References LogTrace, and sistrip::mlCabling_.

1006  : feds_(),
1007  registry_(),
1008  connections_(),
1009  detected_(),
1010  undetected_()
1011 {
1013  << "[SiStripFedCabling::" << __func__ << "]"
1014  << " Default constructing object...";
1015 }
Conns connections_
Container of connection objects.
Feds feds_
&quot;Active&quot; FEDs that have connected FE devices
Registry registry_
Container of &quot;ranges&quot; indexed by FED id.
Conns undetected_
FE devices that are detected.
static const char mlCabling_[]
Conns detected_
Connections to FE devices that are not detected.
#define LogTrace(id)
SiStripFedCabling::~SiStripFedCabling ( )

Default destructor.

Definition at line 1019 of file SiStripFedCabling.cc.

References LogTrace, and sistrip::mlCabling_.

1019  {
1021  << "[SiStripFedCabling::" << __func__ << "]"
1022  << " Destructing object...";
1023 }
static const char mlCabling_[]
#define LogTrace(id)

Member Function Documentation

void SiStripFedCabling::buildFedCabling ( const std::vector< FedChannelConnection > &  input)

TO BE DEPRECATED! TO BE DEPRECATED! TO BE DEPRECATED!

Definition at line 929 of file SiStripFedCabling.cc.

Referenced by SiStripFedCablingBuilderFromDb::getFedCabling(), and SiStripFedCabling().

929  {
931  input.end() ) );
932 }
boost::iterator_range< ConnsConstIter > ConnsConstIterRange
void buildFedCabling(const std::vector< FedChannelConnection > &)
void SiStripFedCabling::buildFedCabling ( ConnsConstIterRange  connections)

Builds FED cabling from vector of FED connections.

Definition at line 1027 of file SiStripFedCabling.cc.

References SiStripFedCabling::ConnsRange::begin(), connections_, filterCSVwithJSON::copy, SiStripFedCabling::ConnsRange::emptyPair(), feds_, spr::find(), getHLTprescales::index, findQualityFiles::jj, LogTrace, FEDNumbering::MAXSiStripFEDID, FEDNumbering::MINSiStripFEDID, sistrip::mlCabling_, range(), registry_, python.multivaluedict::sort(), and groupFilesInBlocks::temp.

1027  {
1028 
1029  // Check input
1030  if ( input.empty() ) {
1032  << "[SiStripFedCabling::" << __func__ << "]"
1033  << " Input vector of FedChannelConnections is of zero size!"
1034  << " Unable to populate FED cabling object!";
1035  return;
1036  }
1037 
1038  std::stringstream ss;
1039  ss << "[SiStripFedCabling::" << __func__ << "]"
1040  << " Building FED cabling from "
1041  << input.size()
1042  << " connections...";
1043  LogTrace(mlCabling_) << ss.str();
1044 
1045  // Sort input vector by FED id and channel
1046  Conns temp( input.size() );
1047  std::copy( input.begin(), input.end(), temp.begin() );
1048  std::sort( temp.begin(), temp.end() );
1049 
1050  // Strip FED ids
1051  uint16_t min_id = static_cast<uint16_t>( FEDNumbering::MINSiStripFEDID );
1052  uint16_t max_id = static_cast<uint16_t>( FEDNumbering::MAXSiStripFEDID );
1053  uint16_t nfeds = max_id - min_id + 1;
1054 
1055  // Initialise containers
1056  connections_.clear();
1057  connections_.reserve( 96 * nfeds );
1058  registry_.clear();
1059  feds_.clear();
1060  registry_.resize( nfeds, ConnsRange::emptyPair() );
1061 
1062  // Populate container
1063  ConnsIter ii = temp.begin();
1064  ConnsIter jj = temp.end();
1065  for ( ; ii != jj; ++ii ) {
1066 
1067  uint16_t fed_id = ii->fedId();
1068  uint16_t fed_ch = ii->fedCh();
1069  uint16_t index = fed_id - min_id;
1070 
1071  if ( fed_id < min_id || fed_id > max_id ) { continue; }
1072  if ( index >= registry_.size() ) { continue; }
1073  if ( !ii->isConnected() ) { continue; }
1074 
1075  FedsConstIter iter = find( feds_.begin(), feds_.end(), fed_id );
1076  if ( iter == feds_.end() ) { feds_.push_back( fed_id ); }
1077 
1078  if ( registry_[index] == ConnsRange::emptyPair() ) {
1079  ConnsPair conns_pair;
1080  conns_pair.first = std::distance( connections_.begin(), connections_.end() );
1081  connections_.insert( connections_.end(), 96, FedChannelConnection() );
1082  conns_pair.second = std::distance( connections_.begin(), connections_.end() );
1083  registry_[index] = conns_pair;
1084  }
1085 
1086  ConnsRange conns = range( registry_[index] );
1087  ConnsConstIter iconn = conns.begin() + fed_ch;
1088  FedChannelConnection& conn = const_cast<FedChannelConnection&>(*iconn);
1089  conn = *ii;
1090 
1091  }
1092 
1093 }
Conns connections_
Container of connection objects.
Feds feds_
&quot;Active&quot; FEDs that have connected FE devices
std::pair< uint32_t, uint32_t > ConnsPair
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
Registry registry_
Container of &quot;ranges&quot; indexed by FED id.
Conns::iterator ConnsIter
static const char mlCabling_[]
Class containning control, module, detector and connection information, at the level of a FED channel...
Feds::const_iterator FedsConstIter
#define LogTrace(id)
ConnsRange range(ConnsPair) const
Builds range of iterators from pair of offsets.
std::vector< FedChannelConnection > Conns
Conns::const_iterator ConnsConstIter
tuple conn
Definition: results_mgr.py:53
const FedChannelConnection & SiStripFedCabling::connection ( uint16_t  fed_id,
uint16_t  fed_ch 
) const

TO BE DEPRECATED! TO BE DEPRECATED! TO BE DEPRECATED!

Definition at line 949 of file SiStripFedCabling.cc.

References fedConnection(), and convertSQLitetoXML_cfg::output.

Referenced by CommissioningHistosUsingDb::addDcuDetIds(), SiStripSpyMonitorModule::analyze(), SiStripCMMonitorPlugin::analyze(), SiStripShotFilter::filter(), sistrip::FEDEmulatorModule::produce(), SiStripFEDErrorsDQM::readHistogram(), PedsOnlyHistosUsingDb::update(), NoiseHistosUsingDb::update(), PedestalsHistosUsingDb::update(), PedsFullNoiseHistosUsingDb::update(), and ApvTimingHistosUsingDb::update().

950  {
952  output = fedConnection( fed_id, fed_ch );
953  return output;
954 }
FedChannelConnection fedConnection(uint16_t fed_id, uint16_t fed_ch) const
Class containning control, module, detector and connection information, at the level of a FED channel...
const std::vector< FedChannelConnection > & SiStripFedCabling::connections ( uint16_t  fed_id) const

TO BE DEPRECATED! TO BE DEPRECATED! TO BE DEPRECATED!

Definition at line 936 of file SiStripFedCabling.cc.

References filterCSVwithJSON::copy, fedConnections(), and convertSQLitetoXML_cfg::output.

Referenced by SiStripFecCabling::buildFecCabling(), ViewTranslator::buildMaps(), FineDelayHistosUsingDb::computeDelays(), sistrip::SpyUnpacker::createDigis(), sistrip::RawToDigiUnpacker::createDigis(), SiStripCommissioningSource::createTasks(), SiStripCommissioningSource::endJob(), SiStripCommissioningSource::fillHistos(), LaserAlignmentEventFilter::filter(), sistrip::SpyEventMatcherModule::findL1IDandAPVAddress(), SiStripFedCablingManipulator::manipulate(), sistrip::SpyEventMatcher::mergeMatchingData(), sistrip::SpyDigiConverter::mergeModuleChannels(), sistrip::ExcludedFEDListProducer::produce(), SiStripFEDErrorsDQM::readBadAPVs(), SiStripQuality::turnOffFeds(), LatencyHistosUsingDb::update(), and FineDelayHistosUsingDb::update().

936  {
937  static std::vector<FedChannelConnection> output;
938  output.clear();
940  if ( !input.empty() ) {
941  output.resize( input.size() );
942  std::copy( input.begin(), input.end(), output.begin() );
943  } else { output.resize( 96, FedChannelConnection() ); }
944  return output;
945 }
boost::iterator_range< ConnsConstIter > ConnsConstIterRange
Class containning control, module, detector and connection information, at the level of a FED channel...
ConnsConstIterRange fedConnections(uint16_t fed_id) const
const std::vector< FedChannelConnection > & SiStripFedCabling::detected ( ) const

TO BE DEPRECATED! TO BE DEPRECATED! TO BE DEPRECATED!

Definition at line 964 of file SiStripFedCabling.cc.

References detected_.

964  {
965  return detected_;
966 }
Conns detected_
Connections to FE devices that are not detected.
SiStripFedCabling::ConnsConstIterRange SiStripFedCabling::detectedDevices ( ) const
inline

Returns information for "detected, but unconnected" devices.

Definition at line 498 of file SiStripFedCabling.h.

References detected_.

Referenced by SiStripDetCabling::SiStripDetCabling().

498  {
499  return ConnsConstIterRange( detected_.begin(), detected_.end() );
500 }
boost::iterator_range< ConnsConstIter > ConnsConstIterRange
Conns detected_
Connections to FE devices that are not detected.
FedChannelConnection SiStripFedCabling::fedConnection ( uint16_t  fed_id,
uint16_t  fed_ch 
) const

Returns connection object for a given FED id and channel.

Definition at line 1170 of file SiStripFedCabling.cc.

References fedConnections().

Referenced by connection().

1171  {
1172  ConnsConstIterRange conns = fedConnections( fed_id );
1173  if ( !conns.empty() && conns.size() == 96 && fed_ch < 96 ) {
1174  return *( conns.begin() + fed_ch );
1175  } else { return FedChannelConnection(); }
1176 }
boost::iterator_range< ConnsConstIter > ConnsConstIterRange
Class containning control, module, detector and connection information, at the level of a FED channel...
ConnsConstIterRange fedConnections(uint16_t fed_id) const
SiStripFedCabling::ConnsConstIterRange SiStripFedCabling::fedConnections ( uint16_t  fed_id) const

Returns all connection objects for a given FED id.

Definition at line 1161 of file SiStripFedCabling.cc.

References SiStripFedCabling::ConnsRange::invalid(), FEDNumbering::MINSiStripFEDID, SiStripFedCabling::ConnsRange::range(), range(), and registry_.

Referenced by connections(), fedConnection(), and SiStripDetCabling::SiStripDetCabling().

1161  {
1162  uint16_t index = fed_id - FEDNumbering::MINSiStripFEDID;
1163  if ( index < registry_.size() ) {
1164  return range( registry_[ index ] ).range();
1165  } else { return range( registry_[ index ] ).invalid(); }
1166 }
ConnsConstIterRange range() const
Registry registry_
Container of &quot;ranges&quot; indexed by FED id.
ConnsConstIterRange invalid() const
ConnsRange range(ConnsPair) const
Builds range of iterators from pair of offsets.
SiStripFedCabling::FedsConstIterRange SiStripFedCabling::fedIds ( ) const
inline

Retrieve vector of active FED ids.

Definition at line 494 of file SiStripFedCabling.h.

References feds_.

494  {
495  return FedsConstIterRange( feds_.begin(), feds_.end() );
496 }
Feds feds_
&quot;Active&quot; FEDs that have connected FE devices
boost::iterator_range< FedsConstIter > FedsConstIterRange
const std::vector< uint16_t > & SiStripFedCabling::feds ( ) const
void SiStripFedCabling::print ( std::stringstream &  ss) const
inline

LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTDEBUG.

Definition at line 425 of file SiStripFedCabling.h.

References printDebug().

Referenced by operator<<().

425  {
426  printDebug(ss);
427  }
void printDebug(std::stringstream &) const
void SiStripFedCabling::printDebug ( std::stringstream &  ss) const

Prints all connection information for this FED cabling object.

Definition at line 1180 of file SiStripFedCabling.cc.

References SiStripFedCabling::ConnsRange::begin(), detected_, SiStripFedCabling::ConnsRange::end(), feds_, sistrip::invalid_, findQualityFiles::jj, FEDNumbering::MINSiStripFEDID, range(), registry_, SiStripFedCabling::ConnsRange::size(), and undetected_.

Referenced by print().

1180  {
1181 
1182  uint16_t total = 0;
1183  uint16_t nfeds = 0;
1184  uint16_t cntr = 0;
1185 
1186  if ( feds_.empty() ) {
1187  ss << "[SiStripFedCabling::" << __func__ << "]"
1188  << " No FEDs found! Unable to print cabling map!";
1189  return;
1190  } else {
1191  ss << "[SiStripFedCabling::" << __func__ << "]"
1192  << " Printing cabling map for " << feds_.size()
1193  << " FEDs with following ids: ";
1194  }
1195 
1196  std::vector<uint16_t>::const_iterator ii = feds_.begin();
1197  std::vector<uint16_t>::const_iterator jj = feds_.end();
1198  for ( ; ii != jj; ++ii ) { ss << *ii << " "; }
1199  ss << std::endl << std::endl;
1200 
1201  std::vector<uint16_t>::const_iterator ifed = feds_.begin();
1202  std::vector<uint16_t>::const_iterator jfed = feds_.end();
1203  for ( ; ifed != jfed; ++ifed ) {
1204 
1205  uint16_t index = *ifed - FEDNumbering::MINSiStripFEDID;
1206  if ( index < registry_.size() ) {
1207  ConnsRange conns = range( registry_[ index ] );
1208 
1209  ss << " Printing cabling information for FED id " << *ifed
1210  << " (found " << conns.size()
1211  << " FedChannelConnection objects...)"
1212  << std::endl;
1213 
1214  uint16_t ichan = 0;
1215  uint16_t connected = 0;
1216  ConnsConstIter iconn = conns.begin();
1217  ConnsConstIter jconn = conns.end();
1218  for ( ; iconn != jconn; ++iconn ) {
1219  if ( iconn->fedId() != sistrip::invalid_ ) {
1220  connected++;
1221  ss << *iconn << std::endl;
1222  } else {
1223  ss << " (FedId/Ch " << *ifed << "/" << ichan
1224  << ": unconnected channel...)" << std::endl;
1225  cntr++;
1226  }
1227  ichan++;
1228  }
1229 
1230  ss << " Found " << connected
1231  << " connected channels for FED id " << *ifed << std::endl
1232  << std::endl;
1233  if ( connected ) { nfeds++; total += connected; }
1234 
1235  }
1236 
1237  }
1238 
1239  float percent = (100.*cntr) / (96.*nfeds);
1240  percent = static_cast<uint16_t>( 10.*percent );
1241  percent /= 10.;
1242  ss << " Found " << total
1243  << " APV pairs that are connected to a total of "
1244  << nfeds << " FEDs" << std::endl
1245  << " " << detected_.size()
1246  << " APV pairs have been detected, but are not connected" << std::endl
1247  << " " << undetected_.size()
1248  << " APV pairs are undetected (wrt DCU-DetId map)" << std::endl
1249  << " " << cntr
1250  << " FED channels out of a possible " << (96*nfeds)
1251  << " (" << nfeds << " FEDs) are unconnected ("
1252  << percent << "%)" << std::endl
1253  << std::endl;
1254 
1255 }
Feds feds_
&quot;Active&quot; FEDs that have connected FE devices
Registry registry_
Container of &quot;ranges&quot; indexed by FED id.
Conns undetected_
FE devices that are detected.
Conns detected_
Connections to FE devices that are not detected.
ConnsRange range(ConnsPair) const
Builds range of iterators from pair of offsets.
static const uint16_t invalid_
Definition: Constants.h:17
Conns::const_iterator ConnsConstIter
void SiStripFedCabling::printSummary ( std::stringstream &  ss) const

Prints summary information for this FED cabling object.

Definition at line 1308 of file SiStripFedCabling.cc.

References SiStripFedCabling::ConnsRange::begin(), detected_, feds_, SiStripFedKey::feUnit(), findQualityFiles::jj, FEDNumbering::MINSiStripFEDID, sistrip::mlCabling_, range(), registry_, SiStripFedCabling::ConnsRange::size(), pileupDistInMC::total, undetected_, csvLumiCalc::unit, and sistrip::valid_.

Referenced by summary().

1308  {
1309 
1310  ss << "[SiStripFedCabling::" << __func__ << "]";
1311 
1312  if ( feds_.empty() ) {
1313  ss << " No FEDs found!";
1314  return;
1315  }
1316 
1317  ss << " Found " << feds_.size() << " FEDs"
1318  << " with number of connected channels per front-end unit: "
1319  << std::endl
1320  << " FedId FeUnit1 FeUnit2 FeUnit3 FeUnit4 FeUnit5 FeUnit6 FeUnit7 FeUnit8 Total"
1321  << std::endl;
1322 
1323  uint16_t total = 0;
1324  uint16_t nfeds = 0;
1325 
1326  // iterate through fed ids
1327  std::vector<uint16_t>::const_iterator ii = feds_.begin();
1328  std::vector<uint16_t>::const_iterator jj = feds_.end();
1329  for ( ; ii != jj; ++ii ) {
1330 
1331  // check number of connection objects
1332  uint16_t index = *ii - FEDNumbering::MINSiStripFEDID;
1333  if ( index < registry_.size() ) {
1334  ConnsRange conns = range( registry_[ index ] );
1335 
1336  if ( conns.size() < 96 ) {
1338  << "[SiStripFedCabling::" << __func__ << "]"
1339  << " Unexpected size for FedChannelConnection vector! "
1340  << conns.size();
1341  return;
1342  }
1343 
1344  // count connected channels at level of fe unit
1345  std::vector<uint16_t> connected;
1346  connected.resize(8,0);
1347  for ( uint16_t ichan = 0; ichan < 96; ++ichan ) {
1348  ConnsConstIter iconn = conns.begin() + ichan;
1349  if ( iconn->fedId() < sistrip::valid_ ) {
1350  uint16_t unit = SiStripFedKey::feUnit(ichan);
1351  if ( unit > 8 ) { continue; }
1352  connected[unit-1]++;
1353  }
1354  }
1355 
1356  // increment counters
1357  uint16_t tot = 0 ;
1358  ss << " " << std::setw(5) << *ii;
1359  if ( !connected.empty() ) { nfeds++; }
1360  for ( uint16_t unit = 0; unit < 8; ++unit ) {
1361  ss << " " << std::setw(7) << connected[unit];
1362  if ( !connected.empty() ) { tot += connected[unit]; }
1363  }
1364  ss << " " << std::setw(5) << tot << std::endl;
1365  total += tot;
1366 
1367  }
1368 
1369  }
1370 
1371  // print out
1372  float percent = (100.*total) / (96.*nfeds);
1373  percent = static_cast<uint16_t>( 10.*percent );
1374  percent /= 10.;
1375  ss << " Found: " << std::endl
1376  << " " << nfeds << " out of " << feds_.size()
1377  << " FEDs with at least one connected channel " << std::endl
1378  << " " << feds_.size() - nfeds << " out of " << feds_.size()
1379  << " FEDs with no connected channels." << std::endl
1380  << " " << total << " connected channels in total" << std::endl
1381  << " " << detected_.size()
1382  << " APV pairs have been detected, but are not connected" << std::endl
1383  << " " << undetected_.size()
1384  << " APV pairs are undetected (wrt DCU-DetId map)" << std::endl
1385  << " " << percent
1386  << "% of FED channels are connected" << std::endl;
1387 
1388 }
Feds feds_
&quot;Active&quot; FEDs that have connected FE devices
static const uint16_t valid_
Definition: Constants.h:18
Registry registry_
Container of &quot;ranges&quot; indexed by FED id.
Conns undetected_
FE devices that are detected.
static const char mlCabling_[]
Conns detected_
Connections to FE devices that are not detected.
string unit
Definition: csvLumiCalc.py:46
ConnsRange range(ConnsPair) const
Builds range of iterators from pair of offsets.
const uint16_t & feUnit() const
Conns::const_iterator ConnsConstIter
SiStripFedCabling::ConnsRange SiStripFedCabling::range ( SiStripFedCabling::ConnsPair  p) const
inline

Builds range of iterators from pair of offsets.

Definition at line 542 of file SiStripFedCabling.h.

References connections_.

Referenced by buildFedCabling(), fedConnections(), printDebug(), printSummary(), and terse().

542  {
543  return ConnsRange( connections_, p );
544 }
Conns connections_
Container of connection objects.
void SiStripFedCabling::summary ( std::stringstream &  ss) const
inline

LEFT FOR COMPATIBILITY. SHOULD BE REPLACED BY PRINTSUMMARY.

Definition at line 435 of file SiStripFedCabling.h.

References printSummary().

Referenced by CommissioningHistosUsingDb::CommissioningHistosUsingDb(), and sistrip::RawToDigiModule::updateCabling().

435  {
436  printSummary(ss);
437  }
void printSummary(std::stringstream &) const
void SiStripFedCabling::terse ( std::stringstream &  ss) const

Prints terse information for this FED cabling object.

Definition at line 1259 of file SiStripFedCabling.cc.

References SiStripFedCabling::ConnsRange::begin(), SiStripFedCabling::ConnsRange::end(), feds_, sistrip::invalid_, FEDNumbering::MINSiStripFEDID, range(), registry_, and SiStripFedCabling::ConnsRange::size().

Referenced by CommissioningHistosUsingDb::CommissioningHistosUsingDb(), and sistrip::RawToDigiModule::updateCabling().

1259  {
1260 
1261 
1262  ss << "[SiStripFedCabling::" << __func__ << "]";
1263 
1264  if ( feds_.empty() ) {
1265  ss << " No FEDs found! Unable to print cabling map!";
1266  return;
1267  }
1268 
1269  ss << " Printing cabling map for " << feds_.size()
1270  << " FEDs: " << std::endl << std::endl;
1271 
1272  std::vector<uint16_t>::const_iterator ifed = feds_.begin();
1273  std::vector<uint16_t>::const_iterator jfed = feds_.end();
1274  for ( ; ifed != jfed; ++ifed ) {
1275 
1276  uint16_t index = *ifed - FEDNumbering::MINSiStripFEDID;
1277  if ( index < registry_.size() ) {
1278  ConnsRange conns = range( registry_[ index ] );
1279 
1280  ss << " Printing cabling information for FED id " << *ifed
1281  << " (found " << conns.size()
1282  << " FedChannelConnection objects...)"
1283  << std::endl;
1284 
1285  uint16_t connected = 0;
1286  ConnsConstIter iconn = conns.begin();
1287  ConnsConstIter jconn = conns.end();
1288  for ( ; iconn != jconn; ++iconn ) {
1289  if ( iconn->fedId() != sistrip::invalid_ ) {
1290  connected++;
1291  iconn->terse(ss);
1292  ss << std::endl;
1293  }
1294  }
1295 
1296  ss << " Found " << connected
1297  << " connected channels for FED id " << *ifed << std::endl
1298  << std::endl;
1299 
1300  }
1301 
1302  }
1303 
1304 }
Feds feds_
&quot;Active&quot; FEDs that have connected FE devices
Registry registry_
Container of &quot;ranges&quot; indexed by FED id.
ConnsRange range(ConnsPair) const
Builds range of iterators from pair of offsets.
static const uint16_t invalid_
Definition: Constants.h:17
Conns::const_iterator ConnsConstIter
const std::vector< FedChannelConnection > & SiStripFedCabling::undetected ( ) const

TO BE DEPRECATED! TO BE DEPRECATED! TO BE DEPRECATED!

Definition at line 970 of file SiStripFedCabling.cc.

References undetected_.

970  {
971  return undetected_;
972 }
Conns undetected_
FE devices that are detected.
SiStripFedCabling::ConnsConstIterRange SiStripFedCabling::undetectedDevices ( ) const
inline

Returns information for all "undetected" devices.

Definition at line 502 of file SiStripFedCabling.h.

References undetected_.

Referenced by SiStripDetCabling::SiStripDetCabling().

502  {
503  return ConnsConstIterRange( undetected_.begin(), undetected_.end() );
504 }
Conns undetected_
FE devices that are detected.
boost::iterator_range< ConnsConstIter > ConnsConstIterRange

Member Data Documentation

Conns SiStripFedCabling::connections_
private

Container of connection objects.

Definition at line 482 of file SiStripFedCabling.h.

Referenced by buildFedCabling(), and range().

Conns SiStripFedCabling::detected_
private

Connections to FE devices that are not detected.

Definition at line 485 of file SiStripFedCabling.h.

Referenced by detected(), detectedDevices(), printDebug(), and printSummary().

Feds SiStripFedCabling::feds_
private

"Active" FEDs that have connected FE devices

Definition at line 476 of file SiStripFedCabling.h.

Referenced by buildFedCabling(), fedIds(), feds(), printDebug(), printSummary(), and terse().

Registry SiStripFedCabling::registry_
private

Container of "ranges" indexed by FED id.

Definition at line 479 of file SiStripFedCabling.h.

Referenced by buildFedCabling(), fedConnections(), printDebug(), printSummary(), and terse().

Conns SiStripFedCabling::undetected_
private

FE devices that are detected.

Definition at line 488 of file SiStripFedCabling.h.

Referenced by printDebug(), printSummary(), undetected(), and undetectedDevices().