CMS 3D CMS Logo

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 override
 
bool isEqual (const SiStripKey &) const override
 
bool isInvalid () const override
 
bool isInvalid (const sistrip::Granularity &) const override
 
bool isValid () const override
 
bool isValid (const sistrip::Granularity &) const override
 
void print (std::stringstream &ss) const override
 
 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 ()
 
void terse (std::stringstream &ss) const override
 
- 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 () override
 
void initFromPath () override
 
void initFromValue () override
 
void initGranularity () override
 

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 56 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 12 of file SiStripFedKey.cc.

References initFromKey(), initFromPath(), initFromValue(), and initGranularity().

15  :
16  SiStripKey(),
17  fedId_(fed_id),
18  feUnit_(fe_unit),
19  feChan_(fe_chan),
20  fedApv_(fed_apv)
21 {
22  // order is important!
23  initFromValue();
24  initFromKey();
25  initFromPath();
27 }
void initFromValue() override
void initFromPath() override
void initFromKey() override
uint16_t fedApv_
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
void initGranularity() override
SiStripFedKey::SiStripFedKey ( const uint32_t &  fed_key)

Constructor using 32-bit "FED key".

Definition at line 31 of file SiStripFedKey.cc.

References initFromKey(), initFromPath(), initFromValue(), and initGranularity().

31  :
32  SiStripKey(fed_key),
37 {
38  // order is important!
39  initFromKey();
40  initFromValue();
41  initFromPath();
43 }
void initFromValue() override
void initFromPath() override
void initFromKey() override
uint16_t fedApv_
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
void initGranularity() override
static const uint16_t invalid_
Definition: Constants.h:16
SiStripFedKey::SiStripFedKey ( const std::string &  directory_path)

Constructor using directory path.

Definition at line 47 of file SiStripFedKey.cc.

References initFromKey(), initFromPath(), initFromValue(), and initGranularity().

47  :
53 {
54  // order is important!
55  initFromPath();
56  initFromValue();
57  initFromKey();
59 }
void initFromValue() override
void initFromPath() override
void initFromKey() override
uint16_t fedApv_
const std::string & path() const
Definition: SiStripKey.h:126
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
void initGranularity() override
static const uint16_t invalid_
Definition: Constants.h:16
SiStripFedKey::SiStripFedKey ( const SiStripFedKey input)

Copy constructor.

Definition at line 63 of file SiStripFedKey.cc.

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

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

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

77  :
78  SiStripKey(),
83 {
84  const SiStripFedKey& fed_key = dynamic_cast<const SiStripFedKey&>(input);
85  key(fed_key.key());
86  path(fed_key.path());
87  granularity(fed_key.granularity());
88  fedId_ = fed_key.fedId();
89  feUnit_ = fed_key.feUnit();
90  feChan_ = fed_key.feChan();
91  fedApv_ = fed_key.fedApv();
92 }
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
static std::string const input
Definition: EdmProvDump.cc:45
const uint32_t & key() const
Definition: SiStripKey.h:125
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:127
uint16_t fedApv_
const std::string & path() const
Definition: SiStripKey.h:126
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:16
const uint16_t & feChan() const
const uint16_t & fedId() const
SiStripFedKey::SiStripFedKey ( )

Default constructor

Definition at line 96 of file SiStripFedKey.cc.

96  :
97  SiStripKey(),
102 {;}
uint16_t fedApv_
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
static const uint16_t invalid_
Definition: Constants.h:16

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 128 of file SiStripFedKey.cc.

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

128  {
129  if ( fed_ch < sistrip::FEDCH_PER_FED ) {
130  return ( (95-fed_ch)%12 + 1 );
131  }
132  return sistrip::invalid_;
133 }
static const uint16_t invalid_
Definition: Constants.h:16
static const uint16_t FEDCH_PER_FED
const uint16_t & SiStripFedKey::fedApv ( ) const
inline

Returns APV within FED channel.

Definition at line 197 of file SiStripFedKey.h.

References fedApv_.

Referenced by SummaryGeneratorReadoutView::fill(), isConsistent(), isEqual(), print(), SiStripFedKey(), and terse().

