CMS 3D CMS Logo

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

Base utility class that identifies a position within a logical structure of the strip tracker. More...

#include <SiStripKey.h>

Inheritance diagram for SiStripKey:
SiStripDetKey SiStripFecKey SiStripFedKey SiStripNullKey

Public Member Functions

const uint16_t & channel () const
 
const sistrip::Granularitygranularity () const
 
virtual bool isConsistent (const SiStripKey &) const
 
virtual bool isEqual (const SiStripKey &) const
 
virtual bool isInvalid () const
 
virtual bool isInvalid (const sistrip::Granularity &) const
 
virtual bool isValid () const
 
virtual bool isValid (const sistrip::Granularity &) const
 
const uint32_t & key () const
 
const SiStripKeyoperator= (const SiStripKey &)
 
const std::string & path () const
 
virtual void print (std::stringstream &ss) const
 
 SiStripKey (const uint32_t &key)
 
 SiStripKey (const std::string &directory_path)
 
 SiStripKey (const SiStripKey &)
 
 SiStripKey ()
 
virtual void terse (std::stringstream &ss) const
 
virtual ~SiStripKey ()
 

Protected Member Functions

void channel (const uint16_t &)
 
void granularity (const sistrip::Granularity &)
 
virtual void initFromKey ()
 
virtual void initFromPath ()
 
virtual void initFromValue ()
 
virtual void initGranularity ()
 
void key (const uint32_t &)
 
void path (const std::string &)
 

Private Attributes

uint16_t channel_
 
sistrip::Granularity granularity_
 
uint32_t key_
 
std::string path_
 

Detailed Description

Base utility class that identifies a position within a logical structure of the strip tracker.

Author
R.Bainbridge

Definition at line 24 of file SiStripKey.h.

Constructor & Destructor Documentation

SiStripKey::SiStripKey ( const uint32_t &  key)

Constructor using 32-bit "key".

Definition at line 10 of file SiStripKey.cc.

10  :
11  key_(key),
15 {;}
sistrip::Granularity granularity_
Definition: SiStripKey.h:117
const uint32_t & key() const
Definition: SiStripKey.h:126
std::string path_
Definition: SiStripKey.h:114
uint32_t key_
Definition: SiStripKey.h:111
static const uint16_t invalid_
Definition: Constants.h:17
uint16_t channel_
Definition: SiStripKey.h:120
static const char null_[]
Definition: Constants.h:23
SiStripKey::SiStripKey ( const std::string &  directory_path)

Constructor using directory path.

Definition at line 19 of file SiStripKey.cc.

19  :
21  path_(path),
24 {;}
static const uint32_t invalid32_
Definition: Constants.h:16
sistrip::Granularity granularity_
Definition: SiStripKey.h:117
std::string path_
Definition: SiStripKey.h:114
const std::string & path() const
Definition: SiStripKey.h:127
uint32_t key_
Definition: SiStripKey.h:111
static const uint16_t invalid_
Definition: Constants.h:17
uint16_t channel_
Definition: SiStripKey.h:120
SiStripKey::SiStripKey ( const SiStripKey input)

Copy constructor.

Definition at line 28 of file SiStripKey.cc.

28  :
29  key_( input.key() ),
30  path_( input.path() ),
31  granularity_( input.granularity() ),
32  channel_( input.channel() )
33 {;}
sistrip::Granularity granularity_
Definition: SiStripKey.h:117
const uint32_t & key() const
Definition: SiStripKey.h:126
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:128
std::string path_
Definition: SiStripKey.h:114
const std::string & path() const
Definition: SiStripKey.h:127
uint32_t key_
Definition: SiStripKey.h:111
const uint16_t & channel() const
Definition: SiStripKey.h:129
uint16_t channel_
Definition: SiStripKey.h:120
SiStripKey::SiStripKey ( )

Default constructor.

Definition at line 48 of file SiStripKey.cc.

48  :
53 {;}
static const uint32_t invalid32_
Definition: Constants.h:16
sistrip::Granularity granularity_
Definition: SiStripKey.h:117
std::string path_
Definition: SiStripKey.h:114
uint32_t key_
Definition: SiStripKey.h:111
static const uint16_t invalid_
Definition: Constants.h:17
uint16_t channel_
Definition: SiStripKey.h:120
static const char null_[]
Definition: Constants.h:23
virtual SiStripKey::~SiStripKey ( )
inlinevirtual

Virtual destructor.

Definition at line 46 of file SiStripKey.h.

46 {;}

Member Function Documentation

const uint16_t & SiStripKey::channel ( ) const
inline
void SiStripKey::channel ( const uint16_t &  chan)
inlineprotected

Definition at line 134 of file SiStripKey.h.

References channel_.

134 { channel_ = chan; }
uint16_t channel_
Definition: SiStripKey.h:120
const sistrip::Granularity & SiStripKey::granularity ( ) const
inline
void SiStripKey::granularity ( const sistrip::Granularity gran)
inlineprotected

