CMS 3D CMS Logo

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

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... More...

#include <SiStripFedKey.h>

Inheritance diagram for SiStripFedKey:
SiStripKey

Public Member Functions

const uint16_t & feChan () const
 
const uint16_t & fedApv () const
 
uint16_t fedChannel () const
 
const uint16_t & fedId () const
 
const uint16_t & feUnit () const
 
bool isConsistent (const SiStripKey &) const
 
bool isEqual (const SiStripKey &) const
 
bool isInvalid () const
 
bool isInvalid (const sistrip::Granularity &) const
 
bool isValid () const
 
bool isValid (const sistrip::Granularity &) const
 
virtual void print (std::stringstream &ss) const
 
 SiStripFedKey (const uint16_t &fed_id, const uint16_t &fe_unit=0, const uint16_t &fe_chan=0, const uint16_t &fed_apv=0)
 
 SiStripFedKey (const uint32_t &fed_key)
 
 SiStripFedKey (const std::string &directory_path)
 
 SiStripFedKey (const SiStripFedKey &)
 
 SiStripFedKey (const SiStripKey &)
 
 SiStripFedKey ()
 
virtual void terse (std::stringstream &ss) const
 
- Public Member Functions inherited from SiStripKey
const uint16_t & channel () const
 
const sistrip::Granularitygranularity () const
 
const uint32_t & key () const
 
const SiStripKeyoperator= (const SiStripKey &)
 
const std::string & path () const
 
 SiStripKey (const uint32_t &key)
 
 SiStripKey (const std::string &directory_path)
 
 SiStripKey (const SiStripKey &)
 
 SiStripKey ()
 
virtual ~SiStripKey ()
 

Static Public Member Functions

static uint16_t feChan (const uint16_t &fed_ch)
 
static uint16_t fedCh (const uint16_t &fe_unit, const uint16_t &fe_chan)
 
static uint32_t fedIndex (const uint16_t &fed_id, const uint16_t &fed_ch)
 
static uint16_t feUnit (const uint16_t &fed_ch)
 

Private Member Functions

void initFromKey ()
 
void initFromPath ()
 
void initFromValue ()
 
void initGranularity ()
 

Private Attributes

uint16_t feChan_
 
uint16_t fedApv_
 
uint16_t fedId_
 
uint16_t feUnit_
 

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
 

Additional Inherited Members

- Protected Member Functions inherited from SiStripKey
void channel (const uint16_t &)
 
void granularity (const sistrip::Granularity &)
 
void key (const uint32_t &)
 
void path (const std::string &)
 

Detailed Description

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.

Author
R.Bainbridge
R.Bainbridge

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.

Constructor & Destructor Documentation

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().

16  :
17  SiStripKey(),
18  fedId_(fed_id),
19  feUnit_(fe_unit),
20  feChan_(fe_chan),
21  fedApv_(fed_apv)
22 {
23  // order is important!
24  initFromValue();
25  initFromKey();
26  initFromPath();
28 }
uint16_t fedApv_
uint16_t feChan_
void initFromValue()
uint16_t fedId_
uint16_t feUnit_
void initGranularity()
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().

32  :
33  SiStripKey(fed_key),
38 {
39  // order is important!
40  initFromKey();
41  initFromValue();
42  initFromPath();
44 }
uint16_t fedApv_
uint16_t feChan_
void initFromValue()
uint16_t fedId_
uint16_t feUnit_
void initGranularity()
static const uint16_t invalid_
Definition: Constants.h:17
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().

48  :
54 {
55  // order is important!
56  initFromPath();
57  initFromValue();
58  initFromKey();
60 }
uint16_t fedApv_
const std::string & path() const
Definition: SiStripKey.h:127
uint16_t feChan_
void initFromValue()
uint16_t fedId_
uint16_t feUnit_
void initGranularity()
static const uint16_t invalid_
Definition: Constants.h:17
SiStripFedKey::SiStripFedKey ( const SiStripFedKey input)

Copy constructor.

Definition at line 64 of file SiStripFedKey.cc.

References SiStripKey::granularity(), SiStripKey::key(), and SiStripKey::path().

