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), path_(sistrip::null_), granularity_(sistrip::UNDEFINED_GRAN), channel_(sistrip::invalid_) {
11  ;
12 }
13 
14 // -----------------------------------------------------------------------------
15 //
17  : key_(sistrip::invalid32_), path_(path), granularity_(sistrip::UNDEFINED_GRAN), channel_(sistrip::invalid_) {
18  ;
19 }
20 
21 // -----------------------------------------------------------------------------
22 //
24  : key_(input.key()), path_(input.path()), granularity_(input.granularity()), channel_(input.channel()) {
25  ;
26 }
27 
28 // -----------------------------------------------------------------------------
29 //
31  if (this == &rhs) {
32  return *this;
33  }
34  key_ = rhs.key();
35  path_ = rhs.path();
36  granularity_ = rhs.granularity();
37  channel_ = rhs.channel();
38  return *this;
39 }
40 
41 // -----------------------------------------------------------------------------
42 //
44  : key_(sistrip::invalid32_),
46  granularity_(sistrip::UNDEFINED_GRAN),
47  channel_(sistrip::invalid_) {
48  ;
49 }
50 
51 // -----------------------------------------------------------------------------
52 //
53 bool SiStripKey::isEqual(const SiStripKey& input) const {
54  if (key_ == input.key() && path_ == input.path() && granularity_ == input.granularity() &&
55  channel_ == input.channel()) {
56  return true;
57  } else {
58  return false;
59  }
60 }
61 
62 // -----------------------------------------------------------------------------
63 //
64 bool SiStripKey::isConsistent(const SiStripKey& input) const { return isEqual(input); }
65 
66 // -----------------------------------------------------------------------------
67 //
68 bool SiStripKey::isValid() const {
71 }
72 
73 // -----------------------------------------------------------------------------
74 //
75 bool SiStripKey::isValid(const sistrip::Granularity& gran) const { return isValid(); }
76 
77 // -----------------------------------------------------------------------------
78 //
79 bool SiStripKey::isInvalid() const {
82 }
83 
84 // -----------------------------------------------------------------------------
85 //
86 bool SiStripKey::isInvalid(const sistrip::Granularity& gran) const { return isInvalid(); }
87 
88 // -----------------------------------------------------------------------------
89 //
90 void SiStripKey::print(std::stringstream& ss) const {
91  ss << " [SiStripKey::print]" << std::endl
92  << std::hex << " 32-bit key : 0x" << std::setfill('0') << std::setw(8) << key() << std::endl
93  << std::setfill(' ') << std::dec << " Directory : " << path() << std::endl
94  << " Granularity : " << SiStripEnumsAndStrings::granularity(granularity()) << std::endl
95  << " Channel : " << channel();
96 }
97 
98 // -----------------------------------------------------------------------------
99 //
100 std::ostream& operator<<(std::ostream& os, const SiStripKey& input) {
101  std::stringstream ss;
102  input.print(ss);
103  os << ss.str();
104  return os;
105 }
const uint16_t & channel() const
Definition: SiStripKey.h:123
static const uint32_t invalid32_
Definition: Constants.h:15
const std::string & path() const
Definition: SiStripKey.h:121
static std::string granularity(const sistrip::Granularity &)
sistrip::Granularity granularity_
Definition: SiStripKey.h:112
virtual bool isConsistent(const SiStripKey &) const
Definition: SiStripKey.cc:64
sistrip classes
const SiStripKey & operator=(const SiStripKey &)
Definition: SiStripKey.cc:30
static std::string const input
Definition: EdmProvDump.cc:47
std::string path_
Definition: SiStripKey.h:109
virtual bool isEqual(const SiStripKey &) const
Definition: SiStripKey.cc:53
const uint32_t & key() const
Definition: SiStripKey.h:120
Base utility class that identifies a position within a logical structure of the strip tracker...
Definition: SiStripKey.h:23
uint32_t key_
Definition: SiStripKey.h:106
virtual bool isValid() const
Definition: SiStripKey.cc:68
virtual bool isInvalid() const
Definition: SiStripKey.cc:79
virtual void print(std::stringstream &ss) const
Definition: SiStripKey.cc:90
std::string & path_
static const uint16_t invalid_
Definition: Constants.h:16
uint16_t channel_
Definition: SiStripKey.h:115
const sistrip::Granularity & granularity() const
Definition: SiStripKey.h:122
static const char null_[]
Definition: Constants.h:22
std::ostream & operator<<(std::ostream &os, const SiStripKey &input)
Definition: SiStripKey.cc:100