Definition at line 133 of file SiStripKey.h.

References granularity_.

133 { granularity_ = gran; }
sistrip::Granularity granularity_
Definition: SiStripKey.h:117
virtual void SiStripKey::initFromKey ( )
inlineprotectedvirtual

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 97 of file SiStripKey.h.

97 {;}
virtual void SiStripKey::initFromPath ( )
inlineprotectedvirtual

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 98 of file SiStripKey.h.

98 {;}
virtual void SiStripKey::initFromValue ( )
inlineprotectedvirtual

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 96 of file SiStripKey.h.

96 {;}
virtual void SiStripKey::initGranularity ( )
inlineprotectedvirtual

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 99 of file SiStripKey.h.

99 {;}
bool SiStripKey::isConsistent ( const SiStripKey input) const
virtual

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

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 69 of file SiStripKey.cc.

References isEqual().

69  {
70  return isEqual(input);
71 }
virtual bool isEqual(const SiStripKey &) const
Definition: SiStripKey.cc:57
bool SiStripKey::isEqual ( const SiStripKey input) const
virtual

Identifies key objects with identical member data.

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 57 of file SiStripKey.cc.

References channel(), channel_, granularity(), granularity_, key(), key_, path(), and path_.

Referenced by isConsistent().

57  {
58  if ( !(&input) ) { return false; }
59  if ( key_ == input.key() &&
60  path_ == input.path() &&
61  granularity_ == input.granularity() &&
62  channel_ == input.channel() ) {
63  return true;
64  } else { return false; }
65 }
sistrip::Granularity granularity_
Definition: SiStripKey.h:117
const uint32_t & key() const
Definition: SiStripKey.h:126
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:128
std::string path_
Definition: SiStripKey.h:114
const std::string & path() const
Definition: SiStripKey.h:127
uint32_t key_
Definition: SiStripKey.h:111
const uint16_t & channel() const
Definition: SiStripKey.h:129
uint16_t channel_
Definition: SiStripKey.h:120
bool SiStripKey::isInvalid ( ) const
virtual

Identifies all member data as being invalid.

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 90 of file SiStripKey.cc.

References channel_, granularity_, sistrip::invalid32_, sistrip::invalid_, key_, sistrip::null_, path_, and sistrip::UNDEFINED_GRAN.

Referenced by isInvalid().

