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 56 of file SiStripCondObjBuilderFromDb.h.

Constructor & Destructor Documentation

◆ SkipDeviceDescription() [1/2]

SiStripCondObjBuilderFromDb::SkipDeviceDescription::SkipDeviceDescription ( )

◆ SkipDeviceDescription() [2/2]

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

Definition at line 918 of file SiStripCondObjBuilderFromDb.cc.

919  : fec_(pset.getUntrackedParameter<uint32_t>("fecCrate", sistrip::invalid_),
920  pset.getUntrackedParameter<uint32_t>("fecSlot", sistrip::invalid_),
921  pset.getUntrackedParameter<uint32_t>("fecRing", sistrip::invalid_),
922  pset.getUntrackedParameter<uint32_t>("ccuAddr", sistrip::invalid_),
923  pset.getUntrackedParameter<uint32_t>("ccuChan", sistrip::invalid_),
924  pset.getUntrackedParameter<uint32_t>("lldChan", sistrip::invalid_),
925  pset.getUntrackedParameter<uint32_t>("i2cAddr", sistrip::invalid_)),
926  fed_(pset.getUntrackedParameter<uint32_t>("fedId", sistrip::invalid_),
927  pset.getUntrackedParameter<uint32_t>("feUnit", sistrip::invalid_),
928  pset.getUntrackedParameter<uint32_t>("feChan", sistrip::invalid_),
929  pset.getUntrackedParameter<uint32_t>("fedApv", sistrip::invalid_)),
930  detid_(pset.getUntrackedParameter<uint32_t>("detid", sistrip::invalid32_)) {
931  if (!fec_.isValid() && !fed_.isValid() && detid_ == sistrip::invalid32_) {
932  throw cms::Exception("InvalidPSet") << "None of FEC coordinates/FED coordinates/detids are valid in this PSet!\n"
933  << pset.dump(2);
934  }
935 }

References detid_, Exception, fec_, fed_, sistrip::invalid32_, SiStripFecKey::isValid(), SiStripFedKey::isValid(), and muonDTDigis_cfi::pset.

Member Function Documentation

◆ dump()

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

Definition at line 964 of file SiStripCondObjBuilderFromDb.cc.

964  {
965  std::stringstream ss;
966  fec_.terse(ss);
967  ss << "\n";
968  fed_.terse(ss);
969  ss << "\n";
970  ss << "detid=" << detid_;
971  return ss.str();
972 }

References contentValuesCheck::ss.

◆ isConsistent()

bool SiStripCondObjBuilderFromDb::SkipDeviceDescription::isConsistent ( const FedChannelConnection fc) const

Definition at line 937 of file SiStripCondObjBuilderFromDb.cc.

937  {
938  auto comp = [](uint16_t desc, uint16_t device) { return desc == 0 || desc == device; };
939 
940  // use FEC coordinates first if provided
941  if (fec_.isValid()) {
942  return comp(fec_.fecCrate(), fc.fecCrate()) && comp(fec_.fecSlot(), fc.fecSlot()) &&
943  comp(fec_.fecRing(), fc.fecRing()) && comp(fec_.ccuAddr(), fc.ccuAddr()) &&
944  comp(fec_.ccuChan(), fc.ccuChan()) && comp(fec_.lldChan(), fc.lldChannel()) &&
945  (comp(fec_.i2cAddr(), fc.i2cAddr(0)) ||
946  comp(fec_.i2cAddr(), fc.i2cAddr(1))); // do not distinguish between APV1 and APV2
947  }
948 
949  // then try FED coordinates
950  if (fed_.isValid()) {
951  return comp(fed_.fedId(), fc.fedId()) && comp(fed_.feUnit(), SiStripFedKey::feUnit(fc.fedCh())) &&
953  // no fedApv in FedChannelConnection -- and we do not distinguish between APV1 and APV2
954  }
955 
956  // last try detids (will skip all APVs on the module)
957  if (detid_ != sistrip::invalid32_) {
958  return detid_ == fc.detId();
959  }
960 
961  return false;
962 }

References FedChannelConnection::ccuAddr(), FedChannelConnection::ccuChan(), AlCaHLTBitMon_QueryRunRegistry::comp, submitPVResolutionJobs::desc, FedChannelConnection::detId(), FedChannelConnection::fecCrate(), SiStripFedKey::feChan(), FedChannelConnection::fecRing(), FedChannelConnection::fecSlot(), FedChannelConnection::fedCh(), FedChannelConnection::fedId(), SiStripFedKey::feUnit(), FedChannelConnection::i2cAddr(), sistrip::invalid32_, and FedChannelConnection::lldChannel().

