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 1062 of file HitPattern.h.

Constructor & Destructor Documentation

◆ PatternSet() [1/2]

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

Definition at line 1079 of file HitPattern.h.

1079 : 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 1071 of file HitPattern.h.

1071 { 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 1067 of file HitPattern.h.

1067 { 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 1073 of file HitPattern.h.

1073 { 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 1069 of file HitPattern.h.

1069 { 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 1083 of file HitPattern.h.

1083  {
1084  int lhit = 0;
1085  auto unpack = [&lhit, this](uint16_t pattern) -> bool {
1086  unsigned char p = 255 & (pattern >> 3);
1087  hit[lhit++] = p;
1088 
1089  // bouble sort
1090  if (lhit > 1) {
1091  for (auto h = hit + lhit - 1; h != hit; --h) {
1092  if ((*(h - 1)) <= p) {
1093  break;
1094  }
1095  (*h) = *(h - 1);
1096  *(h - 1) = p;
1097  }
1098  }
1099  return lhit < MaxHits;
1100  };
1101 
1103  nhit = lhit;
1104  }

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 1077 of file HitPattern.h.

1077 { return hit[i]; }

References mps_fire::i.

◆ size()

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

Definition at line 1075 of file HitPattern.h.

1075 { 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 1064 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 1063 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
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
h
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
Definition: L1TUtmAlgorithmRcd.h:4
reco::PatternSet::fill
void fill(HitPattern::HitCategory category, HitPattern const &hp)
Definition: HitPattern.h:1083
reco::HitPattern::validHitFilter
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:765
reco::PatternSet::hit
unsigned char hit[N]
Definition: HitPattern.h:1064
trackingPlots.hp
hp
Definition: trackingPlots.py:1230
h
reco::PatternSet::nhit
unsigned char nhit
Definition: HitPattern.h:1065
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:1063