CMS 3D CMS Logo

SiStripKey.cc
Go to the documentation of this file.
1 
5 #include <iomanip>
6 
7 // -----------------------------------------------------------------------------
8 //
9 SiStripKey::SiStripKey( const uint32_t& key ) :
10  key_(key),
12  granularity_(sistrip::UNDEFINED_GRAN),
13  channel_(sistrip::invalid_)
14 {;}
15 
16 // -----------------------------------------------------------------------------
17 //
20  path_(path),
23 {;}
24 
25 // -----------------------------------------------------------------------------
26 //
28  key_( input.key() ),
29  path_( input.path() ),
30  granularity_( input.granularity() ),
31  channel_( input.channel() )
32 {;}
33 
34 // -----------------------------------------------------------------------------
35 //
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 }
44 
45 // -----------------------------------------------------------------------------
46 //
52 {;}
53 
54 // -----------------------------------------------------------------------------
55 //
56 bool SiStripKey::isEqual( const SiStripKey& input ) const {
57  if ( key_ == input.key() &&
58  path_ == input.path() &&
59  granularity_ == input.granularity() &&
60  channel_ == input.channel() ) {
61  return true;
62  } else { return false; }
63 }
64 
65 // -----------------------------------------------------------------------------
66 //
68  return isEqual(input);
69 }
70 
71 // -----------------------------------------------------------------------------
72 //
73 bool SiStripKey::isValid() const {
74  return ( key_ != sistrip::invalid32_ &&
75  path_ != sistrip::null_ &&
78 }
79 
80 // -----------------------------------------------------------------------------
81 //
82 bool SiStripKey::isValid( const sistrip::Granularity& gran ) const {
83  return isValid();
84 }
85 
86 // -----------------------------------------------------------------------------
87 //
88 bool SiStripKey::isInvalid() const {
89  return ( key_ == sistrip::invalid32_ ||
90  path_ == sistrip::null_ ||
93 }
94 
95 // -----------------------------------------------------------------------------
96 //
97 bool SiStripKey::isInvalid( const sistrip::Granularity& gran ) const {
98  return isInvalid();
99 }
100 
101 // -----------------------------------------------------------------------------
102 //
103 void SiStripKey::print( std::stringstream& ss ) const {
104  ss << " [SiStripKey::print]" << std::endl
105  << std::hex
106  << " 32-bit key : 0x"
107  << std::setfill('0')
108  << std::setw(8) << key() << std::endl
109  << std::setfill(' ')
110  << std::dec
111  << " Directory : " << path() << std::endl
112  << " Granularity : "
114  << " Channel : " << channel();
115 }
116 
117 // -----------------------------------------------------------------------------
118 //
119 std::ostream& operator<< ( std::ostream& os, const SiStripKey& input ) {
120  std::stringstream ss;
121  input.print(ss);
122  os << ss.str();
123  return os;
124 }
virtual bool isEqual(const SiStripKey &) const
Definition: SiStripKey.cc:56
static const uint32_t invalid32_
Definition: Constants.h:15
static std::string granularity(const sistrip::Granularity &)
sistrip::Granularity granularity_
Definition: SiStripKey.h:116
sistrip classes
virtual void print(std::stringstream &ss) const
Definition: SiStripKey.cc:103
const SiStripKey & operator=(const SiStripKey &)
Definition: SiStripKey.cc:36
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
std::string path_
Definition: SiStripKey.h:113
Base utility class that identifies a position within a logical structure of the strip tracker...
Definition: SiStripKey.h:23
const std::string & path() const
Definition: SiStripKey.h:126
uint32_t key_
Definition: SiStripKey.h:110
virtual bool isValid() const
Definition: SiStripKey.cc:73
const uint16_t & channel() const
Definition: SiStripKey.h:128
std::string & path_
static const uint16_t invalid_
Definition: Constants.h:16
virtual bool isInvalid() const
Definition: SiStripKey.cc:88
uint16_t channel_
Definition: SiStripKey.h:119
virtual bool isConsistent(const SiStripKey &) const
Definition: SiStripKey.cc:67
static const char null_[]
Definition: Constants.h:22
std::ostream & operator<<(std::ostream &os, const SiStripKey &input)
Definition: SiStripKey.cc:119