197 { 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 106 of file SiStripFedKey.cc.

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

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

107  {
108  if ( fe_unit <= sistrip::FEUNITS_PER_FED &&
109  fe_chan <= sistrip::FEDCH_PER_FEUNIT ) {
110  if ( fe_unit != 0 && fe_chan != 0 ) {
111  return ( 95 - ( 12 * (fe_unit-1) + (fe_chan-1) ) );
112  }
113  }
114  return sistrip::invalid_;
115 }
static const uint16_t FEUNITS_PER_FED
static const uint16_t FEDCH_PER_FEUNIT
static const uint16_t invalid_
Definition: Constants.h:16
uint16_t SiStripFedKey::fedChannel ( ) const
inline

Returns FED channel (according to "internal" numbering).

Definition at line 198 of file SiStripFedKey.h.

References feChan_, fedCh(), and feUnit_.

Referenced by CommissioningHistosUsingDb::addDcuDetIds(), CommissioningAnalysis::header(), FastFedCablingAnalysis::header(), FedCablingAnalysis::print(), print(), PedsFullNoiseHistosUsingDb::update(), PedestalsHistosUsingDb::update(), DaqScopeModeHistosUsingDb::update(), and ApvTimingHistosUsingDb::update().

198 { 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 137 of file SiStripFedKey.cc.

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

Referenced by SiStripSpyDisplayModule::analyze().

138  {
139  if ( fed_id < sistrip::FED_ID_MIN ||
140  fed_id > sistrip::FED_ID_MAX ||
141  fed_ch >= sistrip::FEDCH_PER_FED ) { return sistrip::invalid32_; }
142  return ( fed_id * sistrip::FEDCH_PER_FED + fed_ch );
143 }
static const uint16_t FED_ID_MIN
static const uint32_t invalid32_
Definition: Constants.h:15
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 119 of file SiStripFedKey.cc.

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

119  {
120  if ( fed_ch < sistrip::FEDCH_PER_FED ) {
121  return ( (95-fed_ch)/12 + 1 );
122  }
123  return sistrip::invalid_;
124 }
static const uint16_t invalid_
Definition: Constants.h:16
static const uint16_t FEDCH_PER_FED
void SiStripFedKey::initFromKey ( )
overrideprivatevirtual

Reimplemented from SiStripKey.

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

246  {
247 
248  if ( key() == sistrip::invalid32_ ) {
249 
250  // ---------- Set FedKey based on member data ----------
251 
252  // Initialise to null value
253  key(0);
254 
255  // Extract FED id
256  if ( fedId_ >= sistrip::FED_ID_MIN &&
258  key( key() | (fedId_<<fedIdOffset_) );
259  } else if ( fedId_ == 0 ) {
260  key( key() | (fedId_<<fedIdOffset_) );
261  } else {
262  key( key() | (fedIdMask_<<fedIdOffset_) );
263  }
264 
265  // Extract FE unit
266  if ( feUnit_ >= 1 &&
268  key( key() | (feUnit_<<feUnitOffset_) );
269  } else if ( feUnit_ == 0 ) {
270  key( key() | (feUnit_<<feUnitOffset_) );
271  } else {
272  key( key() | (feUnitMask_<<feUnitOffset_) );
273  }
274 
275  // Extract FE chan
276  if ( feChan_ >= 1 &&
278  key( key() | (feChan_<<feChanOffset_) );
279  } else if ( feChan_ == 0 ) {
280  key( key() | (feChan_<<feChanOffset_) );
281  } else {
282  key( key() | (feChanMask_<<feChanOffset_) );
283  }
284 
285  // Extract FED APV
286  if ( fedApv_ >= 1 &&
288  key( key() | (fedApv_<<fedApvOffset_) );
289  } else if ( fedApv_ == 0 ) {
290  key( key() | (fedApv_<<fedApvOffset_) );
291  } else {
292  key( key() | (fedApvMask_<<fedApvOffset_) );
293  }
294 
295  // Set invalid key if necessary
296  if ( fedId_ == sistrip::invalid_ &&
299  fedApv_ == sistrip::invalid_ ) {
301  }
302 
303  } else {
304 
305  // ---------- Set member data based on FED key ----------
306 
307  fedId_ = ( key()>>fedIdOffset_ ) & fedIdMask_;
311 
312  if ( fedId_ == fedIdMask_ ) { fedId_ = sistrip::invalid_; }
313  if ( feUnit_ == feUnitMask_ ) { feUnit_ = sistrip::invalid_; }
314  if ( feChan_ == feChanMask_ ) { feChan_ = sistrip::invalid_; }
315  if ( fedApv_ == fedApvMask_ ) { fedApv_ = sistrip::invalid_; }
316 
317  }
318 
319 }
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:15
const uint32_t & key() const
Definition: SiStripKey.h:125
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:16
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 ( )
overrideprivatevirtual

Reimplemented from SiStripKey.

Definition at line 323 of file SiStripFedKey.cc.

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

Referenced by SiStripFedKey().

323  {
324 
325  if ( path() == sistrip::null_ ) {
326 
327  // ---------- Set directory path based on member data ----------
328 
329  std::stringstream dir;
330 
331  dir << sistrip::root_ << sistrip::dir_
333 
334  // Add FED id
335  if ( fedId_ ) {
337 
338  // Add FE unit
339  if ( feUnit_ ) {
341 
342  // Add FE channel
343  if ( feChan_ ) {
345 
346  // Add FED APV
347  if ( fedApv_ ) {
349  }
350  }
351  }
352  }
353 
354  std::string temp( dir.str() );
355  path( temp );
356 
357  } else {
358 
359  // ---------- Set member data based on directory path ----------
360 
361  fedId_ = 0;
362  feUnit_ = 0;
363  feChan_ = 0;
364  fedApv_ = 0;
365 
366  // Check if root is found
367  if ( path().find( sistrip::root_ ) == std::string::npos ) {
368  std::string temp = path();
369  path( std::string(sistrip::root_) + sistrip::dir_ + temp );
370  }
371 
372  size_t curr = 0; // current string position
373  size_t next = 0; // next string position
374  next = path().find( sistrip::readoutView_, curr );
375 
376  // Extract view
377  curr = next;
378  if ( curr != std::string::npos ) {
379  next = path().find( sistrip::feDriver_, curr );
380  std::string readout_view( path(),
381  curr+(sizeof(sistrip::readoutView_) - 1),
382  (next-(sizeof(sistrip::dir_) - 1))-curr );
383 
384  // Extract FED id
385  curr = next;
386  if ( curr != std::string::npos ) {
387  next = path().find( sistrip::feUnit_, curr );
388  std::string fed_id( path(),
389  curr+(sizeof(sistrip::feDriver_) - 1),
390  (next-(sizeof(sistrip::dir_) - 1))-curr );
391  fedId_ = atoi( fed_id.c_str() );
392 
393  // Extract FE unit
394  curr = next;
395  if ( curr != std::string::npos ) {
396  next = path().find( sistrip::feChan_, curr );
397  std::string fe_unit( path(),
398  curr+(sizeof(sistrip::feUnit_) - 1),
399  next-curr );
400  feUnit_ = atoi( fe_unit.c_str() );
401 
402  // Extract FE channel
403  curr = next;
404  if ( curr != std::string::npos ) {
405  next = path().find( sistrip::fedApv_, curr );
406  std::string fe_chan( path(),
407  curr+(sizeof(sistrip::feChan_) - 1),
408  next-curr );
409  feChan_ = atoi( fe_chan.c_str() );
410 
411  // Extract FED APV
412  curr = next;
413  if ( curr != std::string::npos ) {
414  next = std::string::npos;
415  std::string fed_apv( path(),
416  curr+(sizeof(sistrip::fedApv_) - 1),
417  next-curr );
418  fedApv_ = atoi( fed_apv.c_str() );
419  }
420  }
421  }
422  }
423  } else {
424  std::stringstream ss;
425  ss << sistrip::root_ << sistrip::dir_;
426  //ss << sistrip::root_ << sistrip::dir_
427  //<< sistrip::unknownView_ << sistrip::dir_;
428  std::string temp( ss.str() );
429  path( temp );
430  }
431 
432  }
433 
434 }
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:20
uint16_t fedApv_
static const char fedApv_[]
const std::string & path() const
Definition: SiStripKey.h:126
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:22
void SiStripFedKey::initFromValue ( )
overrideprivatevirtual

Reimplemented from SiStripKey.

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

228  {
229 
230  if ( not ( (fedId_ >= sistrip::FED_ID_MIN &&
232  ( fedId_ == 0 ) ) ) {
234  }
235 
237 
239 
241 
242 }
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:16
static const uint16_t FED_ID_MAX
static const uint16_t APVS_PER_FEDCH
void SiStripFedKey::initGranularity ( )
overrideprivatevirtual

Reimplemented from SiStripKey.

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

438  {
439 
441  channel(0);
442  if ( fedId_ && fedId_ != sistrip::invalid_ ) {
444  channel(fedId_);
445  if ( feUnit_ && feUnit_ != sistrip::invalid_ ) {
447  channel(feUnit_);
448  if ( feChan_ && feChan_ != sistrip::invalid_ ) {
450  channel(feChan_);
451  if ( fedApv_ && fedApv_ != sistrip::invalid_ ) {
453  channel(fedApv_);
454  } else if ( fedApv_ == sistrip::invalid_ ) {
457  }
458  } else if ( feChan_ == sistrip::invalid_ ) {
461  }
462  } else if ( feUnit_ == sistrip::invalid_ ) {
465  }
466  } else if ( fedId_ == sistrip::invalid_ ) {
469  }
470 
471 }
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:127
uint16_t fedApv_
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
const uint16_t & channel() const
Definition: SiStripKey.h:128
static const uint16_t invalid_
Definition: Constants.h:16
bool SiStripFedKey::isConsistent ( const SiStripKey key) const
overridevirtual

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

Reimplemented from SiStripKey.

Definition at line 159 of file SiStripFedKey.cc.

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

159  {
160  const SiStripFedKey& input = dynamic_cast<const SiStripFedKey&>(key);
161  if ( isEqual(input) ) { return true; }
162  else if ( ( fedId_ == 0 || input.fedId() == 0 ) &&
163  ( feUnit_ == 0 || input.feUnit() == 0 ) &&
164  ( feChan_ == 0 || input.feChan() == 0 ) &&
165  ( fedApv_ == 0 || input.fedApv() == 0 ) ) {
166  return true;
167  } else { return false; }
168 }
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
bool isEqual(const SiStripKey &) const override
static std::string const input
Definition: EdmProvDump.cc:45
const uint32_t & key() const
Definition: SiStripKey.h:125
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::isEqual ( const SiStripKey key) const
overridevirtual

Identifies key objects with identical member data.

Reimplemented from SiStripKey.

Definition at line 147 of file SiStripFedKey.cc.

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

Referenced by isConsistent().

147  {
148  const SiStripFedKey& input = dynamic_cast<const SiStripFedKey&>(key);
149  if ( fedId_ == input.fedId() &&
150  feUnit_ == input.feUnit() &&
151  feChan_ == input.feChan() &&
152  fedApv_ == input.fedApv() ) {
153  return true;
154  } else { return false; }
155 }
A container class for generic run and event-related info, information required by the commissioning a...
Definition: SiStripFedKey.h:56
static std::string const input
Definition: EdmProvDump.cc:45
const uint32_t & key() const
Definition: SiStripKey.h:125
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
overridevirtual

Identifies all member data as being invalid.

Reimplemented from SiStripKey.

Definition at line 200 of file SiStripFedKey.cc.

References sistrip::FED_APV.

200  {
201  return isInvalid(sistrip::FED_APV);
202 }
bool isInvalid() const override
bool SiStripFedKey::isInvalid ( const sistrip::Granularity gran) const
overridevirtual

All member data to level of "Granularity" are invalid. If sistrip::Granularity is "undefined", returns true.

Reimplemented from SiStripKey.

Definition at line 206 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.

206  {
207  if ( gran == sistrip::FED_SYSTEM ) { return false; }
208  else if ( gran == sistrip::UNDEFINED_GRAN ||
209  gran == sistrip::UNKNOWN_GRAN ) { return false; }
210 
211  if ( fedId_ == sistrip::invalid_ ) {
212  if ( gran == sistrip::FE_DRIVER ) { return true; }
213  if ( feUnit_ == sistrip::invalid_ ) {
214  if ( gran == sistrip::FE_UNIT ) { return true; }
215  if ( feChan_ == sistrip::invalid_ ) {
216  if ( gran == sistrip::FE_CHAN ) { return true; }
217  if ( fedApv_ == sistrip::invalid_ ) {
218  if ( gran == sistrip::FED_APV ) { return true; }
219  }
220  }
221  }
222  }
223  return false;
224 }
uint16_t fedApv_
uint16_t feChan_
uint16_t fedId_
uint16_t feUnit_
static const uint16_t invalid_
Definition: Constants.h:16
bool SiStripFedKey::isValid ( void  ) const
overridevirtual
bool SiStripFedKey::isValid ( const sistrip::Granularity gran) const
overridevirtual

All member data to level of "Granularity" are valid. If sistrip::Granularity is "undefined", returns false.

Reimplemented from SiStripKey.

Definition at line 178 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.

Referenced by ntupleDataFormat._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

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

Print member data of the key

Reimplemented from SiStripKey.

Definition at line 500 of file SiStripFedKey.cc.

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

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

500  {
501  ss << " [SiStripFedKey::print]" << std::endl
502  << std::hex
503  << " FED key : 0x"
504  << std::setfill('0')
505  << std::setw(8) << key() << std::endl
506  << std::setfill(' ')
507  << std::dec
508  << " FED id : " << fedId() << std::endl
509  << " Front-End unit : " << feUnit() << std::endl
510  << " Front-End chan : " << feChan() << std::endl
511  << " (internal chan) : "
512  << "(" << fedChannel() << ")" << std::endl
513  << " FED APV : " << fedApv() << std::endl
514  << " Directory : " << path() << std::endl
515  << " Granularity : "
517  << " Channel : " << channel() << std::endl
518  << " isValid : " << isValid();
519 }
static std::string granularity(const sistrip::Granularity &)
const uint32_t & key() const
Definition: SiStripKey.h:125
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:127
const std::string & path() const
Definition: SiStripKey.h:126
uint16_t fedChannel() const
const uint16_t & fedApv() const
const uint16_t & feUnit() const
const uint16_t & channel() const
Definition: SiStripKey.h:128
const uint16_t & feChan() const
bool isValid() const override
const uint16_t & fedId() const
void SiStripFedKey::terse ( std::stringstream &  ss) const
overridevirtual

A terse summary of the key

Reimplemented from SiStripKey.

Definition at line 475 of file SiStripFedKey.cc.

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

Referenced by SiStripCondObjBuilderFromDb::SkipDeviceDescription::dump().

475  {
476  ss << "FED:crate/slot/id/unit/chan/apv= "
477  << "-" << "/"
478  << "-" << "/"
479  << fedId() << "/"
480  << feUnit() << "/"
481  << feChan() << "/"
482  << fedApv();
483 // ss << " FedKey"
484 // //<<"=0x"
485 // //<< std::hex
486 // //<< std::setfill('0') << std::setw(8) << key() << std::setfill(' ')
487 // //<< std::dec
488 // //<< ", " << ( isValid() ? "Valid" : "Invalid" )
489 // //<< ", FedCrate=" << fedCrate()
490 // //<< ", FedSlot=" << fedSlot()
491 // << ", FedId=" << fedId()
492 // << ", FeUnit=" << feUnit()
493 // << ", FeChan=" << feChan()
494 // //<< ", FedChannel=" << fedChannel()
495 // << ", FedApv=" << fedApv();
496 }
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 187 of file SiStripFedKey.h.

Referenced by initFromKey().

const uint16_t SiStripFedKey::feChanOffset_ = 2
staticprivate

Definition at line 179 of file SiStripFedKey.h.

Referenced by initFromKey().

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

Definition at line 188 of file SiStripFedKey.h.

Referenced by initFromKey().

const uint16_t SiStripFedKey::fedApvOffset_ = 0
staticprivate

Definition at line 180 of file SiStripFedKey.h.

Referenced by initFromKey().

const uint16_t SiStripFedKey::fedCrateMask_ = 0x03F
staticprivate

Definition at line 183 of file SiStripFedKey.h.

const uint16_t SiStripFedKey::fedCrateOffset_ = 24
staticprivate

Definition at line 175 of file SiStripFedKey.h.

uint16_t SiStripFedKey::fedId_
private

FED id [0,50-489,invalid].

Definition at line 163 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 185 of file SiStripFedKey.h.

Referenced by initFromKey().

const uint16_t SiStripFedKey::fedIdOffset_ = 10
staticprivate

Definition at line 177 of file SiStripFedKey.h.

Referenced by initFromKey().

const uint16_t SiStripFedKey::fedSlotMask_ = 0x01F
staticprivate

Definition at line 184 of file SiStripFedKey.h.

const uint16_t SiStripFedKey::fedSlotOffset_ = 19
staticprivate

Definition at line 176 of file SiStripFedKey.h.

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

Definition at line 186 of file SiStripFedKey.h.

Referenced by initFromKey().

const uint16_t SiStripFedKey::feUnitOffset_ = 6
staticprivate

Definition at line 178 of file SiStripFedKey.h.

Referenced by initFromKey().