90  {
91  return ( key_ == sistrip::invalid32_ ||
92  path_ == sistrip::null_ ||
95 }
static const uint32_t invalid32_
Definition: Constants.h:16
sistrip::Granularity granularity_
Definition: SiStripKey.h:117
std::string path_
Definition: SiStripKey.h:114
uint32_t key_
Definition: SiStripKey.h:111
static const uint16_t invalid_
Definition: Constants.h:17
uint16_t channel_
Definition: SiStripKey.h:120
static const char null_[]
Definition: Constants.h:23
bool SiStripKey::isInvalid ( const sistrip::Granularity gran) const
virtual

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

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 99 of file SiStripKey.cc.

References isInvalid().

99  {
100  return isInvalid();
101 }
virtual bool isInvalid() const
Definition: SiStripKey.cc:90
bool SiStripKey::isValid ( void  ) const
virtual

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

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 75 of file SiStripKey.cc.

References channel_, granularity_, sistrip::invalid32_, sistrip::invalid_, key_, sistrip::null_, path_, and sistrip::UNDEFINED_GRAN.

Referenced by isValid().

75  {
76  return ( key_ != sistrip::invalid32_ &&
77  path_ != sistrip::null_ &&
80 }
static const uint32_t invalid32_
Definition: Constants.h:16
sistrip::Granularity granularity_
Definition: SiStripKey.h:117
std::string path_
Definition: SiStripKey.h:114
uint32_t key_
Definition: SiStripKey.h:111
static const uint16_t invalid_
Definition: Constants.h:17
uint16_t channel_
Definition: SiStripKey.h:120
static const char null_[]
Definition: Constants.h:23
bool SiStripKey::isValid ( const sistrip::Granularity gran) const
virtual

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

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 84 of file SiStripKey.cc.

References isValid().

84  {
85  return isValid();
86 }
virtual bool isValid() const
Definition: SiStripKey.cc:75
const uint32_t & SiStripKey::key ( ) const
inline

Returns 32-bit key.

Definition at line 126 of file SiStripKey.h.

References key_.

Referenced by FedCablingAlgorithm::analyse(), FineDelayTask::book(), LatencyTask::book(), CommissioningHistosUsingDb::buildDetInfo(), SiStripFedCablingBuilderFromDb::buildFecCablingFromDetIds(), ViewTranslator::buildMaps(), CommissioningHistosUsingDb::detInfo(), CalibrationSummaryFactory::extract(), CommissioningHistograms::extractHistograms(), SiStripCommissioningSource::fillCablingHistos(), SiStripDetKey::initFromKey(), SiStripFecKey::initFromKey(), SiStripFedKey::initFromKey(), SiStripFecKey::initFromValue(), SiStripDetKey::isConsistent(), SiStripFecKey::isConsistent(), SiStripFedKey::isConsistent(), isEqual(), SiStripDetKey::isEqual(), SiStripFecKey::isEqual(), SiStripFedKey::isEqual(), key(), SiStripFedCablingFakeESSource::make(), ConsistentWithKey::operator()(), operator<(), operator=(), SiStripNullKey::print(), print(), SiStripDetKey::print(), SiStripFecKey::print(), SiStripFedKey::print(), SiStripConfigDb::printAnalysisDescriptions(), SiStripConfigDb::printDeviceDescriptions(), SiStripDetKey::SiStripDetKey(), SiStripFecKey::SiStripFecKey(), SiStripFedKey::SiStripFedKey(), SiStripHistoTitle::SiStripHistoTitle(), PedsOnlyAnalysis::summary(), VpspScanAnalysis::summary(), PedestalsAnalysis::summary(), NoiseAnalysis::summary(), OptoScanAnalysis::summary(), FastFedCablingAnalysis::summary(), PedsFullNoiseAnalysis::summary(), PedestalsHistosUsingDb::update(), OptoScanHistosUsingDb::update(), PedsOnlyHistosUsingDb::update(), ApvTimingHistosUsingDb::update(), PedsFullNoiseHistosUsingDb::update(), VpspScanHistosUsingDb::update(), NoiseHistosUsingDb::update(), LatencyHistosUsingDb::update(), FastFedCablingHistosUsingDb::update(), and FineDelayHistosUsingDb::update().

126 { return key_; }
uint32_t key_
Definition: SiStripKey.h:111
void SiStripKey::key ( const uint32_t &  key)
inlineprotected

Definition at line 131 of file SiStripKey.h.

References key(), and key_.

131 { key_ = key; }
const uint32_t & key() const
Definition: SiStripKey.h:126
uint32_t key_
Definition: SiStripKey.h:111
const SiStripKey & SiStripKey::operator= ( const SiStripKey rhs)

Assignment.

Definition at line 37 of file SiStripKey.cc.

References channel(), channel_, granularity(), granularity_, key(), key_, path(), and path_.

37  {
38  if ( this == &rhs ) { return *this; }
39  key_ = rhs.key();
40  path_ = rhs.path();
41  granularity_ = rhs.granularity();
42  channel_ = rhs.channel();
43  return *this;
44 }
sistrip::Granularity granularity_
Definition: SiStripKey.h:117
const uint32_t & key() const
Definition: SiStripKey.h:126
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:128
std::string path_
Definition: SiStripKey.h:114
const std::string & path() const
Definition: SiStripKey.h:127
uint32_t key_
Definition: SiStripKey.h:111
const uint16_t & channel() const
Definition: SiStripKey.h:129
uint16_t channel_
Definition: SiStripKey.h:120
const std::string & SiStripKey::path ( ) const
inline
void SiStripKey::path ( const std::string &  path)
inlineprotected

Definition at line 132 of file SiStripKey.h.

References path(), and path_.

132 { path_ = path; }
std::string path_
Definition: SiStripKey.h:114
const std::string & path() const
Definition: SiStripKey.h:127
void SiStripKey::print ( std::stringstream &  ss) const
virtual

Print member data of the key

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 105 of file SiStripKey.cc.

References channel(), SiStripEnumsAndStrings::granularity(), granularity(), key(), and path().

Referenced by operator<<().

105  {
106  ss << " [SiStripKey::print]" << std::endl
107  << std::hex
108  << " 32-bit key : 0x"
109  << std::setfill('0')
110  << std::setw(8) << key() << std::endl
111  << std::setfill(' ')
112  << std::dec
113  << " Directory : " << path() << std::endl
114  << " Granularity : "
116  << " Channel : " << channel();
117 }
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
const std::string & path() const
Definition: SiStripKey.h:127
const uint16_t & channel() const
Definition: SiStripKey.h:129
virtual void SiStripKey::terse ( std::stringstream &  ss) const
inlinevirtual

A terse summary of the key

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 90 of file SiStripKey.h.

90 {;}

Member Data Documentation

uint16_t SiStripKey::channel_
private

Channel of key granularity.

Definition at line 120 of file SiStripKey.h.

Referenced by channel(), isEqual(), isInvalid(), isValid(), and operator=().

sistrip::Granularity SiStripKey::granularity_
private

Granularity to which FED key is unambiguous.

Definition at line 117 of file SiStripKey.h.

Referenced by granularity(), isEqual(), isInvalid(), isValid(), and operator=().

uint32_t SiStripKey::key_
private

32-bit key.

Definition at line 111 of file SiStripKey.h.

Referenced by isEqual(), isInvalid(), isValid(), key(), and operator=().

std::string SiStripKey::path_
private