#include <DataFormats/SiStripCommon/interface/SiStripFedKey.h>
Public Member Functions | |
const uint16_t & | feChan () const |
Returns chan of FE unit (according to "external" numbering). | |
const uint16_t & | fedApv () const |
Returns APV within FED channel. | |
uint16_t | fedChannel () const |
Returns FED channel (according to "internal" numbering). | |
const uint16_t & | fedId () const |
Returns FED id. | |
const uint16_t & | feUnit () const |
Returns Front-End unit (according to "external" numbering). | |
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 null ("all"). | |
virtual void | print (std::stringstream &ss) const |
Print member data of the key. | |
SiStripFedKey () | |
Default constructor. | |
SiStripFedKey (const SiStripKey &) | |
Copy constructor using base class. | |
SiStripFedKey (const SiStripFedKey &) | |
Copy constructor. | |
SiStripFedKey (const std::string &directory_path) | |
Constructor using directory path. | |
SiStripFedKey (const uint32_t &fed_key) | |
Constructor using 32-bit "FED key". | |
SiStripFedKey (const uint16_t &fed_id, const uint16_t &fe_unit=0, const uint16_t &fe_chan=0, const uint16_t &fed_apv=0) | |
Constructor using FED id, FE unit, FE channel, and APV. | |
virtual void | terse (std::stringstream &ss) const |
A terse summary of the key. | |
Static Public Member Functions | |
static uint16_t | feChan (const uint16_t &fed_ch) |
Returns Front-End channel ("external" numbering scheme) for given FED channel ("internal" numbering scheme). | |
static uint16_t | fedCh (const uint16_t &fe_unit, const uint16_t &fe_chan) |
Returns FED channel ("internal" numbering scheme) for given Front-End unit and channel ("external" numbering scheme). | |
static uint32_t | fedIndex (const uint16_t &fed_id, const uint16_t &fed_ch) |
Returns number that encodes FED id and FED channel, which can be used to index vectors containing event and non-event data. | |
static uint16_t | feUnit (const uint16_t &fed_ch) |
Returns Front-End unit ("external" numbering scheme) for given FED channel ("internal" numbering scheme). | |
Private Member Functions | |
void | initFromKey () |
void | initFromPath () |
void | initFromValue () |
void | initGranularity () |
Private Attributes | |
uint16_t | feChan_ |
FE channel [0,1-12,invalid]. | |
uint16_t | fedApv_ |
APV [0,1-2,invalid]. | |
uint16_t | fedId_ |
FED id [0,50-489,invalid]. | |
uint16_t | feUnit_ |
FE unit [0,1-8,invalid]. | |
Static Private Attributes | |
static const uint16_t | feChanMask_ = 0x00F |
static const uint16_t | feChanOffset_ = 2 |
static const uint16_t | fedApvMask_ = 0x003 |
static const uint16_t | fedApvOffset_ = 0 |
static const uint16_t | fedCrateMask_ = 0x03F |
static const uint16_t | fedCrateOffset_ = 24 |
static const uint16_t | fedIdMask_ = 0x1FF |
static const uint16_t | fedIdOffset_ = 10 |
static const uint16_t | fedSlotMask_ = 0x01F |
static const uint16_t | fedSlotOffset_ = 19 |
static const uint16_t | feUnitMask_ = 0x00F |
static const uint16_t | feUnitOffset_ = 6 |
A container class for generic run and event-related info, information required by the commissioning analyses (such as hardware parameters), event quality flags, error conditions, etc...
Utility class that identifies a position within the strip tracker readout structure, down to the level of an APV25 chip.
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, FedId = 0xFFFF means "invalid FED id"). Data with null values signifies "all" (ie, FedId = 0 means "all FEDs").
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 FED key is unambiguous (ie, not "invalid" or "null") in defining a position within the readout system.
In addition, the class provides static methods that allow to convert between the two "FED channel" numbering schema in place. The class member data hold values that respect the "external" numbering scheme used by the optical links group. Front-End units are numbered from 1 to 8, bottom to top. Channels with the FE units are numbered 1 to 12, bottom to top. The "internal" numbering scheme is used by the DAQ software, which numbers FED channels consecutively from 0 to 95, top to bottom.
Definition at line 57 of file SiStripFedKey.h.
SiStripFedKey::SiStripFedKey | ( | const uint16_t & | fed_id, | |
const uint16_t & | fe_unit = 0 , |
|||
const uint16_t & | fe_chan = 0 , |
|||
const uint16_t & | fed_apv = 0 | |||
) |
Constructor using FED id, FE unit, FE channel, and APV.
Definition at line 13 of file SiStripFedKey.cc.
References initFromKey(), initFromPath(), initFromValue(), and initGranularity().
00016 : 00017 SiStripKey(), 00018 fedId_(fed_id), 00019 feUnit_(fe_unit), 00020 feChan_(fe_chan), 00021 fedApv_(fed_apv) 00022 { 00023 // order is important! 00024 initFromValue(); 00025 initFromKey(); 00026 initFromPath(); 00027 initGranularity(); 00028 }
SiStripFedKey::SiStripFedKey | ( | const uint32_t & | fed_key | ) |
Constructor using 32-bit "FED key".
Definition at line 32 of file SiStripFedKey.cc.
References initFromKey(), initFromPath(), initFromValue(), and initGranularity().
00032 : 00033 SiStripKey(fed_key), 00034 fedId_(sistrip::invalid_), 00035 feUnit_(sistrip::invalid_), 00036 feChan_(sistrip::invalid_), 00037 fedApv_(sistrip::invalid_) 00038 { 00039 // order is important! 00040 initFromKey(); 00041 initFromValue(); 00042 initFromPath(); 00043 initGranularity(); 00044 }
SiStripFedKey::SiStripFedKey | ( | const std::string & | directory_path | ) |
Constructor using directory path.
Definition at line 48 of file SiStripFedKey.cc.
References initFromKey(), initFromPath(), initFromValue(), and initGranularity().
00048 : 00049 SiStripKey(path), 00050 fedId_(sistrip::invalid_), 00051 feUnit_(sistrip::invalid_), 00052 feChan_(sistrip::invalid_), 00053 fedApv_(sistrip::invalid_) 00054 { 00055 // order is important! 00056 initFromPath(); 00057 initFromValue(); 00058 initFromKey(); 00059 initGranularity(); 00060 }
SiStripFedKey::SiStripFedKey | ( | const SiStripFedKey & | input | ) |
Copy constructor.
Definition at line 64 of file SiStripFedKey.cc.
References SiStripKey::granularity(), SiStripKey::key(), and SiStripKey::path().
00064 : 00065 SiStripKey(), 00066 fedId_(input.fedId()), 00067 feUnit_(input.feUnit()), 00068 feChan_(input.feChan()), 00069 fedApv_(input.fedApv()) 00070 { 00071 key(input.key()); 00072 path(input.path()); 00073 granularity(input.granularity()); 00074 }
SiStripFedKey::SiStripFedKey | ( | const SiStripKey & | input | ) |
Copy constructor using base class.
Definition at line 78 of file SiStripFedKey.cc.
References feChan(), feChan_, fedApv(), fedApv_, fedId(), fedId_, feUnit(), feUnit_, SiStripKey::granularity(), SiStripKey::key(), SiStripKey::path(), and pyDBSRunClass::temp.
00078 : 00079 SiStripKey(), 00080 fedId_(sistrip::invalid_), 00081 feUnit_(sistrip::invalid_), 00082 feChan_(sistrip::invalid_), 00083 fedApv_(sistrip::invalid_) 00084 { 00085 SiStripKey& temp = const_cast<SiStripKey&>(input); 00086 SiStripFedKey& fed_key = dynamic_cast<SiStripFedKey&>(temp); 00087 if ( (&fed_key) ) { 00088 key(fed_key.key()); 00089 path(fed_key.path()); 00090 granularity(fed_key.granularity()); 00091 fedId_ = fed_key.fedId(); 00092 feUnit_ = fed_key.feUnit(); 00093 feChan_ = fed_key.feChan(); 00094 fedApv_ = fed_key.fedApv(); 00095 } 00096 }
SiStripFedKey::SiStripFedKey | ( | ) |
Default constructor.
Definition at line 100 of file SiStripFedKey.cc.
00100 : 00101 SiStripKey(), 00102 fedId_(sistrip::invalid_), 00103 feUnit_(sistrip::invalid_), 00104 feChan_(sistrip::invalid_), 00105 fedApv_(sistrip::invalid_) 00106 {;}
uint16_t SiStripFedKey::feChan | ( | const uint16_t & | fed_ch | ) | [static] |
Returns Front-End channel ("external" numbering scheme) for given FED channel ("internal" numbering scheme).
Definition at line 132 of file SiStripFedKey.cc.
References sistrip::FEDCH_PER_FED, and sistrip::invalid_.
00132 { 00133 if ( fed_ch < sistrip::FEDCH_PER_FED ) { 00134 return ( (95-fed_ch)%12 + 1 ); 00135 } 00136 return sistrip::invalid_; 00137 }
const uint16_t & SiStripFedKey::feChan | ( | ) | const [inline] |
Returns chan of FE unit (according to "external" numbering).
Definition at line 197 of file SiStripFedKey.h.
References feChan_.
Referenced by CommissioningHistosUsingDb::addDcuDetIds(), FedCablingAlgorithm::analyse(), ViewTranslator::buildMaps(), CommissioningTask::CommissioningTask(), SiStripCommissioningSource::createTasks(), SummaryGeneratorReadoutView::fill(), FastFedCablingAnalysis::header(), CommissioningAnalysis::header(), isConsistent(), isEqual(), FedChannelConnection::print(), print(), SiStripFedKey(), FastFedCablingAnalysis::summary(), FedChannelConnection::terse(), terse(), FastFedCablingHistosUsingDb::update(), NoiseHistosUsingDb::update(), PedsOnlyHistosUsingDb::update(), PedestalsHistosUsingDb::update(), and ApvTimingHistosUsingDb::update().
00197 { return feChan_; }
const uint16_t & SiStripFedKey::fedApv | ( | ) | const [inline] |
Returns APV within FED channel.
Definition at line 198 of file SiStripFedKey.h.
References fedApv_.
Referenced by SummaryGeneratorReadoutView::fill(), isConsistent(), isEqual(), print(), SiStripFedKey(), and terse().
00198 { return fedApv_; }
uint16_t SiStripFedKey::fedCh | ( | const uint16_t & | fe_unit, | |
const uint16_t & | fe_chan | |||
) | [static] |
Returns FED channel ("internal" numbering scheme) for given Front-End unit and channel ("external" numbering scheme).
Definition at line 110 of file SiStripFedKey.cc.
References sistrip::FEDCH_PER_FEUNIT, sistrip::FEUNITS_PER_FED, and sistrip::invalid_.
Referenced by fedChannel().
00111 { 00112 if ( fe_unit <= sistrip::FEUNITS_PER_FED && 00113 fe_chan <= sistrip::FEDCH_PER_FEUNIT ) { 00114 if ( fe_unit != 0 && fe_chan != 0 ) { 00115 return ( 95 - ( 12 * (fe_unit-1) + (fe_chan-1) ) ); 00116 } 00117 } 00118 return sistrip::invalid_; 00119 }
uint16_t SiStripFedKey::fedChannel | ( | ) | const [inline] |
Returns FED channel (according to "internal" numbering).
Definition at line 199 of file SiStripFedKey.h.
References feChan_, fedCh(), and feUnit_.
Referenced by CommissioningHistosUsingDb::addDcuDetIds(), FastFedCablingAnalysis::header(), CommissioningAnalysis::header(), print(), FedCablingAnalysis::print(), and ApvTimingHistosUsingDb::update().
const uint16_t & SiStripFedKey::fedId | ( | ) | const [inline] |
Returns FED id.
Definition at line 195 of file SiStripFedKey.h.
References fedId_.
Referenced by CommissioningHistosUsingDb::addDcuDetIds(), SummaryGeneratorReadoutView::fill(), FastFedCablingAnalysis::header(), CommissioningAnalysis::header(), isConsistent(), isEqual(), print(), FedCablingAnalysis::print(), SiStripFedKey(), FastFedCablingAnalysis::summary(), terse(), and ApvTimingHistosUsingDb::update().
00195 { return fedId_; }
uint32_t SiStripFedKey::fedIndex | ( | const uint16_t & | fed_id, | |
const uint16_t & | fed_ch | |||
) | [static] |
Returns number that encodes FED id and FED channel, which can be used to index vectors containing event and non-event data.
Users should check if returned value is valid for indexing vector!
Definition at line 141 of file SiStripFedKey.cc.
References sistrip::FED_ID_MAX, sistrip::FED_ID_MIN, sistrip::FEDCH_PER_FED, and sistrip::invalid32_.
00142 { 00143 if ( fed_id < sistrip::FED_ID_MIN || 00144 fed_id > sistrip::FED_ID_MAX || 00145 fed_ch >= sistrip::FEDCH_PER_FED ) { return sistrip::invalid32_; } 00146 return ( fed_id * sistrip::FEDCH_PER_FED + fed_ch ); 00147 }
uint16_t SiStripFedKey::feUnit | ( | const uint16_t & | fed_ch | ) | [static] |
Returns Front-End unit ("external" numbering scheme) for given FED channel ("internal" numbering scheme).
Definition at line 123 of file SiStripFedKey.cc.
References sistrip::FEDCH_PER_FED, and sistrip::invalid_.
00123 { 00124 if ( fed_ch < sistrip::FEDCH_PER_FED ) { 00125 return ( (95-fed_ch)/12 + 1 ); 00126 } 00127 return sistrip::invalid_; 00128 }
const uint16_t & SiStripFedKey::feUnit | ( | ) | const [inline] |
Returns Front-End unit (according to "external" numbering).
Definition at line 196 of file SiStripFedKey.h.
References feUnit_.
Referenced by CommissioningHistosUsingDb::addDcuDetIds(), FedCablingAlgorithm::analyse(), ViewTranslator::buildMaps(), CommissioningTask::CommissioningTask(), SiStripCommissioningSource::createTasks(), SummaryGeneratorReadoutView::fill(), FastFedCablingAnalysis::header(), CommissioningAnalysis::header(), isConsistent(), isEqual(), FedChannelConnection::print(), print(), SiStripFedKey(), SiStripFedCabling::summary(), FastFedCablingAnalysis::summary(), FedChannelConnection::terse(), terse(), FastFedCablingHistosUsingDb::update(), NoiseHistosUsingDb::update(), PedsOnlyHistosUsingDb::update(), PedestalsHistosUsingDb::update(), and ApvTimingHistosUsingDb::update().
00196 { return feUnit_; }
void SiStripFedKey::initFromKey | ( | ) | [private, virtual] |
Reimplemented from SiStripKey.
Definition at line 260 of file SiStripFedKey.cc.
References sistrip::APVS_PER_FEDCH, feChan_, feChanMask_, feChanOffset_, sistrip::FED_ID_MAX, sistrip::FED_ID_MIN, fedApv_, fedApvMask_, fedApvOffset_, sistrip::FEDCH_PER_FEUNIT, fedId_, fedIdMask_, fedIdOffset_, feUnit_, feUnitMask_, feUnitOffset_, sistrip::FEUNITS_PER_FED, sistrip::invalid32_, sistrip::invalid_, and SiStripKey::key().
Referenced by SiStripFedKey().
00260 { 00261 00262 if ( key() == sistrip::invalid32_ ) { 00263 00264 // ---------- Set FedKey based on member data ---------- 00265 00266 // Initialise to null value 00267 key(0); 00268 00269 // Extract FED id 00270 if ( fedId_ >= sistrip::FED_ID_MIN && 00271 fedId_ <= sistrip::FED_ID_MAX ) { 00272 key( key() | (fedId_<<fedIdOffset_) ); 00273 } else if ( fedId_ == 0 ) { 00274 key( key() | (fedId_<<fedIdOffset_) ); 00275 } else { 00276 key( key() | (fedIdMask_<<fedIdOffset_) ); 00277 } 00278 00279 // Extract FE unit 00280 if ( feUnit_ >= 1 && 00281 feUnit_ <= sistrip::FEUNITS_PER_FED ) { 00282 key( key() | (feUnit_<<feUnitOffset_) ); 00283 } else if ( feUnit_ == 0 ) { 00284 key( key() | (feUnit_<<feUnitOffset_) ); 00285 } else { 00286 key( key() | (feUnitMask_<<feUnitOffset_) ); 00287 } 00288 00289 // Extract FE chan 00290 if ( feChan_ >= 1 && 00291 feChan_ <= sistrip::FEDCH_PER_FEUNIT ) { 00292 key( key() | (feChan_<<feChanOffset_) ); 00293 } else if ( feChan_ == 0 ) { 00294 key( key() | (feChan_<<feChanOffset_) ); 00295 } else { 00296 key( key() | (feChanMask_<<feChanOffset_) ); 00297 } 00298 00299 // Extract FED APV 00300 if ( fedApv_ >= 1 && 00301 fedApv_ <= sistrip::APVS_PER_FEDCH ) { 00302 key( key() | (fedApv_<<fedApvOffset_) ); 00303 } else if ( fedApv_ == 0 ) { 00304 key( key() | (fedApv_<<fedApvOffset_) ); 00305 } else { 00306 key( key() | (fedApvMask_<<fedApvOffset_) ); 00307 } 00308 00309 // Set invalid key if necessary 00310 if ( fedId_ == sistrip::invalid_ && 00311 feUnit_ == sistrip::invalid_ && 00312 feChan_ == sistrip::invalid_ && 00313 fedApv_ == sistrip::invalid_ ) { 00314 key( sistrip::invalid32_ ); 00315 } 00316 00317 } else { 00318 00319 // ---------- Set member data based on FED key ---------- 00320 00321 fedId_ = ( key()>>fedIdOffset_ ) & fedIdMask_; 00322 feUnit_ = ( key()>>feUnitOffset_ ) & feUnitMask_; 00323 feChan_ = ( key()>>feChanOffset_ ) & feChanMask_; 00324 fedApv_ = ( key()>>fedApvOffset_ ) & fedApvMask_; 00325 00326 if ( fedId_ == fedIdMask_ ) { fedId_ = sistrip::invalid_; } 00327 if ( feUnit_ == feUnitMask_ ) { feUnit_ = sistrip::invalid_; } 00328 if ( feChan_ == feChanMask_ ) { feChan_ = sistrip::invalid_; } 00329 if ( fedApv_ == fedApvMask_ ) { fedApv_ = sistrip::invalid_; } 00330 00331 } 00332 00333 }
void SiStripFedKey::initFromPath | ( | ) | [private, virtual] |
Reimplemented from SiStripKey.
Definition at line 337 of file SiStripFedKey.cc.
References dir, sistrip::dir_, feChan_, sistrip::feChan_, sistrip::fedApv_, fedApv_, fedId_, sistrip::feDriver_, sistrip::feUnit_, feUnit_, find(), sistrip::null_, SiStripKey::path(), sistrip::readoutView_, sistrip::root_, size, ss, and pyDBSRunClass::temp.
Referenced by SiStripFedKey().
00337 { 00338 00339 if ( path() == sistrip::null_ ) { 00340 00341 // ---------- Set directory path based on member data ---------- 00342 00343 std::stringstream dir; 00344 00345 dir << sistrip::root_ << sistrip::dir_ 00346 << sistrip::readoutView_ << sistrip::dir_; 00347 00348 // Add FED id 00349 if ( fedId_ ) { 00350 dir << sistrip::feDriver_ << fedId_ << sistrip::dir_; 00351 00352 // Add FE unit 00353 if ( feUnit_ ) { 00354 dir << sistrip::feUnit_ << feUnit_ << sistrip::dir_; 00355 00356 // Add FE channel 00357 if ( feChan_ ) { 00358 dir << sistrip::feChan_ << feChan_ << sistrip::dir_; 00359 00360 // Add FED APV 00361 if ( fedApv_ ) { 00362 dir << sistrip::fedApv_ << fedApv_ << sistrip::dir_; 00363 } 00364 } 00365 } 00366 } 00367 00368 std::string temp( dir.str() ); 00369 path( temp ); 00370 00371 } else { 00372 00373 // ---------- Set member data based on directory path ---------- 00374 00375 fedId_ = 0; 00376 feUnit_ = 0; 00377 feChan_ = 0; 00378 fedApv_ = 0; 00379 00380 // Check if root is found 00381 if ( path().find( sistrip::root_ ) == std::string::npos ) { 00382 std::string temp = path(); 00383 path( sistrip::root_ + sistrip::dir_ + temp ); 00384 } 00385 00386 uint32_t curr = 0; // current string position 00387 uint32_t next = 0; // next string position 00388 next = path().find( sistrip::readoutView_, curr ); 00389 00390 // Extract view 00391 curr = next; 00392 if ( curr != std::string::npos ) { 00393 next = path().find( sistrip::feDriver_, curr ); 00394 std::string readout_view( path(), 00395 curr+sistrip::readoutView_.size(), 00396 (next-sistrip::dir_.size())-curr ); 00397 00398 // Extract FED id 00399 curr = next; 00400 if ( curr != std::string::npos ) { 00401 next = path().find( sistrip::feUnit_, curr ); 00402 std::string fed_id( path(), 00403 curr+sistrip::feDriver_.size(), 00404 (next-sistrip::dir_.size())-curr ); 00405 fedId_ = atoi( fed_id.c_str() ); 00406 00407 // Extract FE unit 00408 curr = next; 00409 if ( curr != std::string::npos ) { 00410 next = path().find( sistrip::feChan_, curr ); 00411 std::string fe_unit( path(), 00412 curr+sistrip::feUnit_.size(), 00413 next-curr ); 00414 feUnit_ = atoi( fe_unit.c_str() ); 00415 00416 // Extract FE channel 00417 curr = next; 00418 if ( curr != std::string::npos ) { 00419 next = path().find( sistrip::fedApv_, curr ); 00420 std::string fe_chan( path(), 00421 curr+sistrip::feChan_.size(), 00422 next-curr ); 00423 feChan_ = atoi( fe_chan.c_str() ); 00424 00425 // Extract FED APV 00426 curr = next; 00427 if ( curr != std::string::npos ) { 00428 next = std::string::npos; 00429 std::string fed_apv( path(), 00430 curr+sistrip::fedApv_.size(), 00431 next-curr ); 00432 fedApv_ = atoi( fed_apv.c_str() ); 00433 } 00434 } 00435 } 00436 } 00437 } else { 00438 std::stringstream ss; 00439 ss << sistrip::root_ << sistrip::dir_; 00440 //ss << sistrip::root_ << sistrip::dir_ 00441 //<< sistrip::unknownView_ << sistrip::dir_; 00442 std::string temp( ss.str() ); 00443 path( temp ); 00444 } 00445 00446 } 00447 00448 }
void SiStripFedKey::initFromValue | ( | ) | [private, virtual] |
Reimplemented from SiStripKey.
Definition at line 236 of file SiStripFedKey.cc.
References sistrip::APVS_PER_FEDCH, feChan_, sistrip::FED_ID_MAX, sistrip::FED_ID_MIN, fedApv_, sistrip::FEDCH_PER_FEUNIT, fedId_, feUnit_, sistrip::FEUNITS_PER_FED, and sistrip::invalid_.
Referenced by SiStripFedKey().
00236 { 00237 00238 if ( fedId_ >= sistrip::FED_ID_MIN && 00239 fedId_ <= sistrip::FED_ID_MAX ) { 00240 fedId_ = fedId_; 00241 } else if ( fedId_ == 0 ) { 00242 fedId_ = fedId_; 00243 } else { 00244 fedId_ = sistrip::invalid_; 00245 } 00246 00247 if ( feUnit_ <= sistrip::FEUNITS_PER_FED ) { feUnit_ = feUnit_; } 00248 else { feUnit_ = sistrip::invalid_; } 00249 00250 if ( feChan_ <= sistrip::FEDCH_PER_FEUNIT ) { feChan_ = feChan_; } 00251 else { feChan_ = sistrip::invalid_; } 00252 00253 if ( fedApv_ <= sistrip::APVS_PER_FEDCH ) { fedApv_ = fedApv_; } 00254 else { fedApv_ = sistrip::invalid_; } 00255 00256 }
void SiStripFedKey::initGranularity | ( | ) | [private, virtual] |
Reimplemented from SiStripKey.
Definition at line 452 of file SiStripFedKey.cc.
References SiStripKey::channel(), sistrip::FE_CHAN, sistrip::FE_DRIVER, sistrip::FE_UNIT, feChan_, sistrip::FED_APV, sistrip::FED_SYSTEM, fedApv_, fedId_, feUnit_, SiStripKey::granularity(), sistrip::invalid_, and sistrip::UNKNOWN_GRAN.
Referenced by SiStripFedKey().
00452 { 00453 00454 granularity( sistrip::FED_SYSTEM ); 00455 channel(0); 00456 if ( fedId_ && fedId_ != sistrip::invalid_ ) { 00457 granularity( sistrip::FE_DRIVER ); 00458 channel(fedId_); 00459 if ( feUnit_ && feUnit_ != sistrip::invalid_ ) { 00460 granularity( sistrip::FE_UNIT ); 00461 channel(feUnit_); 00462 if ( feChan_ && feChan_ != sistrip::invalid_ ) { 00463 granularity( sistrip::FE_CHAN ); 00464 channel(feChan_); 00465 if ( fedApv_ && fedApv_ != sistrip::invalid_ ) { 00466 granularity( sistrip::FED_APV ); 00467 channel(fedApv_); 00468 } else if ( fedApv_ == sistrip::invalid_ ) { 00469 granularity( sistrip::UNKNOWN_GRAN ); 00470 channel(sistrip::invalid_); 00471 } 00472 } else if ( feChan_ == sistrip::invalid_ ) { 00473 granularity( sistrip::UNKNOWN_GRAN ); 00474 channel(sistrip::invalid_); 00475 } 00476 } else if ( feUnit_ == sistrip::invalid_ ) { 00477 granularity( sistrip::UNKNOWN_GRAN ); 00478 channel(sistrip::invalid_); 00479 } 00480 } else if ( fedId_ == sistrip::invalid_ ) { 00481 granularity( sistrip::UNKNOWN_GRAN ); 00482 channel(sistrip::invalid_); 00483 } 00484 00485 }
bool SiStripFedKey::isConsistent | ( | const SiStripKey & | key | ) | const [virtual] |
"Consistent" means identical and/or null (ie, "all") data.
Reimplemented from SiStripKey.
Definition at line 165 of file SiStripFedKey.cc.
References feChan(), feChan_, fedApv(), fedApv_, fedId(), fedId_, feUnit(), feUnit_, iggi_31X_cfg::input, isEqual(), and pyDBSRunClass::temp.
00165 { 00166 SiStripKey& temp = const_cast<SiStripKey&>(key); 00167 SiStripFedKey& input = dynamic_cast<SiStripFedKey&>(temp); 00168 if ( !(&input) ) { return false; } 00169 if ( isEqual(input) ) { return true; } 00170 else if ( ( fedId_ == 0 || input.fedId() == 0 ) && 00171 ( feUnit_ == 0 || input.feUnit() == 0 ) && 00172 ( feChan_ == 0 || input.feChan() == 0 ) && 00173 ( fedApv_ == 0 || input.fedApv() == 0 ) ) { 00174 return true; 00175 } else { return false; } 00176 }
bool SiStripFedKey::isEqual | ( | const SiStripKey & | key | ) | const [virtual] |
Identifies key objects with identical member data.
Reimplemented from SiStripKey.
Definition at line 151 of file SiStripFedKey.cc.
References feChan(), feChan_, fedApv(), fedApv_, fedId(), fedId_, feUnit(), feUnit_, iggi_31X_cfg::input, and pyDBSRunClass::temp.
Referenced by isConsistent().
00151 { 00152 SiStripKey& temp = const_cast<SiStripKey&>(key); 00153 SiStripFedKey& input = dynamic_cast<SiStripFedKey&>(temp); 00154 if ( !(&input) ) { return false; } 00155 if ( fedId_ == input.fedId() && 00156 feUnit_ == input.feUnit() && 00157 feChan_ == input.feChan() && 00158 fedApv_ == input.fedApv() ) { 00159 return true; 00160 } else { return false; } 00161 }
bool SiStripFedKey::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 214 of file SiStripFedKey.cc.
References sistrip::FE_CHAN, sistrip::FE_DRIVER, sistrip::FE_UNIT, feChan_, sistrip::FED_APV, sistrip::FED_SYSTEM, fedApv_, fedId_, feUnit_, sistrip::invalid_, sistrip::UNDEFINED_GRAN, and sistrip::UNKNOWN_GRAN.
00214 { 00215 if ( gran == sistrip::FED_SYSTEM ) { return false; } 00216 else if ( gran == sistrip::UNDEFINED_GRAN || 00217 gran == sistrip::UNKNOWN_GRAN ) { return false; } 00218 00219 if ( fedId_ == sistrip::invalid_ ) { 00220 if ( gran == sistrip::FE_DRIVER ) { return true; } 00221 if ( feUnit_ == sistrip::invalid_ ) { 00222 if ( gran == sistrip::FE_UNIT ) { return true; } 00223 if ( feChan_ == sistrip::invalid_ ) { 00224 if ( gran == sistrip::FE_CHAN ) { return true; } 00225 if ( fedApv_ == sistrip::invalid_ ) { 00226 if ( gran == sistrip::FED_APV ) { return true; } 00227 } 00228 } 00229 } 00230 } 00231 return false; 00232 }
bool SiStripFedKey::isInvalid | ( | ) | const [virtual] |
Identifies all member data as being invalid.
Reimplemented from SiStripKey.
Definition at line 208 of file SiStripFedKey.cc.
References sistrip::FED_APV.
00208 { 00209 return isInvalid(sistrip::FED_APV); 00210 }
bool SiStripFedKey::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 186 of file SiStripFedKey.cc.
References sistrip::FE_CHAN, sistrip::FE_DRIVER, sistrip::FE_UNIT, feChan_, sistrip::FED_APV, sistrip::FED_SYSTEM, fedApv_, fedId_, feUnit_, sistrip::invalid_, sistrip::UNDEFINED_GRAN, and sistrip::UNKNOWN_GRAN.
00186 { 00187 if ( gran == sistrip::FED_SYSTEM ) { return true; } 00188 else if ( gran == sistrip::UNDEFINED_GRAN || 00189 gran == sistrip::UNKNOWN_GRAN ) { return false; } 00190 00191 if ( fedId_ != sistrip::invalid_ ) { 00192 if ( gran == sistrip::FE_DRIVER ) { return true; } 00193 if ( feUnit_ != sistrip::invalid_ ) { 00194 if ( gran == sistrip::FE_UNIT ) { return true; } 00195 if ( feChan_ != sistrip::invalid_ ) { 00196 if ( gran == sistrip::FE_CHAN ) { return true; } 00197 if ( fedApv_ != sistrip::invalid_ ) { 00198 if ( gran == sistrip::FED_APV ) { return true; } 00199 } 00200 } 00201 } 00202 } 00203 return false; 00204 }
Identifies all member data as being "valid" or null ("all").
Reimplemented from SiStripKey.
Definition at line 180 of file SiStripFedKey.cc.
References sistrip::FED_APV.
Referenced by SummaryGeneratorReadoutView::fill(), and print().
00180 { 00181 return isValid(sistrip::FED_APV); 00182 }
void SiStripFedKey::print | ( | std::stringstream & | ss | ) | const [virtual] |
Print member data of the key.
Reimplemented from SiStripKey.
Definition at line 514 of file SiStripFedKey.cc.
References SiStripKey::channel(), lat::endl(), feChan(), fedApv(), fedChannel(), fedId(), feUnit(), SiStripKey::granularity(), SiStripEnumsAndStrings::granularity(), isValid(), SiStripKey::key(), and SiStripKey::path().
Referenced by operator<<().
00514 { 00515 ss << " [SiStripFedKey::print]" << std::endl 00516 << std::hex 00517 << " FED key : 0x" 00518 << std::setfill('0') 00519 << std::setw(8) << key() << std::endl 00520 << std::setfill(' ') 00521 << std::dec 00522 << " FED id : " << fedId() << std::endl 00523 << " Front-End unit : " << feUnit() << std::endl 00524 << " Front-End chan : " << feChan() << std::endl 00525 << " (internal chan) : " 00526 << "(" << fedChannel() << ")" << std::endl 00527 << " FED APV : " << fedApv() << std::endl 00528 << " Directory : " << path() << std::endl 00529 << " Granularity : " 00530 << SiStripEnumsAndStrings::granularity( granularity() ) << std::endl 00531 << " Channel : " << channel() << std::endl 00532 << " isValid : " << isValid(); 00533 }
void SiStripFedKey::terse | ( | std::stringstream & | ss | ) | const [virtual] |
A terse summary of the key.
Reimplemented from SiStripKey.
Definition at line 489 of file SiStripFedKey.cc.
References feChan(), fedApv(), fedId(), and feUnit().
00489 { 00490 ss << "FED:crate/slot/id/unit/chan/apv= " 00491 << "-" << "/" 00492 << "-" << "/" 00493 << fedId() << "/" 00494 << feUnit() << "/" 00495 << feChan() << "/" 00496 << fedApv(); 00497 // ss << " FedKey" 00498 // //<<"=0x" 00499 // //<< std::hex 00500 // //<< std::setfill('0') << std::setw(8) << key() << std::setfill(' ') 00501 // //<< std::dec 00502 // //<< ", " << ( isValid() ? "Valid" : "Invalid" ) 00503 // //<< ", FedCrate=" << fedCrate() 00504 // //<< ", FedSlot=" << fedSlot() 00505 // << ", FedId=" << fedId() 00506 // << ", FeUnit=" << feUnit() 00507 // << ", FeChan=" << feChan() 00508 // //<< ", FedChannel=" << fedChannel() 00509 // << ", FedApv=" << fedApv(); 00510 }
uint16_t SiStripFedKey::feChan_ [private] |
FE channel [0,1-12,invalid].
Definition at line 170 of file SiStripFedKey.h.
Referenced by feChan(), fedChannel(), initFromKey(), initFromPath(), initFromValue(), initGranularity(), isConsistent(), isEqual(), isInvalid(), isValid(), and SiStripFedKey().
const uint16_t SiStripFedKey::feChanMask_ = 0x00F [static, private] |
const uint16_t SiStripFedKey::feChanOffset_ = 2 [static, private] |
uint16_t SiStripFedKey::fedApv_ [private] |
APV [0,1-2,invalid].
Definition at line 173 of file SiStripFedKey.h.
Referenced by fedApv(), initFromKey(), initFromPath(), initFromValue(), initGranularity(), isConsistent(), isEqual(), isInvalid(), isValid(), and SiStripFedKey().
const uint16_t SiStripFedKey::fedApvMask_ = 0x003 [static, private] |
const uint16_t SiStripFedKey::fedApvOffset_ = 0 [static, private] |
const uint16_t SiStripFedKey::fedCrateMask_ = 0x03F [static, private] |
Definition at line 184 of file SiStripFedKey.h.
const uint16_t SiStripFedKey::fedCrateOffset_ = 24 [static, private] |
Definition at line 176 of file SiStripFedKey.h.
uint16_t SiStripFedKey::fedId_ [private] |
FED id [0,50-489,invalid].
Definition at line 164 of file SiStripFedKey.h.
Referenced by fedId(), initFromKey(), initFromPath(), initFromValue(), initGranularity(), isConsistent(), isEqual(), isInvalid(), isValid(), and SiStripFedKey().
const uint16_t SiStripFedKey::fedIdMask_ = 0x1FF [static, private] |
const uint16_t SiStripFedKey::fedIdOffset_ = 10 [static, private] |
const uint16_t SiStripFedKey::fedSlotMask_ = 0x01F [static, private] |
Definition at line 185 of file SiStripFedKey.h.
const uint16_t SiStripFedKey::fedSlotOffset_ = 19 [static, private] |
Definition at line 177 of file SiStripFedKey.h.
uint16_t SiStripFedKey::feUnit_ [private] |
FE unit [0,1-8,invalid].
Definition at line 167 of file SiStripFedKey.h.
Referenced by fedChannel(), feUnit(), initFromKey(), initFromPath(), initFromValue(), initGranularity(), isConsistent(), isEqual(), isInvalid(), isValid(), and SiStripFedKey().
const uint16_t SiStripFedKey::feUnitMask_ = 0x00F [static, private] |
const uint16_t SiStripFedKey::feUnitOffset_ = 6 [static, private] |