64  :
65  SiStripKey(),
66  fedId_(input.fedId()),
67  feUnit_(input.feUnit()),
68  feChan_(input.feChan()),
69  fedApv_(input.fedApv())
70 {
71  key(input.key());
72  path(input.path());
73  granularity(input.granularity());
74 }
const uint32_t & key() const
Definition: SiStripKey.h:126
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:128
uint16_t fedApv_
const std::string & path() const
Definition: SiStripKey.h:127
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
const uint16_t & fedApv() const
const uint16_t & feUnit() const
const uint16_t & feChan() const
const uint16_t & fedId() const
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(), LaserDQM_cfg::input, SiStripKey::key(), and SiStripKey::path().

78  :
79  SiStripKey(),
84 {
85  const SiStripFedKey& fed_key = dynamic_cast<const SiStripFedKey&>(input);
86  if ( (&fed_key) ) {
87  key(fed_key.key());
88  path(fed_key.path());
89  granularity(fed_key.granularity());
90  fedId_ = fed_key.fedId();
91  feUnit_ = fed_key.feUnit();
92  feChan_ = fed_key.feChan();
93  fedApv_ = fed_key.fedApv();
94  }
95 }
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:57
const uint32_t & key() const
Definition: SiStripKey.h:126
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:128
uint16_t fedApv_
const std::string & path() const
Definition: SiStripKey.h:127
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
const uint16_t & fedApv() const
const uint16_t & feUnit() const
static const uint16_t invalid_
Definition: Constants.h:17
const uint16_t & feChan() const
const uint16_t & fedId() const
SiStripFedKey::SiStripFedKey ( )

Default constructor

Definition at line 99 of file SiStripFedKey.cc.

99  :
100  SiStripKey(),
105 {;}
uint16_t fedApv_
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
static const uint16_t invalid_
Definition: Constants.h:17

Member Function Documentation

const uint16_t & SiStripFedKey::feChan ( ) const
inline
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 131 of file SiStripFedKey.cc.

References sistrip::FEDCH_PER_FED, and sistrip::invalid_.

131  {
132  if ( fed_ch < sistrip::FEDCH_PER_FED ) {
133  return ( (95-fed_ch)%12 + 1 );
134  }
135  return sistrip::invalid_;
136 }
static const uint16_t invalid_
Definition: Constants.h:17
static const uint16_t FEDCH_PER_FED
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().

198 { return fedApv_; }
uint16_t 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 109 of file SiStripFedKey.cc.

References sistrip::FEDCH_PER_FEUNIT, sistrip::FEUNITS_PER_FED, and sistrip::invalid_.

Referenced by fedChannel(), and SiStripCondObjBuilderFromDb::setValuesApvTiming().

110  {
111  if ( fe_unit <= sistrip::FEUNITS_PER_FED &&
112  fe_chan <= sistrip::FEDCH_PER_FEUNIT ) {
113  if ( fe_unit != 0 && fe_chan != 0 ) {
114  return ( 95 - ( 12 * (fe_unit-1) + (fe_chan-1) ) );
115  }
116  }
117  return sistrip::invalid_;
118 }
static const uint16_t FEUNITS_PER_FED
static const uint16_t FEDCH_PER_FEUNIT
static const uint16_t invalid_
Definition: Constants.h:17
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(), CommissioningAnalysis::header(), FastFedCablingAnalysis::header(), FedCablingAnalysis::print(), print(), PedestalsHistosUsingDb::update(), PedsFullNoiseHistosUsingDb::update(), and ApvTimingHistosUsingDb::update().

199 { return fedCh( feUnit_, feChan_ ); }
uint16_t feChan_
uint16_t feUnit_
static uint16_t fedCh(const uint16_t &fe_unit, const uint16_t &fe_chan)
const uint16_t & SiStripFedKey::fedId ( ) const
inline
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 140 of file SiStripFedKey.cc.

References sistrip::FED_ID_MAX, sistrip::FED_ID_MIN, sistrip::FEDCH_PER_FED, and sistrip::invalid32_.

Referenced by SiStripSpyDisplayModule::analyze(), sistrip::SpyUnpacker::createDigis(), and sistrip::SpyDigiConverter::mergeModuleChannels().

