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 * begin ()
 
unsigned const char * begin () const
 
unsigned char * end ()
 
unsigned const char * end () const
 
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 1080 of file HitPattern.h.

Constructor & Destructor Documentation

◆ PatternSet() [1/2]

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

Definition at line 1097 of file HitPattern.h.

1097 : nhit(0) {}

◆ PatternSet() [2/2]

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

Member Function Documentation

◆ begin() [1/2]

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

Definition at line 1089 of file HitPattern.h.

1089 { return hit; }

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

◆ begin() [2/2]

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

Definition at line 1085 of file HitPattern.h.

1085 { return hit; }

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

Referenced by reco::commonHits().

◆ end() [1/2]

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

Definition at line 1091 of file HitPattern.h.

1091 { return hit + nhit; }

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

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

◆ end() [2/2]

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

Definition at line 1087 of file HitPattern.h.

1087 { return hit + nhit; }

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

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

◆ fill()

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

Definition at line 1101 of file HitPattern.h.

1101  {
1102  int lhit = 0;
1103  auto unpack = [&lhit, this](uint16_t pattern) -> bool {
1104  unsigned char p = 255 & (pattern >> 3);
1105  hit[lhit++] = p;
1106 
1107  // bouble sort
1108  if (lhit > 1) {
1109  for (auto h = hit + lhit - 1; h != hit; --h) {
1110  if ((*(h - 1)) <= p) {
1111  break;
1112  }
1113  (*h) = *(h - 1);
1114  *(h - 1) = p;
1115  }
1116  }
1117  return lhit < MaxHits;
1118  };
1119 
1121  nhit = lhit;
1122  }

References taus_updatedMVAIds_cff::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().

◆ operator[]()

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

Definition at line 1095 of file HitPattern.h.

1095 { return hit[i]; }

References mps_fire::i.

◆ size()

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

Definition at line 1093 of file HitPattern.h.

1093 { return nhit; }

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

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

Member Data Documentation

◆ hit

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

Definition at line 1082 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
staticconstexpr

Definition at line 1081 of file HitPattern.h.

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

◆ nhit

template<int N = HitPattern::MaxHits>
unsigned char reco::PatternSet< N >::nhit
taus_updatedMVAIds_cff.category
category
Definition: taus_updatedMVAIds_cff.py:31
mps_fire.i
i
Definition: mps_fire.py:428
reco::PatternSet::fill
void fill(HitPattern::HitCategory category, HitPattern const &hp)
Definition: HitPattern.h:1101
reco::HitPattern::validHitFilter
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:783
reco::PatternSet::hit
unsigned char hit[N]
Definition: HitPattern.h:1082
h
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
trackingPlots.hp
hp
Definition: trackingPlots.py:1231
h
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
reco::PatternSet::nhit
unsigned char nhit
Definition: HitPattern.h:1083
topSingleLeptonDQM_PU_cfi.pattern
pattern
Definition: topSingleLeptonDQM_PU_cfi.py:39
BeamSpotPI::unpack
std::pair< unsigned int, unsigned int > unpack(cond::Time_t since)
Definition: BeamSpotPayloadInspectorHelper.h:23
hit
Definition: SiStripHitEffFromCalibTree.cc:88
reco::PatternSet::MaxHits
static constexpr int MaxHits
Definition: HitPattern.h:1081