CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripKey.cc
Go to the documentation of this file.
1 // Last commit: $Id: SiStripKey.cc,v 1.6 2008/02/06 14:32:54 bainbrid Exp $
2 
6 #include <iomanip>
7 
8 // -----------------------------------------------------------------------------
9 //
10 SiStripKey::SiStripKey( const uint32_t& key ) :
11  key_(key),
12  path_(sistrip::null_),
13  granularity_(sistrip::UNDEFINED_GRAN),
14  channel_(sistrip::invalid_)
15 {;}
16 
17 // -----------------------------------------------------------------------------
18 //
20  key_(sistrip::invalid32_),
21  path_(path),
22  granularity_(sistrip::UNDEFINED_GRAN),
23  channel_(sistrip::invalid_)
24 {;}
25 
26 // -----------------------------------------------------------------------------
27 //
29  key_( input.key() ),
30  path_( input.path() ),
31  granularity_( input.granularity() ),
32  channel_( input.channel() )
33 {;}
34 
35 // -----------------------------------------------------------------------------
36 //
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 }
45 
46 // -----------------------------------------------------------------------------
47 //
49  key_(sistrip::invalid32_),
50  path_(sistrip::null_),
51  granularity_(sistrip::UNDEFINED_GRAN),
52  channel_(sistrip::invalid_)
53 {;}
54 
55 // -----------------------------------------------------------------------------
56 //
57 bool SiStripKey::isEqual( const SiStripKey& input ) const {
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 }
66 
67 // -----------------------------------------------------------------------------
68 //
70  return isEqual(input);
71 }
72 
73 // -----------------------------------------------------------------------------
74 //
75 bool SiStripKey::isValid() const {
76  return ( key_ != sistrip::invalid32_ &&
77  path_ != sistrip::null_ &&
80 }
81 
82 // -----------------------------------------------------------------------------
83 //
84 bool SiStripKey::isValid( const sistrip::Granularity& gran ) const {
85  return isValid();
86 }
87 
88 // -----------------------------------------------------------------------------
89 //
90 bool SiStripKey::isInvalid() const {
91  return ( key_ == sistrip::invalid32_ ||
92  path_ == sistrip::null_ ||
95 }
96 
97 // -----------------------------------------------------------------------------
98 //
99 bool SiStripKey::isInvalid( const sistrip::Granularity& gran ) const {
100  return isInvalid();
101 }
102 
103 // -----------------------------------------------------------------------------
104 //
105 void SiStripKey::print( std::stringstream& ss ) const {
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 }
118 
119 // -----------------------------------------------------------------------------
120 //
121 std::ostream& operator<< ( std::ostream& os, const SiStripKey& input ) {
122  std::stringstream ss;
123  input.print(ss);
124  os << ss.str();
125  return os;
126 }
virtual bool isEqual(const SiStripKey &) const
Definition: SiStripKey.cc:57
static const uint32_t invalid32_
Definition: Constants.h:16
static std::string granularity(const sistrip::Granularity &)
sistrip::Granularity granularity_
Definition: SiStripKey.h:117
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
virtual void print(std::stringstream &ss) const
Definition: SiStripKey.cc:105
const SiStripKey & operator=(const SiStripKey &)
Definition: SiStripKey.cc:37
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
Base utility class that identifies a position within a logical structure of the strip tracker...
Definition: SiStripKey.h:24
const std::string & path() const
Definition: SiStripKey.h:127
uint32_t key_
Definition: SiStripKey.h:111
virtual bool isValid() const
Definition: SiStripKey.cc:75
const uint16_t & channel() const
Definition: SiStripKey.h:129
std::string & path_
static const uint16_t invalid_
Definition: Constants.h:17
virtual bool isInvalid() const
Definition: SiStripKey.cc:90
list key
Definition: combine.py:13
uint16_t channel_
Definition: SiStripKey.h:120
virtual bool isConsistent(const SiStripKey &) const
Definition: SiStripKey.cc:69
static const char null_[]
Definition: Constants.h:23