CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Static Public Attributes
reco::PatternSet< N > Struct Template Reference

#include <HitPattern.h>

Public Member Functions

unsigned char const * begin () const
 
unsigned char * begin ()
 
unsigned char const * end () const
 
unsigned char * end ()
 
void fill (HitPattern::HitCategory category, HitPattern const &hp)
 
unsigned char operator[] (int i) const
 
 PatternSet ()
 
 PatternSet (HitPattern::HitCategory category, HitPattern const &hp)
 
int size () const
 

Public Attributes

unsigned char hit [N]
 
unsigned char nhit
 

Static Public Attributes

static constexpr int MaxHits = N
 

Detailed Description

template<int N = HitPattern::MaxHits>
struct reco::PatternSet< N >

Definition at line 1093 of file HitPattern.h.

Constructor & Destructor Documentation

◆ PatternSet() [1/2]

template<int N = HitPattern::MaxHits>
reco::PatternSet< N >::PatternSet ( )
inline

Definition at line 1110 of file HitPattern.h.

1110 : nhit(0) {}
unsigned char nhit
Definition: HitPattern.h:1096

◆ PatternSet() [2/2]

template<int N = HitPattern::MaxHits>
reco::PatternSet< N >::PatternSet ( HitPattern::HitCategory  category,
HitPattern const &  hp 
)
inline

Definition at line 1112 of file HitPattern.h.

References validateAlignments::category, reco::PatternSet< N >::fill(), and trackingPlots::hp.

1112 { fill(category, hp); }
void fill(HitPattern::HitCategory category, HitPattern const &hp)
Definition: HitPattern.h:1114

Member Function Documentation

◆ begin() [1/2]

template<int N = HitPattern::MaxHits>
unsigned char const* reco::PatternSet< N >::begin ( void  ) const
inline

Definition at line 1098 of file HitPattern.h.

References reco::PatternSet< N >::hit.

Referenced by reco::commonHits().

1098 { return hit; }
unsigned char hit[N]
Definition: HitPattern.h:1095

◆ begin() [2/2]

template<int N = HitPattern::MaxHits>
unsigned char* reco::PatternSet< N >::begin ( void  )
inline

Definition at line 1102 of file HitPattern.h.

References reco::PatternSet< N >::hit.

1102 { return hit; }
unsigned char hit[N]
Definition: HitPattern.h:1095

◆ end() [1/2]

template<int N = HitPattern::MaxHits>
unsigned char const* reco::PatternSet< N >::end ( void  ) const
inline

Definition at line 1100 of file HitPattern.h.

References reco::PatternSet< N >::nhit.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

1100 { return hit + nhit; }
unsigned char nhit
Definition: HitPattern.h:1096

◆ end() [2/2]

template<int N = HitPattern::MaxHits>
unsigned char* reco::PatternSet< N >::end ( void  )
inline

Definition at line 1104 of file HitPattern.h.

References reco::PatternSet< N >::nhit.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

1104 { return hit + nhit; }
unsigned char nhit
Definition: HitPattern.h:1096

◆ fill()

template<int N = HitPattern::MaxHits>
void reco::PatternSet< N >::fill ( HitPattern::HitCategory  category,
HitPattern const &  hp 
)
inline

Definition at line 1114 of file HitPattern.h.

References validateAlignments::category, h, reco::PatternSet< N >::hit, trackingPlots::hp, reco::PatternSet< N >::MaxHits, reco::PatternSet< N >::nhit, AlCaHLTBitMon_ParallelJobs::p, topSingleLeptonDQM_PU_cfi::pattern, BeamSpotPI::unpack(), and reco::HitPattern::validHitFilter().

Referenced by reco::PatternSet< N >::PatternSet().

1114  {
1115  int lhit = 0;
1116  auto unpack = [&lhit, this](uint16_t pattern) -> bool {
1117  unsigned char p = 255 & (pattern >> 3);
1118  hit[lhit++] = p;
1119 
1120  // bouble sort
1121  if (lhit > 1) {
1122  for (auto h = hit + lhit - 1; h != hit; --h) {
1123  if ((*(h - 1)) <= p) {
1124  break;
1125  }
1126  (*h) = *(h - 1);
1127  *(h - 1) = p;
1128  }
1129  }
1130  return lhit < MaxHits;
1131  };
1132 
1134  nhit = lhit;
1135  }
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)
unsigned char nhit
Definition: HitPattern.h:1096
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:796
static constexpr int MaxHits
Definition: HitPattern.h:1094
unsigned char hit[N]
Definition: HitPattern.h:1095
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ operator[]()

template<int N = HitPattern::MaxHits>
unsigned char reco::PatternSet< N >::operator[] ( int  i) const
inline

Definition at line 1108 of file HitPattern.h.

References mps_fire::i.

1108 { return hit[i]; }

◆ size()

template<int N = HitPattern::MaxHits>
int reco::PatternSet< N >::size ( void  ) const
inline

Definition at line 1106 of file HitPattern.h.

References reco::PatternSet< N >::nhit.

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

1106 { return nhit; }
unsigned char nhit
Definition: HitPattern.h:1096

Member Data Documentation

◆ hit

template<int N = HitPattern::MaxHits>
unsigned char reco::PatternSet< N >::hit[N]

Definition at line 1095 of file HitPattern.h.

Referenced by reco::PatternSet< N >::begin(), and reco::PatternSet< N >::fill().

◆ MaxHits

template<int N = HitPattern::MaxHits>
constexpr int reco::PatternSet< N >::MaxHits = N
static

Definition at line 1094 of file HitPattern.h.

Referenced by reco::PatternSet< N >::fill().

◆ nhit

template<int N = HitPattern::MaxHits>
unsigned char reco::PatternSet< N >::nhit