141  {
142  if ( fed_id < sistrip::FED_ID_MIN ||
143  fed_id > sistrip::FED_ID_MAX ||
144  fed_ch >= sistrip::FEDCH_PER_FED ) { return sistrip::invalid32_; }
145  return ( fed_id * sistrip::FEDCH_PER_FED + fed_ch );
146 }
static const uint16_t FED_ID_MIN
static const uint32_t invalid32_
Definition: Constants.h:16
static const uint16_t FEDCH_PER_FED
static const uint16_t FED_ID_MAX
const uint16_t & SiStripFedKey::feUnit ( ) const
inline
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 122 of file SiStripFedKey.cc.

References sistrip::FEDCH_PER_FED, and sistrip::invalid_.

122  {
123  if ( fed_ch < sistrip::FEDCH_PER_FED ) {
124  return ( (95-fed_ch)/12 + 1 );
125  }
126  return sistrip::invalid_;
127 }
static const uint16_t invalid_
Definition: Constants.h:17
static const uint16_t FEDCH_PER_FED
void SiStripFedKey::initFromKey ( )
privatevirtual

Reimplemented from SiStripKey.

Definition at line 257 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().

257  {
258 
259  if ( key() == sistrip::invalid32_ ) {
260 
261  // ---------- Set FedKey based on member data ----------
262 
263  // Initialise to null value
264  key(0);
265 
266  // Extract FED id
267  if ( fedId_ >= sistrip::FED_ID_MIN &&
269  key( key() | (fedId_<<fedIdOffset_) );
270  } else if ( fedId_ == 0 ) {
271  key( key() | (fedId_<<fedIdOffset_) );
272  } else {
273  key( key() | (fedIdMask_<<fedIdOffset_) );
274  }
275 
276  // Extract FE unit
277  if ( feUnit_ >= 1 &&
279  key( key() | (feUnit_<<feUnitOffset_) );
280  } else if ( feUnit_ == 0 ) {
281  key( key() | (feUnit_<<feUnitOffset_) );
282  } else {
283  key( key() | (feUnitMask_<<feUnitOffset_) );
284  }
285 
286  // Extract FE chan
287  if ( feChan_ >= 1 &&
289  key( key() | (feChan_<<feChanOffset_) );
290  } else if ( feChan_ == 0 ) {
291  key( key() | (feChan_<<feChanOffset_) );
292  } else {
293  key( key() | (feChanMask_<<feChanOffset_) );
294  }
295 
296  // Extract FED APV
297  if ( fedApv_ >= 1 &&
299  key( key() | (fedApv_<<fedApvOffset_) );
300  } else if ( fedApv_ == 0 ) {
301  key( key() | (fedApv_<<fedApvOffset_) );
302  } else {
303  key( key() | (fedApvMask_<<fedApvOffset_) );
304  }
305 
306  // Set invalid key if necessary
307  if ( fedId_ == sistrip::invalid_ &&
310  fedApv_ == sistrip::invalid_ ) {
312  }
313 
314  } else {
315 
316  // ---------- Set member data based on FED key ----------
317 
318  fedId_ = ( key()>>fedIdOffset_ ) & fedIdMask_;
322 
323  if ( fedId_ == fedIdMask_ ) { fedId_ = sistrip::invalid_; }
324  if ( feUnit_ == feUnitMask_ ) { feUnit_ = sistrip::invalid_; }
325  if ( feChan_ == feChanMask_ ) { feChan_ = sistrip::invalid_; }
326  if ( fedApv_ == fedApvMask_ ) { fedApv_ = sistrip::invalid_; }
327 
328  }
329 
330 }
static const uint16_t feChanMask_
static const uint16_t FED_ID_MIN
static const uint16_t feUnitOffset_
static const uint32_t invalid32_
Definition: Constants.h:16
const uint32_t & key() const
Definition: SiStripKey.h:126
uint16_t fedApv_
static const uint16_t FEUNITS_PER_FED
static const uint16_t feUnitMask_
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
static const uint16_t fedIdOffset_
static const uint16_t feChanOffset_
static const uint16_t FEDCH_PER_FEUNIT
static const uint16_t invalid_
Definition: Constants.h:17
static const uint16_t fedApvMask_
static const uint16_t FED_ID_MAX
static const uint16_t fedIdMask_
static const uint16_t APVS_PER_FEDCH
static const uint16_t fedApvOffset_
void SiStripFedKey::initFromPath ( )
privatevirtual