Member Data Documentation

◆ detid_

uint32_t SiStripCondObjBuilderFromDb::SkipDeviceDescription::detid_
private

Definition at line 69 of file SiStripCondObjBuilderFromDb.h.

Referenced by SkipDeviceDescription().

◆ fec_

SiStripFecKey SiStripCondObjBuilderFromDb::SkipDeviceDescription::fec_
private

Definition at line 67 of file SiStripCondObjBuilderFromDb.h.

Referenced by SkipDeviceDescription().

◆ fed_

SiStripFedKey SiStripCondObjBuilderFromDb::SkipDeviceDescription::fed_
private

Definition at line 68 of file SiStripCondObjBuilderFromDb.h.

Referenced by SkipDeviceDescription().

FedChannelConnection::lldChannel
uint16_t lldChannel() const
Definition: FedChannelConnection.cc:106
FedChannelConnection::fecCrate
const uint16_t & fecCrate() const
Definition: FedChannelConnection.h:201
AlCaHLTBitMon_QueryRunRegistry.comp
string comp
Definition: AlCaHLTBitMon_QueryRunRegistry.py:249
sistrip::invalid32_
static const uint32_t invalid32_
Definition: Constants.h:15
SiStripFedKey::isValid
bool isValid() const override
Definition: SiStripFedKey.cc:157
FedChannelConnection::fedCh
const uint16_t & fedCh() const
Definition: FedChannelConnection.h:221
SiStripFecKey::lldChan
const uint16_t & lldChan() const
Definition: SiStripFecKey.h:203
FedChannelConnection::i2cAddr
const uint16_t & i2cAddr(const uint16_t &apv0_or_1) const
Definition: FedChannelConnection.cc:89
SiStripCondObjBuilderFromDb::SkipDeviceDescription::fed_
SiStripFedKey fed_
Definition: SiStripCondObjBuilderFromDb.h:68
SiStripFecKey::fecCrate
const uint16_t & fecCrate() const
Definition: SiStripFecKey.h:198
FedChannelConnection::fecSlot
const uint16_t & fecSlot() const
Definition: FedChannelConnection.h:202
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
SiStripFecKey::terse
void terse(std::stringstream &ss) const override
Definition: SiStripFecKey.cc:709
SiStripFecKey::fecRing
const uint16_t & fecRing() const
Definition: SiStripFecKey.h:200
SiStripFedKey::terse
void terse(std::stringstream &ss) const override
Definition: SiStripFedKey.cc:459
SiStripFecKey::ccuChan
const uint16_t & ccuChan() const
Definition: SiStripFecKey.h:202
FedChannelConnection::detId
const uint32_t & detId() const
Definition: FedChannelConnection.h:213
FedChannelConnection::ccuAddr
const uint16_t & ccuAddr() const
Definition: FedChannelConnection.h:204
SiStripFedKey::feUnit
const uint16_t & feUnit() const
Definition: SiStripFedKey.h:189
sistrip::invalid_
static const uint16_t invalid_
Definition: Constants.h:16
SiStripCondObjBuilderFromDb::SkipDeviceDescription::detid_
uint32_t detid_
Definition: SiStripCondObjBuilderFromDb.h:69
FedChannelConnection::fedId
const uint16_t & fedId() const
Definition: FedChannelConnection.h:220
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
SiStripFecKey::i2cAddr
const uint16_t & i2cAddr() const
Definition: SiStripFecKey.h:204
Exception
Definition: hltDiff.cc:245
SiStripFecKey::ccuAddr
const uint16_t & ccuAddr() const
Definition: SiStripFecKey.h:201
SiStripCondObjBuilderFromDb::SkipDeviceDescription::fec_
SiStripFecKey fec_
Definition: SiStripCondObjBuilderFromDb.h:67
FedChannelConnection::ccuChan
const uint16_t & ccuChan() const
Definition: FedChannelConnection.h:205
SiStripFecKey::fecSlot
const uint16_t & fecSlot() const
Definition: SiStripFecKey.h:199
SiStripFedKey::fedId
const uint16_t & fedId() const
Definition: SiStripFedKey.h:188
FedChannelConnection::fecRing
const uint16_t & fecRing() const
Definition: FedChannelConnection.h:203
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
SiStripFedKey::feChan
const uint16_t & feChan() const
Definition: SiStripFedKey.h:190
SiStripFecKey::isValid
bool isValid() const override
Definition: SiStripFecKey.cc:244