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 
5 #include <iomanip>
6 
7 // -----------------------------------------------------------------------------
8 //
9 SiStripKey::SiStripKey( const uint32_t& key ) :
10  key_(key),
11  path_(sistrip::null_),
12  granularity_(sistrip::UNDEFINED_GRAN),
13  channel_(sistrip::invalid_)
14 {;}
15 
16 // -----------------------------------------------------------------------------
17 //
19  key_(sistrip::invalid32_),
20  path_(path),
21  granularity_(sistrip::UNDEFINED_GRAN),
22  channel_(sistrip::invalid_)
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 //
48  key_(sistrip::invalid32_),
49  path_(sistrip::null_),
50  granularity_(sistrip::UNDEFINED_GRAN),
51  channel_(sistrip::invalid_)
52 {;}
53 
54 // -----------------------------------------------------------------------------
55 //
56 bool SiStripKey::isEqual( const SiStripKey& input ) const {
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 }
65 
66 // -----------------------------------------------------------------------------
67 //
69  return isEqual(input);
70 }
71 
72 // -----------------------------------------------------------------------------
73 //
74 bool SiStripKey::isValid() const {
75  return ( key_ != sistrip::invalid32_ &&
76  path_ != sistrip::null_ &&
79 }
80 
81 // -----------------------------------------------------------------------------
82 //
83 bool SiStripKey::isValid( const sistrip::Granularity& gran ) const {
84  return isValid();
85 }
86 
87 // -----------------------------------------------------------------------------
88 //
89 bool SiStripKey::isInvalid() const {
90  return ( key_ == sistrip::invalid32_ ||
91  path_ == sistrip::null_ ||
94 }
95 
96 // -----------------------------------------------------------------------------
97 //
98 bool SiStripKey::isInvalid( const sistrip::Granularity& gran ) const {
99  return isInvalid();
100 }
101 
102 // -----------------------------------------------------------------------------
103 //
104 void SiStripKey::print( std::stringstream& ss ) const {
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 }
117 
118 // -----------------------------------------------------------------------------
119 //
120 std::ostream& operator<< ( std::ostream& os, const SiStripKey& input ) {
121  std::stringstream ss;
122  input.print(ss);
123  os << ss.str();
124  return os;
125 }
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
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
virtual void print(std::stringstream &ss) const
Definition: SiStripKey.cc:104
const SiStripKey & operator=(const SiStripKey &)
Definition: SiStripKey.cc:36
static std::string const input
Definition: EdmProvDump.cc:44
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
string key
FastSim: produces sample of signal events, overlayed with premixed minbias events.
virtual bool isValid() const
Definition: SiStripKey.cc:74
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:89
uint16_t channel_
Definition: SiStripKey.h:119
virtual bool isConsistent(const SiStripKey &) const
Definition: SiStripKey.cc:68
static const char null_[]
Definition: Constants.h:22