Reimplemented from SiStripKey.

Definition at line 334 of file SiStripFedKey.cc.

References dir, sistrip::dir_, sistrip::feChan_, feChan_, sistrip::fedApv_, fedApv_, fedId_, sistrip::feDriver_, sistrip::feUnit_, feUnit_, spr::find(), sistrip::null_, SiStripKey::path(), sistrip::readoutView_, sistrip::root_, AlCaHLTBitMon_QueryRunRegistry::string, and groupFilesInBlocks::temp.

Referenced by SiStripFedKey().

334  {
335 
336  if ( path() == sistrip::null_ ) {
337 
338  // ---------- Set directory path based on member data ----------
339 
340  std::stringstream dir;
341 
342  dir << sistrip::root_ << sistrip::dir_
344 
345  // Add FED id
346  if ( fedId_ ) {
348 
349  // Add FE unit
350  if ( feUnit_ ) {
352 
353  // Add FE channel
354  if ( feChan_ ) {
356 
357  // Add FED APV
358  if ( fedApv_ ) {
360  }
361  }
362  }
363  }
364 
365  std::string temp( dir.str() );
366  path( temp );
367 
368  } else {
369 
370  // ---------- Set member data based on directory path ----------
371 
372  fedId_ = 0;
373  feUnit_ = 0;
374  feChan_ = 0;
375  fedApv_ = 0;
376 
377  // Check if root is found
378  if ( path().find( sistrip::root_ ) == std::string::npos ) {
379  std::string temp = path();
380  path( std::string(sistrip::root_) + sistrip::dir_ + temp );
381  }
382 
383  size_t curr = 0; // current string position
384  size_t next = 0; // next string position
385  next = path().find( sistrip::readoutView_, curr );
386 
387  // Extract view
388  curr = next;
389  if ( curr != std::string::npos ) {
390  next = path().find( sistrip::feDriver_, curr );
391  std::string readout_view( path(),
392  curr+(sizeof(sistrip::readoutView_) - 1),
393  (next-(sizeof(sistrip::dir_) - 1))-curr );
394 
395  // Extract FED id
396  curr = next;
397  if ( curr != std::string::npos ) {
398  next = path().find( sistrip::feUnit_, curr );
399  std::string fed_id( path(),
400  curr+(sizeof(sistrip::feDriver_) - 1),
401  (next-(sizeof(sistrip::dir_) - 1))-curr );
402  fedId_ = atoi( fed_id.c_str() );
403 
404  // Extract FE unit
405  curr = next;
406  if ( curr != std::string::npos ) {
407  next = path().find( sistrip::feChan_, curr );
408  std::string fe_unit( path(),
409  curr+(sizeof(sistrip::feUnit_) - 1),
410  next-curr );
411  feUnit_ = atoi( fe_unit.c_str() );
412 
413  // Extract FE channel
414  curr = next;
415  if ( curr != std::string::npos ) {
416  next = path().find( sistrip::fedApv_, curr );
417  std::string fe_chan( path(),
418  curr+(sizeof(sistrip::feChan_) - 1),
419  next-curr );
420  feChan_ = atoi( fe_chan.c_str() );
421 
422  // Extract FED APV
423  curr = next;
424  if ( curr != std::string::npos ) {
425  next = std::string::npos;
426  std::string fed_apv( path(),
427  curr+(sizeof(sistrip::fedApv_) - 1),
428  next-curr );
429  fedApv_ = atoi( fed_apv.c_str() );
430  }
431  }
432  }
433  }
434  } else {
435  std::stringstream ss;
436  ss << sistrip::root_ << sistrip::dir_;
437  //ss << sistrip::root_ << sistrip::dir_
438  //<< sistrip::unknownView_ << sistrip::dir_;
439  std::string temp( ss.str() );
440  path( temp );
441  }
442 
443  }
444 
445 }
static const char feDriver_[]
static const char dir_[]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
uint16_t fedApv_
static const char fedApv_[]
const std::string & path() const
Definition: SiStripKey.h:127
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
static const char feChan_[]
static const char root_[]
static const char feUnit_[]
dbl *** dir
Definition: mlp_gen.cc:35
static const char readoutView_[]
static const char null_[]
Definition: Constants.h:23
void SiStripFedKey::initFromValue ( )
privatevirtual

