#include <DataFormats/SiStripCommon/interface/SiStripFecKey.h>
Public Member Functions | |
const uint16_t & | ccuAddr () const |
Returns CCU module. | |
const uint16_t & | ccuChan () const |
Returns Front-End module. | |
const uint16_t & | fecCrate () const |
Returns VME crate. | |
const uint16_t & | fecRing () const |
Returns FEC control ring. | |
const uint16_t & | fecSlot () const |
Returns FEC identifier (VME slot). | |
const uint16_t & | i2cAddr () const |
Returns I2C address ("invalid" if inconsistent with LLD chan. | |
bool | isConsistent (const SiStripKey &) const |
"Consistent" means identical and/or null (ie, "all") data. | |
bool | isEqual (const SiStripKey &) const |
Identifies key objects with identical member data. | |
bool | isInvalid (const sistrip::Granularity &) const |
All member data to level of "Granularity" are invalid. | |
bool | isInvalid () const |
Identifies all member data as being "invalid". | |
bool | isValid (const sistrip::Granularity &) const |
All member data to level of "Granularity" are "valid". | |
bool | isValid () const |
Identifies all member data as being "valid" or "all" (null). | |
const uint16_t & | lldChan () const |
Returns LLD channel. | |
virtual void | print (std::stringstream &ss) const |
A terse summary of the key. | |
SiStripFecKey () | |
Default constructor. | |
SiStripFecKey (const SiStripKey &, const sistrip::Granularity &) | |
Copy to level specified by granularity. | |
SiStripFecKey (const SiStripKey &) | |
Copy constructor using base class. | |
SiStripFecKey (const SiStripFecKey &) | |
Copy constructor. | |
SiStripFecKey (const std::string &directory_path) | |
Constructor using directory path. | |
SiStripFecKey (const uint32_t &fec_key) | |
Constructor using 32-bit "FEC key". | |
SiStripFecKey (const uint16_t &fec_crate, const uint16_t &fec_slot=0, const uint16_t &fec_ring=0, const uint16_t &ccu_addr=0, const uint16_t &ccu_chan=0, const uint16_t &lld_chan=0, const uint16_t &i2c_addr=0) | |
Constructor using crate, FEC, ring, CCU, module and channel. | |
virtual void | terse (std::stringstream &ss) const |
A terse summary of the key. | |
Static Public Member Functions | |
static bool | firstApvOfPair (const uint16_t &i2c_addr) |
Identifies if first APV of pair for given I2C addr (32-37). | |
static uint16_t | hybridPos (const uint16_t &i2c_addr) |
Returns hybrid position (1-6) for a given I2C addr (32-37). | |
static uint16_t | i2cAddr (const uint16_t &lld_chan, const bool &first_apv_of_pair) |
Returns I2C addr (32-37) for LLD chan (1-3) and APV pos. | |
static uint16_t | i2cAddr (const uint16_t &hybrid_pos) |
Returns I2C addr (32-37) for a given hybrid position (1-6). | |
static uint16_t | lldChan (const uint16_t &i2c_addr) |
Returns LLD channel (1-3) for a given APV I2C addr (32-37). | |
Private Member Functions | |
void | initFromKey () |
void | initFromPath () |
void | initFromValue () |
void | initGranularity () |
Private Attributes | |
uint16_t | ccuAddr_ |
CCU module [0,1-126,invalid]. | |
uint16_t | ccuChan_ |
FE module [0,16-31,invalid]. | |
uint16_t | fecCrate_ |
FEC crate [0,1-4,invalid]. | |
uint16_t | fecRing_ |
FEC ring [0,1-8,invalid]. | |
uint16_t | fecSlot_ |
FEC slot [0,2-21,invalid]. | |
uint16_t | i2cAddr_ |
APV I2C address [0,32-37,invalid]. | |
uint16_t | lldChan_ |
LLD channel [0,1-3,invalid]. | |
Static Private Attributes | |
static const uint16_t | ccuAddrMask_ = 0xFF |
static const uint16_t | ccuAddrOffset_ = 10 |
static const uint16_t | ccuChanMask_ = 0x1F |
static const uint16_t | ccuChanOffset_ = 5 |
static const uint16_t | fecCrateMask_ = 0x07 |
static const uint16_t | fecCrateOffset_ = 27 |
static const uint16_t | fecRingMask_ = 0x0F |
static const uint16_t | fecRingOffset_ = 18 |
static const uint16_t | fecSlotMask_ = 0x1F |
static const uint16_t | fecSlotOffset_ = 22 |
static const uint16_t | i2cAddrMask_ = 0x03 |
static const uint16_t | i2cAddrOffset_ = 0 |
static const uint16_t | lldChanMask_ = 0x07 |
static const uint16_t | lldChanOffset_ = 2 |
Utility class that identifies a position within the strip tracker control structure, down to the level of an APV25.
The class allows to encode the position within a 32-bit "key" and, conversely, unpack a 32-bit key to provide the position.
The class provides the following member data:
Member data (integer in type only) with values of 0xFFFF signifies "invalid" (ie, FecSlot = 0xFFFF means "invalid FEC slot"). Data with null values signifies "all" (ie, FecSlot = 0 means "all FEC slots").
The class generates a "directory path" string according to the member data. This can be used to organise histograms / other data types when using DQM / root. Conversely, the member data can also be built using the directory path when provided as a constructor argument.
The class also provides the "granularity" to which the FEC key is unambiguous (ie, not "invalid" or "null") in defining a position within the control system.
Definition at line 46 of file SiStripFecKey.h.
SiStripFecKey::SiStripFecKey | ( | const uint16_t & | fec_crate, | |
const uint16_t & | fec_slot = 0 , |
|||
const uint16_t & | fec_ring = 0 , |
|||
const uint16_t & | ccu_addr = 0 , |
|||
const uint16_t & | ccu_chan = 0 , |
|||
const uint16_t & | lld_chan = 0 , |
|||
const uint16_t & | i2c_addr = 0 | |||
) |
Constructor using crate, FEC, ring, CCU, module and channel.
Definition at line 14 of file SiStripFecKey.cc.
References initFromKey(), initFromPath(), initFromValue(), and initGranularity().
00020 : 00021 SiStripKey(), 00022 fecCrate_(fec_crate), 00023 fecSlot_(fec_slot), 00024 fecRing_(fec_ring), 00025 ccuAddr_(ccu_addr), 00026 ccuChan_(ccu_chan), 00027 lldChan_(lld_chan), 00028 i2cAddr_(i2c_addr) 00029 { 00030 // order is important! 00031 initFromValue(); 00032 initFromKey(); 00033 initFromPath(); 00034 initGranularity(); 00035 }
SiStripFecKey::SiStripFecKey | ( | const uint32_t & | fec_key | ) |
Constructor using 32-bit "FEC key".
Definition at line 39 of file SiStripFecKey.cc.
References initFromKey(), initFromPath(), initFromValue(), and initGranularity().
00039 : 00040 SiStripKey(fec_key), 00041 fecCrate_(sistrip::invalid_), 00042 fecSlot_(sistrip::invalid_), 00043 fecRing_(sistrip::invalid_), 00044 ccuAddr_(sistrip::invalid_), 00045 ccuChan_(sistrip::invalid_), 00046 lldChan_(sistrip::invalid_), 00047 i2cAddr_(sistrip::invalid_) 00048 { 00049 // order is important! 00050 initFromKey(); 00051 initFromValue(); 00052 initFromPath(); 00053 initGranularity(); 00054 }
SiStripFecKey::SiStripFecKey | ( | const std::string & | directory_path | ) |
Constructor using directory path.
Definition at line 58 of file SiStripFecKey.cc.
References initFromKey(), initFromPath(), initFromValue(), and initGranularity().
00058 : 00059 SiStripKey(path), 00060 fecCrate_(sistrip::invalid_), 00061 fecSlot_(sistrip::invalid_), 00062 fecRing_(sistrip::invalid_), 00063 ccuAddr_(sistrip::invalid_), 00064 ccuChan_(sistrip::invalid_), 00065 lldChan_(sistrip::invalid_), 00066 i2cAddr_(sistrip::invalid_) 00067 { 00068 // order is important! 00069 initFromPath(); 00070 initFromValue(); 00071 initFromKey(); 00072 initGranularity(); 00073 }
SiStripFecKey::SiStripFecKey | ( | const SiStripFecKey & | input | ) |
Copy constructor.
Definition at line 77 of file SiStripFecKey.cc.
References SiStripKey::granularity(), SiStripKey::key(), and SiStripKey::path().
00077 : 00078 SiStripKey(), 00079 fecCrate_(input.fecCrate()), 00080 fecSlot_(input.fecSlot()), 00081 fecRing_(input.fecRing()), 00082 ccuAddr_(input.ccuAddr()), 00083 ccuChan_(input.ccuChan()), 00084 lldChan_(input.lldChan()), 00085 i2cAddr_(input.i2cAddr()) 00086 { 00087 key(input.key()); 00088 path(input.path()); 00089 granularity(input.granularity()); 00090 }
SiStripFecKey::SiStripFecKey | ( | const SiStripKey & | input | ) |
Copy constructor using base class.
Definition at line 94 of file SiStripFecKey.cc.
References ccuAddr(), ccuAddr_, ccuChan(), ccuChan_, fecCrate(), fecCrate_, fecRing(), fecRing_, fecSlot(), fecSlot_, SiStripKey::granularity(), i2cAddr(), i2cAddr_, SiStripKey::key(), lldChan(), lldChan_, SiStripKey::path(), and pyDBSRunClass::temp.
00094 : 00095 SiStripKey(), 00096 fecCrate_(sistrip::invalid_), 00097 fecSlot_(sistrip::invalid_), 00098 fecRing_(sistrip::invalid_), 00099 ccuAddr_(sistrip::invalid_), 00100 ccuChan_(sistrip::invalid_), 00101 lldChan_(sistrip::invalid_), 00102 i2cAddr_(sistrip::invalid_) 00103 { 00104 SiStripKey& temp = const_cast<SiStripKey&>(input); 00105 SiStripFecKey& fec_key = dynamic_cast<SiStripFecKey&>(temp); 00106 if ( (&fec_key) ) { 00107 key(fec_key.key()); 00108 path(fec_key.path()); 00109 granularity(fec_key.granularity()); 00110 fecCrate_ = fec_key.fecCrate(); 00111 fecSlot_ = fec_key.fecSlot(); 00112 fecRing_ = fec_key.fecRing(); 00113 ccuAddr_ = fec_key.ccuAddr(); 00114 ccuChan_ = fec_key.ccuChan(); 00115 lldChan_ = fec_key.lldChan(); 00116 i2cAddr_ = fec_key.i2cAddr(); 00117 } 00118 }
SiStripFecKey::SiStripFecKey | ( | const SiStripKey & | input, | |
const sistrip::Granularity & | gran | |||
) |
Copy to level specified by granularity.
Definition at line 122 of file SiStripFecKey.cc.
References sistrip::APV, sistrip::CCU_ADDR, sistrip::CCU_CHAN, ccuAddr(), ccuAddr_, ccuChan(), ccuChan_, sistrip::FEC_CRATE, sistrip::FEC_RING, sistrip::FEC_SLOT, fecCrate(), fecCrate_, fecRing(), fecRing_, fecSlot(), fecSlot_, i2cAddr(), i2cAddr_, initFromKey(), initFromPath(), initFromValue(), initGranularity(), sistrip::LLD_CHAN, lldChan(), lldChan_, and pyDBSRunClass::temp.
00123 : 00124 SiStripKey(), 00125 fecCrate_(0), 00126 fecSlot_(0), 00127 fecRing_(0), 00128 ccuAddr_(0), 00129 ccuChan_(0), 00130 lldChan_(0), 00131 i2cAddr_(0) 00132 { 00133 SiStripKey& temp = const_cast<SiStripKey&>(input); 00134 SiStripFecKey& fec_key = dynamic_cast<SiStripFecKey&>(temp); 00135 if ( (&fec_key) ) { 00136 00137 if ( gran == sistrip::FEC_CRATE || gran == sistrip::FEC_SLOT || 00138 gran == sistrip::FEC_RING || gran == sistrip::CCU_ADDR || 00139 gran == sistrip::CCU_CHAN || gran == sistrip::LLD_CHAN || 00140 gran == sistrip::APV ) { 00141 fecCrate_ = fec_key.fecCrate(); 00142 } 00143 00144 if ( gran == sistrip::FEC_SLOT || gran == sistrip::FEC_RING || 00145 gran == sistrip::CCU_ADDR || gran == sistrip::CCU_CHAN || 00146 gran == sistrip::LLD_CHAN || gran == sistrip::APV ) { 00147 fecSlot_ = fec_key.fecSlot(); 00148 } 00149 00150 if ( gran == sistrip::FEC_RING || gran == sistrip::CCU_ADDR || 00151 gran == sistrip::CCU_CHAN || gran == sistrip::LLD_CHAN || 00152 gran == sistrip::APV ) { 00153 fecRing_ = fec_key.fecRing(); 00154 } 00155 00156 if ( gran == sistrip::CCU_ADDR || gran == sistrip::CCU_CHAN || 00157 gran == sistrip::LLD_CHAN || gran == sistrip::APV ) { 00158 ccuAddr_ = fec_key.ccuAddr(); 00159 } 00160 00161 if ( gran == sistrip::CCU_CHAN || gran == sistrip::LLD_CHAN || 00162 gran == sistrip::APV ) { 00163 ccuChan_ = fec_key.ccuChan(); 00164 } 00165 00166 if ( gran == sistrip::LLD_CHAN || gran == sistrip::APV ) { 00167 lldChan_ = fec_key.lldChan(); 00168 } 00169 00170 if ( gran == sistrip::APV ) { 00171 i2cAddr_ = fec_key.i2cAddr(); 00172 } 00173 00174 initFromValue(); 00175 initFromKey(); 00176 initFromPath(); 00177 initGranularity(); 00178 00179 } 00180 00181 }
SiStripFecKey::SiStripFecKey | ( | ) |
Default constructor.
Definition at line 185 of file SiStripFecKey.cc.
00185 : 00186 SiStripKey(), 00187 fecCrate_(sistrip::invalid_), 00188 fecSlot_(sistrip::invalid_), 00189 fecRing_(sistrip::invalid_), 00190 ccuAddr_(sistrip::invalid_), 00191 ccuChan_(sistrip::invalid_), 00192 lldChan_(sistrip::invalid_), 00193 i2cAddr_(sistrip::invalid_) 00194 {;}
const uint16_t & SiStripFecKey::ccuAddr | ( | ) | const [inline] |
Returns CCU module.
Definition at line 208 of file SiStripFecKey.h.
References ccuAddr_.
Referenced by SiStripModule::addApv(), SiStripModule::addDevices(), CommissioningHistosUsingDb::buildDetInfo(), SiStripModule::ccuAddr(), CommissioningHistosUsingDb::deviceIsPresent(), CalibrationSummaryFactory::extract(), SummaryGeneratorControlView::fill(), SiStripCommissioningSource::fillCablingHistos(), FastFedCablingAnalysis::header(), CommissioningAnalysis::header(), ApvTimingHistograms::histoAnalysis(), FedTimingHistograms::histoAnalysis(), isConsistent(), isEqual(), print(), SiStripModule::print(), SiStripFecKey(), PedsOnlyAnalysis::summary(), VpspScanAnalysis::summary(), NoiseAnalysis::summary(), PedestalsAnalysis::summary(), OptoScanAnalysis::summary(), CommissioningAnalysis::summary(), terse(), SiStripModule::terse(), OptoScanHistosUsingDb::update(), LatencyHistosUsingDb::update(), ApvTimingHistosUsingDb::update(), VpspScanHistosUsingDb::update(), and FineDelayHistosUsingDb::update().
00208 { return ccuAddr_; }
const uint16_t & SiStripFecKey::ccuChan | ( | ) | const [inline] |
Returns Front-End module.
Definition at line 209 of file SiStripFecKey.h.
References ccuChan_.
Referenced by SiStripModule::addApv(), SiStripModule::addDevices(), CommissioningHistosUsingDb::buildDetInfo(), SiStripModule::ccuChan(), CommissioningHistosUsingDb::deviceIsPresent(), CalibrationSummaryFactory::extract(), SummaryGeneratorControlView::fill(), SiStripCommissioningSource::fillCablingHistos(), FastFedCablingAnalysis::header(), CommissioningAnalysis::header(), ApvTimingHistograms::histoAnalysis(), FedTimingHistograms::histoAnalysis(), isEqual(), print(), SiStripModule::print(), SiStripFecKey(), PedsOnlyAnalysis::summary(), VpspScanAnalysis::summary(), NoiseAnalysis::summary(), PedestalsAnalysis::summary(), OptoScanAnalysis::summary(), CommissioningAnalysis::summary(), terse(), SiStripModule::terse(), OptoScanHistosUsingDb::update(), LatencyHistosUsingDb::update(), ApvTimingHistosUsingDb::update(), VpspScanHistosUsingDb::update(), and FineDelayHistosUsingDb::update().
00209 { return ccuChan_; }
const uint16_t & SiStripFecKey::fecCrate | ( | ) | const [inline] |
Returns VME crate.
Definition at line 205 of file SiStripFecKey.h.
References fecCrate_.
Referenced by SiStripModule::addApv(), SiStripModule::addDevices(), CommissioningHistosUsingDb::buildDetInfo(), CommissioningHistosUsingDb::deviceIsPresent(), CalibrationSummaryFactory::extract(), SiStripModule::fecCrate(), SummaryGeneratorControlView::fill(), SiStripCommissioningSource::fillCablingHistos(), FastFedCablingAnalysis::header(), CommissioningAnalysis::header(), ApvTimingHistograms::histoAnalysis(), FedTimingHistograms::histoAnalysis(), isConsistent(), isEqual(), print(), SiStripModule::print(), SiStripConfigDb::printDeviceDescriptions(), SiStripFecKey(), PedsOnlyAnalysis::summary(), VpspScanAnalysis::summary(), NoiseAnalysis::summary(), PedestalsAnalysis::summary(), OptoScanAnalysis::summary(), CommissioningAnalysis::summary(), terse(), SiStripModule::terse(), OptoScanHistosUsingDb::update(), LatencyHistosUsingDb::update(), ApvTimingHistosUsingDb::update(), VpspScanHistosUsingDb::update(), and FineDelayHistosUsingDb::update().
00205 { return fecCrate_; }
const uint16_t & SiStripFecKey::fecRing | ( | ) | const [inline] |
Returns FEC control ring.
Definition at line 207 of file SiStripFecKey.h.
References fecRing_.
Referenced by SiStripModule::addApv(), SiStripModule::addDevices(), CommissioningHistosUsingDb::buildDetInfo(), CommissioningHistosUsingDb::deviceIsPresent(), CalibrationSummaryFactory::extract(), SiStripModule::fecRing(), SummaryGeneratorControlView::fill(), SiStripCommissioningSource::fillCablingHistos(), FastFedCablingAnalysis::header(), CommissioningAnalysis::header(), ApvTimingHistograms::histoAnalysis(), FedTimingHistograms::histoAnalysis(), isConsistent(), isEqual(), print(), SiStripModule::print(), SiStripConfigDb::printDeviceDescriptions(), SiStripFecKey(), PedsOnlyAnalysis::summary(), VpspScanAnalysis::summary(), NoiseAnalysis::summary(), PedestalsAnalysis::summary(), OptoScanAnalysis::summary(), CommissioningAnalysis::summary(), terse(), SiStripModule::terse(), OptoScanHistosUsingDb::update(), LatencyHistosUsingDb::update(), ApvTimingHistosUsingDb::update(), VpspScanHistosUsingDb::update(), and FineDelayHistosUsingDb::update().
00207 { return fecRing_; }
const uint16_t & SiStripFecKey::fecSlot | ( | ) | const [inline] |
Returns FEC identifier (VME slot).
Definition at line 206 of file SiStripFecKey.h.
References fecSlot_.
Referenced by SiStripModule::addApv(), SiStripModule::addDevices(), CommissioningHistosUsingDb::buildDetInfo(), CommissioningHistosUsingDb::deviceIsPresent(), CalibrationSummaryFactory::extract(), SiStripModule::fecSlot(), SummaryGeneratorControlView::fill(), SiStripCommissioningSource::fillCablingHistos(), FastFedCablingAnalysis::header(), CommissioningAnalysis::header(), ApvTimingHistograms::histoAnalysis(), FedTimingHistograms::histoAnalysis(), isConsistent(), isEqual(), print(), SiStripModule::print(), SiStripConfigDb::printDeviceDescriptions(), SiStripFecKey(), PedsOnlyAnalysis::summary(), VpspScanAnalysis::summary(), NoiseAnalysis::summary(), PedestalsAnalysis::summary(), OptoScanAnalysis::summary(), CommissioningAnalysis::summary(), terse(), SiStripModule::terse(), OptoScanHistosUsingDb::update(), LatencyHistosUsingDb::update(), ApvTimingHistosUsingDb::update(), VpspScanHistosUsingDb::update(), and FineDelayHistosUsingDb::update().
00206 { return fecSlot_; }
bool SiStripFecKey::firstApvOfPair | ( | const uint16_t & | i2c_addr | ) | [static] |
Identifies if first APV of pair for given I2C addr (32-37).
Definition at line 242 of file SiStripFecKey.cc.
References sistrip::APV_I2C_MAX, sistrip::APV_I2C_MIN, and sistrip::invalid_.
Referenced by initFromKey().
00242 { 00243 if ( i2c_addr < sistrip::APV_I2C_MIN || 00244 i2c_addr > sistrip::APV_I2C_MAX ) { 00245 return sistrip::invalid_; 00246 } 00247 return ( ( ( i2c_addr - sistrip::APV_I2C_MIN ) % 2 ) == 0 ); 00248 }
uint16_t SiStripFecKey::hybridPos | ( | const uint16_t & | i2c_addr | ) | [static] |
Returns hybrid position (1-6) for a given I2C addr (32-37).
Definition at line 198 of file SiStripFecKey.cc.
References sistrip::APV_I2C_MAX, sistrip::APV_I2C_MIN, and sistrip::invalid_.
00198 { 00199 if ( i2c_addr < sistrip::APV_I2C_MIN || 00200 i2c_addr > sistrip::APV_I2C_MAX ) { 00201 return sistrip::invalid_; 00202 } 00203 return ( i2c_addr - sistrip::APV_I2C_MIN + 1 ); 00204 }
uint16_t SiStripFecKey::i2cAddr | ( | const uint16_t & | lld_chan, | |
const bool & | first_apv_of_pair | |||
) | [static] |
Returns I2C addr (32-37) for LLD chan (1-3) and APV pos.
Definition at line 220 of file SiStripFecKey.cc.
References sistrip::APV_I2C_MIN, sistrip::APVS_PER_CHAN, sistrip::invalid_, sistrip::LLD_CHAN_MAX, and sistrip::LLD_CHAN_MIN.
00221 { 00222 if ( lld_chan < sistrip::LLD_CHAN_MIN || 00223 lld_chan > sistrip::LLD_CHAN_MAX ) { 00224 return sistrip::invalid_; 00225 } 00226 return ( sistrip::APV_I2C_MIN + lld_chan * sistrip::APVS_PER_CHAN - (first_apv?2:1) ); 00227 }
uint16_t SiStripFecKey::i2cAddr | ( | const uint16_t & | hybrid_pos | ) | [static] |
Returns I2C addr (32-37) for a given hybrid position (1-6).
Definition at line 208 of file SiStripFecKey.cc.
References sistrip::APV_I2C_MAX, sistrip::APV_I2C_MIN, and sistrip::invalid_.
00208 { 00209 if ( !hybrid_pos || 00210 hybrid_pos > 00211 ( sistrip::APV_I2C_MAX - 00212 sistrip::APV_I2C_MIN + 1 ) ) { 00213 return sistrip::invalid_; 00214 } 00215 return ( hybrid_pos + sistrip::APV_I2C_MIN - 1 ); 00216 }
const uint16_t & SiStripFecKey::i2cAddr | ( | ) | const [inline] |
Returns I2C address ("invalid" if inconsistent with LLD chan.
Definition at line 211 of file SiStripFecKey.h.
References i2cAddr_.
Referenced by SiStripFedCablingBuilderFromDb::buildFecCablingFromDevices(), PedestalsHistosUsingDb::create(), FastFedCablingHistosUsingDb::create(), VpspScanHistosUsingDb::create(), CalibrationHistosUsingDb::create(), NoiseHistosUsingDb::create(), PedsOnlyHistosUsingDb::create(), ApvTimingHistosUsingDb::create(), OptoScanHistosUsingDb::create(), CalibrationSummaryFactory::extract(), initFromKey(), isConsistent(), isEqual(), print(), SiStripFecKey(), PedsOnlyAnalysis::summary(), NoiseAnalysis::summary(), PedestalsAnalysis::summary(), terse(), and FastFedCablingHistosUsingDb::update().
00211 { return i2cAddr_; }
void SiStripFecKey::initFromKey | ( | ) | [private, virtual] |
Reimplemented from SiStripKey.
Definition at line 426 of file SiStripFecKey.cc.
References sistrip::APV_I2C_MAX, sistrip::APV_I2C_MIN, sistrip::CCU_ADDR_MAX, sistrip::CCU_ADDR_MIN, sistrip::CCU_CHAN_MAX, sistrip::CCU_CHAN_MIN, ccuAddr_, ccuAddrMask_, ccuAddrOffset_, ccuChan_, ccuChanMask_, ccuChanOffset_, sistrip::CRATE_SLOT_MAX, sistrip::CRATE_SLOT_MIN, sistrip::FEC_CRATE_MAX, sistrip::FEC_CRATE_MIN, sistrip::FEC_RING_MAX, sistrip::FEC_RING_MIN, fecCrate_, fecCrateMask_, fecCrateOffset_, fecRing_, fecRingMask_, fecRingOffset_, fecSlot_, fecSlotMask_, fecSlotOffset_, firstApvOfPair(), i2cAddr(), i2cAddr_, i2cAddrMask_, i2cAddrOffset_, sistrip::invalid32_, sistrip::invalid_, SiStripKey::key(), sistrip::LLD_CHAN_MAX, sistrip::LLD_CHAN_MIN, lldChan(), lldChan_, lldChanMask_, and lldChanOffset_.
Referenced by SiStripFecKey().
00426 { 00427 00428 if ( key() == sistrip::invalid32_ ) { 00429 00430 // ---------- Set FecKey based on member data ---------- 00431 00432 // Initialise to null value 00433 key(0); 00434 00435 // Extract FEC crate 00436 if ( fecCrate_ >= sistrip::FEC_CRATE_MIN && 00437 fecCrate_ <= sistrip::FEC_CRATE_MAX ) { 00438 key( key() | (fecCrate_<<fecCrateOffset_) ); 00439 } else if ( fecCrate_ == 0 ) { 00440 key( key() | (fecCrate_<<fecCrateOffset_) ); 00441 } else { 00442 key( key() | (fecCrateMask_<<fecCrateOffset_) ); 00443 } 00444 00445 // Extract FEC slot 00446 if ( fecSlot_ >= sistrip::CRATE_SLOT_MIN && 00447 fecSlot_ <= sistrip::CRATE_SLOT_MAX ) { 00448 key( key() | (fecSlot_<<fecSlotOffset_) ); 00449 } else if ( fecSlot_ == 0 ) { 00450 key( key() | (fecSlot_<<fecSlotOffset_) ); 00451 } else { 00452 key( key() | (fecSlotMask_<<fecSlotOffset_) ); 00453 } 00454 00455 // Extract FEC ring 00456 if ( fecRing_ >= sistrip::FEC_RING_MIN && 00457 fecRing_ <= sistrip::FEC_RING_MAX ) { 00458 key( key() | (fecRing_<<fecRingOffset_) ); 00459 } else if ( fecRing_ == 0 ) { 00460 key( key() | (fecRing_<<fecRingOffset_) ); 00461 } else { 00462 key( key() | (fecRingMask_<<fecRingOffset_) ); 00463 } 00464 00465 // Extract CCU addr 00466 if ( ccuAddr_ >= sistrip::CCU_ADDR_MIN && 00467 ccuAddr_ <= sistrip::CCU_ADDR_MAX ) { 00468 key( key() | (ccuAddr_<<ccuAddrOffset_) ); 00469 } else if ( ccuAddr_ == 0 ) { 00470 key( key() | (ccuAddr_<<ccuAddrOffset_) ); 00471 } else { 00472 key( key() | (ccuAddrMask_<<ccuAddrOffset_) ); 00473 } 00474 00475 // Extract CCU chan 00476 if ( ccuChan_ >= sistrip::CCU_CHAN_MIN && 00477 ccuChan_ <= sistrip::CCU_CHAN_MAX ) { 00478 key( key() | ( (ccuChan_-(sistrip::CCU_CHAN_MIN-1)) << ccuChanOffset_ ) ); 00479 } else if ( ccuChan_ == 0 ) { 00480 key( key() | (ccuChan_<<ccuChanOffset_) ); 00481 } else { 00482 key( key() | (ccuChanMask_<<ccuChanOffset_) ); 00483 } 00484 00485 // Extract LLD channel 00486 if ( lldChan_ >= sistrip::LLD_CHAN_MIN && 00487 lldChan_ <= sistrip::LLD_CHAN_MAX ) { 00488 key( key() | (lldChan_<<lldChanOffset_) ); 00489 } else if ( lldChan_ == 0 ) { 00490 key( key() | (lldChan_<<lldChanOffset_) ); 00491 } else { 00492 key( key() | (lldChanMask_<<lldChanOffset_) ); 00493 } 00494 00495 // Extract APV I2C address 00496 if ( i2cAddr_ >= sistrip::APV_I2C_MIN && 00497 i2cAddr_ <= sistrip::APV_I2C_MAX ) { 00498 key( key() | ( ( firstApvOfPair( i2cAddr_ ) ? 1 : 2 ) << i2cAddrOffset_ ) ); // key encodes APV number (1 or 2) 00499 if ( lldChan_ && lldChan( i2cAddr_ ) != lldChan_ ) { 00500 i2cAddr_ = sistrip::invalid_; 00501 key( key() | (i2cAddrMask_<<i2cAddrOffset_) ); 00502 } 00503 } else if ( i2cAddr_ == 0 ) { 00504 key( key() | (i2cAddr_<<i2cAddrOffset_) ); 00505 } else { 00506 key( key() | (i2cAddrMask_<<i2cAddrOffset_) ); 00507 } 00508 00509 } else { 00510 00511 // ---------- Set member data based on FEC key ---------- 00512 00513 fecCrate_ = ( key()>>fecCrateOffset_ ) & fecCrateMask_; 00514 fecSlot_ = ( key()>>fecSlotOffset_ ) & fecSlotMask_; 00515 fecRing_ = ( key()>>fecRingOffset_ ) & fecRingMask_; 00516 ccuAddr_ = ( key()>>ccuAddrOffset_ ) & ccuAddrMask_; 00517 ccuChan_ = ( key()>>ccuChanOffset_ ) & ccuChanMask_; 00518 lldChan_ = ( key()>>lldChanOffset_ ) & lldChanMask_; 00519 i2cAddr_ = ( key()>>i2cAddrOffset_ ) & i2cAddrMask_; 00520 00521 if ( fecCrate_ == fecCrateMask_ ) { fecCrate_ = sistrip::invalid_; } 00522 if ( fecSlot_ == fecSlotMask_ ) { fecSlot_ = sistrip::invalid_; } 00523 if ( fecRing_ == fecRingMask_ ) { fecRing_ = sistrip::invalid_; } 00524 if ( ccuAddr_ == ccuAddrMask_ ) { ccuAddr_ = sistrip::invalid_; } 00525 if ( ccuChan_ == ccuChanMask_ ) { ccuChan_ = sistrip::invalid_; } 00526 else if ( ccuChan_ ) { ccuChan_ += (sistrip::CCU_CHAN_MIN-1); } 00527 if ( lldChan_ == lldChanMask_ ) { lldChan_ = sistrip::invalid_; } 00528 if ( i2cAddr_ == i2cAddrMask_ ) { i2cAddr_ = sistrip::invalid_; } 00529 else if ( i2cAddr_ && lldChan_ != lldChanMask_ ) { i2cAddr_ = i2cAddr( lldChan_, 2-i2cAddr_ ); } 00530 00531 } 00532 00533 }
void SiStripFecKey::initFromPath | ( | ) | [private, virtual] |
Reimplemented from SiStripKey.
Definition at line 537 of file SiStripFecKey.cc.
References sistrip::apv_, sistrip::ccuAddr_, ccuAddr_, ccuChan_, sistrip::ccuChan_, sistrip::controlView_, dir, sistrip::dir_, fecCrate_, sistrip::fecCrate_, sistrip::fecRing_, fecRing_, fecSlot_, sistrip::fecSlot_, find(), i2cAddr_, sistrip::lldChan_, lldChan_, sistrip::null_, SiStripKey::path(), sistrip::root_, size, ss, and pyDBSRunClass::temp.
Referenced by SiStripFecKey().
00537 { 00538 00539 if ( path() == sistrip::null_ ) { 00540 00541 // ---------- Set directory path based on member data ---------- 00542 00543 std::stringstream dir; 00544 00545 dir << sistrip::root_ << sistrip::dir_ 00546 << sistrip::controlView_ << sistrip::dir_; 00547 00548 // Add FEC crate 00549 if ( fecCrate_ ) { 00550 dir << sistrip::fecCrate_ << fecCrate_ << sistrip::dir_; 00551 00552 // Add FEC slot 00553 if ( fecSlot_ ) { 00554 dir << sistrip::fecSlot_ << fecSlot_ << sistrip::dir_; 00555 00556 // Add FEC ring 00557 if ( fecRing_ ) { 00558 dir << sistrip::fecRing_ << fecRing_ << sistrip::dir_; 00559 00560 // Add CCU address 00561 if ( ccuAddr_ ) { 00562 dir << sistrip::ccuAddr_ << ccuAddr_ << sistrip::dir_; 00563 00564 // Add CCU channel 00565 if ( ccuChan_ ) { 00566 dir << sistrip::ccuChan_ << ccuChan_ << sistrip::dir_; 00567 00568 // Add LLD channel 00569 if ( lldChan_ ) { 00570 dir << sistrip::lldChan_ << lldChan_ << sistrip::dir_; 00571 00572 // Add APV I2C address 00573 if ( i2cAddr_ ) { 00574 dir << sistrip::apv_ << i2cAddr_ << sistrip::dir_; 00575 } 00576 } 00577 } 00578 } 00579 } 00580 } 00581 } 00582 00583 std::string temp( dir.str() ); 00584 path( temp ); 00585 00586 } else { 00587 00588 // ---------- Set member data based on directory path ---------- 00589 00590 fecCrate_ = 0; 00591 fecSlot_ = 0; 00592 fecRing_ = 0; 00593 ccuAddr_ = 0; 00594 ccuChan_ = 0; 00595 lldChan_ = 0; 00596 i2cAddr_ = 0; 00597 00598 // Check if root is found 00599 if ( path().find( sistrip::root_ ) == std::string::npos ) { 00600 std::string temp = path(); 00601 path( sistrip::root_ + sistrip::dir_ + temp ); 00602 } 00603 00604 uint32_t curr = 0; // current string position 00605 uint32_t next = 0; // next string position 00606 next = path().find( sistrip::controlView_, curr ); 00607 00608 // Extract view 00609 curr = next; 00610 if ( curr != std::string::npos ) { 00611 next = path().find( sistrip::fecCrate_, curr ); 00612 std::string control_view( path(), 00613 curr+sistrip::controlView_.size(), 00614 (next-sistrip::dir_.size())-curr ); 00615 00616 // Extract FEC crate 00617 curr = next; 00618 if ( curr != std::string::npos ) { 00619 next = path().find( sistrip::fecSlot_, curr ); 00620 std::string fec_crate( path(), 00621 curr+sistrip::fecCrate_.size(), 00622 (next-sistrip::dir_.size())-curr ); 00623 fecCrate_ = std::atoi( fec_crate.c_str() ); 00624 00625 // Extract FEC slot 00626 curr = next; 00627 if ( curr != std::string::npos ) { 00628 next = path().find( sistrip::fecRing_, curr ); 00629 std::string fec_slot( path(), 00630 curr+sistrip::fecSlot_.size(), 00631 (next-sistrip::dir_.size())-curr ); 00632 fecSlot_ = std::atoi( fec_slot.c_str() ); 00633 00634 // Extract FEC ring 00635 curr = next; 00636 if ( curr != std::string::npos ) { 00637 next = path().find( sistrip::ccuAddr_, curr ); 00638 std::string fec_ring( path(), 00639 curr+sistrip::fecRing_.size(), 00640 (next-sistrip::dir_.size())-curr ); 00641 fecRing_ = std::atoi( fec_ring.c_str() ); 00642 00643 // Extract CCU address 00644 curr = next; 00645 if ( curr != std::string::npos ) { 00646 next = path().find( sistrip::ccuChan_, curr ); 00647 std::string ccu_addr( path(), 00648 curr+sistrip::ccuAddr_.size(), 00649 (next-sistrip::dir_.size())-curr ); 00650 ccuAddr_ = std::atoi( ccu_addr.c_str() ); 00651 00652 // Extract CCU channel 00653 curr = next; 00654 if ( curr != std::string::npos ) { 00655 next = path().find( sistrip::lldChan_, curr ); 00656 std::string ccu_chan( path(), 00657 curr+sistrip::ccuChan_.size(), 00658 (next-sistrip::dir_.size())-curr ); 00659 ccuChan_ = std::atoi( ccu_chan.c_str() ); 00660 00661 // Extract LLD channel 00662 curr = next; 00663 if ( curr != std::string::npos ) { 00664 next = path().find( sistrip::apv_, curr ); 00665 std::string lld_chan( path(), 00666 curr+sistrip::lldChan_.size(), 00667 (next-sistrip::dir_.size())-curr ); 00668 lldChan_ = std::atoi( lld_chan.c_str() ); 00669 00670 // Extract I2C address 00671 curr = next; 00672 if ( curr != std::string::npos ) { 00673 next = std::string::npos; 00674 std::string i2c_addr( path(), 00675 curr+sistrip::apv_.size(), 00676 next-curr ); 00677 i2cAddr_ = std::atoi( i2c_addr.c_str() ); 00678 } 00679 } 00680 } 00681 } 00682 } 00683 } 00684 } 00685 } else { 00686 std::stringstream ss; 00687 ss << sistrip::root_ << sistrip::dir_; 00688 //ss << sistrip::root_ << sistrip::dir_ 00689 //<< sistrip::unknownView_ << sistrip::dir_; 00690 std::string temp( ss.str() ); 00691 path( temp ); 00692 } 00693 00694 } 00695 00696 }
void SiStripFecKey::initFromValue | ( | ) | [private, virtual] |
Reimplemented from SiStripKey.
Definition at line 360 of file SiStripFecKey.cc.
References sistrip::APV_I2C_MAX, sistrip::APV_I2C_MIN, sistrip::CCU_ADDR_MAX, sistrip::CCU_ADDR_MIN, sistrip::CCU_CHAN_MAX, sistrip::CCU_CHAN_MIN, ccuAddr_, ccuChan_, sistrip::CRATE_SLOT_MAX, sistrip::CRATE_SLOT_MIN, sistrip::FEC_CRATE_MAX, sistrip::FEC_CRATE_MIN, sistrip::FEC_RING_MAX, sistrip::FEC_RING_MIN, fecCrate_, fecRing_, fecSlot_, i2cAddr_, i2cAddrMask_, i2cAddrOffset_, sistrip::invalid_, SiStripKey::key(), sistrip::LLD_CHAN_MAX, sistrip::LLD_CHAN_MIN, lldChan(), and lldChan_.
Referenced by SiStripFecKey().
00360 { 00361 00362 // FEC crate 00363 if ( fecCrate_ >= sistrip::FEC_CRATE_MIN && 00364 fecCrate_ <= sistrip::FEC_CRATE_MAX ) { 00365 fecCrate_ = fecCrate_; 00366 } else if ( fecCrate_ == 0 ) { 00367 fecCrate_ = 0; 00368 } else { fecCrate_ = sistrip::invalid_; } 00369 00370 // FEC slot 00371 if ( fecSlot_ >= sistrip::CRATE_SLOT_MIN && 00372 fecSlot_ <= sistrip::CRATE_SLOT_MAX ) { 00373 fecSlot_ = fecSlot_; 00374 } else if ( fecSlot_ == 0 ) { 00375 fecSlot_ = 0; 00376 } else { fecSlot_ = sistrip::invalid_; } 00377 00378 // FEC ring 00379 if ( fecRing_ >= sistrip::FEC_RING_MIN && 00380 fecRing_ <= sistrip::FEC_RING_MAX ) { 00381 fecRing_ = fecRing_; 00382 } else if ( fecRing_ == 0 ) { 00383 fecRing_ = 0; 00384 } else { fecRing_ = sistrip::invalid_; } 00385 00386 // CCU addr 00387 if ( ccuAddr_ >= sistrip::CCU_ADDR_MIN && 00388 ccuAddr_ <= sistrip::CCU_ADDR_MAX ) { 00389 ccuAddr_ = ccuAddr_; 00390 } else if ( ccuAddr_ == 0 ) { 00391 ccuAddr_ = 0; 00392 } else { ccuAddr_ = sistrip::invalid_; } 00393 00394 // CCU chan 00395 if ( ccuChan_ >= sistrip::CCU_CHAN_MIN && 00396 ccuChan_ <= sistrip::CCU_CHAN_MAX ) { 00397 ccuChan_ = ccuChan_; 00398 } else if ( ccuChan_ == 0 ) { 00399 ccuChan_ = 0; 00400 } else { ccuChan_ = sistrip::invalid_; } 00401 00402 // LLD channel 00403 if ( lldChan_ >= sistrip::LLD_CHAN_MIN && 00404 lldChan_ <= sistrip::LLD_CHAN_MAX ) { 00405 lldChan_ = lldChan_; 00406 } else if ( lldChan_ == 0 ) { 00407 lldChan_ = 0; 00408 } else { lldChan_ = sistrip::invalid_; } 00409 00410 // APV I2C address 00411 if ( i2cAddr_ >= sistrip::APV_I2C_MIN && 00412 i2cAddr_ <= sistrip::APV_I2C_MAX ) { 00413 i2cAddr_ = i2cAddr_; 00414 if ( lldChan_ && lldChan( i2cAddr_ ) != lldChan_ ) { 00415 i2cAddr_ = sistrip::invalid_; 00416 key( key() | (i2cAddrMask_<<i2cAddrOffset_) ); 00417 } 00418 } else if ( i2cAddr_ == 0 ) { 00419 i2cAddr_ = 0; 00420 } else { i2cAddr_ = sistrip::invalid_; } 00421 00422 }
void SiStripFecKey::initGranularity | ( | ) | [private, virtual] |
Reimplemented from SiStripKey.
Definition at line 700 of file SiStripFecKey.cc.
References sistrip::APV, sistrip::CCU_ADDR, sistrip::CCU_CHAN, ccuAddr_, ccuChan_, SiStripKey::channel(), sistrip::FEC_CRATE, sistrip::FEC_RING, sistrip::FEC_SLOT, sistrip::FEC_SYSTEM, fecCrate_, fecRing_, fecSlot_, SiStripKey::granularity(), i2cAddr_, sistrip::invalid_, sistrip::LLD_CHAN, lldChan_, and sistrip::UNKNOWN_GRAN.
Referenced by SiStripFecKey().
00700 { 00701 00702 granularity( sistrip::FEC_SYSTEM ); 00703 channel(0); 00704 if ( fecCrate_ && fecCrate_ != sistrip::invalid_ ) { 00705 granularity( sistrip::FEC_CRATE ); 00706 channel(fecCrate_); 00707 if ( fecSlot_ && fecSlot_ != sistrip::invalid_ ) { 00708 granularity( sistrip::FEC_SLOT ); 00709 channel(fecSlot_); 00710 if ( fecRing_ && fecRing_ != sistrip::invalid_ ) { 00711 granularity( sistrip::FEC_RING ); 00712 channel(fecRing_); 00713 if ( ccuAddr_ && ccuAddr_ != sistrip::invalid_ ) { 00714 granularity( sistrip::CCU_ADDR ); 00715 channel(ccuAddr_); 00716 if ( ccuChan_ && ccuChan_ != sistrip::invalid_ ) { 00717 granularity( sistrip::CCU_CHAN ); 00718 channel(ccuChan_); 00719 if ( lldChan_ && lldChan_ != sistrip::invalid_ ) { 00720 granularity( sistrip::LLD_CHAN ); 00721 channel(lldChan_); 00722 if ( i2cAddr_ && i2cAddr_ != sistrip::invalid_ ) { 00723 granularity( sistrip::APV ); 00724 channel(i2cAddr_); 00725 } else if ( i2cAddr_ == sistrip::invalid_ ) { 00726 granularity( sistrip::UNKNOWN_GRAN ); 00727 channel(sistrip::invalid_); 00728 } 00729 } else if ( lldChan_ == sistrip::invalid_ ) { 00730 granularity( sistrip::UNKNOWN_GRAN ); 00731 channel(sistrip::invalid_); 00732 } 00733 } else if ( ccuChan_ == sistrip::invalid_ ) { 00734 granularity( sistrip::UNKNOWN_GRAN ); 00735 channel(sistrip::invalid_); 00736 } 00737 } else if ( ccuAddr_ == sistrip::invalid_ ) { 00738 granularity( sistrip::UNKNOWN_GRAN ); 00739 channel(sistrip::invalid_); 00740 } 00741 } else if ( fecRing_ == sistrip::invalid_ ) { 00742 granularity( sistrip::UNKNOWN_GRAN ); 00743 channel(sistrip::invalid_); 00744 } 00745 } else if ( fecSlot_ == sistrip::invalid_ ) { 00746 granularity( sistrip::UNKNOWN_GRAN ); 00747 channel(sistrip::invalid_); 00748 } 00749 } else if ( fecCrate_ == sistrip::invalid_ ) { 00750 granularity( sistrip::UNKNOWN_GRAN ); 00751 channel(sistrip::invalid_); 00752 } 00753 00754 }
bool SiStripFecKey::isConsistent | ( | const SiStripKey & | key | ) | const [virtual] |
"Consistent" means identical and/or null (ie, "all") data.
Reimplemented from SiStripKey.
Definition at line 269 of file SiStripFecKey.cc.
References ccuAddr(), ccuAddr_, fecCrate(), fecCrate_, fecRing(), fecRing_, fecSlot(), fecSlot_, i2cAddr(), i2cAddr_, iggi_31X_cfg::input, isEqual(), lldChan(), lldChan_, and pyDBSRunClass::temp.
00269 { 00270 SiStripKey& temp = const_cast<SiStripKey&>(key); 00271 SiStripFecKey& input = dynamic_cast<SiStripFecKey&>(temp); 00272 if ( !(&input) ) { return false; } 00273 if ( isEqual(input) ) { return true; } 00274 else if ( ( fecCrate_ == 0 || input.fecCrate() == 0 ) && 00275 ( fecSlot_ == 0 || input.fecSlot() == 0 ) && 00276 ( fecRing_ == 0 || input.fecRing() == 0 ) && 00277 ( ccuAddr_ == 0 || input.ccuAddr() == 0 ) && 00278 ( lldChan_ == 0 || input.lldChan() == 0 ) && 00279 ( i2cAddr_ == 0 || input.i2cAddr() == 0 ) ) { 00280 return true; 00281 } else { return false; } 00282 }
bool SiStripFecKey::isEqual | ( | const SiStripKey & | key | ) | const [virtual] |
Identifies key objects with identical member data.
Reimplemented from SiStripKey.
Definition at line 252 of file SiStripFecKey.cc.
References ccuAddr(), ccuAddr_, ccuChan(), ccuChan_, fecCrate(), fecCrate_, fecRing(), fecRing_, fecSlot(), fecSlot_, i2cAddr(), i2cAddr_, iggi_31X_cfg::input, lldChan(), lldChan_, and pyDBSRunClass::temp.
Referenced by isConsistent().
00252 { 00253 SiStripKey& temp = const_cast<SiStripKey&>(key); 00254 SiStripFecKey& input = dynamic_cast<SiStripFecKey&>(temp); 00255 if ( !(&input) ) { return false; } 00256 if ( fecCrate_ == input.fecCrate() && 00257 fecSlot_ == input.fecSlot() && 00258 fecRing_ == input.fecRing() && 00259 ccuAddr_ == input.ccuAddr() && 00260 ccuChan_ == input.ccuChan() && 00261 lldChan_ == input.lldChan() && 00262 i2cAddr_ == input.i2cAddr() ) { 00263 return true; 00264 } else { return false; } 00265 }
bool SiStripFecKey::isInvalid | ( | const sistrip::Granularity & | gran | ) | const [virtual] |
All member data to level of "Granularity" are invalid.
If sistrip::Granularity is "undefined", returns true.
Reimplemented from SiStripKey.
Definition at line 329 of file SiStripFecKey.cc.
References sistrip::APV, sistrip::CCU_ADDR, sistrip::CCU_CHAN, ccuAddr_, ccuChan_, sistrip::FEC_CRATE, sistrip::FEC_RING, sistrip::FEC_SYSTEM, fecCrate_, fecRing_, fecSlot_, i2cAddr_, sistrip::invalid_, sistrip::LLD_CHAN, lldChan_, sistrip::UNDEFINED_GRAN, and sistrip::UNKNOWN_GRAN.
00329 { 00330 if ( gran == sistrip::FEC_SYSTEM ) { return false; } 00331 else if ( gran == sistrip::UNDEFINED_GRAN || 00332 gran == sistrip::UNKNOWN_GRAN ) { return false; } 00333 00334 if ( fecCrate_ == sistrip::invalid_ ) { 00335 if ( gran == sistrip::FEC_CRATE ) { return true; } 00336 if ( fecSlot_ == sistrip::invalid_ ) { 00337 if ( gran == sistrip::FEC_RING ) { return true; } 00338 if ( fecRing_ == sistrip::invalid_ ) { 00339 if ( gran == sistrip::FEC_RING ) { return true; } 00340 if ( ccuAddr_ == sistrip::invalid_ ) { 00341 if ( gran == sistrip::CCU_ADDR ) { return true; } 00342 if ( ccuChan_ == sistrip::invalid_ ) { 00343 if ( gran == sistrip::CCU_CHAN ) { return true; } 00344 if ( lldChan_ == sistrip::invalid_ ) { 00345 if ( gran == sistrip::LLD_CHAN ) { return true; } 00346 if ( i2cAddr_ == sistrip::invalid_ ) { 00347 if ( gran == sistrip::APV ) { return true; } 00348 } 00349 } 00350 } 00351 } 00352 } 00353 } 00354 } 00355 return false; 00356 }
bool SiStripFecKey::isInvalid | ( | ) | const [virtual] |
Identifies all member data as being "invalid".
Reimplemented from SiStripKey.
Definition at line 323 of file SiStripFecKey.cc.
References sistrip::APV.
Referenced by CommissioningHistosUsingDb::detInfo().
00323 { 00324 return isInvalid(sistrip::APV); 00325 }
bool SiStripFecKey::isValid | ( | const sistrip::Granularity & | gran | ) | const [virtual] |
All member data to level of "Granularity" are "valid".
If sistrip::Granularity is "undefined", returns false.
Reimplemented from SiStripKey.
Definition at line 292 of file SiStripFecKey.cc.
References sistrip::APV, sistrip::CCU_ADDR, sistrip::CCU_CHAN, ccuAddr_, ccuChan_, sistrip::FEC_CRATE, sistrip::FEC_RING, sistrip::FEC_SYSTEM, fecCrate_, fecRing_, fecSlot_, i2cAddr_, sistrip::invalid_, sistrip::LLD_CHAN, lldChan_, sistrip::UNDEFINED_GRAN, and sistrip::UNKNOWN_GRAN.
00292 { 00293 if ( gran == sistrip::FEC_SYSTEM ) { return true; } 00294 else if ( gran == sistrip::UNDEFINED_GRAN || 00295 gran == sistrip::UNKNOWN_GRAN ) { return false; } 00296 00297 if ( fecCrate_ != sistrip::invalid_ ) { 00298 if ( gran == sistrip::FEC_CRATE ) { return true; } 00299 if ( fecSlot_ != sistrip::invalid_ ) { 00300 if ( gran == sistrip::FEC_RING ) { return true; } 00301 if ( fecRing_ != sistrip::invalid_ ) { 00302 if ( gran == sistrip::FEC_RING ) { return true; } 00303 if ( ccuAddr_ != sistrip::invalid_ ) { 00304 if ( gran == sistrip::CCU_ADDR ) { return true; } 00305 if ( ccuChan_ != sistrip::invalid_ ) { 00306 if ( gran == sistrip::CCU_CHAN ) { return true; } 00307 if ( lldChan_ != sistrip::invalid_ ) { 00308 if ( gran == sistrip::LLD_CHAN ) { return true; } 00309 if ( i2cAddr_ != sistrip::invalid_ ) { 00310 if ( gran == sistrip::APV ) { return true; } 00311 } 00312 } 00313 } 00314 } 00315 } 00316 } 00317 } 00318 return false; 00319 }
Identifies all member data as being "valid" or "all" (null).
Reimplemented from SiStripKey.
Definition at line 286 of file SiStripFecKey.cc.
References sistrip::APV.
Referenced by CommissioningHistosUsingDb::buildDetInfo(), SummaryGeneratorControlView::fill(), FastFedCablingAnalysis::header(), and print().
00286 { 00287 return isValid(sistrip::APV); 00288 }
uint16_t SiStripFecKey::lldChan | ( | const uint16_t & | i2c_addr | ) | [static] |
Returns LLD channel (1-3) for a given APV I2C addr (32-37).
Definition at line 231 of file SiStripFecKey.cc.
References sistrip::APV_I2C_MAX, sistrip::APV_I2C_MIN, and sistrip::invalid_.
00231 { 00232 if ( i2c_addr == 0 ) { return 0; } 00233 else if ( i2c_addr < sistrip::APV_I2C_MIN || 00234 i2c_addr > sistrip::APV_I2C_MAX ) { 00235 return sistrip::invalid_; 00236 } 00237 return ( ( i2c_addr - sistrip::APV_I2C_MIN ) / 2 + 1 ); 00238 }
const uint16_t & SiStripFecKey::lldChan | ( | ) | const [inline] |
Returns LLD channel.
Definition at line 210 of file SiStripFecKey.h.
References lldChan_.
Referenced by CommissioningHistograms::createCollations(), SiStripConfigDb::deviceAddress(), CalibrationSummaryFactory::extract(), CommissioningHistograms::extractHistograms(), FastFedCablingAnalysis::header(), CommissioningAnalysis::header(), ApvTimingHistograms::histoAnalysis(), initFromKey(), initFromValue(), isConsistent(), isEqual(), print(), SiStripFecKey(), PedsOnlyAnalysis::summary(), VpspScanAnalysis::summary(), PedestalsAnalysis::summary(), NoiseAnalysis::summary(), OptoScanAnalysis::summary(), FastFedCablingAnalysis::summary(), CommissioningAnalysis::summary(), and terse().
00210 { return lldChan_; }
void SiStripFecKey::print | ( | std::stringstream & | ss | ) | const [virtual] |
A terse summary of the key.
Reimplemented from SiStripKey.
Definition at line 784 of file SiStripFecKey.cc.
References ccuAddr(), ccuChan(), SiStripKey::channel(), lat::endl(), fecCrate(), fecRing(), fecSlot(), SiStripKey::granularity(), SiStripEnumsAndStrings::granularity(), i2cAddr(), isValid(), SiStripKey::key(), lldChan(), and SiStripKey::path().
Referenced by operator<<().
00784 { 00785 ss << " [SiStripFecKey::print]" << std::endl 00786 << std::hex 00787 << " FEC key : 0x" 00788 << std::setfill('0') 00789 << std::setw(8) << key() << std::endl 00790 << std::setfill(' ') 00791 << std::dec 00792 << " FEC VME crate : " << fecCrate() << std::endl 00793 << " FEC VME slot : " << fecSlot() << std::endl 00794 << " FEC control ring : " << fecRing() << std::endl 00795 << " CCU I2C address : " << ccuAddr() << std::endl 00796 << " CCU chan (FE module) : " << ccuChan() << std::endl 00797 << " LaserDriver channel : " << lldChan() << std::endl 00798 << " APV I2C address : " << i2cAddr() << std::endl 00799 << " Directory : " << path() << std::endl 00800 << " Granularity : " 00801 << SiStripEnumsAndStrings::granularity( granularity() ) << std::endl 00802 << " Channel : " << channel() << std::endl 00803 << " isValid : " << isValid(); 00804 }
void SiStripFecKey::terse | ( | std::stringstream & | ss | ) | const [virtual] |
A terse summary of the key.
Reimplemented from SiStripKey.
Definition at line 758 of file SiStripFecKey.cc.
References ccuAddr(), ccuChan(), fecCrate(), fecRing(), fecSlot(), i2cAddr(), and lldChan().
00758 { 00759 ss << "FEC:crate/slot/ring/CCU/module/LLD/I2C= " 00760 << fecCrate() << "/" 00761 << fecSlot() << "/" 00762 << fecRing() << "/" 00763 << ccuAddr() << "/" 00764 << ccuChan() << "/" 00765 << lldChan() << "/" 00766 << i2cAddr(); 00767 // ss << " FecKey" 00768 // //<< "=0x" 00769 // //<< std::hex 00770 // //<< std::setfill('0') << std::setw(8) << key() << std::setfill(' ') 00771 // //<< std::dec 00772 // //<< ", " << ( isValid() ? "Valid" : "Invalid" ) 00773 // << ", Crate=" << fecCrate() 00774 // << ", Slot=" << fecSlot() 00775 // << ", Ring=" << fecRing() 00776 // << ", CCU=" << ccuAddr() 00777 // << ", module=" << ccuChan() 00778 // << ", LLD=" << lldChan() 00779 // << ", I2C=" << i2cAddr(); 00780 }
uint16_t SiStripFecKey::ccuAddr_ [private] |
CCU module [0,1-126,invalid].
Definition at line 172 of file SiStripFecKey.h.
Referenced by ccuAddr(), initFromKey(), initFromPath(), initFromValue(), initGranularity(), isConsistent(), isEqual(), isInvalid(), isValid(), and SiStripFecKey().
const uint16_t SiStripFecKey::ccuAddrMask_ = 0xFF [static, private] |
const uint16_t SiStripFecKey::ccuAddrOffset_ = 10 [static, private] |
uint16_t SiStripFecKey::ccuChan_ [private] |
FE module [0,16-31,invalid].
Definition at line 175 of file SiStripFecKey.h.
Referenced by ccuChan(), initFromKey(), initFromPath(), initFromValue(), initGranularity(), isEqual(), isInvalid(), isValid(), and SiStripFecKey().
const uint16_t SiStripFecKey::ccuChanMask_ = 0x1F [static, private] |
const uint16_t SiStripFecKey::ccuChanOffset_ = 5 [static, private] |
uint16_t SiStripFecKey::fecCrate_ [private] |
FEC crate [0,1-4,invalid].
Definition at line 163 of file SiStripFecKey.h.
Referenced by fecCrate(), initFromKey(), initFromPath(), initFromValue(), initGranularity(), isConsistent(), isEqual(), isInvalid(), isValid(), and SiStripFecKey().
const uint16_t SiStripFecKey::fecCrateMask_ = 0x07 [static, private] |
const uint16_t SiStripFecKey::fecCrateOffset_ = 27 [static, private] |
uint16_t SiStripFecKey::fecRing_ [private] |
FEC ring [0,1-8,invalid].
Definition at line 169 of file SiStripFecKey.h.
Referenced by fecRing(), initFromKey(), initFromPath(), initFromValue(), initGranularity(), isConsistent(), isEqual(), isInvalid(), isValid(), and SiStripFecKey().
const uint16_t SiStripFecKey::fecRingMask_ = 0x0F [static, private] |
const uint16_t SiStripFecKey::fecRingOffset_ = 18 [static, private] |
uint16_t SiStripFecKey::fecSlot_ [private] |
FEC slot [0,2-21,invalid].
Definition at line 166 of file SiStripFecKey.h.
Referenced by fecSlot(), initFromKey(), initFromPath(), initFromValue(), initGranularity(), isConsistent(), isEqual(), isInvalid(), isValid(), and SiStripFecKey().
const uint16_t SiStripFecKey::fecSlotMask_ = 0x1F [static, private] |
const uint16_t SiStripFecKey::fecSlotOffset_ = 22 [static, private] |
uint16_t SiStripFecKey::i2cAddr_ [private] |
APV I2C address [0,32-37,invalid].
Definition at line 181 of file SiStripFecKey.h.
Referenced by i2cAddr(), initFromKey(), initFromPath(), initFromValue(), initGranularity(), isConsistent(), isEqual(), isInvalid(), isValid(), and SiStripFecKey().
const uint16_t SiStripFecKey::i2cAddrMask_ = 0x03 [static, private] |
const uint16_t SiStripFecKey::i2cAddrOffset_ = 0 [static, private] |
uint16_t SiStripFecKey::lldChan_ [private] |
LLD channel [0,1-3,invalid].
Definition at line 178 of file SiStripFecKey.h.
Referenced by initFromKey(), initFromPath(), initFromValue(), initGranularity(), isConsistent(), isEqual(), isInvalid(), isValid(), lldChan(), and SiStripFecKey().
const uint16_t SiStripFecKey::lldChanMask_ = 0x07 [static, private] |
const uint16_t SiStripFecKey::lldChanOffset_ = 2 [static, private] |