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 23 of file SiStripKey.h.

Constructor & Destructor Documentation

SiStripKey::SiStripKey ( const uint32_t &  key)

Constructor using 32-bit "key".

Definition at line 9 of file SiStripKey.cc.

9  :
10  key_(key),
14 {;}
sistrip::Granularity granularity_
Definition: SiStripKey.h:116
const uint32_t & key() const
Definition: SiStripKey.h:125
std::string path_
Definition: SiStripKey.h:113
uint32_t key_
Definition: SiStripKey.h:110
static const uint16_t invalid_
Definition: Constants.h:16
uint16_t channel_
Definition: SiStripKey.h:119
static const char null_[]
Definition: Constants.h:22
SiStripKey::SiStripKey ( const std::string &  directory_path)

Constructor using directory path.

Definition at line 18 of file SiStripKey.cc.

18  :
20  path_(path),
23 {;}
static const uint32_t invalid32_
Definition: Constants.h:15
sistrip::Granularity granularity_
Definition: SiStripKey.h:116
std::string path_
Definition: SiStripKey.h:113
const std::string & path() const
Definition: SiStripKey.h:126
uint32_t key_
Definition: SiStripKey.h:110
static const uint16_t invalid_
Definition: Constants.h:16
uint16_t channel_
Definition: SiStripKey.h:119
SiStripKey::SiStripKey ( const SiStripKey input)

Copy constructor.

Definition at line 27 of file SiStripKey.cc.

27  :
28  key_( input.key() ),
29  path_( input.path() ),
30  granularity_( input.granularity() ),
31  channel_( input.channel() )
32 {;}
sistrip::Granularity granularity_
Definition: SiStripKey.h:116
const uint32_t & key() const
Definition: SiStripKey.h:125
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:127
std::string path_
Definition: SiStripKey.h:113
const std::string & path() const
Definition: SiStripKey.h:126
uint32_t key_
Definition: SiStripKey.h:110
const uint16_t & channel() const
Definition: SiStripKey.h:128
uint16_t channel_
Definition: SiStripKey.h:119
SiStripKey::SiStripKey ( )

Default constructor.

Definition at line 47 of file SiStripKey.cc.

47  :
52 {;}
static const uint32_t invalid32_
Definition: Constants.h:15
sistrip::Granularity granularity_
Definition: SiStripKey.h:116
std::string path_
Definition: SiStripKey.h:113
uint32_t key_
Definition: SiStripKey.h:110
static const uint16_t invalid_
Definition: Constants.h:16
uint16_t channel_
Definition: SiStripKey.h:119
static const char null_[]
Definition: Constants.h:22
virtual SiStripKey::~SiStripKey ( )
inlinevirtual

Virtual destructor.

Definition at line 45 of file SiStripKey.h.

45 {;}

Member Function Documentation

const uint16_t & SiStripKey::channel ( ) const
inline

Returns channel for key granularity.

Definition at line 128 of file SiStripKey.h.

References channel_.

Referenced by SummaryGeneratorControlView::fill(), isEqual(), operator=(), SiStripNullKey::print(), and print().

128 { return channel_; }
uint16_t channel_
Definition: SiStripKey.h:119
void SiStripKey::channel ( const uint16_t &  chan)
inlineprotected

Definition at line 133 of file SiStripKey.h.

References channel_.

133 { channel_ = chan; }
uint16_t channel_
Definition: SiStripKey.h:119
const sistrip::Granularity & SiStripKey::granularity ( ) const
inline

Returns granularity to which key is unambiguous.

Definition at line 127 of file SiStripKey.h.

References granularity_.

Referenced by isEqual(), operator=(), SiStripNullKey::print(), and print().

127 { return granularity_; }
sistrip::Granularity granularity_
Definition: SiStripKey.h:116
void SiStripKey::granularity ( const sistrip::Granularity gran)
inlineprotected

Definition at line 132 of file SiStripKey.h.

References granularity_.

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

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 96 of file SiStripKey.h.

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

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 97 of file SiStripKey.h.

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

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 95 of file SiStripKey.h.

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

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 98 of file SiStripKey.h.

98 {;}
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 68 of file SiStripKey.cc.

References isEqual().

68  {
69  return isEqual(input);
70 }
virtual bool isEqual(const SiStripKey &) const
Definition: SiStripKey.cc:56
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 56 of file SiStripKey.cc.

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

Referenced by isConsistent().

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

Identifies all member data as being invalid.

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 89 of file SiStripKey.cc.

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

Referenced by isInvalid().