Reimplemented from SiStripKey.

Definition at line 233 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().

233  {
234 
235  if ( fedId_ >= sistrip::FED_ID_MIN &&
237  fedId_ = fedId_;
238  } else if ( fedId_ == 0 ) {
239  fedId_ = fedId_;
240  } else {
242  }
243 
245  else { feUnit_ = sistrip::invalid_; }
246 
248  else { feChan_ = sistrip::invalid_; }
249 
251  else { fedApv_ = sistrip::invalid_; }
252 
253 }
static const uint16_t FED_ID_MIN
uint16_t fedApv_
static const uint16_t FEUNITS_PER_FED
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
static const uint16_t FEDCH_PER_FEUNIT
static const uint16_t invalid_
Definition: Constants.h:17
static const uint16_t FED_ID_MAX
static const uint16_t APVS_PER_FEDCH
void SiStripFedKey::initGranularity ( )
privatevirtual

Reimplemented from SiStripKey.

Definition at line 449 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().

449  {
450 
452  channel(0);
453  if ( fedId_ && fedId_ != sistrip::invalid_ ) {
455  channel(fedId_);
456  if ( feUnit_ && feUnit_ != sistrip::invalid_ ) {
458  channel(feUnit_);
459  if ( feChan_ && feChan_ != sistrip::invalid_ ) {
461  channel(feChan_);
462  if ( fedApv_ && fedApv_ != sistrip::invalid_ ) {
464  channel(fedApv_);
465  } else if ( fedApv_ == sistrip::invalid_ ) {
468  }
469  } else if ( feChan_ == sistrip::invalid_ ) {
472  }
473  } else if ( feUnit_ == sistrip::invalid_ ) {
476  }
477  } else if ( fedId_ == sistrip::invalid_ ) {
480  }
481 
482 }
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:128
uint16_t fedApv_
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
const uint16_t & channel() const
Definition: SiStripKey.h:129
static const uint16_t invalid_
Definition: Constants.h:17
bool SiStripFedKey::isConsistent ( const SiStripKey key) const
virtual

"Consistent" means identical and/or null (ie, "all") data.

Reimplemented from SiStripKey.

Definition at line 163 of file SiStripFedKey.cc.

References feChan(), feChan_, fedApv(), fedApv_, fedId(), fedId_, feUnit(), feUnit_, LaserDQM_cfg::input, isEqual(), and SiStripKey::key().

163  {
164  const SiStripFedKey& input = dynamic_cast<const SiStripFedKey&>(key);
165  if ( !(&input) ) { return false; }
166  if ( isEqual(input) ) { return true; }
167  else if ( ( fedId_ == 0 || input.fedId() == 0 ) &&
168  ( feUnit_ == 0 || input.feUnit() == 0 ) &&
169  ( feChan_ == 0 || input.feChan() == 0 ) &&
170  ( fedApv_ == 0 || input.fedApv() == 0 ) ) {
171  return true;
172  } else { return false; }
173 }
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:57
const uint32_t & key() const
Definition: SiStripKey.h:126
uint16_t fedApv_
bool isEqual(const SiStripKey &) const
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
const uint16_t & fedApv() const
const uint16_t & feUnit() const
const uint16_t & feChan() const
const uint16_t & fedId() const
bool SiStripFedKey::isEqual ( const SiStripKey key) const
virtual

Identifies key objects with identical member data.

Reimplemented from SiStripKey.

Definition at line 150 of file SiStripFedKey.cc.

References feChan(), feChan_, fedApv(), fedApv_, fedId(), fedId_, feUnit(), feUnit_, LaserDQM_cfg::input, and SiStripKey::key().

Referenced by isConsistent().

