CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
SiStripCondObjBuilderFromDb::SkipDeviceDescription Class Reference

#include <SiStripCondObjBuilderFromDb.h>

Public Member Functions

std::string dump () const
 
bool isConsistent (const FedChannelConnection &fc) const
 
 SkipDeviceDescription ()
 
 SkipDeviceDescription (const edm::ParameterSet &pset)
 

Private Attributes

uint32_t detid_
 
SiStripFecKey fec_
 
SiStripFedKey fed_
 

Detailed Description

Definition at line 59 of file SiStripCondObjBuilderFromDb.h.

Constructor & Destructor Documentation

SiStripCondObjBuilderFromDb::SkipDeviceDescription::SkipDeviceDescription ( )
SiStripCondObjBuilderFromDb::SkipDeviceDescription::SkipDeviceDescription ( const edm::ParameterSet pset)

Definition at line 927 of file SiStripCondObjBuilderFromDb.cc.

References detid_, edm::ParameterSet::dump(), Exception, fec_, fed_, sistrip::invalid32_, SiStripFecKey::isValid(), and SiStripFedKey::isValid().

927  :
928  fec_(pset.getUntrackedParameter<uint32_t>("fecCrate", sistrip::invalid_),
929  pset.getUntrackedParameter<uint32_t>("fecSlot", sistrip::invalid_),
930  pset.getUntrackedParameter<uint32_t>("fecRing", sistrip::invalid_),
931  pset.getUntrackedParameter<uint32_t>("ccuAddr", sistrip::invalid_),
932  pset.getUntrackedParameter<uint32_t>("ccuChan", sistrip::invalid_),
933  pset.getUntrackedParameter<uint32_t>("lldChan", sistrip::invalid_),
934  pset.getUntrackedParameter<uint32_t>("i2cAddr", sistrip::invalid_)),
935  fed_(pset.getUntrackedParameter<uint32_t>("fedId", sistrip::invalid_),
936  pset.getUntrackedParameter<uint32_t>("feUnit", sistrip::invalid_),
937  pset.getUntrackedParameter<uint32_t>("feChan", sistrip::invalid_),
938  pset.getUntrackedParameter<uint32_t>("fedApv", sistrip::invalid_)),
939  detid_(pset.getUntrackedParameter<uint32_t>("detid", sistrip::invalid32_))
940 {
942  throw cms::Exception("InvalidPSet") << "None of FEC coordinates/FED coordinates/detids are valid in this PSet!\n" << pset.dump(2);
943  }
944 }
T getUntrackedParameter(std::string const &, T const &) const
std::string dump(unsigned int indent=0) const
static const uint32_t invalid32_
Definition: Constants.h:15
static const uint16_t invalid_
Definition: Constants.h:16
bool isValid() const override
bool isValid() const override

Member Function Documentation

std::string SiStripCondObjBuilderFromDb::SkipDeviceDescription::dump ( void  ) const

Definition at line 977 of file SiStripCondObjBuilderFromDb.cc.

References detid_, fec_, fed_, SiStripFecKey::terse(), and SiStripFedKey::terse().

977  {
978  std::stringstream ss;
979  fec_.terse(ss);
980  ss << "\n";
981  fed_.terse(ss);
982  ss << "\n";
983  ss << "detid=" << detid_;
984  return ss.str();
985 }
void terse(std::stringstream &ss) const override
void terse(std::stringstream &ss) const override
bool SiStripCondObjBuilderFromDb::SkipDeviceDescription::isConsistent ( const FedChannelConnection fc) const

Definition at line 946 of file SiStripCondObjBuilderFromDb.cc.

References SiStripFecKey::ccuAddr(), FedChannelConnection::ccuAddr(), SiStripFecKey::ccuChan(), FedChannelConnection::ccuChan(), AlCaHLTBitMon_QueryRunRegistry::comp, FedChannelConnection::detId(), detid_, fec_, SiStripFecKey::fecCrate(), FedChannelConnection::fecCrate(), SiStripFedKey::feChan(), SiStripFecKey::fecRing(), FedChannelConnection::fecRing(), SiStripFecKey::fecSlot(), FedChannelConnection::fecSlot(), fed_, FedChannelConnection::fedCh(), SiStripFedKey::fedId(), FedChannelConnection::fedId(), SiStripFedKey::feUnit(), SiStripFecKey::i2cAddr(), FedChannelConnection::i2cAddr(), sistrip::invalid32_, SiStripFecKey::isValid(), SiStripFedKey::isValid(), SiStripFecKey::lldChan(), and FedChannelConnection::lldChannel().

946  {
947 
948  auto comp = [](uint16_t desc, uint16_t device) { return desc==0 || desc==device; };
949 
950  // use FEC coordinates first if provided
951  if (fec_.isValid()){
952  return comp(fec_.fecCrate(), fc.fecCrate())
953  && comp(fec_.fecSlot(), fc.fecSlot())
954  && comp(fec_.fecRing(), fc.fecRing())
955  && comp(fec_.ccuAddr(), fc.ccuAddr())
956  && comp(fec_.ccuChan(), fc.ccuChan())
957  && comp(fec_.lldChan(), fc.lldChannel())
958  && (comp(fec_.i2cAddr(), fc.i2cAddr(0)) || comp(fec_.i2cAddr(), fc.i2cAddr(1))); // do not distinguish between APV1 and APV2
959  }
960 
961  // then try FED coordinates
962  if (fed_.isValid()){
963  return comp(fed_.fedId(), fc.fedId())
966  // no fedApv in FedChannelConnection -- and we do not distinguish between APV1 and APV2
967  }
968 
969  // last try detids (will skip all APVs on the module)
971  return detid_ == fc.detId();
972  }
973 
974  return false;
975 }
const uint16_t & fecSlot() const
const uint16_t & fecCrate() const
const uint16_t & fecRing() const
const uint16_t & fedCh() const
static const uint32_t invalid32_
Definition: Constants.h:15
const uint16_t & lldChan() const
const uint16_t & fecSlot() const
uint16_t lldChannel() const
const uint16_t & i2cAddr() const
const uint16_t & fedId() const
const uint16_t & fecRing() const
const uint32_t & detId() const
const uint16_t & ccuChan() const
const uint16_t & ccuAddr() const
const uint16_t & fecCrate() const
const uint16_t & feUnit() const
const uint16_t & ccuAddr() const
const uint16_t & feChan() const
bool isValid() const override
bool isValid() const override
const uint16_t & ccuChan() const
const uint16_t & fedId() const
const uint16_t & i2cAddr(const uint16_t &apv0_or_1) const

Member Data Documentation

uint32_t SiStripCondObjBuilderFromDb::SkipDeviceDescription::detid_
private

Definition at line 72 of file SiStripCondObjBuilderFromDb.h.

Referenced by dump(), isConsistent(), and SkipDeviceDescription().

SiStripFecKey SiStripCondObjBuilderFromDb::SkipDeviceDescription::fec_
private

Definition at line 70 of file SiStripCondObjBuilderFromDb.h.

Referenced by dump(), isConsistent(), and SkipDeviceDescription().

SiStripFedKey SiStripCondObjBuilderFromDb::SkipDeviceDescription::fed_
private

Definition at line 71 of file SiStripCondObjBuilderFromDb.h.

Referenced by dump(), isConsistent(), and SkipDeviceDescription().