CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Attributes
DTCombinatorialPatternReco::TriedPattern Class Reference

#include <DTCombinatorialPatternReco.h>

Classes

class  HashFunction
 

Public Types

typedef values::const_iterator const_iterator
 
typedef std::vector< short unsigned int > values
 

Public Member Functions

const_iterator begin () const
 
const_iterator end () const
 
size_t hash () const
 
template<class T >
void hash_combine (std::size_t &seed, const T &v)
 
bool operator== (const TriedPattern &other) const
 
void push_back (short unsigned int i)
 push back value, and update the hash More...
 
values::size_type size () const
 
 TriedPattern ()
 

Private Attributes

size_t hash_
 
values values_
 

Detailed Description

Definition at line 108 of file DTCombinatorialPatternReco.h.

Member Typedef Documentation

◆ const_iterator

Definition at line 138 of file DTCombinatorialPatternReco.h.

◆ values

typedef std::vector<short unsigned int> DTCombinatorialPatternReco::TriedPattern::values

Definition at line 110 of file DTCombinatorialPatternReco.h.

Constructor & Destructor Documentation

◆ TriedPattern()

DTCombinatorialPatternReco::TriedPattern::TriedPattern ( )
inline

Definition at line 113 of file DTCombinatorialPatternReco.h.

113 : hash_(1) { values_.reserve(8); }

References values_.

Member Function Documentation

◆ begin()

const_iterator DTCombinatorialPatternReco::TriedPattern::begin ( void  ) const
inline

Definition at line 139 of file DTCombinatorialPatternReco.h.

139 { return values_.begin(); }

References values_.

◆ end()

const_iterator DTCombinatorialPatternReco::TriedPattern::end ( void  ) const
inline

Definition at line 140 of file DTCombinatorialPatternReco.h.

140 { return values_.end(); }

References values_.

◆ hash()

size_t DTCombinatorialPatternReco::TriedPattern::hash ( ) const
inline

return the hash: equal objects MUST have the same hash, different ones should have different ones

Definition at line 135 of file DTCombinatorialPatternReco.h.

135 { return hash_; }

References hash_.

◆ hash_combine()

template<class T >
void DTCombinatorialPatternReco::TriedPattern::hash_combine ( std::size_t &  seed,
const T v 
)
inline

Definition at line 123 of file DTCombinatorialPatternReco.h.

123  {
124  std::hash<T> hasher;
125  seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
126  }

References visDQMUpload::hasher, fileCollector::seed, and findQualityFiles::v.

Referenced by push_back().

◆ operator==()

bool DTCombinatorialPatternReco::TriedPattern::operator== ( const TriedPattern other) const
inline

Definition at line 116 of file DTCombinatorialPatternReco.h.

116  {
117  return (hash_ == other.hash_) && // cheap
118  (values_ == other.values_); // expensive last resort
119  }

References hash_, trackingPlots::other, and values_.

◆ push_back()

void DTCombinatorialPatternReco::TriedPattern::push_back ( short unsigned int  i)
inline

push back value, and update the hash

Definition at line 129 of file DTCombinatorialPatternReco.h.

129  {
130  hash_combine(hash_, i);
131  values_.push_back(i);
132  }

References hash_, hash_combine(), mps_fire::i, and values_.

◆ size()

values::size_type DTCombinatorialPatternReco::TriedPattern::size ( void  ) const
inline

Definition at line 141 of file DTCombinatorialPatternReco.h.

141 { return values_.size(); }

References values_.

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

Member Data Documentation

◆ hash_

size_t DTCombinatorialPatternReco::TriedPattern::hash_
private

Definition at line 151 of file DTCombinatorialPatternReco.h.

Referenced by hash(), operator==(), and push_back().

◆ values_

values DTCombinatorialPatternReco::TriedPattern::values_
private

Definition at line 150 of file DTCombinatorialPatternReco.h.

Referenced by begin(), end(), operator==(), push_back(), size(), and TriedPattern().

mps_fire.i
i
Definition: mps_fire.py:428
DTCombinatorialPatternReco::TriedPattern::hash_
size_t hash_
Definition: DTCombinatorialPatternReco.h:151
findQualityFiles.v
v
Definition: findQualityFiles.py:179
fileCollector.seed
seed
Definition: fileCollector.py:127
trackingPlots.other
other
Definition: trackingPlots.py:1460
visDQMUpload.hasher
hasher
Definition: visDQMUpload.py:152
DTCombinatorialPatternReco::TriedPattern::values_
values values_
Definition: DTCombinatorialPatternReco.h:150
DTCombinatorialPatternReco::TriedPattern::hash_combine
void hash_combine(std::size_t &seed, const T &v)
Definition: DTCombinatorialPatternReco.h:123