150  {
151  const SiStripFedKey& input = dynamic_cast<const SiStripFedKey&>(key);
152  if ( !(&input) ) { return false; }
153  if ( fedId_ == input.fedId() &&
154  feUnit_ == input.feUnit() &&
155  feChan_ == input.feChan() &&
156  fedApv_ == input.fedApv() ) {
157  return true;
158  } else { return false; }
159 }
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:57
const uint32_t & key() const
Definition: SiStripKey.h:126
uint16_t fedApv_
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
const uint16_t & fedApv() const
const uint16_t & feUnit() const
const uint16_t & feChan() const
const uint16_t & fedId() const
bool SiStripFedKey::isInvalid ( ) const
virtual

Identifies all member data as being invalid.

Reimplemented from SiStripKey.

Definition at line 205 of file SiStripFedKey.cc.

References sistrip::FED_APV.

205  {
206  return isInvalid(sistrip::FED_APV);
207 }
bool isInvalid() const
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 211 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.

211  {
212  if ( gran == sistrip::FED_SYSTEM ) { return false; }
213  else if ( gran == sistrip::UNDEFINED_GRAN ||
214  gran == sistrip::UNKNOWN_GRAN ) { return false; }
215 
216  if ( fedId_ == sistrip::invalid_ ) {
217  if ( gran == sistrip::FE_DRIVER ) { return true; }
218  if ( feUnit_ == sistrip::invalid_ ) {
219  if ( gran == sistrip::FE_UNIT ) { return true; }
220  if ( feChan_ == sistrip::invalid_ ) {
221  if ( gran == sistrip::FE_CHAN ) { return true; }
222  if ( fedApv_ == sistrip::invalid_ ) {
223  if ( gran == sistrip::FED_APV ) { return true; }
224  }
225  }
226  }
227  }
228  return false;
229 }
uint16_t fedApv_
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
static const uint16_t invalid_
Definition: Constants.h:17
bool SiStripFedKey::isValid ( void  ) const
virtual

Identifies all member data as being "valid" or null ("all").

Reimplemented from SiStripKey.

Definition at line 177 of file SiStripFedKey.cc.

References sistrip::FED_APV.

Referenced by SummaryGeneratorReadoutView::fill(), and print().

177  {
178  return isValid(sistrip::FED_APV);
179 }
bool isValid() const
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 183 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.

183  {
184  if ( gran == sistrip::FED_SYSTEM ) { return true; }
185  else if ( gran == sistrip::UNDEFINED_GRAN ||
186  gran == sistrip::UNKNOWN_GRAN ) { return false; }
187 
188  if ( fedId_ != sistrip::invalid_ ) {
189  if ( gran == sistrip::FE_DRIVER ) { return true; }
190  if ( feUnit_ != sistrip::invalid_ ) {
191  if ( gran == sistrip::FE_UNIT ) { return true; }
192  if ( feChan_ != sistrip::invalid_ ) {
193  if ( gran == sistrip::FE_CHAN ) { return true; }
194  if ( fedApv_ != sistrip::invalid_ ) {
195  if ( gran == sistrip::FED_APV ) { return true; }
196  }
197  }
198  }
199  }
200  return false;
201 }
uint16_t fedApv_
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
static const uint16_t invalid_
Definition: Constants.h:17
void SiStripFedKey::print ( std::stringstream &  ss) const
virtual

Print member data of the key

Reimplemented from SiStripKey.

Definition at line 511 of file SiStripFedKey.cc.

References SiStripKey::channel(), feChan(), fedApv(), fedChannel(), fedId(), feUnit(), SiStripEnumsAndStrings::granularity(), SiStripKey::granularity(), isValid(), SiStripKey::key(), and SiStripKey::path().

Referenced by operator<<(), and CommissioningHistograms::printHistosMap().