89  {
90  return ( key_ == sistrip::invalid32_ ||
91  path_ == sistrip::null_ ||
94 }
static const uint32_t invalid32_
Definition: Constants.h:15
sistrip::Granularity granularity_
Definition: SiStripKey.h:116
std::string path_
Definition: SiStripKey.h:113
uint32_t key_
Definition: SiStripKey.h:110
static const uint16_t invalid_
Definition: Constants.h:16
uint16_t channel_
Definition: SiStripKey.h:119
static const char null_[]
Definition: Constants.h:22
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 98 of file SiStripKey.cc.

References isInvalid().

98  {
99  return isInvalid();
100 }
virtual bool isInvalid() const
Definition: SiStripKey.cc:89
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 74 of file SiStripKey.cc.

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

Referenced by isValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

74  {
75  return ( key_ != sistrip::invalid32_ &&
76  path_ != sistrip::null_ &&
79 }
static const uint32_t invalid32_
Definition: Constants.h:15
sistrip::Granularity granularity_
Definition: SiStripKey.h:116
std::string path_
Definition: SiStripKey.h:113
uint32_t key_
Definition: SiStripKey.h:110
static const uint16_t invalid_
Definition: Constants.h:16
uint16_t channel_
Definition: SiStripKey.h:119
static const char null_[]
Definition: Constants.h:22
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 83 of file SiStripKey.cc.

References isValid().

Referenced by core.AutoHandle.AutoHandle::ReallyLoad().

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

Returns 32-bit key.

Definition at line 125 of file SiStripKey.h.

References key_.

Referenced by FedCablingAlgorithm::analyse(), FineDelayTask::book(), isEqual(), key(), operator<(), operator=(), SiStripNullKey::print(), print(), and VpspScanAnalysis::summary().

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

Definition at line 130 of file SiStripKey.h.

References key(), and key_.

130 { key_ = key; }
const uint32_t & key() const
Definition: SiStripKey.h:125
uint32_t key_
Definition: SiStripKey.h:110
const SiStripKey & SiStripKey::operator= ( const SiStripKey rhs)

Assignment.

Definition at line 36 of file SiStripKey.cc.

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

36  {
37  if ( this == &rhs ) { return *this; }
38  key_ = rhs.key();
39  path_ = rhs.path();
40  granularity_ = rhs.granularity();
41  channel_ = rhs.channel();
42  return *this;
43 }
sistrip::Granularity granularity_
Definition: SiStripKey.h:116
const uint32_t & key() const
Definition: SiStripKey.h:125
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:127
std::string path_
Definition: SiStripKey.h:113
const std::string & path() const
Definition: SiStripKey.h:126
uint32_t key_
Definition: SiStripKey.h:110
const uint16_t & channel() const
Definition: SiStripKey.h:128
uint16_t channel_
Definition: SiStripKey.h:119
const std::string & SiStripKey::path ( ) const
inline

Returns directory path.

Definition at line 126 of file SiStripKey.h.

References path_.

Referenced by FineDelayTask::book(), SummaryGeneratorReadoutView::fill(), SummaryGeneratorControlView::fill(), isEqual(), operator=(), path(), SiStripNullKey::print(), and print().

126 { return path_; }
std::string path_
Definition: SiStripKey.h:113
void SiStripKey::path ( const std::string &  path)
inlineprotected

Definition at line 131 of file SiStripKey.h.

References path(), and path_.

131 { path_ = path; }
std::string path_
Definition: SiStripKey.h:113
const std::string & path() const
Definition: SiStripKey.h:126
void SiStripKey::print ( std::stringstream &  ss) const
virtual

Print member data of the key

Reimplemented in SiStripFedKey, SiStripFecKey, SiStripDetKey, and SiStripNullKey.

Definition at line 104 of file SiStripKey.cc.

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

Referenced by operator<<().

104  {
105  ss << " [SiStripKey::print]" << std::endl
106  << std::hex
107  << " 32-bit key : 0x"
108  << std::setfill('0')
109  << std::setw(8) << key() << std::endl
110  << std::setfill(' ')
111  << std::dec
112  << " Directory : " << path() << std::endl
113  << " Granularity : "
115  << " Channel : " << channel();
116 }
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
const uint16_t & channel() const
Definition: SiStripKey.h:128
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 89 of file SiStripKey.h.

89 {;}

Member Data Documentation

uint16_t SiStripKey::channel_
private

Channel of key granularity.

Definition at line 119 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 116 of file SiStripKey.h.

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

uint32_t SiStripKey::key_
private

32-bit key.

Definition at line 110 of file SiStripKey.h.

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

std::string SiStripKey::path_
private

Directory path.

Definition at line 113 of file SiStripKey.h.

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