511  {
512  ss << " [SiStripFedKey::print]" << std::endl
513  << std::hex
514  << " FED key : 0x"
515  << std::setfill('0')
516  << std::setw(8) << key() << std::endl
517  << std::setfill(' ')
518  << std::dec
519  << " FED id : " << fedId() << std::endl
520  << " Front-End unit : " << feUnit() << std::endl
521  << " Front-End chan : " << feChan() << std::endl
522  << " (internal chan) : "
523  << "(" << fedChannel() << ")" << std::endl
524  << " FED APV : " << fedApv() << std::endl
525  << " Directory : " << path() << std::endl
526  << " Granularity : "
528  << " Channel : " << channel() << std::endl
529  << " isValid : " << isValid();
530 }
static std::string granularity(const sistrip::Granularity &)
const uint32_t & key() const
Definition: SiStripKey.h:126
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:128
bool isValid() const
const std::string & path() const
Definition: SiStripKey.h:127
uint16_t fedChannel() const
const uint16_t & fedApv() const
const uint16_t & feUnit() const
const uint16_t & channel() const
Definition: SiStripKey.h:129
const uint16_t & feChan() const
const uint16_t & fedId() const
void SiStripFedKey::terse ( std::stringstream &  ss) const
virtual

A terse summary of the key

Reimplemented from SiStripKey.

Definition at line 486 of file SiStripFedKey.cc.

References feChan(), fedApv(), fedId(), and feUnit().

486  {
487  ss << "FED:crate/slot/id/unit/chan/apv= "
488  << "-" << "/"
489  << "-" << "/"
490  << fedId() << "/"
491  << feUnit() << "/"
492  << feChan() << "/"
493  << fedApv();
494 // ss << " FedKey"
495 // //<<"=0x"
496 // //<< std::hex
497 // //<< std::setfill('0') << std::setw(8) << key() << std::setfill(' ')
498 // //<< std::dec
499 // //<< ", " << ( isValid() ? "Valid" : "Invalid" )
500 // //<< ", FedCrate=" << fedCrate()
501 // //<< ", FedSlot=" << fedSlot()
502 // << ", FedId=" << fedId()
503 // << ", FeUnit=" << feUnit()
504 // << ", FeChan=" << feChan()
505 // //<< ", FedChannel=" << fedChannel()
506 // << ", FedApv=" << fedApv();
507 }
const uint16_t & fedApv() const
const uint16_t & feUnit() const
const uint16_t & feChan() const
const uint16_t & fedId() const

Member Data Documentation

uint16_t SiStripFedKey::feChan_
private
const uint16_t SiStripFedKey::feChanMask_ = 0x00F
staticprivate

Definition at line 188 of file SiStripFedKey.h.

Referenced by initFromKey().

const uint16_t SiStripFedKey::feChanOffset_ = 2
staticprivate

Definition at line 180 of file SiStripFedKey.h.

Referenced by initFromKey().

uint16_t SiStripFedKey::fedApv_
private
const uint16_t SiStripFedKey::fedApvMask_ = 0x003
staticprivate

Definition at line 189 of file SiStripFedKey.h.

Referenced by initFromKey().

const uint16_t SiStripFedKey::fedApvOffset_ = 0
staticprivate

Definition at line 181 of file SiStripFedKey.h.

Referenced by initFromKey().

const uint16_t SiStripFedKey::fedCrateMask_ = 0x03F
staticprivate

Definition at line 184 of file SiStripFedKey.h.

const uint16_t SiStripFedKey::fedCrateOffset_ = 24
staticprivate

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
staticprivate

Definition at line 186 of file SiStripFedKey.h.

Referenced by initFromKey().

const uint16_t SiStripFedKey::fedIdOffset_ = 10
staticprivate

Definition at line 178 of file SiStripFedKey.h.

Referenced by initFromKey().

const uint16_t SiStripFedKey::fedSlotMask_ = 0x01F
staticprivate

Definition at line 185 of file SiStripFedKey.h.

const uint16_t SiStripFedKey::fedSlotOffset_ = 19
staticprivate

Definition at line 177 of file SiStripFedKey.h.

uint16_t SiStripFedKey::feUnit_
private
const uint16_t SiStripFedKey::feUnitMask_ = 0x00F
staticprivate

Definition at line 187 of file SiStripFedKey.h.

Referenced by initFromKey().

const uint16_t SiStripFedKey::feUnitOffset_ = 6
staticprivate

Definition at line 179 of file SiStripFedKey.h.

Referenced by initFromKey().